On Mon, Feb 17, 2003 at 02:21:25PM -0600, [EMAIL PROTECTED] wrote:
>
> >
> > > I had only-root-readable index files, and the generated exlcude file
> > > was empty.
> > >
> > > IMHO amcheck should check that the exclude files on the client are
> > > readable.
> >
> > It should, unless you specified them to be optional.
>
> It would seem to me that even if they are optional, if present,
> they should be readable, and warning about them being present but
> unreadable would be good...
Agree, all error except ENOENT should always be reported.
What about this patch.
Jean-Louis
--
Jean-Louis Martineau email: [EMAIL PROTECTED]
Departement IRO, Universite de Montreal
C.P. 6128, Succ. CENTRE-VILLE Tel: (514) 343-6111 ext. 3529
Montreal, Canada, H3C 3J7 Fax: (514) 343-5834
diff -u -r --show-c-function --exclude-from=amanda.diff
amanda-2.4.4b1.orig/client-src/client_util.c
amanda-2.4.4b1.new/client-src/client_util.c
--- amanda-2.4.4b1.orig/client-src/client_util.c 2003-01-02 20:05:56.000000000
-0500
+++ amanda-2.4.4b1.new/client-src/client_util.c 2003-02-17 21:08:26.000000000 -0500
@@ -267,7 +267,8 @@ int verbose;
debug_prefix(NULL),
exclname,
strerror(errno)));
- if(verbose && options->exclude_optional==0)
+ if(verbose && (options->exclude_optional == 0 ||
+ errno != ENOENT))
printf("ERROR [Can't open exclude file '%s': %s]\n",
exclname, strerror(errno));
}
@@ -281,7 +282,7 @@ int verbose;
debug_prefix(NULL),
filename,
strerror(errno)));
- if(verbose && options->exclude_optional == 0)
+ if(verbose)
printf("ERROR [Can't create exclude file '%s': %s]\n", filename,
strerror(errno));
}
@@ -339,7 +340,8 @@ int verbose;
debug_prefix(NULL),
inclname,
strerror(errno)));
- if(verbose && options->include_optional == 0)
+ if(verbose && (options->include_optional == 0 ||
+ errno != ENOENT))
printf("ERROR [Can't open include file '%s': %s]\n",
inclname, strerror(errno));
}
@@ -349,12 +351,12 @@ int verbose;
fclose(file_include);
}
else {
- dbprintf(("%s: Can't open include file '%s': %s\n",
+ dbprintf(("%s: Can't create include file '%s': %s\n",
debug_prefix(NULL),
filename,
strerror(errno)));
- if(verbose && options->include_optional == 0)
- printf("ERROR [Can't open include file '%s': %s]\n", filename,
+ if(verbose)
+ printf("ERROR [Can't create include file '%s': %s]\n", filename,
strerror(errno));
}
}