the environment. This allows big ID warnings to be suppressed for
vipw and chpass as well.
Since the environment variable test is only performed for callers
of pw_scan() that do not set pw_big_ids_warning, the test can still
be overriden. Currently, chpass and pwd_mkdb are the only users
of pw_scan() and neither of them overrides the environment variable
test.
the uid arg to use_yp() was getting clobbered by the call to my_yp_match().
This led to a problem where a NIS user could edit root's passwd information.
o main returns int not void
o use return 0 at end of main when needed
o use braces to avoid potentially ambiguous else
o don't default to type int
o #ifdef 0 -> #if 0
Reviewed by: obrien and chuckr
Instead, treat the inability to retrieve a record from the server as a
match failure and let things take its course.
Part of the problem here is that NIS _is_ turned on, however the master
server is actually not an NIS server: it's an NIS+ server. And the client
is bound to an NIS+ replica server that's running in YP compat mode.
The code which tries to figure out of the user is local or NIS gets
confused by this.
to "Office Location:" to disambiguate what is expected. Add a note
to the man page to indicate that the office location and office phone
fields are concatenated and printed with the heading "Office:" by
finger(1). Swap the order of the home and office phone fields in the
man page to match the order of the fields in the editor.
If any programs interact with chpass(1) and expect "Location:" instead
of "Office Location:" as the prompt, either this change will have to be
reverted or the other programs will have to be changed.
PR: docs/7533
Update chpass(1) manual page. Change the definition of the class
field and also reorganize the field list to match that of the
/etc/master.passwd file, to avoid confusion.
Add functionality for support for more than 4 subfields within gcos. chsh,
chpass etc did not parse beyond the 4th field previously and so truncated
gcos on updating the database.
(I'm not sure why this happens, though I suspect it may be because
the server is configured with only passwd maps instead of both passwd
and master.passwd maps. This is allowed, but I think in this case
pw_class is left NULL, hence the problem.)
Also applied similar patch to chpass/pw_yp.c just for paranoia's sake.
on chpass & passwd and turn the links into individual files
with the schg flag set, make install will fail to install all
of the proper links.
Fixed by removing the schg flag on all of the links before installing.
Closes PR# 2040.
Submitted by: Ph. Charnier <charnier@xp11.frmug.org>
This will make a number of things easier in the future, as well as (finally!)
avoiding the Id-smashing problem which has plagued developers for so long.
Boy, I'm glad we're not using sup anymore. This update would have been
insane otherwise.
an auto stack variable that was about to disappear. It broke with some
nis passwd changes because of a gethostbyname() call that uses a fair bit
of stack.. This was a timebomb waiting to go off at any time and could
have been causing subtle corruption for a while.
AARGH!!
This is HIGHLY reccomended for 2.2 and presumably 2.1.6
enabled in /etc/master.passwd & friends. This allows the 'USER_YP_AND_LOCAL'
case to make a more sensible guess (if NIS is enabled, default to NIS,
otherwise default to local -- this is better than defaulting to NIS
all the time).
from a script as if it was done in the interactive editor.
When reassembling the gecos string, trim any excess trailing commas, they
look ugly in the passwd file. :-)
Have a simple Makefile tweak to prevent mortal users from changing their
fullname. As ISP's we have seem some real bizzare stuff here..
When decoding the change/expire string, allow the month number as a
synonym for the name of the month.. (ie: 1 as well as Jan or January)
Note that using numbers means there's a chance that you can get bitten
if you're not used to the American DD-MM-YY order.
option to pwd_mkdb and adding this option to utilities invoking it.
Further, the filling of both the secure and insecure databases has been
merged into one loop giving also a performance improvemnet.
Note that I did *not* change the adduser command. I don't read perl
(it is a write only language anyway).
The change will drastically improve performance for passwd and
friends with large passwd files. Vipw's performance won't change.
In order to do that some kind of diff should be made between the
old and new master.passwd and depending the amount of changes, an
incremental or complete update of the databases should be agreed
upon.
is available before trying to go hunting for a domain name. This fixes
the following problem: you have +::::::::: in /etc/master.passwd but
NIS isn't running (no ypbind, no domain name set) -- passwd and chpass
will still try to change an NIS password instead of the local one.
shell to one of the following:
- a non-existent file
- a non-regular file
- a file without any execute bits set
The shell is still set to whatever they entered even if the above
conditions exist (hey, it is the super user doing this after all :-),
but this might give the admin. some warning that they are about to screw
themselves and give them a chance to fix it before it is too late.
Inspired by: some new FreeBSD user on USENET who set his root shell
to a shell that doesn't exist and now can't gain access to root (don't
worry, I sent him some mail on how to recover from this).
a master server and initialize the suser_override flag, but in a non-NIS
environment is should be smart enough to just leave the flag cleared
and return (unless forced with a command-line argument like -y).
Otherwise, it will return an NIS-related error even if NIS isn't
turned on.
Pointed out by: ache