Robert Watson [Fri, 16 Aug 2002 02:14:21 +0000 (02:14 +0000)]
Add LOGIN_SETMAC, which will indicate to the user context management code
that it should also set the user's default MAC label, if available and
permitted.
Obtained from: TrustedBSD Project
Sponsored by: DARPA, NAI Labs
Make mppath and masterpasswd pointers instead of arrays, and initialize
them to point at static strings that contain the default paths. This
makes 'vipw -d' work again (I broke it in rev 1.21; apologies for taking
so long to fix it.)
Spotted by: Olivier Houchard <doginou@cognet.ci0.org>
Sponsored by: DARPA, NAI Labs
This patch explains -F for usershow and groupshow. Because "groupmod
... -F" doesn't do anything, the patch also drops that from groupmod's
command line args.
PR: 35955
Submitted by: Mike DeGraw-Bertsch <mbertsch@radioactivedata.org>
David Malone [Sat, 30 Mar 2002 13:44:45 +0000 (13:44 +0000)]
Minor post warns stuff.
1) Fix up vendor IDs for files I'm touching and put FBSDID in the right place.
2) Cast return value of snprintf to size_t rather than casting sizeof() to
an int, 'cos we know snprintf returns a non-genative number.
3) Avoid 'char *blank = "";' by just strduping. This could be bad sometimes,
but all these variables usually point at malloced memory so this makes
them always point at malloced memory.
Crist J. Clark [Mon, 18 Mar 2002 02:22:53 +0000 (02:22 +0000)]
It was possible for an unprivileged user to tie up the password
information (no one else can vipw(8), chpass(1), or even passwd(1)),
either on purpose or by accident, until an administrator manually
intervened. Instead, do not lock the master.passwd file while a user
is editing his information. But once we go to write the new
information, check that the modified user's information has not
changed in the password database since we started. Abort the changes
if it has.
Yaroslav Tykhiy [Mon, 11 Feb 2002 15:26:20 +0000 (15:26 +0000)]
Found a single point where rmuser(8) wasn't robust to strange
characters in a username: where it was inserted into a regexp.
Fix it by escaping metacharacters in the name with \Q-\E.
The clnt_create(KEYSERVSOCK, CRYPT_PROG, CRYPT_VERS, "unix") hacks
were removed and replaced them with clnt_tp_create, now the af_local
support is fixed.
I also removed the hack how rpcinfo contacted rpcbind, now we can
relay on clnt_tp_create create the client-handle for us. Only
rpcbind itself needs a hardcoded socket-path.
Yaroslav Tykhiy [Mon, 28 Jan 2002 16:37:35 +0000 (16:37 +0000)]
Remove the newly added -force option because it made adduser(8)
less robust to possible errors of the user/admin while adduser(8)
had been intended to minimize their possibility.
An alternative way of introducing strange symbols into usernames
to be committed really soon.
Yaroslav Tykhiy [Wed, 2 Jan 2002 18:54:40 +0000 (18:54 +0000)]
Allow weird characters in usernames if an admin persists on that:
a) Convert all the remaining older Perl system() calls to the new,
more secure LIST format so they are robust to whitespace and
shell metacharacters in their arguments.
b) Add a new option: -force, which allows adding usernames containing
characters that are otherwise illegal.
Add a missing error check. This fixes a bug that would cause pwd_mkdb to
dump core if invoked with an input file that looks like a password file
but isn't (e.g. /etc/group).
Robert Watson [Sat, 15 Sep 2001 16:12:56 +0000 (16:12 +0000)]
o Add a comment noting that the early setting of privileges for the purpose
of NFS home directory and root directory processing fails to include
additional groups. This doesn't impact the final credential, but does
mean that users may be denied login even when additional groups might
allow it.
Use CFLAGS, not COPTS, in the Makefile. bsd.prog.mk conveniently adds
COPTS towards the end of final CFLAGS so that it can be used to
override Makefile and other defaults. Using it in Makefiles risks
having options set using it clobbered when somebody uses it on the
command line.
For new users, create the home directory before sending the welcome
mail, if configured to do so. Some sites have setups where the user's
mail is delivered to their home directory, so sending mail before is
exists didn't work.
Dima Dorfman [Thu, 30 Aug 2001 06:32:17 +0000 (06:32 +0000)]
Unbreak group operations by reverting previous delta which removed the
assignment of `l' in `gr_update' to the return value of snprintf. It
claimed to have fixed the case where snprintf returned -1--in fact, it
broke the entire routine. Not setting `l' here causes fileupdate() to
invariably fail with EINVAL because it does its own check to assert
that the parameter isn't -1.
Guy Helmer [Mon, 30 Jul 2001 16:23:56 +0000 (16:23 +0000)]
The variable giving the name of the temporary password file was
inconsistently named "ptmp" and "etc_ptmp". This commit changes
it to "passwd_tmp" for consistency and to match OpenBSD's name
for the variable.
David E. O'Brien [Fri, 20 Jul 2001 06:20:32 +0000 (06:20 +0000)]
Perform a major cleanup of the usr.sbin Makefiles.
These are not perfectly in agreement with each other style-wise, but they
are orders of orders of magnitude more consistent style-wise than before.
Fix a harmless format string bogon and mark a function as __printflike().
There is still one instance of non-constant format string use inside that
function, but it's hard to fix.
Adrian Chadd [Wed, 2 May 2001 13:20:12 +0000 (13:20 +0000)]
Extend adduser to create "locked" accounts. Adduser can now lock an
account at creation, create accounts with a "*" password (so you can
use alternate authentication schemes without fearing a "default" password
biting you later), and blank passwords.
Yes, adduser could create a blank password account, but this makes it
slightly more difficult to shoot yourself in the foot.
The /etc/adduser.conf entries are:
# use password-based authentication for new users
# defaultusepassword = "yes" | "no"
defaultusepassword = "yes"
# enable account password at creation
# (the password will be prepended with a star if the account isn't enabled)
# defaultenableaccount = "yes" | "no"
defaultenableaccount = "yes"