summaryrefslogtreecommitdiff
path: root/source3/smbd/reply.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2009-10-08 15:36:36 -0700
committerJeremy Allison <jra@samba.org>2009-10-08 15:36:36 -0700
commit333fcba1deff1b097a2c9a3e7d1d3194997f0513 (patch)
treef467f59838cd6690d65e4e3a6b8d0f6639b68808 /source3/smbd/reply.c
parent5c4fea6d72ab06ffbe144a7a7581d710a2b3cc7c (diff)
downloadsamba-333fcba1deff1b097a2c9a3e7d1d3194997f0513.tar.gz
samba-333fcba1deff1b097a2c9a3e7d1d3194997f0513.tar.bz2
samba-333fcba1deff1b097a2c9a3e7d1d3194997f0513.zip
Cope with old CIFSFS clients that use SMBunlink to remove
symlinks instead of trans2:posix_unlink. Jeremy.
Diffstat (limited to 'source3/smbd/reply.c')
-rw-r--r--source3/smbd/reply.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c
index abc316315a..2365ed1da1 100644
--- a/source3/smbd/reply.c
+++ b/source3/smbd/reply.c
@@ -2383,6 +2383,8 @@ static NTSTATUS do_unlink(connection_struct *conn,
files_struct *fsp;
uint32 dirtype_orig = dirtype;
NTSTATUS status;
+ int ret;
+ bool posix_paths = lp_posix_pathnames();
DEBUG(10,("do_unlink: %s, dirtype = %d\n",
smb_fname_str_dbg(smb_fname),
@@ -2392,7 +2394,12 @@ static NTSTATUS do_unlink(connection_struct *conn,
return NT_STATUS_MEDIA_WRITE_PROTECTED;
}
- if (SMB_VFS_LSTAT(conn, smb_fname) != 0) {
+ if (posix_paths) {
+ ret = SMB_VFS_LSTAT(conn, smb_fname);
+ } else {
+ ret = SMB_VFS_LSTAT(conn, smb_fname);
+ }
+ if (ret != 0) {
return map_nt_error_from_unix(errno);
}
@@ -2479,7 +2486,9 @@ static NTSTATUS do_unlink(connection_struct *conn,
FILE_SHARE_NONE, /* share_access */
FILE_OPEN, /* create_disposition*/
FILE_NON_DIRECTORY_FILE, /* create_options */
- FILE_ATTRIBUTE_NORMAL, /* file_attributes */
+ /* file_attributes */
+ posix_paths ? FILE_FLAG_POSIX_SEMANTICS|0777 :
+ FILE_ATTRIBUTE_NORMAL,
0, /* oplock_request */
0, /* allocation_size */
NULL, /* sd */