 ===================================================================
 --- src/dird/dird_conf.c	(rvision 4466)
 +++ src/dird/dird_conf.c	(copie de travail)
-@@ -268,6 +268,7 @@
+@@ -52,6 +52,7 @@
+ 
+ #include "bacula.h"
+ #include "dird.h"
++#include "lib/breg.h"
+ 
+ /* Define the first and last resource ID record
+  * types. Note, these should be unique for each
+@@ -268,6 +269,10 @@
     {"run",       store_alist_str, ITEM(res_job.run_cmds), 0, 0, 0},
     /* Root of where to restore files */
     {"where",    store_dir,      ITEM(res_job.RestoreWhere), 0, 0, 0},
 +   {"whereuseregexp", store_bool, ITEM(res_job.where_use_regexp), 0, 0, 0},
++   {"stripprefix",    store_str,  ITEM(res_job.strip_prefix), 0, 0, 0},
++   {"addprefix",    store_str,  ITEM(res_job.add_prefix), 0, 0, 0},
++   {"addsuffix",    store_str,  ITEM(res_job.add_suffix), 0, 0, 0},
     /* Where to find bootstrap during restore */
     {"bootstrap",store_dir,      ITEM(res_job.RestoreBootstrap), 0, 0, 0},
     /* Where to write bootstrap file during backup */
-@@ -611,6 +612,9 @@
+@@ -611,6 +616,9 @@
        if (res->res_job.RestoreWhere) {
           sendit(sock, _("  --> Where=%s\n"), NPRT(res->res_job.RestoreWhere));
        }

 /* Imported functions */
 extern void print_bsr(UAContext *ua, RBSR *bsr);
 
@@ -83,6 +83,9 @@
    JCR *jcr = ua->jcr;
    char *escaped_bsr_name = NULL;
    char *escaped_where_name = NULL;
+   bool where_use_regexp = false;
+   char *strip_prefix, *add_prefix, *add_suffix;
+   strip_prefix = add_prefix = add_suffix = NULL;
 
    memset(&rx, 0, sizeof(rx));
    rx.path = get_pool_memory(PM_FNAME);
@@ -94,6 +97,29 @@
    i = find_arg_with_value(ua, "where");
    if (i >= 0) {
       rx.where = ua->argv[i];

       if (!acl_access_ok(ua, Where_ACL, rx.where)) {
          ua->error_msg(_("\"where\" specification not authorized.\n"));
          goto bail_out;
@@ -195,9 +234,10 @@
 
       Mmsg(ua->cmd,
           "run job=\"%s\" client=\"%s\" storage=\"%s\" bootstrap=\"%s\""
