From 3ebce3329c5b5edc26a45003884d78c62f2a5dff Mon Sep 17 00:00:00 2001 From: msw Date: Mar 16 1999 03:19:26 +0000 Subject: - just make the NIS part of configuration grayed out if NIS is not installed --- diff --git a/authconfig.c b/authconfig.c index 6bfff7f..ec39906 100644 --- a/authconfig.c +++ b/authconfig.c @@ -212,55 +212,61 @@ int getChoices(int useBack, int configureNis, /* * NIS stuff. */ - if (configureNis) { - nisServerLabel = newtLabel(-1, -1, i18n("NIS Server:")); - bcastCheckBox = newtCheckbox(-1, -1, i18n("Request via broadcast"), - *enableNisServer == '*' ? ' ' : '*', - 0, &newEnableBroadCast); - - nisServerEntry = newtEntry(-1, -1, "", 25, &newNisServer, - NEWT_FLAG_SCROLL); - newtEntrySetFilter(nisServerEntry, entryFilter, NULL); - - if (*enableNisServer == ' ') - newtEntrySetFlags(nisServerEntry, NEWT_ENTRY_DISABLED, - NEWT_FLAGS_SET); - - servercb.state = &newEnableBroadCast; - servercb.entry = nisServerEntry; - newtComponentAddCallback(bcastCheckBox, serverEntryToggle, - &servercb); - - nisCheckBox = newtCheckbox(-1, -1, i18n("Enable NIS"), 0, 0, enableNis); - - nisLabel = newtLabel(-1, -1, i18n("NIS Domain:")); - nisEntry = newtEntry(-1, -1, "", 25, &newNisDomain, - NEWT_FLAG_SCROLL); - newtEntrySetFilter(nisEntry, entryFilter, NULL); - - niscb.state = enableNis; - niscb.bcastState = &newEnableBroadCast; - niscb.domEntry = nisEntry; - niscb.bcast = bcastCheckBox; - niscb.serverEntry = nisServerEntry; - - newtComponentAddCallback(nisCheckBox, nisEntryToggle, - &niscb); + nisServerLabel = newtLabel(-1, -1, i18n("NIS Server:")); + bcastCheckBox = newtCheckbox(-1, -1, i18n("Request via broadcast"), + (*enableNisServer == '*' || !configureNis) ? ' ' : '*', + 0, &newEnableBroadCast); - /* if NIS is already enabled, show that. */ - if (strcmp(*nisDomain,"")) { - newtCheckboxSetValue(nisCheckBox, '*'); - newtEntrySet(nisEntry,*nisDomain, 1); - } - - /* likewise for a nisserver. */ - if (strcmp(*nisServer,"") && *enableNis == '*') { - newtEntrySet(nisServerEntry, *nisServer, 1); - } - - serverEntryToggle(bcastCheckBox, &servercb); - nisEntryToggle(nisCheckBox, &niscb); + nisServerEntry = newtEntry(-1, -1, "", 25, &newNisServer, + NEWT_FLAG_SCROLL); + newtEntrySetFilter(nisServerEntry, entryFilter, NULL); + + if (*enableNisServer == ' ') + newtEntrySetFlags(nisServerEntry, NEWT_ENTRY_DISABLED, + NEWT_FLAGS_SET); + + servercb.state = &newEnableBroadCast; + servercb.entry = nisServerEntry; + newtComponentAddCallback(bcastCheckBox, serverEntryToggle, + &servercb); + + nisCheckBox = newtCheckbox(-1, -1, i18n("Enable NIS"), 0, 0, enableNis); + + nisLabel = newtLabel(-1, -1, i18n("NIS Domain:")); + nisEntry = newtEntry(-1, -1, "", 25, &newNisDomain, + NEWT_FLAG_SCROLL); + newtEntrySetFilter(nisEntry, entryFilter, NULL); + + niscb.state = enableNis; + niscb.bcastState = &newEnableBroadCast; + niscb.domEntry = nisEntry; + niscb.bcast = bcastCheckBox; + niscb.serverEntry = nisServerEntry; + + newtComponentAddCallback(nisCheckBox, nisEntryToggle, + &niscb); + + /* if NIS is already enabled, show that. */ + if (strcmp(*nisDomain,"")) { + newtCheckboxSetValue(nisCheckBox, '*'); + newtEntrySet(nisEntry,*nisDomain, 1); + } + + /* likewise for a nisserver. */ + if (strcmp(*nisServer,"") && *enableNis == '*') { + newtEntrySet(nisServerEntry, *nisServer, 1); } + + serverEntryToggle(bcastCheckBox, &servercb); + nisEntryToggle(nisCheckBox, &niscb); + + if (!configureNis) { + newtEntrySetFlags(nisServerEntry, NEWT_ENTRY_DISABLED, NEWT_FLAGS_SET); + newtCheckboxSetFlags(bcastCheckBox, NEWT_ENTRY_DISABLED, NEWT_FLAGS_SET); + newtEntrySetFlags(nisEntry, NEWT_ENTRY_DISABLED, NEWT_FLAGS_SET); + newtCheckboxSetFlags(nisCheckBox, NEWT_ENTRY_DISABLED, NEWT_FLAGS_SET); + } + /* Shadow Stuff */ shadowCheckBox = newtCheckbox(-1, -1, i18n("Use Shadow Passwords"), 0, 0, &newUseShadow); @@ -278,38 +284,41 @@ int getChoices(int useBack, int configureNis, mainGrid = newtCreateGrid(1, 6); - if (configureNis) { + /* Row 2 of main grid */ + + /* Create the subgrid for nis info */ + subGrid = newtCreateGrid(2, 4); - /* Begin row 1 of main grid */ - newtGridSetField(mainGrid, 0, 0, NEWT_GRID_COMPONENT, nisCheckBox, - 0, 0, 0, 0, NEWT_ANCHOR_LEFT, 0); - - /* Row 2 of main grid */ - - /* Create the subgrid for nis info */ - subGrid = newtCreateGrid(2, 3); - - newtGridSetField(subGrid, 0, 0, NEWT_GRID_COMPONENT, nisLabel, - 1, 0, 1, 0, NEWT_ANCHOR_RIGHT, 0); - newtGridSetField(subGrid, 1, 0, NEWT_GRID_COMPONENT, nisEntry, - 0, 0, 0, 0, NEWT_ANCHOR_LEFT, 0); - newtGridSetField(subGrid, 0, 1, NEWT_GRID_COMPONENT, nisServerLabel, - 1, 0, 1, 0, NEWT_ANCHOR_RIGHT, 0); - - newtGridSetField(subGrid, 1, 1, NEWT_GRID_COMPONENT, bcastCheckBox, - 0, 0, 0, 0, NEWT_ANCHOR_LEFT, 0); - newtGridSetField(subGrid, 0, 2, NEWT_GRID_COMPONENT, - newtLabel(-1, -1, i18n("or use:")), - 0, 0, 1, 0, NEWT_ANCHOR_RIGHT, 0); - newtGridSetField(subGrid, 1, 2, NEWT_GRID_COMPONENT, nisServerEntry, - 0, 0, 0, 0, NEWT_ANCHOR_LEFT, 0); - - /* and the subgrid to the main grid */ - newtGridSetField(mainGrid, 0, 1, NEWT_GRID_SUBGRID, subGrid, - 0, 1, 0, 1, 0, NEWT_GRID_FLAG_GROWX); - } - /* Row 3... and so on */ + /* Begin row 1 of main grid */ + newtGridSetField(subGrid, 0, 0, NEWT_GRID_COMPONENT, nisCheckBox, + 0, 0, 0, 0, NEWT_ANCHOR_LEFT, 0); + + if (!configureNis) { + newtGridSetField(subGrid, 1, 0, NEWT_GRID_COMPONENT, + newtLabel(-1, -1, i18n("(NIS not installed)")), + 0, 0, 0, 0, NEWT_ANCHOR_RIGHT, 0); + } + newtGridSetField(subGrid, 0, 1, NEWT_GRID_COMPONENT, nisLabel, + 1, 0, 1, 0, NEWT_ANCHOR_RIGHT, 0); + newtGridSetField(subGrid, 1, 1, NEWT_GRID_COMPONENT, nisEntry, + 0, 0, 0, 0, NEWT_ANCHOR_LEFT, 0); + newtGridSetField(subGrid, 0, 2, NEWT_GRID_COMPONENT, nisServerLabel, + 1, 0, 1, 0, NEWT_ANCHOR_RIGHT, 0); + + newtGridSetField(subGrid, 1, 2, NEWT_GRID_COMPONENT, bcastCheckBox, + 0, 0, 0, 0, NEWT_ANCHOR_LEFT, 0); + newtGridSetField(subGrid, 0, 3, NEWT_GRID_COMPONENT, + newtLabel(-1, -1, i18n("or use:")), + 0, 0, 1, 0, NEWT_ANCHOR_RIGHT, 0); + newtGridSetField(subGrid, 1, 3, NEWT_GRID_COMPONENT, nisServerEntry, + 0, 0, 0, 0, NEWT_ANCHOR_LEFT, 0); + + /* and the subgrid to the main grid */ + newtGridSetField(mainGrid, 0, 1, NEWT_GRID_SUBGRID, subGrid, + 0, 1, 0, 1, 0, NEWT_GRID_FLAG_GROWX); + + /* Row 3... and so on */ newtGridSetField(mainGrid, 0, 2, NEWT_GRID_COMPONENT, shadowCheckBox, 0, 0, 0, 1, NEWT_ANCHOR_LEFT, 0); diff --git a/authconfig.spec b/authconfig.spec index 7a654d8..1e568f0 100644 --- a/authconfig.spec +++ b/authconfig.spec @@ -2,7 +2,7 @@ Summary: Text-mode tool for setting up NIS and shadow passwords. Name: authconfig %define version 1.3 Version: %{version} -Release: 1 +Release: 2 Copyright: GPL ExclusiveOS: Linux Group: System Environment/Base @@ -33,6 +33,9 @@ rm -rf $RPM_BUILD_ROOT #%attr(-,root,root)/usr/share/locale/*/LC_MESSAGES/authconfig.mo %changelog +* Mon Mar 15 1999 Matt Wilson +- just make the NIS part of configuration grayed out if NIS is not installed + * Tue Mar 09 1999 Preston Brown - static buffer sizes increased. diff --git a/po/authconfig.pot b/po/authconfig.pot index c152e0e..2c99758 100644 --- a/po/authconfig.pot +++ b/po/authconfig.pot @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" -"POT-Creation-Date: 1999-02-15 13:13-0500\n" +"POT-Creation-Date: 1999-03-15 22:17-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -14,89 +14,96 @@ msgstr "" "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: ENCODING\n" -#: ../authconfig.c:36 ../authconfig.c:376 +#: ../authconfig.c:36 ../authconfig.c:386 #, c-format msgid "%s: cannot open /etc/sysconfig/network: %s\n" msgstr "" -#: ../authconfig.c:96 ../authconfig.c:457 +#: ../authconfig.c:96 ../authconfig.c:467 #, c-format msgid "%s: cannot open /etc/yp.conf: %s\n" msgstr "" -#: ../authconfig.c:216 +#. +#. * NIS stuff. +#. +#: ../authconfig.c:215 msgid "NIS Server:" msgstr "" -#: ../authconfig.c:217 +#: ../authconfig.c:216 msgid "Request via broadcast" msgstr "" -#: ../authconfig.c:234 +#: ../authconfig.c:233 msgid "Enable NIS" msgstr "" -#: ../authconfig.c:236 +#: ../authconfig.c:235 msgid "NIS Domain:" msgstr "" #. Shadow Stuff -#: ../authconfig.c:265 +#: ../authconfig.c:271 msgid "Use Shadow Passwords" msgstr "" -#: ../authconfig.c:267 +#: ../authconfig.c:273 msgid "Enable MD5 Passwords" msgstr "" -#: ../authconfig.c:274 ../authconfig.c:337 ../authconfig.c:344 +#: ../authconfig.c:280 ../authconfig.c:347 ../authconfig.c:354 msgid "Ok" msgstr "" -#: ../authconfig.c:275 +#: ../authconfig.c:281 msgid "Back" msgstr "" -#: ../authconfig.c:275 +#: ../authconfig.c:281 msgid "Cancel" msgstr "" -#: ../authconfig.c:302 +#: ../authconfig.c:298 +msgid "(NIS not installed)" +msgstr "" + +#: ../authconfig.c:312 msgid "or use:" msgstr "" -#: ../authconfig.c:325 +#: ../authconfig.c:334 msgid "Authentication Configuration" msgstr "" -#: ../authconfig.c:337 ../authconfig.c:344 +#: ../authconfig.c:347 ../authconfig.c:354 msgid "Error" msgstr "" -#: ../authconfig.c:338 +#: ../authconfig.c:348 msgid "You must enter a NIS server or request via broadcast." msgstr "" -#: ../authconfig.c:345 +#: ../authconfig.c:355 msgid "You must enter a NIS domain." msgstr "" -#: ../authconfig.c:383 +#: ../authconfig.c:393 #, c-format msgid "%s: cannot open /etc/sysconfig/network- for writing: %s\n" msgstr "" -#: ../authconfig.c:464 +#: ../authconfig.c:474 #, c-format msgid "%s: cannot open /etc/yp.conf- for writing: %s\n" msgstr "" -#: ../authconfig.c:633 +#: ../authconfig.c:643 #, c-format msgid "%s: error opening %s\n" msgstr "" -#: ../authconfig.c:667 +#: ../authconfig.c:677 #, c-format msgid "" "Usage: %s [options]\n" @@ -111,68 +118,68 @@ msgid "" " --help show this screen\n" msgstr "" -#: ../authconfig.c:721 +#: ../authconfig.c:731 #, c-format msgid "%s: bad argument %s: %s\n" msgstr "" -#: ../authconfig.c:728 +#: ../authconfig.c:738 #, c-format msgid "%s: unexpected argument\n" msgstr "" -#: ../authconfig.c:740 +#: ../authconfig.c:750 #, c-format msgid "%s: can only be run as root\n" msgstr "" -#: ../authconfig.c:755 +#: ../authconfig.c:765 #, c-format msgid "%s: critical error reading /etc/sysconfig/network" msgstr "" -#: ../authconfig.c:768 +#: ../authconfig.c:778 #, c-format msgid "%s: critical error reading /etc/yp.conf" msgstr "" -#: ../authconfig.c:785 +#: ../authconfig.c:795 #, c-format msgid "%s: critical error reading /etc/pam.d/passwd\n" msgstr "" -#: ../authconfig.c:794 +#: ../authconfig.c:804 msgid "" " / between elements | selects | next " "screen" msgstr "" -#: ../authconfig.c:805 +#: ../authconfig.c:815 #, c-format msgid "%s: nis domain was set to %s, but dialog was cancelled\n" msgstr "" -#: ../authconfig.c:818 +#: ../authconfig.c:828 #, c-format msgid "return values: nis: %c, nisdomain: %s, shadow: %c, md5: %c\n" msgstr "" -#: ../authconfig.c:826 +#: ../authconfig.c:836 #, c-format msgid "%s: critical error writing /etc/sysconfig/network\n" msgstr "" -#: ../authconfig.c:833 +#: ../authconfig.c:843 #, c-format msgid "%s: critical error writing /etc/yp.conf\n" msgstr "" -#: ../authconfig.c:840 +#: ../authconfig.c:851 #, c-format msgid "%s: critical error turning on NIS service\n" msgstr "" -#: ../authconfig.c:846 +#: ../authconfig.c:858 #, c-format msgid "%s: critical error with shadow password manipulation\n" msgstr ""