summaryrefslogtreecommitdiffabout
authorSergey Poznyakoff <gray@gnu.org.ua>2014-05-20 11:38:37 (GMT)
committer Sergey Poznyakoff <gray@gnu.org.ua>2014-05-20 11:38:37 (GMT)
commitf664b904fde206c6c7e0dc45b690ed7d28bea571 (patch) (side-by-side diff)
tree5d8ecd3ab9afed8b1a19b2b522c355aae5bdda9d
parent37e557be7bba1d0611365b40b26ad03e4b66e95b (diff)
downloadpam-modules-f664b904fde206c6c7e0dc45b690ed7d28bea571.tar.gz
pam-modules-f664b904fde206c6c7e0dc45b690ed7d28bea571.tar.bz2
pam_ldaphome: don't run initrc program if the home dir already exists.
* pam_ldaphome/pam_ldaphome.c (create_exists): New return code. (create_home_dir): Return create_exists if the directory already exists. (ldaphome_main): Run initrc only after creating the home dir.
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--pam_ldaphome/pam_ldaphome.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/pam_ldaphome/pam_ldaphome.c b/pam_ldaphome/pam_ldaphome.c
index f89b151..83b9cf7 100644
--- a/pam_ldaphome/pam_ldaphome.c
+++ b/pam_ldaphome/pam_ldaphome.c
@@ -1387,6 +1387,7 @@ dir_in_path(const char *dir, const char *path)
enum create_status {
create_ok,
+ create_exists,
create_failure,
create_skip
};
@@ -1430,7 +1431,8 @@ create_home_dir(pam_handle_t *pamh, struct passwd *pw, struct gray_env *env)
_pam_log(LOG_ERR, "%s exists, but is not a directory",
pw->pw_dir);
return create_failure;
- }
+ } else
+ return create_exists;
return create_ok;
}
@@ -1882,6 +1884,8 @@ ldaphome_main(pam_handle_t *pamh, int flags, int argc, const char **argv,
retval = run_initrc(pamh, pw, env);
if (retval)
break;
+ /* fall through */
+ case create_exists:
retval = import_public_key(pamh, pw, env);
break;
case create_failure:

Return to:

Send suggestions and report system problems to the System administrator.