diff options
author | Volker Lendecke <vlendec@samba.org> | 2007-01-09 08:56:24 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:16:59 -0500 |
commit | b5cad2c2a75ee614ec765d8bfb5b1ad9df984f57 (patch) | |
tree | 2d5172cd4956adbd3a137c35dcc394f7050bf803 | |
parent | 0e4ab9a5ac8e7a82b7cecd5978313c06fb77e364 (diff) | |
download | samba-b5cad2c2a75ee614ec765d8bfb5b1ad9df984f57.tar.gz samba-b5cad2c2a75ee614ec765d8bfb5b1ad9df984f57.tar.bz2 samba-b5cad2c2a75ee614ec765d8bfb5b1ad9df984f57.zip |
r20627: orig_name is not needed anymore, and slightly simplify logic by doing early
returns.
Volker
(This used to be commit 614651c6a72742173de5fa8723403880acc37c09)
-rw-r--r-- | source3/smbd/reply.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c index dfea8bcc0f..d50a6e5224 100644 --- a/source3/smbd/reply.c +++ b/source3/smbd/reply.c @@ -1977,7 +1977,6 @@ NTSTATUS unlink_internals(connection_struct *conn, uint32 dirtype, { pstring directory; pstring mask; - pstring orig_name; char *p; int count=0; NTSTATUS error = NT_STATUS_OK; @@ -1994,11 +1993,6 @@ NTSTATUS unlink_internals(connection_struct *conn, uint32 dirtype, : NT_STATUS_OBJECT_PATH_NOT_FOUND; } - /* - * Feel my pain, this code needs rewriting *very* badly! -- vl - */ - pstrcpy(orig_name, name); - p = strrchr_m(name,'/'); if (!p) { pstrcpy(directory,"."); @@ -2030,7 +2024,7 @@ NTSTATUS unlink_internals(connection_struct *conn, uint32 dirtype, if (SMB_VFS_UNLINK(conn,directory) == 0) { count++; - notify_fname(conn, orig_name, -1, + notify_fname(conn, directory, -1, NOTIFY_ACTION_REMOVED); } @@ -2041,8 +2035,13 @@ NTSTATUS unlink_internals(connection_struct *conn, uint32 dirtype, if (strequal(mask,"????????.???")) pstrcpy(mask,"*"); - if (check_name(directory,conn)) - dir_hnd = OpenDir(conn, directory, mask, dirtype); + if (!check_name(directory,conn)) { + return NT_STATUS_OBJECT_PATH_NOT_FOUND; + } + + if (!(dir_hnd = OpenDir(conn, directory, mask, dirtype))) { + return NT_STATUS_NO_SUCH_FILE; + } /* XXXX the CIFS spec says that if bit0 of the flags2 field is set then the pattern matches against the long name, otherwise the short name |