]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: Remove unused variables
authorVolker Lendecke <vl@samba.org>
Tue, 6 Sep 2022 07:07:31 +0000 (09:07 +0200)
committerJeremy Allison <jra@samba.org>
Wed, 7 Sep 2022 18:40:28 +0000 (18:40 +0000)
ReadDirName happily takes NULL for "sbuf"

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/smbd/close.c

index a4bdd56729a0a9e0bc7ac49c3ef1e04b1c552a9d..4306a59342f8744f2375570980ab52c35183afb7 100644 (file)
@@ -846,7 +846,6 @@ NTSTATUS recursive_rmdir(TALLOC_CTX *ctx,
        const char *dname = NULL;
        char *talloced = NULL;
        long offset = 0;
-       SMB_STRUCT_STAT st;
        struct smb_Dir *dir_hnd = NULL;
        struct files_struct *dirfsp = NULL;
        int retval;
@@ -866,7 +865,7 @@ NTSTATUS recursive_rmdir(TALLOC_CTX *ctx,
 
        dirfsp = dir_hnd_fetch_fsp(dir_hnd);
 
-       while ((dname = ReadDirName(dir_hnd, &offset, &st, &talloced))) {
+       while ((dname = ReadDirName(dir_hnd, &offset, NULL, &talloced))) {
                struct smb_filename *atname = NULL;
                struct smb_filename *smb_dname_full = NULL;
                char *fullname = NULL;
@@ -967,7 +966,6 @@ static NTSTATUS rmdir_internals(TALLOC_CTX *ctx, struct files_struct *fsp)
        struct smb_filename *smb_dname = fsp->fsp_name;
        struct smb_filename *parent_fname = NULL;
        struct smb_filename *at_fname = NULL;
-       SMB_STRUCT_STAT st;
        const char *dname = NULL;
        char *talloced = NULL;
        long dirpos = 0;
@@ -1069,7 +1067,8 @@ static NTSTATUS rmdir_internals(TALLOC_CTX *ctx, struct files_struct *fsp)
 
        dirfsp = dir_hnd_fetch_fsp(dir_hnd);
 
-       while ((dname = ReadDirName(dir_hnd, &dirpos, &st, &talloced)) != NULL) {
+       while ((dname = ReadDirName(
+                       dir_hnd, &dirpos, NULL, &talloced)) != NULL) {
                struct smb_filename *smb_dname_full = NULL;
                struct smb_filename *direntry_fname = NULL;
                char *fullname = NULL;
@@ -1217,7 +1216,8 @@ static NTSTATUS rmdir_internals(TALLOC_CTX *ctx, struct files_struct *fsp)
        /* Do a recursive delete. */
        RewindDir(dir_hnd,&dirpos);
 
-       while ((dname = ReadDirName(dir_hnd, &dirpos, &st, &talloced)) != NULL) {
+       while ((dname = ReadDirName(
+                       dir_hnd, &dirpos, NULL, &talloced)) != NULL) {
                struct smb_filename *direntry_fname = NULL;
                struct smb_filename *smb_dname_full = NULL;
                char *fullname = NULL;