From: Eric Bollengier Date: Fri, 15 Jan 2021 20:22:28 +0000 (+0100) Subject: Replace call .bvfs_ls_all_files with ".bvfs_lsfiles allfiles" X-Git-Tag: Release-11.3.2~772 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b5fba66c78551bdd88e2f3e30932cbfa92327835;p=thirdparty%2Fbacula.git Replace call .bvfs_ls_all_files with ".bvfs_lsfiles allfiles" --- diff --git a/bacula/src/dird/ua_dotcmds.c b/bacula/src/dird/ua_dotcmds.c index 96ac50193..650086175 100644 --- a/bacula/src/dird/ua_dotcmds.c +++ b/bacula/src/dird/ua_dotcmds.c @@ -70,7 +70,6 @@ static bool catalogscmd(UAContext *ua, const char *cmd); static bool dot_ls_cmd(UAContext *ua, const char *cmd); static bool dot_bvfs_lsdirs(UAContext *ua, const char *cmd); static bool dot_bvfs_lsfiles(UAContext *ua, const char *cmd); -static bool dot_bvfs_ls_all_files(UAContext *ua, const char *cmd); static bool dot_bvfs_update(UAContext *ua, const char *cmd); static bool dot_bvfs_get_jobids(UAContext *ua, const char *cmd); static bool dot_bvfs_versions(UAContext *ua, const char *cmd); @@ -128,7 +127,6 @@ static struct cmdstruct commands[] = { /* help */ /* can be used in runscript * { NT_(".actiononpurge"),aopcmd, NULL, true}, { NT_(".bvfs_lsdirs"), dot_bvfs_lsdirs, NULL, true}, { NT_(".bvfs_lsfiles"),dot_bvfs_lsfiles, NULL, true}, - { NT_(".bvfs_ls_all_files"),dot_bvfs_ls_all_files, NULL, true}, { NT_(".bvfs_get_volumes"),dot_bvfs_get_volumes,NULL, true}, { NT_(".bvfs_update"), dot_bvfs_update, NULL, true}, { NT_(".bvfs_get_jobids"), dot_bvfs_get_jobids, NULL, true}, @@ -1082,22 +1080,19 @@ static bool dot_bvfs_get_volumes(UAContext *ua, const char *cmd) } /* - * .bvfs_lsfiles jobid=1,2,3,4 pathid=10 - * .bvfs_lsfiles jobid=1,2,3,4 path=/ + * .bvfs_lsfiles allfiles jobid=1,2,3,4 */ -static bool dot_bvfs_lsfiles(UAContext *ua, const char *cmd) +static bool dot_bvfs_ls_all_files(UAContext *ua, const char *cmd) { - DBId_t pathid=0; int limit=2000, offset=0; - char *path=NULL, *jobid=NULL, *username=NULL; + char *jobid=NULL, *username=NULL; char *pattern=NULL, *filename=NULL; - bool ok; int i; - if (!bvfs_parse_arg(ua, &pathid, &path, &jobid, &username, + if (!bvfs_parse_arg(ua, NULL, NULL, &jobid, &username, &limit, &offset)) { - ua->error_msg("Can't find jobid, pathid or path argument\n"); + ua->error_msg("Can't find jobid argument\n"); return true; /* not enough param */ } if ((i = find_arg_with_value(ua, "pattern")) >= 0) { @@ -1130,17 +1125,9 @@ static bool dot_bvfs_lsfiles(UAContext *ua, const char *cmd) if (filename) { fs.set_filename(filename); } - if (pathid) { - ok = fs.ch_dir(pathid); - } else { - ok = fs.ch_dir(path); - } - if (!ok) { - goto bail_out; - } fs.set_offset(offset); - fs.ls_files(); + fs.ls_all_files(); bail_out: ua->bvfs = NULL; @@ -1148,19 +1135,26 @@ bail_out: } /* - * .bvfs_ls_all_files jobid=1,2,3,4 + * .bvfs_lsfiles jobid=1,2,3,4 pathid=10 + * .bvfs_lsfiles jobid=1,2,3,4 path=/ */ -static bool dot_bvfs_ls_all_files(UAContext *ua, const char *cmd) +static bool dot_bvfs_lsfiles(UAContext *ua, const char *cmd) { + DBId_t pathid=0; int limit=2000, offset=0; - char *jobid=NULL, *username=NULL; + char *path=NULL, *jobid=NULL, *username=NULL; char *pattern=NULL, *filename=NULL; + bool ok; int i; - if (!bvfs_parse_arg(ua, NULL, NULL, &jobid, &username, + if (find_arg(ua, "allfiles") > 0) { + return dot_bvfs_ls_all_files(ua, cmd); + } + + if (!bvfs_parse_arg(ua, &pathid, &path, &jobid, &username, &limit, &offset)) { - ua->error_msg("Can't find jobid argument\n"); + ua->error_msg("Can't find jobid, pathid or path argument\n"); return true; /* not enough param */ } if ((i = find_arg_with_value(ua, "pattern")) >= 0) { @@ -1193,9 +1187,17 @@ static bool dot_bvfs_ls_all_files(UAContext *ua, const char *cmd) if (filename) { fs.set_filename(filename); } + if (pathid) { + ok = fs.ch_dir(pathid); + } else { + ok = fs.ch_dir(path); + } + if (!ok) { + goto bail_out; + } fs.set_offset(offset); - fs.ls_all_files(); + fs.ls_files(); bail_out: ua->bvfs = NULL;