[comp.unix.questions] Help needed: /etc/dialups and /etc/d_passwd

lyndon@ncc.UUCP (Lyndon Nerenberg) (03/18/87)

Could some kind person please mail me a description of how
the /etc/dialups and /etc/d_passwd files work with login(1).

It's in our binaries, but not documented (sigh). Note this is
on a Convergent S/320 under CTIX 5.11 (aka SVR2).

(While I'm at it, syntax for the 'pri=' field in /etc/passwd
would be nice too).

Thanks.
--
  Lyndon Nerenberg - Nexus Computing Corporation - lyndon@ncc.UUCP
 
(calgary,ubc-vision,vax135,watmath,seismo!mnetor)!alberta!ncc!lyndon
                (bellcore,pyramid,winfree)!ncc!lyndon

guy%gorodish@Sun.COM (Guy Harris) (03/18/87)

>Could some kind person please mail me a description of how
>the /etc/dialups and /etc/d_passwd files work with login(1).

From the S5R2 source:

"/etc/dialups" contains the names of dialup ports.  Trailing white
space is stripped from the beginning of the line.  Each line is the
name of a file in "/dev" representing the device for that port, e.g.

	/dev/tty12
	/dev/tty13

Iff the port being logged in on is in this file, it does
dialup-password checking.

"/etc/d_passwd" contains the names of login shells and the password
to be used on dialup ports if your login shell is that shell.  The
two fields are separated by colons, e.g.

	/bin/sh:1zLyW3ayhXlqc
	/bin/csh:1zLyW3ayhXlqz
	/usr/data_entry/mainscreen:1zLyW3ayhXlqw

If it finds your shell in here, the matching password is used;
otherwise, the password for "/bin/sh" is used.  It prompts you with
"Dialup Password:" and requires you to type in the password; dialup
passwords are encrypted in "/etc/d_passwd" in the same way that
account passwords are encrypted in "/etc/passwd".

If there is no password for your shell or "/bin/sh", it may go off the
deep end, using garbage from the stack.  This is fixed in S5R3.

>It's in our binaries, but not documented (sigh).

It's not documented in any obvious place in the S5R3 documentation.
The people maintaining this code should either empty their lower
digestive tract or remove themselves from the commode; document it or
nuke it!

>(While I'm at it, syntax for the 'pri=' field in /etc/passwd
>would be nice too).

If the "GECOS" field in the password database begins with "pri=",
it should be followed by a number, which may be signed.  That number
is used as an argument to "nice".  The first non-numeric character
terminates the priority value, so something like

	pri=5 Joe Blow

could be put there.  Note, however, that not every program that
parses the GECOS field knows about this, so you could end up with
mail or netnews articles being

	From: jblow (pri=5 Joe Blow)

Also note that this checking of the GECOS field is done *in the loop
where it prompts you for your login name and password*.  This seems bogus,
because:

	1) It interprets the field before it even determines whether
	   the login is valid or not.  This means that if you first
	   try to log in as somebody other than yourself, "login" first
	   applies that person's "nice" to itself.

	2) It does this before you've started to log in, so a very
	   high "nice" could slow you down while it's validating your
	   password.

	3) It does this each time before it prompts you for your
	   password; since "nice" values are additive, this means
	   that it doesn't "forget" what it did if you tried to log
	   in as somebody else but got the password wrong.

This is fixed in S5R3; anybody with an unfixed version who has source
should fix this.

guy%gorodish@Sun.COM (Guy Harris) (03/19/87)

In article <15221@sun.uucp>, guy%gorodish@Sun.COM (Guy Harris) writes:

> Trailing white space is stripped from the beginning of the line.

which should teach him not to drink and post at the same time... (just
kidding).

The first white space character on the line (blank, tab, newline),
and everything following it, is deleted from the line.  I guess you
can use that to put in comments....