]> git.decadent.org.uk Git - nfs-utils.git/commitdiff
Set libnfsidmap library debugging level and logging function.
authorneilbrown <neilbrown>
Sun, 26 Mar 2006 23:54:16 +0000 (23:54 +0000)
committerneilbrown <neilbrown>
Sun, 26 Mar 2006 23:54:16 +0000 (23:54 +0000)
This patch adds a call to the new libnfsidmap library function
nfs4_set_debug(), which defines the verbosity level libnfsidmap
should use as well as the logging function.

ChangeLog
utils/idmapd/idmapd.c

index b24b46cbd61788d275f6eb0f356036c5aa1e0f23..b771721bfdd4de0c97f31e029c4c01a4c3a0cf05 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2006-03-27 Steve Dickson <steved@redhat.com>
+       Set libnfsidmap library debugging level and logging function.
+
+       This patch adds a call to the new libnfsidmap library function 
+       nfs4_set_debug(), which defines the verbosity level libnfsidmap
+       should use as well as the logging function.
+
 2006-03-27 Kevin Coffman <kwc@citi.umich.edu>
        Don't close file descriptor until after calling event_del().
 
 2006-03-27 Kevin Coffman <kwc@citi.umich.edu>
        Don't close file descriptor until after calling event_del().
 
index 69396af78fede8448dbfa2438bc0236043b28eba..ca52c2c497a8a03ffa3f9f3ffc17a5bbf2d13944 100644 (file)
@@ -287,6 +287,7 @@ main(int argc, char **argv)
 
        if (stat(conf_path, &sb) == -1 && (errno == ENOENT || errno == EACCES)) {
                warn("Skipping configuration file \"%s\"", conf_path);
 
        if (stat(conf_path, &sb) == -1 && (errno == ENOENT || errno == EACCES)) {
                warn("Skipping configuration file \"%s\"", conf_path);
+               conf_path = NULL;
        } else {
                conf_init();
                verbose = conf_get_num("General", "Verbosity", 0);
        } else {
                conf_init();
                verbose = conf_get_num("General", "Verbosity", 0);
@@ -295,7 +296,6 @@ main(int argc, char **argv)
                        strlcpy(pipefsdir, xpipefsdir, sizeof(pipefsdir));
                CONF_SAVE(nobodyuser, conf_get_str("Mapping", "Nobody-User"));
                CONF_SAVE(nobodygroup, conf_get_str("Mapping", "Nobody-Group"));
                        strlcpy(pipefsdir, xpipefsdir, sizeof(pipefsdir));
                CONF_SAVE(nobodyuser, conf_get_str("Mapping", "Nobody-User"));
                CONF_SAVE(nobodygroup, conf_get_str("Mapping", "Nobody-Group"));
-               nfs4_init_name_mapping(conf_path);
        }
 
        while ((opt = getopt(argc, argv, GETOPTSTR)) != -1)
        }
 
        while ((opt = getopt(argc, argv, GETOPTSTR)) != -1)
@@ -337,6 +337,12 @@ main(int argc, char **argv)
                errx(1, "Could not find group \"%s\"", nobodygroup);
        nobodygid = gr->gr_gid;
 
                errx(1, "Could not find group \"%s\"", nobodygroup);
        nobodygid = gr->gr_gid;
 
+       nfs4_set_debug(verbose, idmapd_warnx);
+       if (conf_path == NULL)
+               conf_path = _PATH_IDMAPDCONF;
+       if (nfs4_init_name_mapping(conf_path))
+               errx(1, "Unable to create name to user id mappings.");
+
        if (!fg)
                mydaemon(0, 0);
 
        if (!fg)
                mydaemon(0, 0);