diff --git a/src/dird/ua_label.c b/src/dird/ua_label.c index 8fd005efdf1..83fdcd2a9eb 100644 --- a/src/dird/ua_label.c +++ b/src/dird/ua_label.c @@ -482,7 +482,14 @@ bool is_volume_name_legal(UAContext *ua, const char *name) { int len; const char *p; - const char *accept = ":.-_"; + const char *accept = ":.-_/"; + + if (name[0] == '/') { + if (ua) { + ua->error_msg(_("Volume name can not start with \"/\".\n")); + } + return 0; + } /* * Restrict the characters permitted in the Volume name diff --git a/src/stored/scan.c b/src/stored/scan.c index 3e9d4d43081..4a947247c4d 100644 --- a/src/stored/scan.c +++ b/src/stored/scan.c @@ -139,8 +139,11 @@ static bool is_volume_name_legal(char *name) { int len; const char *p; - const char *accept = ":.-_"; + const char *accept = ":.-_/"; + if (name[0] == '/') { + return false; + } /* Restrict the characters permitted in the Volume name */ for (p=name; *p; p++) { if (B_ISALPHA(*p) || B_ISDIGIT(*p) || strchr(accept, (int)(*p))) {