Subject: Re: vipw . how can I use my adduser scrpt?
To: Dale Einarson <dale@me.concordia.ca>
From: Simon Raahauge DeSantis <xiamin@scdesantis.ne.mediaone.net>
List: port-mac68k
Date: 09/02/1998 22:45:06
On Wed, Sep 02, 1998 at 10:14:00PM -0400, Dale Einarson wrote:
> hello,
> 	I have a adduser script that has worked on SGI, DEC and SUN. But I have
> noticed that the passwd file has a master.passwd so I made modifications.
> 
> I run my script and make some entries.
> if I cat passwd ( or master.passwd) the entries are there.
> 	but if I finger or chmod ( chmod is in my script) nothing has worked
> 

I assume from the information here that your script just appeneds the
new entry to the end of master.passwd (or passwd)?

> But if I then, vipw and save ( without editing) my entries from above will
> now work.
> 

According to the vipw man page it uses pwd_mkdb(8) to do the real
magic. I bet the reason things aren't working is that while the
entries might be in the ext files, they're not in the password
database (/etc/spwd.db and /etc/pwd.db).
It looks to me like your script should copy the password file, modify
it, then use pwd_mkdb to install the changed file. Of course, then you
need to deal with race conditions when making the copy to edit. I
don't speak from experience since I do what little adding of users I
need to do by hand. Anyway, the pwd_mkdb(8) man page would be a great
place to start. Or you could wimp out and install addnerd from the pkg
collection. ;)

> is there something I can add to my script?
> 
> 
> < =============================================== >
> Dale Einarson
> =8{>
> 514-843-9358 vox / fax

-- 
-Simon Raahauge DeSantis