From: Andrew Bartlett Date: Tue, 7 Aug 2012 04:19:06 +0000 (+1000) Subject: s3-pysmbd: Try opening as a file, then as a directory X-Git-Tag: ldb-1.1.10~80 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f06c216d0b3ffd036ac10f9abe9b2fe3ff319f09;p=thirdparty%2Fsamba.git s3-pysmbd: Try opening as a file, then as a directory Autobuild-User(master): Andrew Bartlett Autobuild-Date(master): Tue Aug 7 08:59:21 CEST 2012 on sn-devel-104 --- diff --git a/source3/smbd/pysmbd.c b/source3/smbd/pysmbd.c index 8a5bde1090f..6bef8af66d2 100644 --- a/source3/smbd/pysmbd.c +++ b/source3/smbd/pysmbd.c @@ -129,9 +129,9 @@ static NTSTATUS set_nt_acl_no_snum(const char *fname, flags = O_RDONLY; #endif - fsp->fh->fd = SMB_VFS_OPEN(conn, smb_fname, fsp, flags, 00400); + fsp->fh->fd = SMB_VFS_OPEN(conn, smb_fname, fsp, O_RDWR, 00400); if (fsp->fh->fd == -1 && errno == EISDIR) { - fsp->fh->fd = SMB_VFS_OPEN(conn, smb_fname, fsp, O_RDWR, 00400); + fsp->fh->fd = SMB_VFS_OPEN(conn, smb_fname, fsp, flags, 00400); } if (fsp->fh->fd == -1) { printf("open: error=%d (%s)\n", errno, strerror(errno));