]> git.decadent.org.uk Git - nfs-utils.git/blobdiff - utils/nfsidmap/nfsidmap.c
Imported upstream 1.2.8
[nfs-utils.git] / utils / nfsidmap / nfsidmap.c
index cf1155188851836fcd0ef38934afd9d9f8244cb9..e14543c85770d5dd9f167d55c4517486cde302ed 100644 (file)
@@ -12,6 +12,7 @@
 
 #include <unistd.h>
 #include "xlog.h"
+#include "conffile.h"
 
 int verbose = 0;
 char *usage="Usage: %s [-v] [-c || [-u|-g|-r key] || [-t timeout] key desc]";
@@ -26,6 +27,10 @@ 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
@@ -267,6 +272,13 @@ int main(int argc, char **argv)
                }
        }
 
+       if (nfs4_init_name_mapping(PATH_IDMAPDCONF))  {
+               xlog_err("Unable to create name to user id mappings.");
+               return 1;
+       }
+       if (!verbose)
+               verbose = conf_get_num("General", "Verbosity", 0);
+
        if (keystr) {
                rc = key_revoke(keystr, keymask);
                return rc;