s3: Repace a char * with an smb_filename struct in reply_rmdir
authorTim Prouty <tprouty@samba.org>
Thu, 9 Jul 2009 03:15:02 +0000 (20:15 -0700)
committerTim Prouty <tprouty@samba.org>
Thu, 9 Jul 2009 04:36:04 +0000 (21:36 -0700)
source3/smbd/reply.c

index 837d17dc0b8aab2a785df77fc5a28d573c16f1d3..1fd4e50ea66c77392608898990970827885b3e8a 100644 (file)
@@ -5541,7 +5541,7 @@ void reply_rmdir(struct smb_request *req)
                                 req->flags2 & FLAGS2_DFS_PATHNAMES,
                                 directory,
                                 &smb_dname,
-                                &directory);
+                                NULL);
        if (!NT_STATUS_IS_OK(status)) {
                if (NT_STATUS_EQUAL(status,NT_STATUS_PATH_NOT_COVERED)) {
                        reply_botherror(req, NT_STATUS_PATH_NOT_COVERED,
@@ -5552,7 +5552,12 @@ void reply_rmdir(struct smb_request *req)
                goto out;
        }
 
-       dptr_closepath(directory, req->smbpid);
+       if (is_ntfs_stream_smb_fname(smb_dname)) {
+               reply_nterror(req, NT_STATUS_NOT_A_DIRECTORY);
+               goto out;
+       }
+
+       dptr_closepath(smb_dname->base_name, req->smbpid);
        status = rmdir_internals(ctx, conn, smb_dname);
        if (!NT_STATUS_IS_OK(status)) {
                reply_nterror(req, status);
@@ -5561,7 +5566,7 @@ void reply_rmdir(struct smb_request *req)
 
        reply_outbuf(req, 0, 0);
 
-       DEBUG( 3, ( "rmdir %s\n", directory ) );
+       DEBUG(3, ("rmdir %s\n", smb_fname_str_dbg(smb_dname)));
  out:
        TALLOC_FREE(smb_dname);
        END_PROFILE(SMBrmdir);