mirror of
https://github.com/samba-team/samba.git
synced 2025-08-15 13:49:28 +03:00
s3: Remove "cli" from "struct finfo"
This commit is contained in:
@ -517,7 +517,8 @@ static bool do_this_one(struct file_info *finfo)
|
|||||||
Display info about a file.
|
Display info about a file.
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
static void display_finfo(struct file_info *finfo, const char *dir)
|
static void display_finfo(struct cli_state *cli_state, struct file_info *finfo,
|
||||||
|
const char *dir)
|
||||||
{
|
{
|
||||||
time_t t;
|
time_t t;
|
||||||
TALLOC_CTX *ctx = talloc_tos();
|
TALLOC_CTX *ctx = talloc_tos();
|
||||||
@ -555,19 +556,19 @@ static void display_finfo(struct file_info *finfo, const char *dir)
|
|||||||
d_printf( "MODE:%s\n", attrib_string(finfo->mode));
|
d_printf( "MODE:%s\n", attrib_string(finfo->mode));
|
||||||
d_printf( "SIZE:%.0f\n", (double)finfo->size);
|
d_printf( "SIZE:%.0f\n", (double)finfo->size);
|
||||||
d_printf( "MTIME:%s", time_to_asc(t));
|
d_printf( "MTIME:%s", time_to_asc(t));
|
||||||
if (!NT_STATUS_IS_OK(cli_ntcreate(finfo->cli, afname, 0,
|
if (!NT_STATUS_IS_OK(cli_ntcreate(cli_state, afname, 0,
|
||||||
CREATE_ACCESS_READ, 0, FILE_SHARE_READ|FILE_SHARE_WRITE,
|
CREATE_ACCESS_READ, 0, FILE_SHARE_READ|FILE_SHARE_WRITE,
|
||||||
FILE_OPEN, 0x0, 0x0, &fnum))) {
|
FILE_OPEN, 0x0, 0x0, &fnum))) {
|
||||||
DEBUG( 0, ("display_finfo() Failed to open %s: %s\n",
|
DEBUG( 0, ("display_finfo() Failed to open %s: %s\n",
|
||||||
afname,
|
afname,
|
||||||
cli_errstr( finfo->cli)));
|
cli_errstr(cli_state)));
|
||||||
} else {
|
} else {
|
||||||
struct security_descriptor *sd = NULL;
|
struct security_descriptor *sd = NULL;
|
||||||
sd = cli_query_secdesc(finfo->cli, fnum, ctx);
|
sd = cli_query_secdesc(cli_state, fnum, ctx);
|
||||||
if (!sd) {
|
if (!sd) {
|
||||||
DEBUG( 0, ("display_finfo() failed to "
|
DEBUG( 0, ("display_finfo() failed to "
|
||||||
"get security descriptor: %s",
|
"get security descriptor: %s",
|
||||||
cli_errstr( finfo->cli)));
|
cli_errstr(cli_state)));
|
||||||
} else {
|
} else {
|
||||||
display_sec_desc(sd);
|
display_sec_desc(sd);
|
||||||
}
|
}
|
||||||
@ -581,7 +582,8 @@ static void display_finfo(struct file_info *finfo, const char *dir)
|
|||||||
Accumulate size of a file.
|
Accumulate size of a file.
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
static void do_du(struct file_info *finfo, const char *dir)
|
static void do_du(struct cli_state *cli_state, struct file_info *finfo,
|
||||||
|
const char *dir)
|
||||||
{
|
{
|
||||||
if (do_this_one(finfo)) {
|
if (do_this_one(finfo)) {
|
||||||
dir_total += finfo->size;
|
dir_total += finfo->size;
|
||||||
@ -594,7 +596,8 @@ static char *do_list_queue = 0;
|
|||||||
static long do_list_queue_size = 0;
|
static long do_list_queue_size = 0;
|
||||||
static long do_list_queue_start = 0;
|
static long do_list_queue_start = 0;
|
||||||
static long do_list_queue_end = 0;
|
static long do_list_queue_end = 0;
|
||||||
static void (*do_list_fn)(struct file_info *, const char *dir);
|
static void (*do_list_fn)(struct cli_state *cli_state, struct file_info *,
|
||||||
|
const char *dir);
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
Functions for do_list_queue.
|
Functions for do_list_queue.
|
||||||
@ -714,6 +717,7 @@ static int do_list_queue_empty(void)
|
|||||||
static void do_list_helper(const char *mntpoint, struct file_info *f,
|
static void do_list_helper(const char *mntpoint, struct file_info *f,
|
||||||
const char *mask, void *state)
|
const char *mask, void *state)
|
||||||
{
|
{
|
||||||
|
struct cli_state *cli_state = (struct cli_state *)state;
|
||||||
TALLOC_CTX *ctx = talloc_tos();
|
TALLOC_CTX *ctx = talloc_tos();
|
||||||
char *dir = NULL;
|
char *dir = NULL;
|
||||||
char *dir_end = NULL;
|
char *dir_end = NULL;
|
||||||
@ -729,7 +733,7 @@ static void do_list_helper(const char *mntpoint, struct file_info *f,
|
|||||||
|
|
||||||
if (f->mode & aDIR) {
|
if (f->mode & aDIR) {
|
||||||
if (do_list_dirs && do_this_one(f)) {
|
if (do_list_dirs && do_this_one(f)) {
|
||||||
do_list_fn(f, dir);
|
do_list_fn(cli_state, f, dir);
|
||||||
}
|
}
|
||||||
if (do_list_recurse &&
|
if (do_list_recurse &&
|
||||||
f->name &&
|
f->name &&
|
||||||
@ -774,7 +778,7 @@ static void do_list_helper(const char *mntpoint, struct file_info *f,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (do_this_one(f)) {
|
if (do_this_one(f)) {
|
||||||
do_list_fn(f,dir);
|
do_list_fn(cli_state, f, dir);
|
||||||
}
|
}
|
||||||
TALLOC_FREE(dir);
|
TALLOC_FREE(dir);
|
||||||
}
|
}
|
||||||
@ -785,7 +789,8 @@ static void do_list_helper(const char *mntpoint, struct file_info *f,
|
|||||||
|
|
||||||
void do_list(const char *mask,
|
void do_list(const char *mask,
|
||||||
uint16 attribute,
|
uint16 attribute,
|
||||||
void (*fn)(struct file_info *, const char *dir),
|
void (*fn)(struct cli_state *cli_state, struct file_info *,
|
||||||
|
const char *dir),
|
||||||
bool rec,
|
bool rec,
|
||||||
bool dirs)
|
bool dirs)
|
||||||
{
|
{
|
||||||
@ -831,7 +836,8 @@ void do_list(const char *mask,
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
cli_list(targetcli, targetpath, attribute, do_list_helper, NULL);
|
cli_list(targetcli, targetpath, attribute,
|
||||||
|
do_list_helper, targetcli);
|
||||||
remove_do_list_queue_head();
|
remove_do_list_queue_head();
|
||||||
if ((! do_list_queue_empty()) && (fn == display_finfo)) {
|
if ((! do_list_queue_empty()) && (fn == display_finfo)) {
|
||||||
char *next_file = do_list_queue_head();
|
char *next_file = do_list_queue_head();
|
||||||
@ -859,7 +865,8 @@ void do_list(const char *mask,
|
|||||||
} else {
|
} else {
|
||||||
/* check for dfs */
|
/* check for dfs */
|
||||||
if (cli_resolve_path(ctx, "", auth_info, cli, mask, &targetcli, &targetpath)) {
|
if (cli_resolve_path(ctx, "", auth_info, cli, mask, &targetcli, &targetpath)) {
|
||||||
if (cli_list(targetcli, targetpath, attribute, do_list_helper, NULL) == -1) {
|
if (cli_list(targetcli, targetpath, attribute,
|
||||||
|
do_list_helper, targetcli) == -1) {
|
||||||
d_printf("%s listing %s\n",
|
d_printf("%s listing %s\n",
|
||||||
cli_errstr(targetcli), targetpath);
|
cli_errstr(targetcli), targetpath);
|
||||||
}
|
}
|
||||||
@ -1154,7 +1161,8 @@ static int cmd_get(void)
|
|||||||
Do an mget operation on one file.
|
Do an mget operation on one file.
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
static void do_mget(struct file_info *finfo, const char *dir)
|
static void do_mget(struct cli_state *cli_state, struct file_info *finfo,
|
||||||
|
const char *dir)
|
||||||
{
|
{
|
||||||
TALLOC_CTX *ctx = talloc_tos();
|
TALLOC_CTX *ctx = talloc_tos();
|
||||||
char *rname = NULL;
|
char *rname = NULL;
|
||||||
@ -2133,7 +2141,8 @@ static int cmd_queue(void)
|
|||||||
Delete some files.
|
Delete some files.
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
static void do_del(struct file_info *finfo, const char *dir)
|
static void do_del(struct cli_state *cli_state, struct file_info *finfo,
|
||||||
|
const char *dir)
|
||||||
{
|
{
|
||||||
TALLOC_CTX *ctx = talloc_tos();
|
TALLOC_CTX *ctx = talloc_tos();
|
||||||
char *mask = NULL;
|
char *mask = NULL;
|
||||||
@ -2152,9 +2161,9 @@ static void do_del(struct file_info *finfo, const char *dir)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!NT_STATUS_IS_OK(cli_unlink(finfo->cli, mask, aSYSTEM | aHIDDEN))) {
|
if (!NT_STATUS_IS_OK(cli_unlink(cli_state, mask, aSYSTEM | aHIDDEN))) {
|
||||||
d_printf("%s deleting remote file %s\n",
|
d_printf("%s deleting remote file %s\n",
|
||||||
cli_errstr(finfo->cli),mask);
|
cli_errstr(cli_state),mask);
|
||||||
}
|
}
|
||||||
TALLOC_FREE(mask);
|
TALLOC_FREE(mask);
|
||||||
}
|
}
|
||||||
|
@ -30,7 +30,8 @@ const char *client_get_cur_dir(void);
|
|||||||
const char *client_set_cur_dir(const char *newdir);
|
const char *client_set_cur_dir(const char *newdir);
|
||||||
void do_list(const char *mask,
|
void do_list(const char *mask,
|
||||||
uint16 attribute,
|
uint16 attribute,
|
||||||
void (*fn)(struct file_info *, const char *dir),
|
void (*fn)(struct cli_state *cli_state, struct file_info *,
|
||||||
|
const char *dir),
|
||||||
bool rec,
|
bool rec,
|
||||||
bool dirs);
|
bool dirs);
|
||||||
int cmd_iosize(void);
|
int cmd_iosize(void);
|
||||||
|
@ -116,7 +116,8 @@ static void writetarheader(int f, const char *aname, uint64_t size, time_t mtim
|
|||||||
const char *amode, unsigned char ftype);
|
const char *amode, unsigned char ftype);
|
||||||
static void do_atar(const char *rname_in, char *lname,
|
static void do_atar(const char *rname_in, char *lname,
|
||||||
struct file_info *finfo1);
|
struct file_info *finfo1);
|
||||||
static void do_tar(struct file_info *finfo, const char *dir);
|
static void do_tar(struct cli_state *cli_state, struct file_info *finfo,
|
||||||
|
const char *dir);
|
||||||
static void oct_it(uint64_t value, int ndgs, char *p);
|
static void oct_it(uint64_t value, int ndgs, char *p);
|
||||||
static void fixtarname(char *tptr, const char *fp, size_t l);
|
static void fixtarname(char *tptr, const char *fp, size_t l);
|
||||||
static int dotarbuf(int f, char *b, int n);
|
static int dotarbuf(int f, char *b, int n);
|
||||||
@ -805,7 +806,8 @@ static void do_atar(const char *rname_in, char *lname,
|
|||||||
Append single file to tar file (or not)
|
Append single file to tar file (or not)
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
static void do_tar(struct file_info *finfo, const char *dir)
|
static void do_tar(struct cli_state *cli_state, struct file_info *finfo,
|
||||||
|
const char *dir)
|
||||||
{
|
{
|
||||||
TALLOC_CTX *ctx = talloc_stackframe();
|
TALLOC_CTX *ctx = talloc_stackframe();
|
||||||
|
|
||||||
|
@ -274,7 +274,6 @@ struct cli_state {
|
|||||||
};
|
};
|
||||||
|
|
||||||
struct file_info {
|
struct file_info {
|
||||||
struct cli_state *cli;
|
|
||||||
uint64_t size;
|
uint64_t size;
|
||||||
uint16 mode;
|
uint16 mode;
|
||||||
uid_t uid;
|
uid_t uid;
|
||||||
|
@ -62,7 +62,6 @@ static size_t interpret_long_filename(TALLOC_CTX *ctx,
|
|||||||
*p_resume_key = 0;
|
*p_resume_key = 0;
|
||||||
}
|
}
|
||||||
ZERO_STRUCTP(finfo);
|
ZERO_STRUCTP(finfo);
|
||||||
finfo->cli = cli;
|
|
||||||
|
|
||||||
switch (level) {
|
switch (level) {
|
||||||
case SMB_FIND_INFO_STANDARD: /* OS/2 understands this */
|
case SMB_FIND_INFO_STANDARD: /* OS/2 understands this */
|
||||||
@ -508,7 +507,6 @@ static bool interpret_short_filename(TALLOC_CTX *ctx,
|
|||||||
size_t ret;
|
size_t ret;
|
||||||
ZERO_STRUCTP(finfo);
|
ZERO_STRUCTP(finfo);
|
||||||
|
|
||||||
finfo->cli = cli;
|
|
||||||
finfo->mode = CVAL(p,21);
|
finfo->mode = CVAL(p,21);
|
||||||
|
|
||||||
/* this date is converted to GMT by make_unix_date */
|
/* this date is converted to GMT by make_unix_date */
|
||||||
|
Reference in New Issue
Block a user