From 946edfd4ace8d0948fe990690325987f1ff9dd96 Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Fri, 5 Sep 2014 17:36:11 +0200 Subject: [PATCH] config: backup - search for tar in more bin dirs --- src/config.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/config.c b/src/config.c index 9f445ed8..13de76a0 100644 --- a/src/config.c +++ b/src/config.c @@ -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;