|
|
a72e7a |
commit 6fc893187db3fceb66129a3fd8437f663a5e33d0
|
|
|
a72e7a |
Author: Jeff Layton <jeff.layton@primarydata.com>
|
|
|
a72e7a |
Date: Tue Sep 8 11:59:25 2015 -0400
|
|
|
a72e7a |
|
|
|
a72e7a |
Strip newlines out of IDMAP_LOG messages
|
|
|
a72e7a |
|
|
|
a72e7a |
When logging to syslog, they aren't needed (or desirable) and when
|
|
|
a72e7a |
logging to stderr the logging function generally adds it itself.
|
|
|
a72e7a |
|
|
|
a72e7a |
Note that I did not change gums.c since it defaults to using printf()
|
|
|
a72e7a |
as a logging function.
|
|
|
a72e7a |
|
|
|
a72e7a |
Signed-off-by: Jeff Layton <jeff.layton@primarydata.com>
|
|
|
a72e7a |
Signed-off-by: Steve Dickson <steved@redhat.com>
|
|
|
a72e7a |
|
|
|
a72e7a |
diff --git a/libnfsidmap.c b/libnfsidmap.c
|
|
|
a72e7a |
index a8a9229..2db4d13 100644
|
|
|
a72e7a |
--- a/libnfsidmap.c
|
|
|
a72e7a |
+++ b/libnfsidmap.c
|
|
|
a72e7a |
@@ -141,20 +141,20 @@ static int load_translation_plugin(char *method, struct mapping_plugin *plgn)
|
|
|
a72e7a |
|
|
|
a72e7a |
dl = dlopen(plgname, RTLD_NOW | RTLD_LOCAL);
|
|
|
a72e7a |
if (dl == NULL) {
|
|
|
a72e7a |
- IDMAP_LOG(1, ("libnfsidmap: Unable to load plugin: %s\n",
|
|
|
a72e7a |
+ IDMAP_LOG(1, ("libnfsidmap: Unable to load plugin: %s",
|
|
|
a72e7a |
dlerror()));
|
|
|
a72e7a |
return -1;
|
|
|
a72e7a |
}
|
|
|
a72e7a |
init_func = (libnfsidmap_plugin_init_t) dlsym(dl, PLUGIN_INIT_FUNC);
|
|
|
a72e7a |
if (init_func == NULL) {
|
|
|
a72e7a |
- IDMAP_LOG(1, ("libnfsidmap: Unable to get init function: %s\n",
|
|
|
a72e7a |
+ IDMAP_LOG(1, ("libnfsidmap: Unable to get init function: %s",
|
|
|
a72e7a |
dlerror()));
|
|
|
a72e7a |
dlclose(dl);
|
|
|
a72e7a |
return -1;
|
|
|
a72e7a |
}
|
|
|
a72e7a |
trans = init_func();
|
|
|
a72e7a |
if (trans == NULL) {
|
|
|
a72e7a |
- IDMAP_LOG(1, ("libnfsidmap: Failed to initialize plugin %s\n",
|
|
|
a72e7a |
+ IDMAP_LOG(1, ("libnfsidmap: Failed to initialize plugin %s",
|
|
|
a72e7a |
PLUGIN_INIT_FUNC, plgname));
|
|
|
a72e7a |
dlclose(dl);
|
|
|
a72e7a |
return -1;
|
|
|
a72e7a |
@@ -163,14 +163,14 @@ static int load_translation_plugin(char *method, struct mapping_plugin *plgn)
|
|
|
a72e7a |
ret = trans->init();
|
|
|
a72e7a |
if (ret) {
|
|
|
a72e7a |
IDMAP_LOG(1, ("libnfsidmap: Failed in %s's init(), "
|
|
|
a72e7a |
- "returned %d\n", plgname, ret));
|
|
|
a72e7a |
+ "returned %d", plgname, ret));
|
|
|
a72e7a |
dlclose(dl);
|
|
|
a72e7a |
return -1;
|
|
|
a72e7a |
}
|
|
|
a72e7a |
}
|
|
|
a72e7a |
plgn->dl_handle = dl;
|
|
|
a72e7a |
plgn->trans = trans;
|
|
|
a72e7a |
- IDMAP_LOG(1, ("libnfsidmap: loaded plugin %s for method %s\n",
|
|
|
a72e7a |
+ IDMAP_LOG(1, ("libnfsidmap: loaded plugin %s for method %s",
|
|
|
a72e7a |
plgname, method));
|
|
|
a72e7a |
|
|
|
a72e7a |
return 0;
|
|
|
a72e7a |
@@ -182,7 +182,7 @@ static void unload_plugins(struct mapping_plugin **plgns)
|
|
|
a72e7a |
for (i = 0; plgns[i] != NULL; i++) {
|
|
|
a72e7a |
if (plgns[i]->dl_handle && dlclose(plgns[i]->dl_handle))
|
|
|
a72e7a |
IDMAP_LOG(1, ("libnfsidmap: failed to "
|
|
|
a72e7a |
- "unload plugin for method = %s\n",
|
|
|
a72e7a |
+ "unload plugin for method = %s",
|
|
|
a72e7a |
plgns[i]->trans->name));
|
|
|
a72e7a |
free(plgns[i]);
|
|
|
a72e7a |
}
|
|
|
a72e7a |
@@ -207,7 +207,7 @@ static int load_plugins(struct conf_list *methods,
|
|
|
a72e7a |
goto out;
|
|
|
a72e7a |
if (load_translation_plugin(m->field, plgns[i]) == -1) {
|
|
|
a72e7a |
IDMAP_LOG(0, ("libnfsidmap: requested translation "
|
|
|
a72e7a |
- "method, '%s', is not available\n",
|
|
|
a72e7a |
+ "method, '%s', is not available",
|
|
|
a72e7a |
m->field));
|
|
|
a72e7a |
goto out;
|
|
|
a72e7a |
}
|
|
|
a72e7a |
@@ -251,7 +251,7 @@ int nfs4_init_name_mapping(char *conffile)
|
|
|
a72e7a |
IDMAP_LOG(1, ("libnfsidmap: Unable to determine "
|
|
|
a72e7a |
"the NFSv4 domain; Using '%s' as the NFSv4 domain "
|
|
|
a72e7a |
"which means UIDs will be mapped to the 'Nobody-User' "
|
|
|
a72e7a |
- "user defined in %s\n",
|
|
|
a72e7a |
+ "user defined in %s",
|
|
|
a72e7a |
IDMAPD_DEFAULT_DOMAIN, PATH_IDMAPDCONF));
|
|
|
a72e7a |
default_domain = IDMAPD_DEFAULT_DOMAIN;
|
|
|
a72e7a |
}
|
|
|
a72e7a |
@@ -344,11 +344,11 @@ int nfs4_init_name_mapping(char *conffile)
|
|
|
a72e7a |
if (err == 0 && pw != NULL)
|
|
|
a72e7a |
nobody_uid = pw->pw_uid;
|
|
|
a72e7a |
else
|
|
|
a72e7a |
- IDMAP_LOG(1, ("libnfsidmap: Nobody-User (%s) not found: %s\n",
|
|
|
a72e7a |
+ IDMAP_LOG(1, ("libnfsidmap: Nobody-User (%s) not found: %s",
|
|
|
a72e7a |
nobody_user, strerror(errno)));
|
|
|
a72e7a |
free(buf);
|
|
|
a72e7a |
} else
|
|
|
a72e7a |
- IDMAP_LOG(0,("libnfsidmap: Nobody-User: no memory : %s\n",
|
|
|
a72e7a |
+ IDMAP_LOG(0,("libnfsidmap: Nobody-User: no memory : %s",
|
|
|
a72e7a |
nobody_user, strerror(errno)));
|
|
|
a72e7a |
}
|
|
|
a72e7a |
|
|
|
a72e7a |
@@ -365,11 +365,11 @@ int nfs4_init_name_mapping(char *conffile)
|
|
|
a72e7a |
if (err == 0 && gr != NULL)
|
|
|
a72e7a |
nobody_gid = gr->gr_gid;
|
|
|
a72e7a |
else
|
|
|
a72e7a |
- IDMAP_LOG(1, ("libnfsidmap: Nobody-Group (%s) not found: %s\n",
|
|
|
a72e7a |
+ IDMAP_LOG(1, ("libnfsidmap: Nobody-Group (%s) not found: %s",
|
|
|
a72e7a |
nobody_group, strerror(errno)));
|
|
|
a72e7a |
free(buf);
|
|
|
a72e7a |
} else
|
|
|
a72e7a |
- IDMAP_LOG(0,("libnfsidmap: Nobody-Group: no memory : %s\n",
|
|
|
a72e7a |
+ IDMAP_LOG(0,("libnfsidmap: Nobody-Group: no memory : %s",
|
|
|
a72e7a |
nobody_group, strerror(errno)));
|
|
|
a72e7a |
}
|
|
|
a72e7a |
|
|
|
a72e7a |
@@ -395,7 +395,7 @@ char * get_default_domain(void)
|
|
|
a72e7a |
ret = domain_from_dns(&default_domain);
|
|
|
a72e7a |
if (ret) {
|
|
|
a72e7a |
IDMAP_LOG(0, ("Unable to determine a default nfsv4 domain; "
|
|
|
a72e7a |
- " consider specifying one in idmapd.conf\n"));
|
|
|
a72e7a |
+ " consider specifying one in idmapd.conf"));
|
|
|
a72e7a |
default_domain = "";
|
|
|
a72e7a |
}
|
|
|
a72e7a |
return default_domain;
|
|
|
a72e7a |
@@ -444,12 +444,12 @@ nfs4_get_default_domain(char *server, char *domain, size_t len)
|
|
|
a72e7a |
if (plgns[i]->trans->funcname == NULL) \
|
|
|
a72e7a |
continue; \
|
|
|
a72e7a |
\
|
|
|
a72e7a |
- IDMAP_LOG(4, ("%s: calling %s->%s\n", __func__, \
|
|
|
a72e7a |
+ IDMAP_LOG(4, ("%s: calling %s->%s", __func__, \
|
|
|
a72e7a |
plgns[i]->trans->name, #funcname)); \
|
|
|
a72e7a |
\
|
|
|
a72e7a |
ret = plgns[i]->trans->funcname(args); \
|
|
|
a72e7a |
\
|
|
|
a72e7a |
- IDMAP_LOG(4, ("%s: %s->%s returned %d\n", \
|
|
|
a72e7a |
+ IDMAP_LOG(4, ("%s: %s->%s returned %d", \
|
|
|
a72e7a |
__func__, plgns[i]->trans->name, \
|
|
|
a72e7a |
#funcname, ret)); \
|
|
|
a72e7a |
\
|
|
|
a72e7a |
@@ -458,7 +458,7 @@ nfs4_get_default_domain(char *server, char *domain, size_t len)
|
|
|
a72e7a |
\
|
|
|
a72e7a |
break; \
|
|
|
a72e7a |
} \
|
|
|
a72e7a |
- IDMAP_LOG(4, ("%s: final return value is %d\n", \
|
|
|
a72e7a |
+ IDMAP_LOG(4, ("%s: final return value is %d", \
|
|
|
a72e7a |
__func__, ret)); \
|
|
|
a72e7a |
return ret; \
|
|
|
a72e7a |
} while (0)
|
|
|
a72e7a |
diff --git a/nss.c b/nss.c
|
|
|
a72e7a |
index b3fef5a..ffe3333 100644
|
|
|
a72e7a |
--- a/nss.c
|
|
|
a72e7a |
+++ b/nss.c
|
|
|
a72e7a |
@@ -178,10 +178,10 @@ static struct passwd *nss_getpwnam(const char *name, const char *domain, int *er
|
|
|
a72e7a |
err = EINVAL;
|
|
|
a72e7a |
localname = strip_domain(name, domain);
|
|
|
a72e7a |
IDMAP_LOG(4, ("nss_getpwnam: name '%s' domain '%s': "
|
|
|
a72e7a |
- "resulting localname '%s'\n", name, domain, localname));
|
|
|
a72e7a |
+ "resulting localname '%s'", name, domain, localname));
|
|
|
a72e7a |
if (localname == NULL) {
|
|
|
a72e7a |
IDMAP_LOG(0, ("nss_getpwnam: name '%s' does not map "
|
|
|
a72e7a |
- "into domain '%s'\n", name,
|
|
|
a72e7a |
+ "into domain '%s'", name,
|
|
|
a72e7a |
domain ? domain : "<not-provided>"));
|
|
|
a72e7a |
goto err_free_buf;
|
|
|
a72e7a |
}
|
|
|
a72e7a |
@@ -189,7 +189,7 @@ static struct passwd *nss_getpwnam(const char *name, const char *domain, int *er
|
|
|
a72e7a |
err = getpwnam_r(localname, &buf->pwbuf, buf->buf, buflen, &pw;;
|
|
|
a72e7a |
if (pw == NULL && domain != NULL)
|
|
|
a72e7a |
IDMAP_LOG(0,
|
|
|
a72e7a |
- ("nss_getpwnam: name '%s' not found in domain '%s'\n",
|
|
|
a72e7a |
+ ("nss_getpwnam: name '%s' not found in domain '%s'",
|
|
|
a72e7a |
localname, domain));
|
|
|
a72e7a |
free(localname);
|
|
|
a72e7a |
if (err == 0 && pw != NULL) {
|
|
|
a72e7a |
diff --git a/static.c b/static.c
|
|
|
a72e7a |
index ec04057..9f587af 100644
|
|
|
a72e7a |
--- a/static.c
|
|
|
a72e7a |
+++ b/static.c
|
|
|
a72e7a |
@@ -124,13 +124,13 @@ again:
|
|
|
a72e7a |
if (err == 0)
|
|
|
a72e7a |
err = ENOENT;
|
|
|
a72e7a |
|
|
|
a72e7a |
- IDMAP_LOG(0, ("static_getpwnam: localname '%s' for '%s' not found\n",
|
|
|
a72e7a |
+ IDMAP_LOG(0, ("static_getpwnam: localname '%s' for '%s' not found",
|
|
|
a72e7a |
localname, name));
|
|
|
a72e7a |
|
|
|
a72e7a |
goto err_free_buf;
|
|
|
a72e7a |
}
|
|
|
a72e7a |
|
|
|
a72e7a |
- IDMAP_LOG(4, ("static_getpwnam: name '%s' mapped to '%s'\n",
|
|
|
a72e7a |
+ IDMAP_LOG(4, ("static_getpwnam: name '%s' mapped to '%s'",
|
|
|
a72e7a |
name, localname));
|
|
|
a72e7a |
|
|
|
a72e7a |
*err_p = 0;
|
|
|
a72e7a |
@@ -174,13 +174,13 @@ again:
|
|
|
a72e7a |
if (err == 0)
|
|
|
a72e7a |
err = ENOENT;
|
|
|
a72e7a |
|
|
|
a72e7a |
- IDMAP_LOG(0, ("static_getgrnam: local group '%s' for '%s' not found\n",
|
|
|
a72e7a |
+ IDMAP_LOG(0, ("static_getgrnam: local group '%s' for '%s' not found",
|
|
|
a72e7a |
localgroup, name));
|
|
|
a72e7a |
|
|
|
a72e7a |
goto err_free_buf;
|
|
|
a72e7a |
}
|
|
|
a72e7a |
|
|
|
a72e7a |
- IDMAP_LOG(4, ("static_getgrnam: group '%s' mapped to '%s'\n",
|
|
|
a72e7a |
+ IDMAP_LOG(4, ("static_getgrnam: group '%s' mapped to '%s'",
|
|
|
a72e7a |
name, localgroup));
|
|
|
a72e7a |
|
|
|
a72e7a |
*err_p = 0;
|
|
|
a72e7a |
diff --git a/umich_ldap.c b/umich_ldap.c
|
|
|
a72e7a |
index b527c5d..886fa0c 100644
|
|
|
a72e7a |
--- a/umich_ldap.c
|
|
|
a72e7a |
+++ b/umich_ldap.c
|
|
|
a72e7a |
@@ -160,7 +160,7 @@ ldap_init_and_bind(LDAP **pld,
|
|
|
a72e7a |
*/
|
|
|
a72e7a |
if ((lerr = ldap_initialize(&ld, server_url)) != LDAP_SUCCESS) {
|
|
|
a72e7a |
IDMAP_LOG(0, ("ldap_init_and_bind: ldap_initialize() failed "
|
|
|
a72e7a |
- "to [%s]: %s (%d)\n", server_url,
|
|
|
a72e7a |
+ "to [%s]: %s (%d)", server_url,
|
|
|
a72e7a |
ldap_err2string(lerr), lerr));
|
|
|
a72e7a |
goto out;
|
|
|
a72e7a |
}
|
|
|
a72e7a |
@@ -168,7 +168,7 @@ ldap_init_and_bind(LDAP **pld,
|
|
|
a72e7a |
if ((ldap_set_option(ld, LDAP_OPT_DEBUG_LEVEL, &debug_level)
|
|
|
a72e7a |
!= LDAP_SUCCESS)) {
|
|
|
a72e7a |
IDMAP_LOG(0, ("ldap_init_and_bind: error setting ldap "
|
|
|
a72e7a |
- "library debugging level\n"));
|
|
|
a72e7a |
+ "library debugging level"));
|
|
|
a72e7a |
goto out;
|
|
|
a72e7a |
}
|
|
|
a72e7a |
|
|
|
a72e7a |
@@ -179,7 +179,7 @@ ldap_init_and_bind(LDAP **pld,
|
|
|
a72e7a |
ldap_get_option(ld, LDAP_OPT_API_INFO, &apiinfo);
|
|
|
a72e7a |
if (apiinfo.ldapai_info_version != LDAP_API_INFO_VERSION) {
|
|
|
a72e7a |
IDMAP_LOG(0, ("ldap_init_and_bind: APIInfo version mismatch: "
|
|
|
a72e7a |
- "library %d, header %d\n",
|
|
|
a72e7a |
+ "library %d, header %d",
|
|
|
a72e7a |
apiinfo.ldapai_info_version, LDAP_API_INFO_VERSION));
|
|
|
a72e7a |
goto out;
|
|
|
a72e7a |
}
|
|
|
a72e7a |
@@ -189,7 +189,7 @@ ldap_init_and_bind(LDAP **pld,
|
|
|
a72e7a |
new_version = LDAP_VERSION3;
|
|
|
a72e7a |
IDMAP_LOG(4, ("ldap_init_and_bind: version mismatch between "
|
|
|
a72e7a |
"API information and protocol version. Setting "
|
|
|
a72e7a |
- "protocol version to %d\n", new_version));
|
|
|
a72e7a |
+ "protocol version to %d", new_version));
|
|
|
a72e7a |
ldap_set_option(ld, LDAP_OPT_PROTOCOL_VERSION, &new_version);
|
|
|
a72e7a |
}
|
|
|
a72e7a |
|
|
|
a72e7a |
@@ -212,7 +212,7 @@ ldap_init_and_bind(LDAP **pld,
|
|
|
a72e7a |
lerr = ldap_set_option(ld, LDAP_OPT_X_TLS, &tls_type);
|
|
|
a72e7a |
if (lerr != LDAP_SUCCESS) {
|
|
|
a72e7a |
IDMAP_LOG(2, ("ldap_init_and_bind: setting SSL "
|
|
|
a72e7a |
- "failed : %s (%d)\n",
|
|
|
a72e7a |
+ "failed : %s (%d)",
|
|
|
a72e7a |
ldap_err2string(lerr), lerr));
|
|
|
a72e7a |
goto out;
|
|
|
a72e7a |
}
|
|
|
a72e7a |
@@ -220,7 +220,7 @@ ldap_init_and_bind(LDAP **pld,
|
|
|
a72e7a |
linfo->ca_cert);
|
|
|
a72e7a |
if (lerr != LDAP_SUCCESS) {
|
|
|
a72e7a |
IDMAP_LOG(2, ("ldap_init_and_bind: setting CA "
|
|
|
a72e7a |
- "certificate file failed : %s (%d)\n",
|
|
|
a72e7a |
+ "certificate file failed : %s (%d)",
|
|
|
a72e7a |
ldap_err2string(lerr), lerr));
|
|
|
a72e7a |
goto out;
|
|
|
a72e7a |
}
|
|
|
a72e7a |
@@ -242,24 +242,24 @@ retry_bind:
|
|
|
a72e7a |
IDMAP_LOG(2, ("ldap_init_and_bind: "
|
|
|
a72e7a |
"got protocol error while attempting "
|
|
|
a72e7a |
"bind with protocol version %d, "
|
|
|
a72e7a |
- "trying protocol version %d\n",
|
|
|
a72e7a |
+ "trying protocol version %d",
|
|
|
a72e7a |
current_version, new_version));
|
|
|
a72e7a |
if ((ldap_get_option(ld, LDAP_OPT_ERROR_STRING, &errmsg) == LDAP_SUCCESS)
|
|
|
a72e7a |
&& (errmsg != NULL) && (*errmsg != '\0')) {
|
|
|
a72e7a |
IDMAP_LOG(2, ("ldap_init_and_bind: "
|
|
|
a72e7a |
- "Additional info: %s\n", errmsg));
|
|
|
a72e7a |
+ "Additional info: %s", errmsg));
|
|
|
a72e7a |
ldap_memfree(errmsg);
|
|
|
a72e7a |
}
|
|
|
a72e7a |
goto retry_bind;
|
|
|
a72e7a |
}
|
|
|
a72e7a |
IDMAP_LOG(2, ("ldap_init_and_bind: ldap_simple_bind_s "
|
|
|
a72e7a |
- "to [%s] as user '%s': %s (%d)\n",
|
|
|
a72e7a |
+ "to [%s] as user '%s': %s (%d)",
|
|
|
a72e7a |
server_url, linfo->user_dn,
|
|
|
a72e7a |
ldap_err2string(lerr), lerr));
|
|
|
a72e7a |
if ((ldap_get_option(ld, LDAP_OPT_ERROR_STRING, &errmsg) == LDAP_SUCCESS)
|
|
|
a72e7a |
&& (errmsg != NULL)&& (*errmsg != '\0')) {
|
|
|
a72e7a |
IDMAP_LOG(2, ("ldap_init_and_bind: "
|
|
|
a72e7a |
- "Additional info: %s\n", errmsg));
|
|
|
a72e7a |
+ "Additional info: %s", errmsg));
|
|
|
a72e7a |
ldap_memfree(errmsg);
|
|
|
a72e7a |
}
|
|
|
a72e7a |
goto out;
|
|
|
a72e7a |
@@ -272,12 +272,12 @@ retry_bind:
|
|
|
a72e7a |
char *errmsg;
|
|
|
a72e7a |
|
|
|
a72e7a |
IDMAP_LOG(2, ("ldap_init_and_bind: ldap_simple_bind_s "
|
|
|
a72e7a |
- "to [%s] as anonymous: %s (%d)\n", server_url,
|
|
|
a72e7a |
+ "to [%s] as anonymous: %s (%d)", server_url,
|
|
|
a72e7a |
ldap_err2string(lerr), lerr));
|
|
|
a72e7a |
if ((ldap_get_option(ld, LDAP_OPT_ERROR_STRING, &errmsg) == LDAP_SUCCESS)
|
|
|
a72e7a |
&& (errmsg != NULL) && (*errmsg != '\0')) {
|
|
|
a72e7a |
IDMAP_LOG(2, ("ldap_init_and_bind: "
|
|
|
a72e7a |
- "Additional info: %s\n", errmsg));
|
|
|
a72e7a |
+ "Additional info: %s", errmsg));
|
|
|
a72e7a |
ldap_memfree(errmsg);
|
|
|
a72e7a |
}
|
|
|
a72e7a |
goto out;
|
|
|
a72e7a |
@@ -323,7 +323,7 @@ umich_name_to_ids(char *name, int idtype, uid_t *uid, gid_t *gid,
|
|
|
a72e7a |
attrtype, name))
|
|
|
a72e7a |
== LDAP_FILT_MAXSIZ) {
|
|
|
a72e7a |
IDMAP_LOG(0, ("ERROR: umich_name_to_ids: filter "
|
|
|
a72e7a |
- "too long!\n"));
|
|
|
a72e7a |
+ "too long!"));
|
|
|
a72e7a |
goto out;
|
|
|
a72e7a |
}
|
|
|
a72e7a |
base = linfo->people_tree;
|
|
|
a72e7a |
@@ -335,13 +335,13 @@ umich_name_to_ids(char *name, int idtype, uid_t *uid, gid_t *gid,
|
|
|
a72e7a |
attrtype, name))
|
|
|
a72e7a |
== LDAP_FILT_MAXSIZ) {
|
|
|
a72e7a |
IDMAP_LOG(0, ("ERROR: umich_name_to_ids: filter "
|
|
|
a72e7a |
- "too long!\n"));
|
|
|
a72e7a |
+ "too long!"));
|
|
|
a72e7a |
goto out;
|
|
|
a72e7a |
}
|
|
|
a72e7a |
base = linfo->group_tree;
|
|
|
a72e7a |
}
|
|
|
a72e7a |
else {
|
|
|
a72e7a |
- IDMAP_LOG(0, ("ERROR: umich_name_to_ids: invalid idtype (%d)\n",
|
|
|
a72e7a |
+ IDMAP_LOG(0, ("ERROR: umich_name_to_ids: invalid idtype (%d)",
|
|
|
a72e7a |
idtype));
|
|
|
a72e7a |
goto out;
|
|
|
a72e7a |
}
|
|
|
a72e7a |
@@ -360,12 +360,12 @@ umich_name_to_ids(char *name, int idtype, uid_t *uid, gid_t *gid,
|
|
|
a72e7a |
char *errmsg;
|
|
|
a72e7a |
|
|
|
a72e7a |
IDMAP_LOG(2, ("umich_name_to_ids: ldap_search_st for "
|
|
|
a72e7a |
- "base '%s', filter '%s': %s (%d)\n",
|
|
|
a72e7a |
+ "base '%s', filter '%s': %s (%d)",
|
|
|
a72e7a |
base, filter, ldap_err2string(err), err));
|
|
|
a72e7a |
if ((ldap_get_option(ld, LDAP_OPT_ERROR_STRING, &errmsg) == LDAP_SUCCESS)
|
|
|
a72e7a |
&& (errmsg != NULL) && (*errmsg != '\0')) {
|
|
|
a72e7a |
IDMAP_LOG(2, ("umich_name_to_ids: "
|
|
|
a72e7a |
- "Additional info: %s\n", errmsg));
|
|
|
a72e7a |
+ "Additional info: %s", errmsg));
|
|
|
a72e7a |
ldap_memfree(errmsg);
|
|
|
a72e7a |
}
|
|
|
a72e7a |
err = -ENOENT;
|
|
|
a72e7a |
@@ -381,7 +381,7 @@ umich_name_to_ids(char *name, int idtype, uid_t *uid, gid_t *gid,
|
|
|
a72e7a |
if (!(entry = ldap_first_entry(ld, result))) {
|
|
|
a72e7a |
lerr = ldap_result2error(ld, result, 0);
|
|
|
a72e7a |
IDMAP_LOG(2, ("umich_name_to_ids: ldap_first_entry: "
|
|
|
a72e7a |
- "%s (%d)\n", ldap_err2string(lerr), lerr));
|
|
|
a72e7a |
+ "%s (%d)", ldap_err2string(lerr), lerr));
|
|
|
a72e7a |
goto out_unbind;
|
|
|
a72e7a |
}
|
|
|
a72e7a |
|
|
|
a72e7a |
@@ -402,7 +402,7 @@ umich_name_to_ids(char *name, int idtype, uid_t *uid, gid_t *gid,
|
|
|
a72e7a |
if ((idstr = ldap_get_values(ld, result, attr_res)) == NULL) {
|
|
|
a72e7a |
lerr = ldap_result2error(ld, result, 0);
|
|
|
a72e7a |
IDMAP_LOG(2, ("umich_name_to_ids: ldap_get_values: "
|
|
|
a72e7a |
- "%s (%d)\n", ldap_err2string(lerr), lerr));
|
|
|
a72e7a |
+ "%s (%d)", ldap_err2string(lerr), lerr));
|
|
|
a72e7a |
goto out_memfree;
|
|
|
a72e7a |
}
|
|
|
a72e7a |
if (strcasecmp(attr_res, ldap_map.NFSv4_uid_attr) == 0) {
|
|
|
a72e7a |
@@ -411,7 +411,7 @@ umich_name_to_ids(char *name, int idtype, uid_t *uid, gid_t *gid,
|
|
|
a72e7a |
if (tmp_uid != tmp_u ||
|
|
|
a72e7a |
(errno == ERANGE && tmp_u == ULONG_MAX)) {
|
|
|
a72e7a |
IDMAP_LOG(0, ("ERROR: umich_name_to_ids: "
|
|
|
a72e7a |
- "uidNumber too long converting '%s'\n",
|
|
|
a72e7a |
+ "uidNumber too long converting '%s'",
|
|
|
a72e7a |
*idstr));
|
|
|
a72e7a |
ldap_memfree(attr_res);
|
|
|
a72e7a |
ldap_value_free(idstr);
|
|
|
a72e7a |
@@ -424,7 +424,7 @@ umich_name_to_ids(char *name, int idtype, uid_t *uid, gid_t *gid,
|
|
|
a72e7a |
if (tmp_gid != tmp_g ||
|
|
|
a72e7a |
(errno == ERANGE && tmp_g == ULONG_MAX)) {
|
|
|
a72e7a |
IDMAP_LOG(0, ("ERROR: umich_name_to_ids: "
|
|
|
a72e7a |
- "gidNumber too long converting '%s'\n",
|
|
|
a72e7a |
+ "gidNumber too long converting '%s'",
|
|
|
a72e7a |
*idstr));
|
|
|
a72e7a |
ldap_memfree(attr_res);
|
|
|
a72e7a |
ldap_value_free(idstr);
|
|
|
a72e7a |
@@ -433,7 +433,7 @@ umich_name_to_ids(char *name, int idtype, uid_t *uid, gid_t *gid,
|
|
|
a72e7a |
*gid = tmp_gid;
|
|
|
a72e7a |
} else {
|
|
|
a72e7a |
IDMAP_LOG(0, ("umich_name_to_ids: received attr "
|
|
|
a72e7a |
- "'%s' ???\n", attr_res));
|
|
|
a72e7a |
+ "'%s' ???", attr_res));
|
|
|
a72e7a |
ldap_memfree(attr_res);
|
|
|
a72e7a |
ldap_value_free(idstr);
|
|
|
a72e7a |
goto out_memfree;
|
|
|
a72e7a |
@@ -485,7 +485,7 @@ umich_id_to_name(uid_t id, int idtype, char **name, size_t len,
|
|
|
a72e7a |
ldap_map.NFSv4_uid_attr, idstr))
|
|
|
a72e7a |
== LDAP_FILT_MAXSIZ) {
|
|
|
a72e7a |
IDMAP_LOG(0, ("ERROR: umich_id_to_name: "
|
|
|
a72e7a |
- "uid filter too long!\n"));
|
|
|
a72e7a |
+ "uid filter too long!"));
|
|
|
a72e7a |
goto out;
|
|
|
a72e7a |
}
|
|
|
a72e7a |
base = linfo->people_tree;
|
|
|
a72e7a |
@@ -496,12 +496,12 @@ umich_id_to_name(uid_t id, int idtype, char **name, size_t len,
|
|
|
a72e7a |
ldap_map.NFSv4_gid_attr,idstr))
|
|
|
a72e7a |
== LDAP_FILT_MAXSIZ) {
|
|
|
a72e7a |
IDMAP_LOG(0, ("ERROR: umich_id_to_name: "
|
|
|
a72e7a |
- "gid filter too long!\n"));
|
|
|
a72e7a |
+ "gid filter too long!"));
|
|
|
a72e7a |
goto out;
|
|
|
a72e7a |
}
|
|
|
a72e7a |
base = linfo->group_tree;
|
|
|
a72e7a |
} else {
|
|
|
a72e7a |
- IDMAP_LOG(0, ("ERROR: umich_id_to_name: invalid idtype (%d)\n",
|
|
|
a72e7a |
+ IDMAP_LOG(0, ("ERROR: umich_id_to_name: invalid idtype (%d)",
|
|
|
a72e7a |
idtype));
|
|
|
a72e7a |
err = -EINVAL;
|
|
|
a72e7a |
goto out;
|
|
|
a72e7a |
@@ -523,12 +523,12 @@ umich_id_to_name(uid_t id, int idtype, char **name, size_t len,
|
|
|
a72e7a |
char * errmsg;
|
|
|
a72e7a |
|
|
|
a72e7a |
IDMAP_LOG(2, ("umich_id_to_name: ldap_search_st for "
|
|
|
a72e7a |
- "base '%s, filter '%s': %s (%d)\n", base, filter,
|
|
|
a72e7a |
+ "base '%s, filter '%s': %s (%d)", base, filter,
|
|
|
a72e7a |
ldap_err2string(err), err));
|
|
|
a72e7a |
if ((ldap_get_option(ld, LDAP_OPT_ERROR_STRING, &errmsg) == LDAP_SUCCESS)
|
|
|
a72e7a |
&& (errmsg != NULL) && (*errmsg != '\0')) {
|
|
|
a72e7a |
IDMAP_LOG(2, ("umich_id_to_name: "
|
|
|
a72e7a |
- "Additional info: %s\n", errmsg));
|
|
|
a72e7a |
+ "Additional info: %s", errmsg));
|
|
|
a72e7a |
ldap_memfree(errmsg);
|
|
|
a72e7a |
}
|
|
|
a72e7a |
|
|
|
a72e7a |
@@ -544,21 +544,21 @@ umich_id_to_name(uid_t id, int idtype, char **name, size_t len,
|
|
|
a72e7a |
if (!(entry = ldap_first_entry(ld, result))) {
|
|
|
a72e7a |
lerr = ldap_result2error(ld, result, 0);
|
|
|
a72e7a |
IDMAP_LOG(2, ("umich_id_to_name: ldap_first_entry: "
|
|
|
a72e7a |
- "%s (%d)\n", ldap_err2string(lerr), lerr));
|
|
|
a72e7a |
+ "%s (%d)", ldap_err2string(lerr), lerr));
|
|
|
a72e7a |
goto out_unbind;
|
|
|
a72e7a |
}
|
|
|
a72e7a |
|
|
|
a72e7a |
if (!(attr_res = ldap_first_attribute(ld, result, &ber))) {
|
|
|
a72e7a |
lerr = ldap_result2error(ld, result, 0);
|
|
|
a72e7a |
IDMAP_LOG(2, ("umich_id_to_name: ldap_first_attribute: "
|
|
|
a72e7a |
- "%s (%d)\n", ldap_err2string(lerr), lerr));
|
|
|
a72e7a |
+ "%s (%d)", ldap_err2string(lerr), lerr));
|
|
|
a72e7a |
goto out_unbind;
|
|
|
a72e7a |
}
|
|
|
a72e7a |
|
|
|
a72e7a |
if ((names = ldap_get_values(ld, result, attr_res)) == NULL) {
|
|
|
a72e7a |
lerr = ldap_result2error(ld, result, 0);
|
|
|
a72e7a |
IDMAP_LOG(2, ("umich_id_to_name: ldap_get_values: "
|
|
|
a72e7a |
- "%s (%d)\n", ldap_err2string(lerr), lerr));
|
|
|
a72e7a |
+ "%s (%d)", ldap_err2string(lerr), lerr));
|
|
|
a72e7a |
goto out_memfree;
|
|
|
a72e7a |
}
|
|
|
a72e7a |
|
|
|
a72e7a |
@@ -571,7 +571,7 @@ umich_id_to_name(uid_t id, int idtype, char **name, size_t len,
|
|
|
a72e7a |
if (strlen(names[0]) >= len) {
|
|
|
a72e7a |
/* not enough space to return the name */
|
|
|
a72e7a |
IDMAP_LOG(1, ("umich_id_to_name: output buffer size (%d) "
|
|
|
a72e7a |
- "too small to return string, '%s', of length %d\n",
|
|
|
a72e7a |
+ "too small to return string, '%s', of length %d",
|
|
|
a72e7a |
len, names[0], strlen(names[0])));
|
|
|
a72e7a |
goto out_memfree;
|
|
|
a72e7a |
}
|
|
|
a72e7a |
@@ -625,7 +625,7 @@ umich_gss_princ_to_grouplist(char *principal, gid_t *groups, int *ngroups,
|
|
|
a72e7a |
ldap_map.GSS_principal_attr, principal))
|
|
|
a72e7a |
== LDAP_FILT_MAXSIZ) {
|
|
|
a72e7a |
IDMAP_LOG(0, ("ERROR: umich_gss_princ_to_grouplist: "
|
|
|
a72e7a |
- "filter too long!\n"));
|
|
|
a72e7a |
+ "filter too long!"));
|
|
|
a72e7a |
goto out;
|
|
|
a72e7a |
}
|
|
|
a72e7a |
|
|
|
a72e7a |
@@ -638,13 +638,13 @@ umich_gss_princ_to_grouplist(char *principal, gid_t *groups, int *ngroups,
|
|
|
a72e7a |
char *errmsg;
|
|
|
a72e7a |
|
|
|
a72e7a |
IDMAP_LOG(2, ("umich_gss_princ_to_grouplist: ldap_search_st "
|
|
|
a72e7a |
- "for tree '%s, filter '%s': %s (%d)\n",
|
|
|
a72e7a |
+ "for tree '%s, filter '%s': %s (%d)",
|
|
|
a72e7a |
linfo->people_tree, filter,
|
|
|
a72e7a |
ldap_err2string(err), err));
|
|
|
a72e7a |
if ((ldap_get_option(ld, LDAP_OPT_ERROR_STRING, &errmsg) == LDAP_SUCCESS)
|
|
|
a72e7a |
&& (errmsg != NULL) && (*errmsg != '\0')) {
|
|
|
a72e7a |
IDMAP_LOG(2, ("umich_gss_princ_to_grouplist: "
|
|
|
a72e7a |
- "Additional info: %s\n", errmsg));
|
|
|
a72e7a |
+ "Additional info: %s", errmsg));
|
|
|
a72e7a |
ldap_memfree(errmsg);
|
|
|
a72e7a |
}
|
|
|
a72e7a |
err = -ENOENT;
|
|
|
a72e7a |
@@ -655,7 +655,7 @@ umich_gss_princ_to_grouplist(char *principal, gid_t *groups, int *ngroups,
|
|
|
a72e7a |
count = ldap_count_entries(ld, result);
|
|
|
a72e7a |
if (count != 1) {
|
|
|
a72e7a |
IDMAP_LOG(2, ("umich_gss_princ_to_grouplist: "
|
|
|
a72e7a |
- "ldap account lookup of gssauthname %s returned %d accounts\n",
|
|
|
a72e7a |
+ "ldap account lookup of gssauthname %s returned %d accounts",
|
|
|
a72e7a |
principal,count));
|
|
|
a72e7a |
goto out_unbind;
|
|
|
a72e7a |
}
|
|
|
a72e7a |
@@ -663,14 +663,14 @@ umich_gss_princ_to_grouplist(char *principal, gid_t *groups, int *ngroups,
|
|
|
a72e7a |
if (!(entry = ldap_first_entry(ld, result))) {
|
|
|
a72e7a |
lerr = ldap_result2error(ld, result, 0);
|
|
|
a72e7a |
IDMAP_LOG(2, ("umich_gss_princ_to_grouplist: ldap_first_entry: "
|
|
|
a72e7a |
- "%s (%d)\n", ldap_err2string(lerr), lerr));
|
|
|
a72e7a |
+ "%s (%d)", ldap_err2string(lerr), lerr));
|
|
|
a72e7a |
goto out_unbind;
|
|
|
a72e7a |
}
|
|
|
a72e7a |
|
|
|
a72e7a |
if ((names = ldap_get_values(ld, result, attrs[0])) == NULL) {
|
|
|
a72e7a |
lerr = ldap_result2error(ld, result, 0);
|
|
|
a72e7a |
IDMAP_LOG(2, ("umich_gss_princ_to_grouplist: ldap_get_values: "
|
|
|
a72e7a |
- "%s (%d)\n", ldap_err2string(lerr), lerr));
|
|
|
a72e7a |
+ "%s (%d)", ldap_err2string(lerr), lerr));
|
|
|
a72e7a |
goto out_unbind;
|
|
|
a72e7a |
}
|
|
|
a72e7a |
|
|
|
a72e7a |
@@ -685,7 +685,7 @@ umich_gss_princ_to_grouplist(char *principal, gid_t *groups, int *ngroups,
|
|
|
a72e7a |
ldap_map.NFSv4_acctname_attr,
|
|
|
a72e7a |
names[0])) == LDAP_FILT_MAXSIZ ) {
|
|
|
a72e7a |
IDMAP_LOG(2, ("ERROR: umich_gss_princ_to_grouplist: "
|
|
|
a72e7a |
- "filter too long!\n"));
|
|
|
a72e7a |
+ "filter too long!"));
|
|
|
a72e7a |
ldap_value_free(names);
|
|
|
a72e7a |
goto out_unbind;
|
|
|
a72e7a |
}
|
|
|
a72e7a |
@@ -702,13 +702,13 @@ umich_gss_princ_to_grouplist(char *principal, gid_t *groups, int *ngroups,
|
|
|
a72e7a |
char *errmsg;
|
|
|
a72e7a |
|
|
|
a72e7a |
IDMAP_LOG(2, ("umich_gss_princ_to_grouplist: ldap_search_st "
|
|
|
a72e7a |
- "for tree '%s, filter '%s': %s (%d)\n",
|
|
|
a72e7a |
+ "for tree '%s, filter '%s': %s (%d)",
|
|
|
a72e7a |
linfo->people_tree, filter,
|
|
|
a72e7a |
ldap_err2string(err), err));
|
|
|
a72e7a |
if ((ldap_get_option(ld, LDAP_OPT_ERROR_STRING, &errmsg) == LDAP_SUCCESS)
|
|
|
a72e7a |
&& (errmsg != NULL) && (*errmsg != '\0')) {
|
|
|
a72e7a |
IDMAP_LOG(2, ("umich_gss_princ_to_grouplist: "
|
|
|
a72e7a |
- "Additional info: %s\n", errmsg));
|
|
|
a72e7a |
+ "Additional info: %s", errmsg));
|
|
|
a72e7a |
ldap_memfree(errmsg);
|
|
|
a72e7a |
}
|
|
|
a72e7a |
err = -ENOENT;
|
|
|
a72e7a |
@@ -720,7 +720,7 @@ umich_gss_princ_to_grouplist(char *principal, gid_t *groups, int *ngroups,
|
|
|
a72e7a |
count = ldap_count_entries(ld, result);
|
|
|
a72e7a |
if (count != 1) {
|
|
|
a72e7a |
IDMAP_LOG(2, ("umich_gss_princ_to_grouplist: "
|
|
|
a72e7a |
- "ldap group member lookup of gssauthname %s returned %d multiple entries\n",
|
|
|
a72e7a |
+ "ldap group member lookup of gssauthname %s returned %d multiple entries",
|
|
|
a72e7a |
principal,count));
|
|
|
a72e7a |
goto out_unbind;
|
|
|
a72e7a |
}
|
|
|
a72e7a |
@@ -728,14 +728,14 @@ umich_gss_princ_to_grouplist(char *principal, gid_t *groups, int *ngroups,
|
|
|
a72e7a |
if (!(entry = ldap_first_entry(ld, result))) {
|
|
|
a72e7a |
lerr = ldap_result2error(ld, result, 0);
|
|
|
a72e7a |
IDMAP_LOG(2, ("umich_gss_princ_to_grouplist: ldap_first_entry: "
|
|
|
a72e7a |
- "%s (%d)\n", ldap_err2string(lerr), lerr));
|
|
|
a72e7a |
+ "%s (%d)", ldap_err2string(lerr), lerr));
|
|
|
a72e7a |
goto out_unbind;
|
|
|
a72e7a |
}
|
|
|
a72e7a |
|
|
|
a72e7a |
if ((names = ldap_get_values(ld, result, attrs[0])) == NULL) {
|
|
|
a72e7a |
lerr = ldap_result2error(ld, result, 0);
|
|
|
a72e7a |
IDMAP_LOG(2, ("umich_gss_princ_to_grouplist: ldap_get_values: "
|
|
|
a72e7a |
- "%s (%d)\n", ldap_err2string(lerr), lerr));
|
|
|
a72e7a |
+ "%s (%d)", ldap_err2string(lerr), lerr));
|
|
|
a72e7a |
goto out_unbind;
|
|
|
a72e7a |
}
|
|
|
a72e7a |
|
|
|
a72e7a |
@@ -747,7 +747,7 @@ umich_gss_princ_to_grouplist(char *principal, gid_t *groups, int *ngroups,
|
|
|
a72e7a |
ldap_value_free(names);
|
|
|
a72e7a |
err = -EINVAL;
|
|
|
a72e7a |
IDMAP_LOG(2, ("umich_gss_princ_to_grouplist: User %s, "
|
|
|
a72e7a |
- "number of groups %d, exceeds requested number %d\n",
|
|
|
a72e7a |
+ "number of groups %d, exceeds requested number %d",
|
|
|
a72e7a |
principal, i, *ngroups));
|
|
|
a72e7a |
*ngroups = i;
|
|
|
a72e7a |
goto out_unbind;
|
|
|
a72e7a |
@@ -780,7 +780,7 @@ umich_gss_princ_to_grouplist(char *principal, gid_t *groups, int *ngroups,
|
|
|
a72e7a |
|
|
|
a72e7a |
if ( f_len == LDAP_FILT_MAXSIZ ) {
|
|
|
a72e7a |
IDMAP_LOG(2, ("ERROR: umich_gss_princ_to_grouplist: "
|
|
|
a72e7a |
- "filter too long!\n"));
|
|
|
a72e7a |
+ "filter too long!"));
|
|
|
a72e7a |
ldap_value_free(names);
|
|
|
a72e7a |
goto out_unbind;
|
|
|
a72e7a |
}
|
|
|
a72e7a |
@@ -793,14 +793,14 @@ umich_gss_princ_to_grouplist(char *principal, gid_t *groups, int *ngroups,
|
|
|
a72e7a |
char *errmsg;
|
|
|
a72e7a |
|
|
|
a72e7a |
IDMAP_LOG(2, ("umich_gss_princ_to_grouplist: ldap_search_st "
|
|
|
a72e7a |
- "for tree '%s, filter '%s': %s (%d)\n",
|
|
|
a72e7a |
+ "for tree '%s, filter '%s': %s (%d)",
|
|
|
a72e7a |
linfo->group_tree, filter,
|
|
|
a72e7a |
ldap_err2string(err), err));
|
|
|
a72e7a |
if ((ldap_get_option(ld, LDAP_OPT_ERROR_STRING, &errmsg)==LDAP_SUCCESS)
|
|
|
a72e7a |
&&
|
|
|
a72e7a |
(errmsg != NULL) && (*errmsg != '\0')) {
|
|
|
a72e7a |
IDMAP_LOG(2, ("umich_gss_princ_to_grouplist: "
|
|
|
a72e7a |
- "Additional info: %s\n", errmsg));
|
|
|
a72e7a |
+ "Additional info: %s", errmsg));
|
|
|
a72e7a |
ldap_memfree(errmsg);
|
|
|
a72e7a |
}
|
|
|
a72e7a |
continue;
|
|
|
a72e7a |
@@ -822,7 +822,7 @@ umich_gss_princ_to_grouplist(char *principal, gid_t *groups, int *ngroups,
|
|
|
a72e7a |
/* There should be only one gidNumber attribute per group */
|
|
|
a72e7a |
if ((valcount = ldap_count_values(vals)) != 1) {
|
|
|
a72e7a |
IDMAP_LOG(2, ("DB problem getting gidNumber of "
|
|
|
a72e7a |
- "posixGroup! (count was %d)\n", valcount));
|
|
|
a72e7a |
+ "posixGroup! (count was %d)", valcount));
|
|
|
a72e7a |
ldap_value_free(vals);
|
|
|
a72e7a |
continue;
|
|
|
a72e7a |
}
|
|
|
a72e7a |
@@ -832,7 +832,7 @@ umich_gss_princ_to_grouplist(char *principal, gid_t *groups, int *ngroups,
|
|
|
a72e7a |
if (tmp_gid != tmp_g ||
|
|
|
a72e7a |
(errno == ERANGE && tmp_g == ULONG_MAX)) {
|
|
|
a72e7a |
IDMAP_LOG(2, ("ERROR: umich_gss_princ_to_grouplist: "
|
|
|
a72e7a |
- "gidNumber too long converting '%s'\n",
|
|
|
a72e7a |
+ "gidNumber too long converting '%s'",
|
|
|
a72e7a |
vals[0]));
|
|
|
a72e7a |
ldap_value_free(vals);
|
|
|
a72e7a |
continue;
|
|
|
a72e7a |
@@ -867,7 +867,7 @@ umich_gss_princ_to_grouplist(char *principal, gid_t *groups, int *ngroups,
|
|
|
a72e7a |
|
|
|
a72e7a |
if ( f_len == LDAP_FILT_MAXSIZ ) {
|
|
|
a72e7a |
IDMAP_LOG(0, ("ERROR: umich_gss_princ_to_grouplist: "
|
|
|
a72e7a |
- "filter too long!\n"));
|
|
|
a72e7a |
+ "filter too long!"));
|
|
|
a72e7a |
ldap_value_free(names);
|
|
|
a72e7a |
goto out_unbind;
|
|
|
a72e7a |
}
|
|
|
a72e7a |
@@ -884,13 +884,13 @@ umich_gss_princ_to_grouplist(char *principal, gid_t *groups, int *ngroups,
|
|
|
a72e7a |
char *errmsg;
|
|
|
a72e7a |
|
|
|
a72e7a |
IDMAP_LOG(2, ("umich_gss_princ_to_grouplist: ldap_search_st "
|
|
|
a72e7a |
- "for tree '%s, filter '%s': %s (%d)\n",
|
|
|
a72e7a |
+ "for tree '%s, filter '%s': %s (%d)",
|
|
|
a72e7a |
linfo->group_tree, filter,
|
|
|
a72e7a |
ldap_err2string(err), err));
|
|
|
a72e7a |
if ((ldap_get_option(ld, LDAP_OPT_ERROR_STRING, &errmsg) == LDAP_SUCCESS) &&
|
|
|
a72e7a |
(errmsg != NULL) && (*errmsg != '\0')) {
|
|
|
a72e7a |
IDMAP_LOG(2, ("umich_gss_princ_to_grouplist: "
|
|
|
a72e7a |
- "Additional info: %s\n", errmsg));
|
|
|
a72e7a |
+ "Additional info: %s", errmsg));
|
|
|
a72e7a |
ldap_memfree(errmsg);
|
|
|
a72e7a |
}
|
|
|
a72e7a |
err = -ENOENT;
|
|
|
a72e7a |
@@ -938,7 +938,7 @@ umich_gss_princ_to_grouplist(char *principal, gid_t *groups, int *ngroups,
|
|
|
a72e7a |
/* There should be only one gidNumber attribute per group */
|
|
|
a72e7a |
if ((valcount = ldap_count_values(vals)) != 1) {
|
|
|
a72e7a |
IDMAP_LOG(0, ("DB problem getting gidNumber of "
|
|
|
a72e7a |
- "posixGroup! (count was %d)\n", valcount));
|
|
|
a72e7a |
+ "posixGroup! (count was %d)", valcount));
|
|
|
a72e7a |
goto out_unbind;
|
|
|
a72e7a |
}
|
|
|
a72e7a |
tmp_g = strtoul(vals[0], (char **)NULL, 10);
|
|
|
a72e7a |
@@ -946,7 +946,7 @@ umich_gss_princ_to_grouplist(char *principal, gid_t *groups, int *ngroups,
|
|
|
a72e7a |
if (tmp_gid != tmp_g ||
|
|
|
a72e7a |
(errno == ERANGE && tmp_g == ULONG_MAX)) {
|
|
|
a72e7a |
IDMAP_LOG(0, ("ERROR: umich_gss_princ_to_grouplist: "
|
|
|
a72e7a |
- "gidNumber too long converting '%s'\n",
|
|
|
a72e7a |
+ "gidNumber too long converting '%s'",
|
|
|
a72e7a |
vals[0]));
|
|
|
a72e7a |
ldap_value_free(vals);
|
|
|
a72e7a |
goto out_unbind;
|
|
|
a72e7a |
@@ -978,7 +978,7 @@ umichldap_gss_princ_to_ids(char *secname, char *principal,
|
|
|
a72e7a |
|
|
|
a72e7a |
if ((strcmp(secname, "krb5") != 0) && (strcmp(secname, "spkm3") != 0)) {
|
|
|
a72e7a |
IDMAP_LOG(0, ("ERROR: umichldap_gss_princ_to_ids: "
|
|
|
a72e7a |
- "invalid secname '%s'\n", secname));
|
|
|
a72e7a |
+ "invalid secname '%s'", secname));
|
|
|
a72e7a |
return err;
|
|
|
a72e7a |
}
|
|
|
a72e7a |
|
|
|
a72e7a |
@@ -1031,7 +1031,7 @@ umichldap_gss_princ_to_grouplist(char *secname, char *principal,
|
|
|
a72e7a |
|
|
|
a72e7a |
if ((strcmp(secname, "krb5") != 0) && (strcmp(secname, "spkm3") != 0)) {
|
|
|
a72e7a |
IDMAP_LOG(0, ("ERROR: umichldap_gss_princ_to_grouplist: "
|
|
|
a72e7a |
- "invalid secname '%s'\n", secname));
|
|
|
a72e7a |
+ "invalid secname '%s'", secname));
|
|
|
a72e7a |
return err;
|
|
|
a72e7a |
}
|
|
|
a72e7a |
|
|
|
a72e7a |
@@ -1068,11 +1068,11 @@ get_canonical_hostname(const char *inname)
|
|
|
a72e7a |
msg = gai_strerror(aierr);
|
|
|
a72e7a |
break;
|
|
|
a72e7a |
}
|
|
|
a72e7a |
- IDMAP_LOG(1, ("%s: '%s': %s\n", __FUNCTION__, inname, msg));
|
|
|
a72e7a |
+ IDMAP_LOG(1, ("%s: '%s': %s", __FUNCTION__, inname, msg));
|
|
|
a72e7a |
goto out_err;
|
|
|
a72e7a |
}
|
|
|
a72e7a |
if (ap == 0) {
|
|
|
a72e7a |
- IDMAP_LOG(1, ("%s: no addresses for host '%s'?\n",
|
|
|
a72e7a |
+ IDMAP_LOG(1, ("%s: no addresses for host '%s'?",
|
|
|
a72e7a |
__FUNCTION__, inname));
|
|
|
a72e7a |
goto out_err;
|
|
|
a72e7a |
}
|
|
|
a72e7a |
@@ -1080,7 +1080,7 @@ get_canonical_hostname(const char *inname)
|
|
|
a72e7a |
error = getnameinfo (ap->ai_addr, ap->ai_addrlen, tmphost,
|
|
|
a72e7a |
sizeof(tmphost), NULL, 0, 0);
|
|
|
a72e7a |
if (error) {
|
|
|
a72e7a |
- IDMAP_LOG(1, ("%s: getnameinfo for host '%s' failed (%d)\n",
|
|
|
a72e7a |
+ IDMAP_LOG(1, ("%s: getnameinfo for host '%s' failed (%d)",
|
|
|
a72e7a |
__FUNCTION__, inname));
|
|
|
a72e7a |
goto out_free;
|
|
|
a72e7a |
}
|
|
|
a72e7a |
@@ -1125,7 +1125,7 @@ umichldap_init(void)
|
|
|
a72e7a |
strncat(missing_msg, "LDAP_base ", sizeof(missing_msg));
|
|
|
a72e7a |
if (strlen(missing_msg) != 0) {
|
|
|
a72e7a |
IDMAP_LOG(0, ("umichldap_init: Missing required information: "
|
|
|
a72e7a |
- "%s\n", missing_msg));
|
|
|
a72e7a |
+ "%s", missing_msg));
|
|
|
a72e7a |
goto fail;
|
|
|
a72e7a |
}
|
|
|
a72e7a |
|
|
|
a72e7a |
@@ -1137,7 +1137,7 @@ umichldap_init(void)
|
|
|
a72e7a |
canon_name = get_canonical_hostname(server_in);
|
|
|
a72e7a |
if (canon_name == NULL)
|
|
|
a72e7a |
IDMAP_LOG(0, ("umichldap_init: Warning! Unable to "
|
|
|
a72e7a |
- "canonicalize server name '%s' as requested.\n",
|
|
|
a72e7a |
+ "canonicalize server name '%s' as requested.",
|
|
|
a72e7a |
server_in));
|
|
|
a72e7a |
else
|
|
|
a72e7a |
ldap_info.server = canon_name;
|
|
|
a72e7a |
@@ -1226,56 +1226,56 @@ umichldap_init(void)
|
|
|
a72e7a |
|
|
|
a72e7a |
if (ldap_info.use_ssl && ldap_info.ca_cert == NULL) {
|
|
|
a72e7a |
IDMAP_LOG(0, ("umichldap_init: You must specify LDAP_ca_cert "
|
|
|
a72e7a |
- "with LDAP_use_ssl=yes\n"));
|
|
|
a72e7a |
+ "with LDAP_use_ssl=yes"));
|
|
|
a72e7a |
goto fail;
|
|
|
a72e7a |
}
|
|
|
a72e7a |
|
|
|
a72e7a |
|
|
|
a72e7a |
/* print out some good debugging info */
|
|
|
a72e7a |
- IDMAP_LOG(1, ("umichldap_init: canonicalize_name: %s\n",
|
|
|
a72e7a |
+ IDMAP_LOG(1, ("umichldap_init: canonicalize_name: %s",
|
|
|
a72e7a |
canonicalize));
|
|
|
a72e7a |
- IDMAP_LOG(1, ("umichldap_init: server : %s (from config value '%s')\n",
|
|
|
a72e7a |
+ IDMAP_LOG(1, ("umichldap_init: server : %s (from config value '%s')",
|
|
|
a72e7a |
ldap_info.server, server_in));
|
|
|
a72e7a |
- IDMAP_LOG(1, ("umichldap_init: port : %d\n", ldap_info.port));
|
|
|
a72e7a |
- IDMAP_LOG(1, ("umichldap_init: people : %s\n", ldap_info.people_tree));
|
|
|
a72e7a |
- IDMAP_LOG(1, ("umichldap_init: groups : %s\n", ldap_info.group_tree));
|
|
|
a72e7a |
+ IDMAP_LOG(1, ("umichldap_init: port : %d", ldap_info.port));
|
|
|
a72e7a |
+ IDMAP_LOG(1, ("umichldap_init: people : %s", ldap_info.people_tree));
|
|
|
a72e7a |
+ IDMAP_LOG(1, ("umichldap_init: groups : %s", ldap_info.group_tree));
|
|
|
a72e7a |
|
|
|
a72e7a |
- IDMAP_LOG(1, ("umichldap_init: user_dn : %s\n",
|
|
|
a72e7a |
+ IDMAP_LOG(1, ("umichldap_init: user_dn : %s",
|
|
|
a72e7a |
(ldap_info.user_dn && strlen(ldap_info.user_dn) != 0)
|
|
|
a72e7a |
? ldap_info.user_dn : "<not-supplied>"));
|
|
|
a72e7a |
/* Don't print actual password into the log. */
|
|
|
a72e7a |
- IDMAP_LOG(1, ("umichldap_init: passwd : %s\n",
|
|
|
a72e7a |
+ IDMAP_LOG(1, ("umichldap_init: passwd : %s",
|
|
|
a72e7a |
(ldap_info.passwd && strlen(ldap_info.passwd) != 0) ?
|
|
|
a72e7a |
"<supplied>" : "<not-supplied>"));
|
|
|
a72e7a |
- IDMAP_LOG(1, ("umichldap_init: use_ssl : %s\n",
|
|
|
a72e7a |
+ IDMAP_LOG(1, ("umichldap_init: use_ssl : %s",
|
|
|
a72e7a |
ldap_info.use_ssl ? "yes" : "no"));
|
|
|
a72e7a |
- IDMAP_LOG(1, ("umichldap_init: ca_cert : %s\n",
|
|
|
a72e7a |
+ IDMAP_LOG(1, ("umichldap_init: ca_cert : %s",
|
|
|
a72e7a |
ldap_info.ca_cert ? ldap_info.ca_cert : "<not-supplied>"));
|
|
|
a72e7a |
- IDMAP_LOG(1, ("umichldap_init: use_memberof_for_groups : %s\n",
|
|
|
a72e7a |
+ IDMAP_LOG(1, ("umichldap_init: use_memberof_for_groups : %s",
|
|
|
a72e7a |
ldap_info.memberof_for_groups ? "yes" : "no"));
|
|
|
a72e7a |
|
|
|
a72e7a |
- IDMAP_LOG(1, ("umichldap_init: NFSv4_person_objectclass : %s\n",
|
|
|
a72e7a |
+ IDMAP_LOG(1, ("umichldap_init: NFSv4_person_objectclass : %s",
|
|
|
a72e7a |
ldap_map.NFSv4_person_objcls));
|
|
|
a72e7a |
- IDMAP_LOG(1, ("umichldap_init: NFSv4_nfsname_attr : %s\n",
|
|
|
a72e7a |
+ IDMAP_LOG(1, ("umichldap_init: NFSv4_nfsname_attr : %s",
|
|
|
a72e7a |
ldap_map.NFSv4_nfsname_attr));
|
|
|
a72e7a |
- IDMAP_LOG(1, ("umichldap_init: NFSv4_acctname_attr : %s\n",
|
|
|
a72e7a |
+ IDMAP_LOG(1, ("umichldap_init: NFSv4_acctname_attr : %s",
|
|
|
a72e7a |
ldap_map.NFSv4_acctname_attr));
|
|
|
a72e7a |
- IDMAP_LOG(1, ("umichldap_init: NFSv4_uid_attr : %s\n",
|
|
|
a72e7a |
+ IDMAP_LOG(1, ("umichldap_init: NFSv4_uid_attr : %s",
|
|
|
a72e7a |
ldap_map.NFSv4_uid_attr));
|
|
|
a72e7a |
- IDMAP_LOG(1, ("umichldap_init: NFSv4_group_objectclass : %s\n",
|
|
|
a72e7a |
+ IDMAP_LOG(1, ("umichldap_init: NFSv4_group_objectclass : %s",
|
|
|
a72e7a |
ldap_map.NFSv4_group_objcls));
|
|
|
a72e7a |
- IDMAP_LOG(1, ("umichldap_init: NFSv4_gid_attr : %s\n",
|
|
|
a72e7a |
+ IDMAP_LOG(1, ("umichldap_init: NFSv4_gid_attr : %s",
|
|
|
a72e7a |
ldap_map.NFSv4_gid_attr));
|
|
|
a72e7a |
- IDMAP_LOG(1, ("umichldap_init: NFSv4_group_nfsname_attr : %s\n",
|
|
|
a72e7a |
+ IDMAP_LOG(1, ("umichldap_init: NFSv4_group_nfsname_attr : %s",
|
|
|
a72e7a |
ldap_map.NFSv4_group_nfsname_attr));
|
|
|
a72e7a |
- IDMAP_LOG(1, ("umichldap_init: NFSv4_member_attr : %s\n",
|
|
|
a72e7a |
+ IDMAP_LOG(1, ("umichldap_init: NFSv4_member_attr : %s",
|
|
|
a72e7a |
ldap_map.NFSv4_member_attr));
|
|
|
a72e7a |
- IDMAP_LOG(1, ("umichldap_init: NFSv4_member_of_attr : %s\n",
|
|
|
a72e7a |
+ IDMAP_LOG(1, ("umichldap_init: NFSv4_member_of_attr : %s",
|
|
|
a72e7a |
ldap_map.NFSv4_member_of_attr));
|
|
|
a72e7a |
- IDMAP_LOG(1, ("umichldap_init: NFSv4_grouplist_filter : %s\n",
|
|
|
a72e7a |
+ IDMAP_LOG(1, ("umichldap_init: NFSv4_grouplist_filter : %s",
|
|
|
a72e7a |
ldap_map.NFSv4_grouplist_filter ?
|
|
|
a72e7a |
ldap_map.NFSv4_grouplist_filter : "<not-specified>"));
|
|
|
a72e7a |
- IDMAP_LOG(1, ("umichldap_init: GSS_principal_attr : %s\n",
|
|
|
a72e7a |
+ IDMAP_LOG(1, ("umichldap_init: GSS_principal_attr : %s",
|
|
|
a72e7a |
ldap_map.GSS_principal_attr));
|
|
|
a72e7a |
return 0;
|
|
|
a72e7a |
fail:
|