Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
config: backup - search for tar in more bin dirs
  • Loading branch information
perexg committed Sep 8, 2014
1 parent 3faeb82 commit 946edfd
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/config.c
Expand Up @@ -978,6 +978,17 @@ dobackup(const char *oldver)

getcwd(cwd, sizeof(cwd));

if (!access("/bin/tar", X_OK))
argv[0] = "/bin/tar";
else if (!access("/usr/bin/tar", X_OK))
argv[0] = "/usr/bin/tar";
else if (!access("/usr/local/bin/tar", X_OK))
argv[0] = "/usr/local/bin/tar";
else {
tvherror("config", "unable to find tar program");
goto fatal;
}

snprintf(outfile, sizeof(outfile), "%s/backup", root);
if (makedirs(outfile, 0700))
goto fatal;
Expand Down

0 comments on commit 946edfd

Please sign in to comment.