From a887922fa97a43c31139dcd4159dfbee0f9c2093 Mon Sep 17 00:00:00 2001 From: rcrit Date: Mon, 15 Mar 2010 13:41:07 -0400 Subject: [PATCH] Add option to enable pam_mkhomedirs in the IPA client installer --- ipa-client/ipa-install/ipa-client-install | 17 ++++++++++++----- ipa-client/man/ipa-client-install.1 | 3 +++ 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/ipa-client/ipa-install/ipa-client-install b/ipa-client/ipa-install/ipa-client-install index 066c5adbd..9e66e786b 100644 --- a/ipa-client/ipa-install/ipa-client-install +++ b/ipa-client/ipa-install/ipa-client-install @@ -74,6 +74,8 @@ def parse_options(): help="use this option when run on a master", default=False) parser.add_option("--permit", dest="permit", action="store_true", help="disable access rules by default, permit all access.", default=False) + parser.add_option("--mkhomedir", dest="mkhomedir", action="store_true", + help="create home directories for users on their first login", default=False) parser.add_option("", "--uninstall", dest="uninstall", action="store_true", default=False, help="uninstall an existing installation") @@ -134,7 +136,7 @@ def uninstall(options): print "Disabling client Kerberos and Ldap configurations" try: - run(["/usr/sbin/authconfig", "--disableldap", "--disablekrb5", "--disablesssd", "--disablesssdauth", "--update"]) + run(["/usr/sbin/authconfig", "--disableldap", "--disablekrb5", "--disablesssd", "--disablesssdauth", "--disablemkhomedir", "--update"]) except Exception, e: print "Failed to remove krb5/ldap configuration. " +str(e) sys.exit(1) @@ -522,11 +524,16 @@ def main(): # Modify nsswitch/pam stack if options.sssd: - run(["/usr/sbin/authconfig", "--enablesssd", "--enablesssdauth", "--update"]) - print "SSSD enabled" + cmd = ["/usr/sbin/authconfig", "--enablesssd", "--enablesssdauth", "--update"] + message = "SSSD enabled" else: - run(["/usr/sbin/authconfig", "--enableldap", "--update"]) - print "LDAP enabled" + cmd = ["/usr/sbin/authconfig", "--enableldap", "--update"] + message = "LDAP enabled" + + if options.mkhomedir: + cmd.append("--enablemkhomedir") + run(cmd) + print message #Check nss_ldap is working properly if not options.on_master: diff --git a/ipa-client/man/ipa-client-install.1 b/ipa-client/man/ipa-client-install.1 index d5efb63bb..9eb0b39d9 100644 --- a/ipa-client/man/ipa-client-install.1 +++ b/ipa-client/man/ipa-client-install.1 @@ -68,6 +68,9 @@ Principal to use to join the IPA realm. \fB\-\-permit\fR Set the SSSD access rules to permit all access. Otherwise the machine will be controlled by the Host-based Access Controls on the IPA server. .TP +\fB\-\-mkhomedir\fR +Create a users home directory if it does not exist. +.TP \fB\-\-uninstall\fR Remove the IPA client software and restore the configuration to the pre-IPA state. .SH "EXIT STATUS"