summaryrefslogtreecommitdiffstats
path: root/pw/pw_conf.c
diff options
context:
space:
mode:
authorDavid Nugent <davidn@FreeBSD.org>1997-01-05 07:15:37 +0000
committerDavid Nugent <davidn@FreeBSD.org>1997-01-05 07:15:37 +0000
commit0dbd2e2a64e789d9d91880a6e9b5322c54384ac0 (patch)
treeb6f86a2dbce41d81b9eb93c5d2d8553354a1bc88 /pw/pw_conf.c
parent4b81d2e23e348ec59138bc968f40b6d2fb3d91ac (diff)
downloadpw-darwin-0dbd2e2a64e789d9d91880a6e9b5322c54384ac0.tar.gz
pw-darwin-0dbd2e2a64e789d9d91880a6e9b5322c54384ac0.tar.zst
pw-darwin-0dbd2e2a64e789d9d91880a6e9b5322c54384ac0.zip
Adds optional NIS passwd file updating and optionally rebuilding
NIS maps. Suggested by: Peter Wemm
Diffstat (limited to 'pw/pw_conf.c')
-rw-r--r--pw/pw_conf.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/pw/pw_conf.c b/pw/pw_conf.c
index 8a0e644..bf93c2a 100644
--- a/pw/pw_conf.c
+++ b/pw/pw_conf.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: pw_conf.c,v 1.1.1.2 1996/12/10 23:59:00 joerg Exp $
+ * $Id: pw_conf.c,v 1.2 1996/12/21 15:35:42 davidn Exp $
*/
#include <string.h>
@@ -40,6 +40,7 @@ enum {
_UC_DEFAULTPWD,
_UC_REUSEUID,
_UC_REUSEGID,
+ _UC_NISPASSWD,
_UC_DOTDIR,
_UC_NEWMAIL,
_UC_LOGFILE,
@@ -81,6 +82,7 @@ static struct userconf config =
0, /* Default password for new users? (nologin) */
0, /* Reuse uids? */
0, /* Reuse gids? */
+ NULL, /* NIS version of the passwd file */
"/usr/share/skel", /* Where to obtain skeleton files */
NULL, /* Mail to send to new accounts */
"/var/log/userlog", /* Where to log changes */
@@ -103,6 +105,7 @@ static char const *comments[_UC_FIELDS] =
"\n# Password for new users? no=nologin yes=loginid none=blank random=random\n",
"\n# Reuse gaps in uid sequence? (yes or no)\n",
"\n# Reuse gaps in gid sequence? (yes or no)\n",
+ "\n# Path to the NIS passwd file (blank or 'no' for none)\n",
"\n# Obtain default dotfiles from this directory\n",
"\n# Mail this file to new user (/etc/newuser.msg or no)\n",
"\n# Log add/change/remove information in this file\n",
@@ -127,6 +130,7 @@ static char const *kwds[] =
"defaultpasswd",
"reuseuids",
"reusegids",
+ "nispasswd",
"skeleton",
"newmail",
"logfile",
@@ -266,6 +270,10 @@ read_userconfig(char const * file)
case _UC_REUSEGID:
config.reuse_gids = boolean_val(q, 0);
break;
+ case _UC_NISPASSWD:
+ config.nispasswd = (q == NULL || !boolean_val(q, 1))
+ ? NULL : newstr(q);
+ break;
case _UC_DOTDIR:
config.dotdir = (q == NULL || !boolean_val(q, 1))
? NULL : newstr(q);
@@ -384,6 +392,10 @@ write_userconfig(char const * file)
case _UC_REUSEGID:
val = boolean_str(config.reuse_gids);
break;
+ case _UC_NISPASSWD:
+ val = config.nispasswd ? config.nispasswd : "";
+ quote = 0;
+ break;
case _UC_DOTDIR:
val = config.dotdir ? config.dotdir : boolean_str(0);
break;