]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/dird/ua_run.c
Fix bug #1959 input validation on delete of jobs.
[bacula/bacula] / bacula / src / dird / ua_run.c
index 878c02971cd2c3242e6e68a9628a37f2c2a08ab8..f66bdd572e0f9d238ac13d153f761ca63ef940e0 100644 (file)
@@ -208,24 +208,6 @@ int modify_job_parameters(UAContext *ua, JCR *jcr, run_ctx &rc)
 {
    int i, opt;
    
-   /* Some options are not available through the menu
-    * TODO: Add an advanced menu?
-    */
-   if (rc.spool_data_set) {
-      jcr->spool_data = rc.spool_data;
-   }
-
-   if (rc.accurate_set) {
-      jcr->accurate = rc.accurate;
-   }
-
-   /* Used by migration jobs that can have the same name,
-    * but can run at the same time
-    */
-   if (rc.ignoreduplicatecheck_set) {
-      jcr->IgnoreDuplicateJobChecking = rc.ignoreduplicatecheck;
-   }
-
    /*
     * At user request modify parameters of job to be run.
     */
@@ -374,7 +356,7 @@ int modify_job_parameters(UAContext *ua, JCR *jcr, run_ctx &rc)
             goto try_again;
          }
          /* Where */
-         if (!get_cmd(ua, _("Please enter path prefix for restore (/ for none): "))) {
+         if (!get_cmd(ua, _("Please enter the full path prefix for restore (/ for none): "))) {
             break;
          }
          if (jcr->RegexWhere) { /* cannot use regexwhere and where */
@@ -570,6 +552,25 @@ static bool reset_restore_context(UAContext *ua, JCR *jcr, run_ctx &rc)
       jcr->RestoreJobId = str_to_int64(rc.jid);
       rc.jid = 0;
    }
+
+   /* Some options are not available through the menu
+    * TODO: Add an advanced menu?
+    */
+   if (rc.spool_data_set) {
+      jcr->spool_data = rc.spool_data;
+   }
+
+   if (rc.accurate_set) {
+      jcr->accurate = rc.accurate;
+   }
+
+   /* Used by migration jobs that can have the same name,
+    * but can run at the same time
+    */
+   if (rc.ignoreduplicatecheck_set) {
+      jcr->IgnoreDuplicateJobChecking = rc.ignoreduplicatecheck;
+   }
+
    return true;
 }
 
@@ -594,7 +595,7 @@ try_again_reg:
    switch (do_prompt(ua, "", _("Select parameter to modify"), NULL, 0)) {
    case 0:
       /* Strip prefix */
-      if (get_cmd(ua, _("Please enter path prefix to strip: "))) {
+      if (get_cmd(ua, _("Please enter the path prefix to strip: "))) {
          if (strip_prefix) bfree(strip_prefix);
          strip_prefix = bstrdup(ua->cmd);
       }
@@ -602,7 +603,7 @@ try_again_reg:
       goto try_again_reg;
    case 1:
       /* Add prefix */
-      if (get_cmd(ua, _("Please enter path prefix to add (/ for none): "))) {
+      if (get_cmd(ua, _("Please enter the path prefix to add (/ for none): "))) {
          if (IsPathSeparator(ua->cmd[0]) && ua->cmd[1] == '\0') {
             ua->cmd[0] = 0;
          }
@@ -613,7 +614,7 @@ try_again_reg:
       goto try_again_reg;
    case 2:
       /* Add suffix */
-      if (get_cmd(ua, _("Please enter file suffix to add: "))) {
+      if (get_cmd(ua, _("Please enter the file suffix to add: "))) {
          if (add_suffix) bfree(add_suffix);
          add_suffix = bstrdup(ua->cmd);
       }