summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Müller <lmuelle@samba.org>2007-07-04 19:52:51 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:23:47 -0500
commit2f6b9c1ec48a558ca6079044ddb5f1718efc6092 (patch)
treee03ef16391a31be76ea4f6fec585868fada7a77e
parent85f7c7127f6542850282a3f86451e8e4e16736c6 (diff)
downloadsamba-2f6b9c1ec48a558ca6079044ddb5f1718efc6092.tar.gz
samba-2f6b9c1ec48a558ca6079044ddb5f1718efc6092.tar.bz2
samba-2f6b9c1ec48a558ca6079044ddb5f1718efc6092.zip
r23707: - Move the asprintf() call to create the key even in
get_conf_item_string() to the later if statement. - Also move the key definition to the later if statement in get_conf_item_string() and get_conf_item_int(). (This used to be commit 3a82ec943a3828b843dd47aaa0e360844d4dfb91)
-rw-r--r--source3/nsswitch/pam_winbind.c26
1 files changed, 12 insertions, 14 deletions
diff --git a/source3/nsswitch/pam_winbind.c b/source3/nsswitch/pam_winbind.c
index 836822a8a9..8109eca4b9 100644
--- a/source3/nsswitch/pam_winbind.c
+++ b/source3/nsswitch/pam_winbind.c
@@ -1491,24 +1491,12 @@ const char *get_conf_item_string(const pam_handle_t *pamh,
{
int i = 0;
const char *parm_opt = NULL;
- char *key = NULL;
if (!(ctrl & config_flag)) {
goto out;
}
/* let the pam opt take precedence over the pam_winbind.conf option */
-
- if (d != NULL) {
-
- if (!asprintf(&key, "global:%s", item)) {
- goto out;
- }
-
- parm_opt = iniparser_getstr(d, key);
- SAFE_FREE(key);
- }
-
for ( i=0; i<argc; i++ ) {
if ((strncmp(argv[i], item, strlen(item)) == 0)) {
@@ -1524,6 +1512,15 @@ const char *get_conf_item_string(const pam_handle_t *pamh,
}
if (d != NULL) {
+ char *key = NULL;
+
+ if (!asprintf(&key, "global:%s", item)) {
+ goto out;
+ }
+
+ parm_opt = iniparser_getstr(d, key);
+ SAFE_FREE(key);
+
_pam_log_debug(pamh, ctrl, LOG_INFO, "CONFIG file: %s '%s'\n", item, parm_opt);
}
out:
@@ -1537,8 +1534,7 @@ int get_config_item_int(const pam_handle_t *pamh,
dictionary *d,
const char *item)
{
- int parm_opt = -1, i = 0;
- char *key = NULL;
+ int i, parm_opt = -1;
/* let the pam opt take precedence over the pam_winbind.conf option */
for (i = 0; i < argc; i++) {
@@ -1561,6 +1557,8 @@ int get_config_item_int(const pam_handle_t *pamh,
}
if (d != NULL) {
+ char *key = NULL;
+
if (!asprintf(&key, "global:%s", item)) {
goto out;
}