Skip to content

Commit

Permalink
Allow slash in volume names
Browse files Browse the repository at this point in the history
In the past, I have had problems with restores failing due to the device
for differential volumes can't find the volumes stored by the incremental.

I also have not been quite satisfied with having all the files in one
large directory without a structure, e.g., when I have different
retention policy for some volumes.

My fix is quite simple: add '/' to the list of acceptable characters in
a volume name.  this allows me to specify the same Archive Device for
all the file media devices, and do the separation with Label Format like
"incr/Incr-". Restore is unproblematic in this setup, since any Device
can be used to access all the volumes (even if they are actually in
different filesystems, due to the structure of my mounts).

Signed-off-by: Marco van Wieringen <mvw@planets.elm.net>
  • Loading branch information
kjetilho authored and Marco van Wieringen committed Feb 17, 2015
1 parent 1c1b763 commit 7969af6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
9 changes: 8 additions & 1 deletion src/dird/ua_label.c
Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion src/stored/scan.c
Expand Up @@ -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))) {
Expand Down

0 comments on commit 7969af6

Please sign in to comment.