s3: Fix bug opening streams with truncating disposition
authorTim Prouty <tprouty@samba.org>
Thu, 19 Feb 2009 07:10:41 +0000 (23:10 -0800)
committerTim Prouty <tprouty@samba.org>
Thu, 19 Feb 2009 07:48:35 +0000 (23:48 -0800)
Do not attempt to delete streams on a truncating open, if the name
we're opening is itself a stream.

Port 176e8857203944bc332844b700749120ce90c891 to standard open path

source3/smbd/open.c

index f7a52d7bd2bb55d2ea3bfa114618e68654725254..9971ffa6798287c106124b578cceced3476dca99 100644 (file)
@@ -1975,7 +1975,7 @@ static NTSTATUS open_file_ntcreate(connection_struct *conn,
        SMB_ASSERT(lck != NULL);
 
        /* Delete streams if create_disposition requires it */
        SMB_ASSERT(lck != NULL);
 
        /* Delete streams if create_disposition requires it */
-       if (file_existed && clear_ads) {
+       if (file_existed && clear_ads && !is_ntfs_stream_name(fname)) {
                status = delete_all_streams(conn, fname);
                if (!NT_STATUS_IS_OK(status)) {
                        TALLOC_FREE(lck);
                status = delete_all_streams(conn, fname);
                if (!NT_STATUS_IS_OK(status)) {
                        TALLOC_FREE(lck);