From: Eric Bollengier Date: Sat, 17 Feb 2007 17:30:11 +0000 (+0000) Subject: ebl add update volume=xxx recyclepool=yyyy X-Git-Tag: Release-2.2.0~1032 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=c35f72ed607c2dd3b401a52a195d4f8b57957059;p=bacula%2Fbacula ebl add update volume=xxx recyclepool=yyyy git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@4194 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/src/dird/protos.h b/bacula/src/dird/protos.h index fa0b88d737..44f4aba962 100644 --- a/bacula/src/dird/protos.h +++ b/bacula/src/dird/protos.h @@ -221,7 +221,7 @@ CLIENT *select_client_resource(UAContext *ua); FILESET *select_fileset_resource(UAContext *ua); int select_pool_and_media_dbr(UAContext *ua, POOL_DBR *pr, MEDIA_DBR *mr); int select_media_dbr(UAContext *ua, MEDIA_DBR *mr); -bool select_pool_dbr(UAContext *ua, POOL_DBR *pr); +bool select_pool_dbr(UAContext *ua, POOL_DBR *pr, char *argk="pool"); int select_client_dbr(UAContext *ua, CLIENT_DBR *cr); void start_prompt(UAContext *ua, const char *msg); @@ -232,7 +232,7 @@ STORE *get_storage_resource(UAContext *ua, bool use_default); int get_storage_drive(UAContext *ua, STORE *store); int get_storage_slot(UAContext *ua, STORE *store); int get_media_type(UAContext *ua, char *MediaType, int max_media); -bool get_pool_dbr(UAContext *ua, POOL_DBR *pr); +bool get_pool_dbr(UAContext *ua, POOL_DBR *pr, char *argk="pool"); int get_client_dbr(UAContext *ua, CLIENT_DBR *cr); POOL *get_pool_resource(UAContext *ua); POOL *select_pool_resource(UAContext *ua); diff --git a/bacula/src/dird/ua_select.c b/bacula/src/dird/ua_select.c index f864492ed7..bf99c057fc 100644 --- a/bacula/src/dird/ua_select.c +++ b/bacula/src/dird/ua_select.c @@ -431,11 +431,11 @@ int select_client_dbr(UAContext *ua, CLIENT_DBR *cr) return 1; } - - /* Scan what the user has entered looking for: * - * pool= + * argk= + * + * where argk can be : pool, recyclepool, scratchpool, nextpool etc.. * * if error or not found, put up a list of pool DBRs * to choose from. @@ -443,7 +443,7 @@ int select_client_dbr(UAContext *ua, CLIENT_DBR *cr) * returns: false on error * true on success and fills in POOL_DBR */ -bool get_pool_dbr(UAContext *ua, POOL_DBR *pr) +bool get_pool_dbr(UAContext *ua, POOL_DBR *pr, char *argk) { if (pr->Name[0]) { /* If name already supplied */ if (db_get_pool_record(ua->jcr, ua->db, pr) && @@ -452,16 +452,17 @@ bool get_pool_dbr(UAContext *ua, POOL_DBR *pr) } bsendmsg(ua, _("Could not find Pool \"%s\": ERR=%s"), pr->Name, db_strerror(ua->db)); } - if (!select_pool_dbr(ua, pr)) { /* try once more */ + if (!select_pool_dbr(ua, pr, argk)) { /* try once more */ return false; } return true; } /* - * Select a Pool record from the catalog + * Select a Pool record from catalog + * argk can be pool, recyclepool, scratchpool etc.. */ -bool select_pool_dbr(UAContext *ua, POOL_DBR *pr) +bool select_pool_dbr(UAContext *ua, POOL_DBR *pr, char *argk) { POOL_DBR opr; char name[MAX_NAME_LENGTH]; @@ -469,7 +470,7 @@ bool select_pool_dbr(UAContext *ua, POOL_DBR *pr) uint32_t *ids; for (i=1; iargc; i++) { - if (strcasecmp(ua->argk[i], NT_("pool")) == 0 && ua->argv[i] && + if (strcasecmp(ua->argk[i], argk) == 0 && ua->argv[i] && acl_access_ok(ua, Pool_ACL, ua->argv[i])) { bstrncpy(pr->Name, ua->argv[i], sizeof(pr->Name)); if (!db_get_pool_record(ua->jcr, ua->db, pr)) {