diff options
Diffstat (limited to 'src/pam_wrapper.c')
-rw-r--r-- | src/pam_wrapper.c | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/src/pam_wrapper.c b/src/pam_wrapper.c index e00744d..9db8f82 100644 --- a/src/pam_wrapper.c +++ b/src/pam_wrapper.c @@ -648,22 +648,29 @@ static void pwrap_init(void) PWRAP_LOG(PWRAP_LOG_DEBUG, "Initialize pam_wrapper"); - for (i = 0; i < 10; i++) { + for (i = 0; i < 36; i++) { struct stat sb; + char c; - tmp_config_dir[len - 1] = (char)(i + 48); - PWRAP_LOG(PWRAP_LOG_TRACE, - "Check pam_wrapper dir %s already exists", - tmp_config_dir); + if (i < 10) { + c = (char)(i + 48); + } else { + c = (char)(i + 87); + } + + tmp_config_dir[len - 1] = c; rc = lstat(tmp_config_dir, &sb); if (rc == 0) { + PWRAP_LOG(PWRAP_LOG_TRACE, + "Check pam_wrapper dir %s already exists", + tmp_config_dir); continue; } else if (errno == ENOENT) { break; } } - if (i == 10) { + if (i == 36) { PWRAP_LOG(PWRAP_LOG_ERROR, "Failed to find a possible path to create pam_wrapper config dir: %s", tmp_config_dir); @@ -1185,6 +1192,8 @@ static int p_rmdirs(const char *path) { struct stat sb; char *fname; + return 0; + if ((d = opendir(path)) != NULL) { while(stat(path, &sb) == 0) { /* if we can remove the directory we're done */ @@ -1261,6 +1270,9 @@ void pwrap_destructor(void) return; } + PWRAP_LOG(PWRAP_LOG_TRACE, + "destructor called for pam_wrapper dir %s", + pwrap.config_dir); env = getenv("PAM_WRAPPER_KEEP_DIR"); if (env == NULL || env[0] != '1') { p_rmdirs(pwrap.config_dir); |