From f30c53e5aacd10d449f01703b31a927c8a7a3134 Mon Sep 17 00:00:00 2001 From: Stelian Pop Date: Mon, 24 Jan 2005 10:32:01 +0000 Subject: [PATCH] Emit warnings not panic() when comparing a file and we don't have enough priviledges to access it. --- CHANGES | 11 ++++++++++- restore/dirs.c | 4 ++-- restore/tape.c | 12 ++++++------ 3 files changed, 18 insertions(+), 9 deletions(-) diff --git a/CHANGES b/CHANGES index 5d2c1e1..a5cd0ea 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,13 @@ -$Id: CHANGES,v 1.269 2005/01/21 09:27:26 stelian Exp $ +$Id: CHANGES,v 1.270 2005/01/24 10:32:01 stelian Exp $ + +Changes between versions 0.4b39 and 0.4b40 (released ????????????????) +====================================================================== + +1. Changed restore to emit warnings (instead of emitting a fatal + error) if a file (or a directory) is unavailable for a + comparision (if the user doesn't have the necessary permissions + to access it for example). Thanks to Kenneth Porter + for the bug report. Changes between versions 0.4b38 and 0.4b39 (released January 21, 2005) ====================================================================== diff --git a/restore/dirs.c b/restore/dirs.c index c9a9482..26c637b 100644 --- a/restore/dirs.c +++ b/restore/dirs.c @@ -42,7 +42,7 @@ #ifndef lint static const char rcsid[] = - "$Id: dirs.c,v 1.30 2005/01/14 13:01:34 stelian Exp $"; + "$Id: dirs.c,v 1.31 2005/01/24 10:32:14 stelian Exp $"; #endif /* not lint */ #include @@ -753,7 +753,7 @@ comparedirmodes(void) unsigned long newflags; if (LSTAT(cp, &sb) < 0) { - warn("%s: does not exist", cp); + warn("unable to stat %s", cp); do_compare_error; continue; } diff --git a/restore/tape.c b/restore/tape.c index c4c50c0..76bdb4c 100644 --- a/restore/tape.c +++ b/restore/tape.c @@ -42,7 +42,7 @@ #ifndef lint static const char rcsid[] = - "$Id: tape.c,v 1.85 2005/01/14 13:01:34 stelian Exp $"; + "$Id: tape.c,v 1.86 2005/01/24 10:32:14 stelian Exp $"; #endif /* not lint */ #include @@ -1527,7 +1527,7 @@ cmpfiles(char *tapefile, char *diskfile, struct STAT *sbuf_disk) int fd_tape, fd_disk; if (STAT(tapefile, &sbuf_tape) != 0) { - panic("Can't lstat tmp file %s: %s\n", tapefile, + panic("can't lstat tmp file %s: %s\n", tapefile, strerror(errno)); do_compare_error; } @@ -1545,12 +1545,12 @@ cmpfiles(char *tapefile, char *diskfile, struct STAT *sbuf_disk) } if ((fd_tape = OPEN(tapefile, O_RDONLY)) < 0) { - panic("Can't open %s: %s\n", tapefile, strerror(errno)); + panic("can't open %s: %s\n", tapefile, strerror(errno)); do_compare_error; } if ((fd_disk = OPEN(diskfile, O_RDONLY)) < 0) { close(fd_tape); - panic("Can't open %s: %s\n", diskfile, strerror(errno)); + panic("can't open %s: %s\n", diskfile, strerror(errno)); do_compare_error; } @@ -1652,7 +1652,7 @@ comparefile(char *name) } if ((r = LSTAT(name, &sb)) != 0) { - warn("%s: does not exist (%d)", name, r); + warn("unable to stat %s", name); do_compare_error; skipfile(); return; @@ -1773,7 +1773,7 @@ comparefile(char *name) case IFREG: #if COMPARE_ONTHEFLY if ((ifile = OPEN(name, O_RDONLY)) < 0) { - panic("Can't open %s: %s\n", name, strerror(errno)); + warn("can't open %s", name); skipfile(); do_compare_error; } -- 2.39.5