X-Git-Url: https://git.decadent.org.uk/gitweb/?p=nfs-utils.git;a=blobdiff_plain;f=utils%2Fnfsidmap%2Fnfsidmap.c;fp=utils%2Fnfsidmap%2Fnfsidmap.c;h=b767395fba10effb198b2217583459de51b3b611;hp=cf1155188851836fcd0ef38934afd9d9f8244cb9;hb=43537ecbc1ab3ae7cefe5d47e7e03b14bf428197;hpb=1ca82a963ace17397bd7ec09f5e0707badd7c254 diff --git a/utils/nfsidmap/nfsidmap.c b/utils/nfsidmap/nfsidmap.c index cf11551..b767395 100644 --- a/utils/nfsidmap/nfsidmap.c +++ b/utils/nfsidmap/nfsidmap.c @@ -12,6 +12,7 @@ #include #include "xlog.h" +#include "conffile.h" int verbose = 0; char *usage="Usage: %s [-v] [-c || [-u|-g|-r key] || [-t timeout] key desc]"; @@ -26,11 +27,26 @@ char *usage="Usage: %s [-v] [-c || [-u|-g|-r key] || [-t timeout] key desc]"; #define DEFAULT_KEYRING "id_resolver" #endif +#ifndef PATH_IDMAPDCONF +#define PATH_IDMAPDCONF "/etc/idmapd.conf" +#endif + static int keyring_clear(char *keyring); #define UIDKEYS 0x1 #define GIDKEYS 0x2 +/* + * Check to the config file for the verbosity level + */ +int +get_config_verbose(char *path) +{ + conf_path = path; + conf_init(); + return conf_get_num("General", "Verbosity", 0); +} + /* * Find either a user or group id based on the name@domain string */ @@ -266,7 +282,9 @@ int main(int argc, char **argv) break; } } - + if (!verbose) { + verbose = get_config_verbose(PATH_IDMAPDCONF); + } if (keystr) { rc = key_revoke(keystr, keymask); return rc;