summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2007-01-15 09:17:11 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:17:09 -0500
commit0cfc6a8e11bf1d2dd80861cf5331f4cde78dd674 (patch)
treec1c83261f768b97d3d3e7d0f6a3a5427dcf94154
parentf428e045c31a27a1672fcbcaea0c6f99bbd4a84f (diff)
downloadsamba-0cfc6a8e11bf1d2dd80861cf5331f4cde78dd674.tar.gz
samba-0cfc6a8e11bf1d2dd80861cf5331f4cde78dd674.tar.bz2
samba-0cfc6a8e11bf1d2dd80861cf5331f4cde78dd674.zip
r20796: Fix the same problem Jeremy has fixed (improper handling of deferred opens)
for delete_driver_files. Proper fix pending... :-) Jeremy, please check. Volker (This used to be commit 21b8f15dd5ad567efeacf5ba22dc4d8c64b09b76)
-rw-r--r--source3/printing/nt_printing.c10
-rw-r--r--source3/smbd/reply.c16
2 files changed, 15 insertions, 11 deletions
diff --git a/source3/printing/nt_printing.c b/source3/printing/nt_printing.c
index 8f264bfd1e..aa9075c7db 100644
--- a/source3/printing/nt_printing.c
+++ b/source3/printing/nt_printing.c
@@ -4853,7 +4853,7 @@ static BOOL delete_driver_files( NT_PRINTER_DRIVER_INFO_LEVEL_3 *info_3, struct
pstrcpy( file, s );
driver_unix_convert(file, conn, NULL, &st);
DEBUG(10,("deleting driverfile [%s]\n", s));
- unlink_internals(conn, 0, file, False);
+ unlink_internals(conn, 0, file, False, False);
}
}
@@ -4862,7 +4862,7 @@ static BOOL delete_driver_files( NT_PRINTER_DRIVER_INFO_LEVEL_3 *info_3, struct
pstrcpy( file, s );
driver_unix_convert(file, conn, NULL, &st);
DEBUG(10,("deleting configfile [%s]\n", s));
- unlink_internals(conn, 0, file, False);
+ unlink_internals(conn, 0, file, False, False);
}
}
@@ -4871,7 +4871,7 @@ static BOOL delete_driver_files( NT_PRINTER_DRIVER_INFO_LEVEL_3 *info_3, struct
pstrcpy( file, s );
driver_unix_convert(file, conn, NULL, &st);
DEBUG(10,("deleting datafile [%s]\n", s));
- unlink_internals(conn, 0, file, False);
+ unlink_internals(conn, 0, file, False, False);
}
}
@@ -4880,7 +4880,7 @@ static BOOL delete_driver_files( NT_PRINTER_DRIVER_INFO_LEVEL_3 *info_3, struct
pstrcpy( file, s );
driver_unix_convert(file, conn, NULL, &st);
DEBUG(10,("deleting helpfile [%s]\n", s));
- unlink_internals(conn, 0, file, False);
+ unlink_internals(conn, 0, file, False, False);
}
}
@@ -4896,7 +4896,7 @@ static BOOL delete_driver_files( NT_PRINTER_DRIVER_INFO_LEVEL_3 *info_3, struct
pstrcpy( file, p );
driver_unix_convert(file, conn, NULL, &st);
DEBUG(10,("deleting dependent file [%s]\n", file));
- unlink_internals(conn, 0, file, False);
+ unlink_internals(conn, 0, file, False, False);
}
i++;
diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c
index 02cada71aa..3a1514f1aa 100644
--- a/source3/smbd/reply.c
+++ b/source3/smbd/reply.c
@@ -1679,7 +1679,8 @@ static NTSTATUS can_rename(connection_struct *conn, char *fname, uint16 dirtype,
Check if a user is allowed to delete a file.
********************************************************************/
-static NTSTATUS can_delete(connection_struct *conn, char *fname, uint32 dirtype)
+static NTSTATUS can_delete(connection_struct *conn, char *fname,
+ uint32 dirtype, BOOL can_defer)
{
SMB_STRUCT_STAT sbuf;
uint32 fattr;
@@ -1777,7 +1778,7 @@ static NTSTATUS can_delete(connection_struct *conn, char *fname, uint32 dirtype)
FILE_OPEN,
0,
FILE_ATTRIBUTE_NORMAL,
- 0,
+ can_defer ? 0 : INTERNAL_OPEN_ONLY,
NULL, &fsp);
if (NT_STATUS_IS_OK(status)) {
@@ -1791,7 +1792,8 @@ static NTSTATUS can_delete(connection_struct *conn, char *fname, uint32 dirtype)
code.
****************************************************************************/
-NTSTATUS unlink_internals(connection_struct *conn, uint32 dirtype, char *name, BOOL has_wild)
+NTSTATUS unlink_internals(connection_struct *conn, uint32 dirtype,
+ char *name, BOOL has_wild, BOOL can_defer)
{
pstring directory;
pstring mask;
@@ -1835,7 +1837,7 @@ NTSTATUS unlink_internals(connection_struct *conn, uint32 dirtype, char *name, B
if (dirtype == 0) {
dirtype = FILE_ATTRIBUTE_NORMAL;
}
- status = can_delete(conn,directory,dirtype);
+ status = can_delete(conn,directory,dirtype,can_defer);
if (!NT_STATUS_IS_OK(status))
return status;
@@ -1885,7 +1887,8 @@ NTSTATUS unlink_internals(connection_struct *conn, uint32 dirtype, char *name, B
continue;
slprintf(fname,sizeof(fname)-1, "%s/%s",directory,dname);
- status = can_delete(conn, fname, dirtype);
+ status = can_delete(conn, fname, dirtype,
+ can_defer);
if (!NT_STATUS_IS_OK(status)) {
continue;
}
@@ -1931,7 +1934,8 @@ int reply_unlink(connection_struct *conn, char *inbuf,char *outbuf, int dum_size
DEBUG(3,("reply_unlink : %s\n",name));
- status = unlink_internals(conn, dirtype, name, path_contains_wcard);
+ status = unlink_internals(conn, dirtype, name, path_contains_wcard,
+ True);
if (!NT_STATUS_IS_OK(status)) {
if (open_was_deferred(SVAL(inbuf,smb_mid))) {
/* We have re-scheduled this call. */