From: Volker Lendecke Date: Fri, 9 Jun 2023 13:05:07 +0000 (+0200) Subject: smbd: Remove unused _prev_offset arg from smbd_dirptr_get_entry() X-Git-Tag: talloc-2.4.1~421 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=99799bcdc8544e884bdf29347df540cbb313237c;p=thirdparty%2Fsamba.git smbd: Remove unused _prev_offset arg from smbd_dirptr_get_entry() Neither of the two callers looked at the result. Signed-off-by: Volker Lendecke Reviewed-by: Jeremy Allison --- diff --git a/source3/smbd/dir.c b/source3/smbd/dir.c index 4635e8bbf39..02e7181c3b8 100644 --- a/source3/smbd/dir.c +++ b/source3/smbd/dir.c @@ -562,8 +562,7 @@ bool smbd_dirptr_get_entry(TALLOC_CTX *ctx, void *private_data, char **_fname, struct smb_filename **_smb_fname, - uint32_t *_mode, - long *_prev_offset) + uint32_t *_mode) { connection_struct *conn = dirptr->conn; struct smb_Dir *dir_hnd = dirptr->dir_hnd; @@ -589,7 +588,6 @@ bool smbd_dirptr_get_entry(TALLOC_CTX *ctx, while (true) { long cur_offset; - long prev_offset; SMB_STRUCT_STAT sbuf = { 0 }; char *dname = NULL; bool isdots; @@ -603,7 +601,6 @@ bool smbd_dirptr_get_entry(TALLOC_CTX *ctx, bool ok; cur_offset = dptr_TellDir(dirptr); - prev_offset = cur_offset; dname = dptr_ReadDirName(ctx, dirptr, &cur_offset, &sbuf); DBG_DEBUG("dir [%s] dirptr [0x%lx] offset [%ld] => " @@ -888,7 +885,6 @@ bool smbd_dirptr_get_entry(TALLOC_CTX *ctx, } *_fname = fname; *_mode = mode; - *_prev_offset = prev_offset; return true; } diff --git a/source3/smbd/globals.h b/source3/smbd/globals.h index c58123ee501..3d9f046a15b 100644 --- a/source3/smbd/globals.h +++ b/source3/smbd/globals.h @@ -181,8 +181,7 @@ bool smbd_dirptr_get_entry(TALLOC_CTX *ctx, void *private_data, char **_fname, struct smb_filename **_smb_fname, - uint32_t *_mode, - long *_prev_offset); + uint32_t *_mode); void smbd_dirptr_push_overflow(struct dptr_struct *dirptr, char **_fname, struct smb_filename **_smb_fname, diff --git a/source3/smbd/smb1_reply.c b/source3/smbd/smb1_reply.c index e96a1c8ca40..7b6bd6c1f56 100644 --- a/source3/smbd/smb1_reply.c +++ b/source3/smbd/smb1_reply.c @@ -1241,7 +1241,6 @@ static bool get_dir_entry(TALLOC_CTX *ctx, char *fname = NULL; struct smb_filename *smb_fname = NULL; uint32_t mode = 0; - long prev_offset; bool ok; ok = smbd_dirptr_get_entry(ctx, @@ -1256,8 +1255,7 @@ static bool get_dir_entry(TALLOC_CTX *ctx, conn, &fname, &smb_fname, - &mode, - &prev_offset); + &mode); if (!ok) { return false; } diff --git a/source3/smbd/smb2_trans2.c b/source3/smbd/smb2_trans2.c index eca59125723..9b72d863752 100644 --- a/source3/smbd/smb2_trans2.c +++ b/source3/smbd/smb2_trans2.c @@ -1919,7 +1919,6 @@ NTSTATUS smbd_dirptr_lanman2_entry(TALLOC_CTX *ctx, { const char *p; const char *mask = NULL; - long prev_dirpos = 0; uint32_t mode = 0; char *fname = NULL; struct smb_filename *smb_fname = NULL; @@ -1967,8 +1966,7 @@ NTSTATUS smbd_dirptr_lanman2_entry(TALLOC_CTX *ctx, &state, &fname, &smb_fname, - &mode, - &prev_dirpos); + &mode); if (!ok) { return NT_STATUS_END_OF_FILE; }