From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,117505c236239773 X-Google-Attributes: gidfee84,public From: Todd Aven Subject: Re: putting passwords in auth.db Date: 1996/10/09 Message-ID: <325C1BEB.3CE6@BankersTrust.Com>#1/1 X-Deja-AN: 188345673 references: content-type: text/plain; charset=us-ascii organization: Bankers Trust Company mime-version: 1.0 newsgroups: comp.unix.osf.osf1 x-mailer: Mozilla 3.0 (WinNT; I) Steve VanDevender wrote: > Has anyone successfully used the getprpwent()/putprpwent() routines to > manipulate the auth.db database, or have other experience relevant to > using or converting shadow passwd files to work under Digital UNIX? I have used getprpwent() for things like ftp, pop, and imap servers that need to authenticate clients against the Digital Unix Enhanced Security authentication database. I've not had any real difficulties with this routine. I don't recall if I've used putprwent(), but I definitely have *not* used it to *create* accounts. For creating accounts, I wrote a perl script. The core of the script creates the (v3.x) protected password entry. It would seem trivial for a reasonably accomplished perl programmer to modify it to clone non-Digital password entries for use on a Digital Unix box. However, there is no guarantee that this approach doesn't compromise the integrity of the authentication subsystem! Below are two snippets of the code, the first for creating the /etc/passwd entry, and the second for creating the authentication database entry. The second snippet needs to be revised slightly to support v4.x, where you must use /tcb/bin/edauth to inject the new entry into the authentication database instead of creating the file directly. That is a trivial exercise in piped commands. Regards, Todd printf PTMP "$username:*:$new_uid:$new_gid:$fullname:$new_dir:$new_shell\n"; # Create the protected password entry $first = substr($username,0,1); $authfile = "/tcb/files/auth/$first/$username"; open(AUTH, ">/tcb/files/auth/$first/$username"); print AUTH "$username:u_name=$username:u_id#$new_uid:\\\n"; print AUTH "\t:u_pwd=$encrypted_password:\\\n"; print AUTH "\t:u_lock\@:\\\n"; print AUTH "\t:chkent:\n"; close(AUTH); chown 6, 11, $authfile; # TODO - get 'auth:auth' numbers from files! chmod(0660,$authfile);