mirror of
https://github.com/samba-team/samba.git
synced 2025-03-27 22:50:26 +03:00
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>
This commit is contained in:
parent
4cc4938a28
commit
4ebe72b942
@ -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)
|
||||
{
|
||||
|
@ -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)
|
||||
{
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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)
|
||||
{
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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)
|
||||
{
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
{
|
||||
|
@ -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;
|
||||
|
@ -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 =
|
||||
|
Loading…
x
Reference in New Issue
Block a user