From 3fdd2fc129932d9386f73a25233d6f9c9b095480 Mon Sep 17 00:00:00 2001 From: nalin Date: Jul 31 2000 21:11:44 +0000 Subject: silently support the broken_shadow and bigcrypt flags for pam_unix only shut down ypbind if /var/run/ypbind exists --- diff --git a/authconfig.c b/authconfig.c index e4500d3..4c12150 100644 --- a/authconfig.c +++ b/authconfig.c @@ -86,14 +86,20 @@ gboolean toggleNisService(gboolean enableNis, char *nisDomain, gboolean nostart) system("/sbin/chkconfig --add ypbind"); system("/sbin/chkconfig --level 345 ypbind on"); if (!nostart) { - system("/sbin/service ypbind restart"); + if(stat(PATH_YPBIND_PID, &st) == 0) { + system("/sbin/service ypbind restart"); + } else { + system("/sbin/service ypbind start"); + } } } } else { system("/bin/domainname \"(none)\""); if(stat(PATH_YPBIND, &st) == 0) { if (!nostart) { - system("/sbin/service ypbind stop"); + if(stat(PATH_YPBIND_PID, &st) == 0) { + system("/sbin/service ypbind stop"); + } } system("/sbin/chkconfig --del ypbind"); } diff --git a/authconfig.spec b/authconfig.spec index b98e065..544ad34 100644 --- a/authconfig.spec +++ b/authconfig.spec @@ -1,6 +1,6 @@ Summary: Text-mode tool for setting up NIS and shadow passwords. Name: authconfig -Version: 4.0.12 +Version: 4.0.14 Release: 1 License: GPL ExclusiveOS: Linux @@ -34,6 +34,10 @@ rm -rf $RPM_BUILD_ROOT %attr(-,root,root)%{_datadir}/locale/*/LC_MESSAGES/authconfig.mo %changelog +* Mon Jul 31 2000 Nalin Dahyabhai +- silently support the broken_shadow and bigcrypt flags for pam_unix +- only shut down ypbind if /var/run/ypbind exists + * Thu Jul 27 2000 Nalin Dahyabhai - break some translations again diff --git a/authinfo.c b/authinfo.c index d0c6899..73b2897 100644 --- a/authinfo.c +++ b/authinfo.c @@ -414,7 +414,7 @@ gboolean authInfoReadPAM(struct authInfoType *authInfo) char ibuf[LINE_MAX]; char module[PATH_MAX]; char flags[PATH_MAX]; - char *p, *q; + char *p, *q, *stack; FILE *fp; fp = fopen(SYSCONFDIR "/pam.d/" AUTH_PAM_SERVICE, "r"); @@ -434,7 +434,9 @@ gboolean authInfoReadPAM(struct authInfoType *authInfo) p = ibuf; for(q = p; !isspace(*q) && (*q != '\0'); q++); /* stack */ - if(strncmp(p, "auth", 4) != 0) { + stack = p; + if((strncmp(stack, "auth", 4) != 0) && + (strncmp(stack, "account", 7) != 0)) { continue; } @@ -464,12 +466,20 @@ gboolean authInfoReadPAM(struct authInfoType *authInfo) for(p = q; isspace(*p) && (*p != '\0'); p++); for(q = p; !isspace(*q) && (*q != '\0'); q++); /* flags */ if(q - p < sizeof(module)) { + if(strncmp(stack, "auth", 4) == 0) if(strstr(module, "pam_unix") || strstr(module, "pam_pwdb")) { authInfo->enableMD5 = (strstr(p, "md5") != NULL); authInfo->enableShadow = (strstr(p, "shadow") != NULL); + authInfo->enableBigCrypt = + (strstr(p, "bigcrypt") != NULL); + } + if(strncmp(stack, "account", 7) == 0) + if(strstr(module, "pam_unix")) { + authInfo->brokenShadow = + (strstr(p, "broken_shadow") != NULL); } } } @@ -1460,16 +1470,27 @@ static void fmt_standard_pam_module(int i, char *obuf, struct authInfoType *info } } if(strcmp(standard_pam_modules[i].name, "unix") == 0) - if(stack != NULL) - if((strcmp(stack, "auth") == 0) || - (strcmp(stack, "password") == 0)) { - if(info->enableMD5) { - strncat(buf, " md5", + if(stack != NULL) { + if((strcmp(stack, "auth") == 0) || + (strcmp(stack, "password") == 0)) { + if(info->enableMD5) { + strncat(buf, " md5", + sizeof(buf) - 1 - strlen(buf)); + } + if(info->enableShadow) { + strncat(buf, " shadow", sizeof(buf) - 1 - strlen(buf)); + } + if(info->enableBigCrypt) { + strncat(buf, " bigcrypt", + sizeof(buf) - 1 - strlen(buf)); + } } - if(info->enableShadow) { - strncat(buf, " shadow", + if((strcmp(stack, "account") == 0)) { + if(info->brokenShadow) { + strncat(buf, " broken_shadow", sizeof(buf) - 1 - strlen(buf)); + } } } strcat(obuf, buf); diff --git a/authinfo.h b/authinfo.h index a3c6f4f..9f3a5f5 100644 --- a/authinfo.h +++ b/authinfo.h @@ -15,6 +15,7 @@ #define PATH_PORTMAP "/sbin/portmap" #define PATH_YPBIND "/sbin/ypbind" +#define PATH_YPBIND_PID "/var/run/ypbind.pid" #define PATH_LIBNSS_LDAP "/lib/libnss_ldap.so.2" #define PATH_LIBNSS_NIS "/lib/libnss_nis.so.2" #define PATH_LIBNSS_WINBIND "/lib/libnss_winbind.so.2" @@ -64,11 +65,13 @@ struct authInfoType { /* Authentication setup. */ gboolean enableMD5; gboolean enableShadow; + gboolean enableBigCrypt; gboolean enableKerberos; gboolean enableLDAPAuth; #ifdef LOCAL_POLICIES gboolean enableLocal; #endif + gboolean brokenShadow; }; struct authInfoType *authInfoRead(); diff --git a/po/authconfig.pot b/po/authconfig.pot index c9ca881..2d21f59 100644 --- a/po/authconfig.pot +++ b/po/authconfig.pot @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" -"POT-Creation-Date: 2000-07-27 15:51-0400\n" +"POT-Creation-Date: 2000-07-31 17:07-0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -14,115 +14,115 @@ msgstr "" "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: ENCODING\n" -#: ../authconfig.c:147 +#: ../authconfig.c:153 #, c-format msgid "" "The %s file was not found, but it is required for %s support to work " "properly. Install the %s package, which provides this file." msgstr "" -#: ../authconfig.c:151 +#: ../authconfig.c:157 msgid "Warning" msgstr "" -#: ../authconfig.c:151 ../authconfig.c:523 ../authconfig.c:528 +#: ../authconfig.c:157 ../authconfig.c:529 ../authconfig.c:534 msgid "Ok" msgstr "" -#: ../authconfig.c:161 ../authconfig.c:235 +#: ../authconfig.c:167 ../authconfig.c:241 msgid " Domain:" msgstr "" -#: ../authconfig.c:162 ../authconfig.c:208 +#: ../authconfig.c:168 ../authconfig.c:214 msgid " Server:" msgstr "" -#: ../authconfig.c:182 +#: ../authconfig.c:188 msgid " LHS:" msgstr "" -#: ../authconfig.c:183 +#: ../authconfig.c:189 msgid " RHS:" msgstr "" -#: ../authconfig.c:209 +#: ../authconfig.c:215 msgid " Base DN:" msgstr "" -#: ../authconfig.c:252 +#: ../authconfig.c:258 msgid " Realm:" msgstr "" -#: ../authconfig.c:253 +#: ../authconfig.c:259 msgid " KDC:" msgstr "" -#: ../authconfig.c:254 +#: ../authconfig.c:260 msgid " Admin Server:" msgstr "" #. Create the window and a form to put into it. -#: ../authconfig.c:294 +#: ../authconfig.c:300 msgid "User Information Configuration" msgstr "" #. NSS modules: NIS. -#: ../authconfig.c:298 +#: ../authconfig.c:304 msgid "Use NIS" msgstr "" -#: ../authconfig.c:321 +#: ../authconfig.c:327 msgid "Use LDAP" msgstr "" -#: ../authconfig.c:340 +#: ../authconfig.c:346 msgid "Use WinBind" msgstr "" -#: ../authconfig.c:354 +#: ../authconfig.c:360 msgid "Use Hesiod" msgstr "" #. Create the buttons. -#: ../authconfig.c:375 +#: ../authconfig.c:381 msgid "Next" msgstr "" -#: ../authconfig.c:376 ../authconfig.c:524 ../authconfig.c:529 +#: ../authconfig.c:382 ../authconfig.c:530 ../authconfig.c:535 msgid "Back" msgstr "" -#: ../authconfig.c:376 ../authconfig.c:525 +#: ../authconfig.c:382 ../authconfig.c:531 msgid "Cancel" msgstr "" #. Create the window and a form to put into it. -#: ../authconfig.c:441 +#: ../authconfig.c:447 msgid "Authentication Configuration" msgstr "" #. PAM setup. -#: ../authconfig.c:445 +#: ../authconfig.c:451 msgid "Use Shadow Passwords" msgstr "" -#: ../authconfig.c:449 +#: ../authconfig.c:455 msgid "Use MD5 Passwords" msgstr "" -#: ../authconfig.c:454 +#: ../authconfig.c:460 msgid "Use LDAP Authentication" msgstr "" -#: ../authconfig.c:475 +#: ../authconfig.c:481 msgid "Use WinBind Authentication" msgstr "" -#: ../authconfig.c:490 +#: ../authconfig.c:496 msgid "Use Kerberos 5" msgstr "" -#: ../authconfig.c:620 +#: ../authconfig.c:626 #, c-format msgid "" "Usage: %s [options]\n" @@ -164,47 +164,47 @@ msgid "" " --help show this screen\n" msgstr "" -#: ../authconfig.c:659 +#: ../authconfig.c:665 msgid "" "\n" " --enablelocal use locally-defined policy " msgstr "" -#: ../authconfig.c:770 +#: ../authconfig.c:776 #, c-format msgid "%s: bad argument %s: %s\n" msgstr "" -#: ../authconfig.c:777 +#: ../authconfig.c:783 #, c-format msgid "%s: unexpected argument\n" msgstr "" -#: ../authconfig.c:789 +#: ../authconfig.c:795 #, c-format msgid "%s: can only be run as root\n" msgstr "" -#: ../authconfig.c:800 ../authconfig.c:807 ../authconfig.c:814 -#: ../authconfig.c:822 ../authconfig.c:830 ../authconfig.c:837 -#: ../authconfig.c:844 ../authconfig.c:851 +#: ../authconfig.c:806 ../authconfig.c:813 ../authconfig.c:820 +#: ../authconfig.c:828 ../authconfig.c:836 ../authconfig.c:843 +#: ../authconfig.c:850 ../authconfig.c:857 #, c-format msgid "%s: critical error reading %s/%s" msgstr "" -#: ../authconfig.c:908 +#: ../authconfig.c:914 msgid "" " / between elements | selects | next " "screen" msgstr "" -#: ../authconfig.c:916 +#: ../authconfig.c:922 msgid "dialog was cancelled\n" msgstr "" -#: ../authconfig.c:984 ../authconfig.c:989 ../authconfig.c:994 -#: ../authconfig.c:999 ../authconfig.c:1005 ../authconfig.c:1011 -#: ../authconfig.c:1015 ../authconfig.c:1020 +#: ../authconfig.c:990 ../authconfig.c:995 ../authconfig.c:1000 +#: ../authconfig.c:1005 ../authconfig.c:1011 ../authconfig.c:1017 +#: ../authconfig.c:1021 ../authconfig.c:1026 #, c-format msgid "%s: critical error writing %s/%s" msgstr ""