X-Git-Url: https://git.decadent.org.uk/gitweb/?p=nfs-utils.git;a=blobdiff_plain;f=utils%2Fgssd%2Fsvcgssd.c;h=6ca0e8d762bf2ae36c321b97bb54f7efbfafd6cf;hp=0db3762d2d00575240600b753f268da0695ce9c6;hb=3724317e223d46908aac2405bbd73ea2de4f36e5;hpb=3829bb90e764cd72c0009cb32a8b39d0fab89d81 diff --git a/utils/gssd/svcgssd.c b/utils/gssd/svcgssd.c index 0db3762..6ca0e8d 100644 --- a/utils/gssd/svcgssd.c +++ b/utils/gssd/svcgssd.c @@ -37,7 +37,9 @@ */ -#include "config.h" +#ifdef HAVE_CONFIG_H +#include +#endif /* HAVE_CONFIG_H */ #include #include @@ -54,6 +56,7 @@ #include #include #include +#include #include "nfslib.h" #include "svcgssd.h" #include "gss_util.h" @@ -124,12 +127,16 @@ mydaemon(int nochdir, int noclose) } static void -release_parent() +release_parent(void) { int status; if (pipefds[1] > 0) { - write(pipefds[1], &status, 1); + if (write(pipefds[1], &status, 1) != 1) { + printerr(1, + "WARN: writing to parent pipe failed: errno %d (%s)\n", + errno, strerror(errno)); + } close(pipefds[1]); pipefds[1] = -1; } @@ -154,7 +161,7 @@ sig_hup(int signal) static void usage(char *progname) { - fprintf(stderr, "usage: %s [-n] [-f] [-v] [-r]\n", + fprintf(stderr, "usage: %s [-n] [-f] [-v] [-r] [-i]\n", progname); exit(1); } @@ -166,15 +173,19 @@ main(int argc, char *argv[]) int fg = 0; int verbosity = 0; int rpc_verbosity = 0; + int idmap_verbosity = 0; int opt; extern char *optarg; char *progname; - while ((opt = getopt(argc, argv, "fvrnp:")) != -1) { + while ((opt = getopt(argc, argv, "fivrnp:")) != -1) { switch (opt) { case 'f': fg = 1; break; + case 'i': + idmap_verbosity++; + break; case 'n': get_creds = 0; break; @@ -203,6 +214,13 @@ main(int argc, char *argv[]) printerr(0, "Warning: rpcsec_gss library does not " "support setting debug level\n"); #endif +#ifdef HAVE_NFS4_SET_DEBUG + nfs4_set_debug(idmap_verbosity, NULL); +#else + if (idmap_verbosity > 0) + printerr(0, "Warning: your nfsidmap library does not " + "support setting debug level\n"); +#endif if (gssd_check_mechs() != 0) { printerr(0, "ERROR: Problem with gssapi library\n");