]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/dird/ua_dotcmds.c
kes Move the checking of the database in initializion of the Director
[bacula/bacula] / bacula / src / dird / ua_dotcmds.c
index 48be7c785c6236e0f61cd4cd905ab134f81eff7d..48f9edf27b1977972053ac24ef550417ef9922cb 100644 (file)
@@ -279,22 +279,27 @@ static int client_backups_handler(void *ctx, int num_field, char **row)
  */
 static bool api_cmd(UAContext *ua, const char *cmd)
 {
-   /* Eventually we will probably have several levels or
-    *  capabilities enabled by this.
-    */
-   ua->api = 1;
+   if (ua->argc == 2) {
+      ua->api = atoi(ua->argk[1]);
+   } else {
+      ua->api = 1;
+   }
    return true;
 }
 
 /*
  * Return the backups for this client 
+ *
+ *  .backups client=xxx fileset=yyy
+ *
  */
 static bool backupscmd(UAContext *ua, const char *cmd)
 {
    if (!open_client_db(ua)) {
       return true;
    }
-   if (ua->argc != 3 || strcmp(ua->argk[1], "client") != 0 || strcmp(ua->argk[2], "fileset") != 0) {
+   if (ua->argc != 3 || strcmp(ua->argk[1], "client") != 0 || 
+       strcmp(ua->argk[2], "fileset") != 0) {
       return true;
    }
    if (!acl_access_ok(ua, Client_ACL, ua->argv[1]) ||