diff options
Diffstat (limited to 'cmds-subvolume.c')
-rw-r--r-- | cmds-subvolume.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/cmds-subvolume.c b/cmds-subvolume.c index c5892847..29ded126 100644 --- a/cmds-subvolume.c +++ b/cmds-subvolume.c @@ -126,8 +126,7 @@ static int cmd_subvol_create(int argc, char **argv) dupdir = strdup(dst); dstdir = dirname(dupdir); - if (!strcmp(newname, ".") || !strcmp(newname, "..") || - strchr(newname, '/') ){ + if (!test_issubvolname(newname)) { fprintf(stderr, "ERROR: incorrect subvolume name '%s'\n", newname); goto out; @@ -301,8 +300,7 @@ again: vname = basename(dupvname); free(cpath); - if (!strcmp(vname, ".") || !strcmp(vname, "..") || - strchr(vname, '/')) { + if (!test_issubvolname(vname)) { fprintf(stderr, "ERROR: incorrect subvolume name '%s'\n", vname); ret = 1; @@ -672,8 +670,7 @@ static int cmd_snapshot(int argc, char **argv) dstdir = dirname(dupdir); } - if (!strcmp(newname, ".") || !strcmp(newname, "..") || - strchr(newname, '/') ){ + if (!test_issubvolname(newname)) { fprintf(stderr, "ERROR: incorrect snapshot name '%s'\n", newname); goto out; |