summaryrefslogtreecommitdiff
path: root/libpam
diff options
context:
space:
mode:
authorThorsten Kukuk <kukuk@thkukuk.de>2004-09-15 12:06:17 +0000
committerThorsten Kukuk <kukuk@thkukuk.de>2004-09-15 12:06:17 +0000
commite1f75a80821125170e23a9b920d138a4a952c708 (patch)
tree06b15c3d9d4fa69fad768cb5071bb4bfc80f9d92 /libpam
parentd7987be1aade2b11454a8b3b3d8e9c1c3df93d5f (diff)
Relevant BUGIDs:
Purpose of commit: Commit summary: --------------- bugfix: Add parts of Steve Grubb's resource leak and other fixes
Diffstat (limited to 'libpam')
-rw-r--r--libpam/include/security/_pam_types.h2
-rw-r--r--libpam/pam_env.c5
-rw-r--r--libpam/pam_handlers.c2
-rw-r--r--libpam/pam_private.h8
4 files changed, 12 insertions, 5 deletions
diff --git a/libpam/include/security/_pam_types.h b/libpam/include/security/_pam_types.h
index 871bfbf2..70f6d6ab 100644
--- a/libpam/include/security/_pam_types.h
+++ b/libpam/include/security/_pam_types.h
@@ -76,7 +76,7 @@ typedef struct pam_handle pam_handle_t;
#define PAM_AUTHTOK_LOCK_BUSY 22 /* Authentication token lock busy */
#define PAM_AUTHTOK_DISABLE_AGING 23 /* Authentication token aging disabled */
#define PAM_TRY_AGAIN 24 /* Preliminary check by password service */
-#define PAM_IGNORE 25 /* Ingore underlying account module */
+#define PAM_IGNORE 25 /* Ignore underlying account module */
/* regardless of whether the control */
/* flag is required, optional, or sufficient */
#define PAM_ABORT 26 /* Critical error (?module fail now request) */
diff --git a/libpam/pam_env.c b/libpam/pam_env.c
index d5a26ccb..ae1ddf2e 100644
--- a/libpam/pam_env.c
+++ b/libpam/pam_env.c
@@ -75,7 +75,7 @@ int _pam_make_env(pam_handle_t *pamh)
/*
* fill entries in pamh->env
*/
-
+
pamh->env->entries = PAM_ENV_CHUNK;
pamh->env->requested = 1;
pamh->env->list[0] = NULL;
@@ -223,7 +223,7 @@ int pam_putenv(pam_handle_t *pamh, const char *name_value)
/* add a new NULL entry at end; increase counter */
pamh->env->list[pamh->env->requested++] = NULL;
-
+
} else { /* replace old */
D(("replacing item: %s\n with: %s"
, pamh->env->list[item], name_value));
@@ -344,6 +344,7 @@ static char **_copy_env(pam_handle_t *pamh)
_pam_overwrite(dump[i]);
_pam_drop(dump[i]);
}
+ __pam_drop(dump);
return NULL;
}
}
diff --git a/libpam/pam_handlers.c b/libpam/pam_handlers.c
index e84d0d03..90c0968a 100644
--- a/libpam/pam_handlers.c
+++ b/libpam/pam_handlers.c
@@ -686,7 +686,7 @@ int _pam_add_handler(pam_handle_t *pamh
/* indicate its name - later we will search for it by this */
if ((mod->name = _pam_strdup(mod_path)) == NULL) {
D(("_pam_handler: couldn't get memory for mod_path"));
- _pam_system_log(LOG_ERR, "no memory for module path", mod_path);
+ _pam_system_log(LOG_ERR, "no memory for module path");
success = PAM_ABORT;
}
diff --git a/libpam/pam_private.h b/libpam/pam_private.h
index 7afc4fa7..1fbd9812 100644
--- a/libpam/pam_private.h
+++ b/libpam/pam_private.h
@@ -250,7 +250,13 @@ void _pam_set_default_control(int *control_array, int default_action);
void _pam_parse_control(int *control_array, char *tok);
-void _pam_system_log(int priority, const char *format, ... );
+void _pam_system_log(int priority, const char *format, ... )
+#ifdef __GNUC__
+ __attribute__ ((format (printf, 2, 3)));
+#else
+ ;
+#endif
+
#define _PAM_SYSTEM_LOG_PREFIX "PAM "
/*