summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2020-10-19 10:09:23 +0200
committerJeremy Allison <jra@samba.org>2020-11-04 18:55:40 +0000
commit4ebe72b942b1404d131047a407b4aac5af0c349d (patch)
treedd52b890002761ce0b1bc0686ece019435500b5c
parent4cc4938a2866738aaff4dc91550bb7a5ad05d7fb (diff)
downloadsamba-4ebe72b942b1404d131047a407b4aac5af0c349d.tar.gz
libsmb: Remove "mntpoint" argument from cli_list() callback
do_list()/do_list_helper() in source3/client/client.c was the only user of this argument. And that use was wrong. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
-rw-r--r--libgpo/gpo_filesync.c6
-rw-r--r--source3/client/client.c6
-rw-r--r--source3/libsmb/cli_smb2_fnum.c5
-rw-r--r--source3/libsmb/cli_smb2_fnum.h3
-rw-r--r--source3/libsmb/clilist.c10
-rw-r--r--source3/libsmb/libsmb_dir.c6
-rw-r--r--source3/libsmb/proto.h5
-rw-r--r--source3/libsmb/pylibsmb.c10
-rw-r--r--source3/torture/nbio.c4
-rw-r--r--source3/torture/test_hidenewfiles.c3
-rw-r--r--source3/torture/test_readdir_timestamp.c1
-rw-r--r--source3/torture/torture.c20
-rw-r--r--source3/utils/net_rpc.c2
-rw-r--r--source3/utils/smbcacls.c2
14 files changed, 32 insertions, 51 deletions
diff --git a/libgpo/gpo_filesync.c b/libgpo/gpo_filesync.c
index 3cd94706551..a547f5da77c 100644
--- a/libgpo/gpo_filesync.c
+++ b/libgpo/gpo_filesync.c
@@ -33,8 +33,7 @@ struct sync_context {
uint16_t attribute;
};
-static NTSTATUS gpo_sync_func(const char *mnt,
- struct file_info *info,
+static NTSTATUS gpo_sync_func(struct file_info *info,
const char *mask,
void *state);
@@ -136,8 +135,7 @@ static NTSTATUS gpo_sync_files(struct sync_context *ctx)
syncronisation call back
****************************************************************/
-static NTSTATUS gpo_sync_func(const char *mnt,
- struct file_info *info,
+static NTSTATUS gpo_sync_func(struct file_info *info,
const char *mask,
void *state)
{
diff --git a/source3/client/client.c b/source3/client/client.c
index 45bfb18de1e..e2fdacd1251 100644
--- a/source3/client/client.c
+++ b/source3/client/client.c
@@ -748,9 +748,8 @@ struct do_list_helper_state {
};
static NTSTATUS do_list_helper(
- const char *mntpoint,
struct file_info *f,
- const char *mask,
+ const char *_mask,
void *private_data)
{
struct do_list_helper_state *state = private_data;
@@ -5721,8 +5720,7 @@ struct completion_remote {
int len;
};
-static NTSTATUS completion_remote_filter(const char *mnt,
- struct file_info *f,
+static NTSTATUS completion_remote_filter(struct file_info *f,
const char *mask,
void *state)
{
diff --git a/source3/libsmb/cli_smb2_fnum.c b/source3/libsmb/cli_smb2_fnum.c
index 492bc4a5414..b64ff087047 100644
--- a/source3/libsmb/cli_smb2_fnum.c
+++ b/source3/libsmb/cli_smb2_fnum.c
@@ -1287,8 +1287,7 @@ static bool windows_parent_dirname(TALLOC_CTX *mem_ctx,
NTSTATUS cli_smb2_list(struct cli_state *cli,
const char *pathname,
uint32_t attribute,
- NTSTATUS (*fn)(const char *mointpoint,
- struct file_info *finfo,
+ NTSTATUS (*fn)(struct file_info *finfo,
const char *mask,
void *private_data),
void *private_data)
@@ -1430,7 +1429,7 @@ NTSTATUS cli_smb2_list(struct cli_state *cli,
*/
processed_file = true;
- status = fn(cli->dfs_mountpoint,
+ status = fn(
finfo,
pathname,
private_data);
diff --git a/source3/libsmb/cli_smb2_fnum.h b/source3/libsmb/cli_smb2_fnum.h
index e24c8cb7279..d47ca43f9dd 100644
--- a/source3/libsmb/cli_smb2_fnum.h
+++ b/source3/libsmb/cli_smb2_fnum.h
@@ -96,8 +96,7 @@ NTSTATUS cli_smb2_unlink_recv(struct tevent_req *req);
NTSTATUS cli_smb2_list(struct cli_state *cli,
const char *pathname,
uint32_t attribute,
- NTSTATUS (*fn)(const char *mointpoint,
- struct file_info *finfo,
+ NTSTATUS (*fn)(struct file_info *finfo,
const char *mask,
void *private_data),
void *private_data);
diff --git a/source3/libsmb/clilist.c b/source3/libsmb/clilist.c
index 57fefdc382a..48635b9cac8 100644
--- a/source3/libsmb/clilist.c
+++ b/source3/libsmb/clilist.c
@@ -569,7 +569,7 @@ static NTSTATUS cli_list_old_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
NTSTATUS cli_list_old(struct cli_state *cli, const char *mask,
uint32_t attribute,
- NTSTATUS (*fn)(const char *, struct file_info *,
+ NTSTATUS (*fn)(struct file_info *,
const char *, void *), void *state)
{
TALLOC_CTX *frame = talloc_stackframe();
@@ -603,7 +603,7 @@ NTSTATUS cli_list_old(struct cli_state *cli, const char *mask,
}
num_finfo = talloc_array_length(finfo);
for (i=0; i<num_finfo; i++) {
- status = fn(cli->dfs_mountpoint, &finfo[i], mask, state);
+ status = fn(&finfo[i], mask, state);
if (!NT_STATUS_IS_OK(status)) {
goto fail;
}
@@ -1040,8 +1040,7 @@ NTSTATUS cli_list_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
NTSTATUS cli_list(struct cli_state *cli,
const char *mask,
uint32_t attribute,
- NTSTATUS (*fn)(const char *mointpoint,
- struct file_info *finfo,
+ NTSTATUS (*fn)(struct file_info *finfo,
const char *mask,
void *private_data),
void *private_data)
@@ -1089,8 +1088,7 @@ NTSTATUS cli_list(struct cli_state *cli,
}
for (i=0; i<num_finfo; i++) {
- status = fn(
- cli->dfs_mountpoint, &finfo[i], mask, private_data);
+ status = fn(&finfo[i], mask, private_data);
if (!NT_STATUS_IS_OK(status)) {
goto fail;
}
diff --git a/source3/libsmb/libsmb_dir.c b/source3/libsmb/libsmb_dir.c
index 4fbfb19b15d..27d0fbd4db5 100644
--- a/source3/libsmb/libsmb_dir.c
+++ b/source3/libsmb/libsmb_dir.c
@@ -333,8 +333,7 @@ list_fn(const char *name,
}
static NTSTATUS
-dir_list_fn(const char *mnt,
- struct file_info *finfo,
+dir_list_fn(struct file_info *finfo,
const char *mask,
void *state)
{
@@ -1636,8 +1635,7 @@ SMBC_mkdir_ctx(SMBCCTX *context,
*/
static NTSTATUS
-rmdir_list_fn(const char *mnt,
- struct file_info *finfo,
+rmdir_list_fn(struct file_info *finfo,
const char *mask,
void *state)
{
diff --git a/source3/libsmb/proto.h b/source3/libsmb/proto.h
index 0e036c5ddc8..5715a0173ec 100644
--- a/source3/libsmb/proto.h
+++ b/source3/libsmb/proto.h
@@ -742,7 +742,7 @@ NTSTATUS is_bad_finfo_name(const struct cli_state *cli,
const struct file_info *finfo);
NTSTATUS cli_list_old(struct cli_state *cli,const char *Mask,uint32_t attribute,
- NTSTATUS (*fn)(const char *, struct file_info *,
+ NTSTATUS (*fn)(struct file_info *,
const char *, void *), void *state);
NTSTATUS cli_list_trans(struct cli_state *cli, const char *mask,
uint32_t attribute, int info_level,
@@ -760,8 +760,7 @@ NTSTATUS cli_list_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
NTSTATUS cli_list(struct cli_state *cli,
const char *mask,
uint32_t attribute,
- NTSTATUS (*fn)(const char *mointpoint,
- struct file_info *finfo,
+ NTSTATUS (*fn)(struct file_info *finfo,
const char *mask,
void *private_data),
void *private_data);
diff --git a/source3/libsmb/pylibsmb.c b/source3/libsmb/pylibsmb.c
index c7a2d73afcb..7985b842a15 100644
--- a/source3/libsmb/pylibsmb.c
+++ b/source3/libsmb/pylibsmb.c
@@ -1106,7 +1106,7 @@ static PyObject *py_cli_delete_on_close(struct py_cli_state *self,
/*
* Helper to add directory listing entries to an overall Python list
*/
-static NTSTATUS list_helper(const char *mntpoint, struct file_info *finfo,
+static NTSTATUS list_helper(struct file_info *finfo,
const char *mask, void *state)
{
PyObject *result = (PyObject *)state;
@@ -1149,8 +1149,7 @@ static NTSTATUS list_helper(const char *mntpoint, struct file_info *finfo,
static NTSTATUS do_listing(struct py_cli_state *self,
const char *base_dir, const char *user_mask,
uint16_t attribute,
- NTSTATUS (*callback_fn)(const char *,
- struct file_info *,
+ NTSTATUS (*callback_fn)(struct file_info *,
const char *, void *),
void *priv)
{
@@ -1194,7 +1193,7 @@ static NTSTATUS do_listing(struct py_cli_state *self,
/* invoke the callback for the async results (SMBv1 connections) */
for (i = 0; i < num_finfos; i++) {
- status = callback_fn(base_dir, &finfos[i], user_mask,
+ status = callback_fn(&finfos[i], user_mask,
priv);
if (!NT_STATUS_IS_OK(status)) {
TALLOC_FREE(finfos);
@@ -1375,8 +1374,7 @@ static NTSTATUS delete_dir_tree(struct py_cli_state *self,
* or a directory. This function gets invoked as a callback for every item in
* the given directory's listings.
*/
-static NTSTATUS delete_tree_callback(const char *mntpoint,
- struct file_info *finfo,
+static NTSTATUS delete_tree_callback(struct file_info *finfo,
const char *mask, void *priv)
{
char *filepath = NULL;
diff --git a/source3/torture/nbio.c b/source3/torture/nbio.c
index 582f0b7e2e9..4fedfc59912 100644
--- a/source3/torture/nbio.c
+++ b/source3/torture/nbio.c
@@ -290,7 +290,7 @@ void nb_qfsinfo(int level)
cli_disk_size(c, "", &bsize, &total, &avail);
}
-static NTSTATUS find_fn(const char *mnt, struct file_info *finfo, const char *name,
+static NTSTATUS find_fn(struct file_info *finfo, const char *name,
void *state)
{
/* noop */
@@ -312,7 +312,7 @@ void nb_flush(int fnum)
static int total_deleted;
-static NTSTATUS delete_fn(const char *mnt, struct file_info *finfo,
+static NTSTATUS delete_fn(struct file_info *finfo,
const char *name, void *state)
{
NTSTATUS status;
diff --git a/source3/torture/test_hidenewfiles.c b/source3/torture/test_hidenewfiles.c
index 2f1638a6ae7..05e6d7ef2b1 100644
--- a/source3/torture/test_hidenewfiles.c
+++ b/source3/torture/test_hidenewfiles.c
@@ -62,8 +62,7 @@ struct have_file_state {
const char *fname;
};
-static NTSTATUS have_file_fn(const char *mntpoint,
- struct file_info *f,
+static NTSTATUS have_file_fn(struct file_info *f,
const char *mask,
void *private_data)
{
diff --git a/source3/torture/test_readdir_timestamp.c b/source3/torture/test_readdir_timestamp.c
index e53883cc21f..0eba415c8b4 100644
--- a/source3/torture/test_readdir_timestamp.c
+++ b/source3/torture/test_readdir_timestamp.c
@@ -403,7 +403,6 @@ struct list_cb_state {
};
static NTSTATUS list_cb(
- const char *mntpoint,
struct file_info *f,
const char *mask,
void *private_data)
diff --git a/source3/torture/torture.c b/source3/torture/torture.c
index d68ee579daf..5440b7288ea 100644
--- a/source3/torture/torture.c
+++ b/source3/torture/torture.c
@@ -9659,7 +9659,7 @@ static bool run_openattrtest(int dummy)
return correct;
}
-static NTSTATUS list_fn(const char *mnt, struct file_info *finfo,
+static NTSTATUS list_fn(struct file_info *finfo,
const char *name, void *state)
{
int *matched = (int *)state;
@@ -9732,7 +9732,7 @@ static bool run_dirtest(int dummy)
return correct;
}
-static NTSTATUS del_fn(const char *mnt, struct file_info *finfo, const char *mask,
+static NTSTATUS del_fn(struct file_info *finfo, const char *mask,
void *state)
{
struct cli_state *pcli = (struct cli_state *)state;
@@ -10909,8 +10909,7 @@ static bool run_mangle1(int dummy)
return true;
}
-static NTSTATUS mangle_illegal_list_shortname_fn(const char *mntpoint,
- struct file_info *f,
+static NTSTATUS mangle_illegal_list_shortname_fn(struct file_info *f,
const char *mask,
void *state)
{
@@ -10927,8 +10926,7 @@ static NTSTATUS mangle_illegal_list_shortname_fn(const char *mntpoint,
return NT_STATUS_OBJECT_NAME_INVALID;
}
-static NTSTATUS mangle_illegal_list_name_fn(const char *mntpoint,
- struct file_info *f,
+static NTSTATUS mangle_illegal_list_name_fn(struct file_info *f,
const char *mask,
void *state)
{
@@ -11461,8 +11459,7 @@ static bool run_large_readx(int dummy)
return correct;
}
-static NTSTATUS msdfs_attribute_list_fn(const char *mnt,
- struct file_info *finfo,
+static NTSTATUS msdfs_attribute_list_fn(struct file_info *finfo,
const char *mask,
void *private_data)
{
@@ -11806,7 +11803,7 @@ static bool run_uid_regression_test(int dummy)
static const char *illegal_chars = "*\\/?<>|\":";
static char force_shortname_chars[] = " +,.[];=\177";
-static NTSTATUS shortname_del_fn(const char *mnt, struct file_info *finfo,
+static NTSTATUS shortname_del_fn(struct file_info *finfo,
const char *mask, void *state)
{
struct cli_state *pcli = (struct cli_state *)state;
@@ -11838,7 +11835,7 @@ struct sn_state {
bool val;
};
-static NTSTATUS shortname_list_fn(const char *mnt, struct file_info *finfo,
+static NTSTATUS shortname_list_fn(struct file_info *finfo,
const char *name, void *state)
{
struct sn_state *s = (struct sn_state *)state;
@@ -12645,8 +12642,7 @@ static bool run_symlink_open_test(int dummy)
return correct;
}
-static NTSTATUS smb1_wild_mangle_list_fn(const char *mnt,
- struct file_info *finfo,
+static NTSTATUS smb1_wild_mangle_list_fn(struct file_info *finfo,
const char *name,
void *state)
{
diff --git a/source3/utils/net_rpc.c b/source3/utils/net_rpc.c
index 0a7c8429ff9..da1d904305b 100644
--- a/source3/utils/net_rpc.c
+++ b/source3/utils/net_rpc.c
@@ -3973,7 +3973,7 @@ static int rpc_share_migrate_shares(struct net_context *c, int argc,
* @param state arg-pointer
*
**/
-static NTSTATUS copy_fn(const char *mnt, struct file_info *f,
+static NTSTATUS copy_fn(struct file_info *f,
const char *mask, void *state)
{
static NTSTATUS nt_status;
diff --git a/source3/utils/smbcacls.c b/source3/utils/smbcacls.c
index 2ff30ad495e..7d280b2fadc 100644
--- a/source3/utils/smbcacls.c
+++ b/source3/utils/smbcacls.c
@@ -1240,7 +1240,7 @@ out:
* propagate_inherited_aces. Children that are themselves directories are passed
* to cli_list again ( to decend the directory structure )
*/
-static NTSTATUS cacl_set_cb(const char *mntpoint, struct file_info *f,
+static NTSTATUS cacl_set_cb(struct file_info *f,
const char *mask, void *state)
{
struct cacl_callback_state *cbstate =