Commit 80ddadb7 authored by Wayne Davison's avatar Wayne Davison

Complain if the --suffix value contains slashes (which is all too easy

to accidentally have happen if you try to specify "~" with --backup-dir).
parent 31f3b68a
......@@ -633,6 +633,11 @@ int parse_arguments(int *argc, const char ***argv, int frommain)
if (!backup_suffix)
backup_suffix = backup_dir? "" : BACKUP_SUFFIX;
backup_suffix_len = strlen(backup_suffix);
if (strchr(backup_suffix, '/') != NULL) {
rprintf(FERROR, "--suffix cannot contain slashes: %s\n",
backup_suffix);
exit_cleanup(RERR_SYNTAX);
}
if (backup_dir)
backup_dir_len = strlen(backup_dir);
else if (!backup_suffix_len) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment