summaryrefslogtreecommitdiff
path: root/libpam/pam_modutil_getpwnam.c
diff options
context:
space:
mode:
authorSteve Langasek <vorlon@debian.org>2007-08-30 04:00:39 +0000
committerSteve Langasek <vorlon@debian.org>2007-08-30 04:00:39 +0000
commit34df708209a4f7c47dd86f8e7a1c5cdcf1054b6f (patch)
tree3e59cb7b44b79ee8cdfb46753e1e10a2640677e2 /libpam/pam_modutil_getpwnam.c
parent5abc6729b8abec8c6c978428b0421ae6d1e03fb0 (diff)
Relevant BUGIDs:
Purpose of commit: portability, cleanup Commit summary: --------------- 2007-08-29 Steve Langasek <vorlon@debian.org> * libpam/pam_modutil_getgrgid.c, libpam/pam_modutil_getgrnam.c, libpam/pam_modutil_getpwnam.c, libpam/pam_modutil_getpwuid.c, libpam/pam_modutil_getspnam.c: don't use pthread mutexes in libpam unnecessarily; this avoids linking problems on non-Linux platforms.
Diffstat (limited to 'libpam/pam_modutil_getpwnam.c')
-rw-r--r--libpam/pam_modutil_getpwnam.c13
1 files changed, 0 insertions, 13 deletions
diff --git a/libpam/pam_modutil_getpwnam.c b/libpam/pam_modutil_getpwnam.c
index 026e61a7..a9dcd6c3 100644
--- a/libpam/pam_modutil_getpwnam.c
+++ b/libpam/pam_modutil_getpwnam.c
@@ -11,21 +11,10 @@
#include <errno.h>
#include <limits.h>
-#include <pthread.h>
#include <pwd.h>
#include <stdio.h>
#include <stdlib.h>
-static pthread_mutex_t _pammodutil_mutex = PTHREAD_MUTEX_INITIALIZER;
-static void _pammodutil_lock(void)
-{
- pthread_mutex_lock(&_pammodutil_mutex);
-}
-static void _pammodutil_unlock(void)
-{
- pthread_mutex_unlock(&_pammodutil_mutex);
-}
-
static int intlen(int number)
{
int len = 2;
@@ -84,13 +73,11 @@ pam_modutil_getpwnam(pam_handle_t *pamh, const char *user)
if (pamh != NULL) {
for (i = 0; i < INT_MAX; i++) {
sprintf(data_name, "_pammodutil_getpwnam_%s_%d", user, i);
- _pammodutil_lock();
status = PAM_NO_MODULE_DATA;
if (pam_get_data(pamh, data_name, &ignore) != PAM_SUCCESS) {
status = pam_set_data(pamh, data_name,
result, pam_modutil_cleanup);
}
- _pammodutil_unlock();
if (status == PAM_SUCCESS) {
break;
}