aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2015-10-01 20:33:12 +0200
committerAndreas Schneider <asn@samba.org>2015-12-10 13:31:19 +0100
commitb9fae84d1cdaa7a7f8518329b3bedf9da7297f44 (patch)
treef11b51b51dbbb70a9aee10ce8569c263592da836
parent0942c7dbfb04c5831f38770c9e383049f361ee62 (diff)
downloadpam_wrapper-b9fae84d1cdaa7a7f8518329b3bedf9da7297f44.tar.gz
pam_wrapper-b9fae84d1cdaa7a7f8518329b3bedf9da7297f44.tar.xz
pam_wrapper-b9fae84d1cdaa7a7f8518329b3bedf9da7297f44.zip
pwrap: Allow more directories
-rw-r--r--src/pam_wrapper.c24
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);