Peter Wemm [Sun, 26 Oct 2003 03:51:47 +0000 (03:51 +0000)]
(mostly) Clean up some const warnings here. The code takes some liberties
because it is the originator of various const strings and knows that they
came from malloc.
Apply the correct fix for bin/50679: don't mess around with process groups
or the tty, just block selected signals in the parent like system(3) does.
Many thanks to bde for his assistance in finding the correct solution.
Band-aid for the "^C kills the editor" problem. I haven't yet found the
proper way to fix this. The way this works is to prepend "exec " to
the editor command to eliminate the "shell in the middle" which prevents
us from properly reawakening the editor after a SIGTSTP.
Mike Makonnen [Wed, 19 Mar 2003 08:07:15 +0000 (08:07 +0000)]
o initialize a couple of local flags so the user can re-edit groups
next time the subroutine is re-entered
o s/configrun/configflag/
o Make the prompt make sense if the user was creating a configuration file
Mike Makonnen [Sun, 9 Feb 2003 18:29:09 +0000 (18:29 +0000)]
Revisit the shell special characters issue and settle it once-and-forall.
All characters will be accepted, and pw(8) can sort out which ones it
will allow and which ones it won't.
Approved by: markm (mentor)
Prodded by: Philippe Bourcier <philippe@cyberabuse.org>
Adrian Chadd [Sat, 8 Feb 2003 08:04:53 +0000 (08:04 +0000)]
Change the behaviour of adduser to match the previous incarnation a little more.
If any of the given groups do not exist complain and let the user try again.
This saves the user from discovering at the end of the process that they've
forgotten to add a group or they've typoed.
Thanks to cmc/dougb for pointing out how bad my sh fu actually is.
Changes so the 'pw' command will allow '$' as the last character in a userid
or group name (mainly for the benefit of samba). This pretty much rewrites
he pw_checkname() routine, but should work exactly the same except for the
above change, and that error messages are somewhat more informative.
PR: 28733 46890
Inspired by: example patch written by Terry Lambert
Reviewed by: no objections on freebsd-arch and freebsd-current
MFC plans: no plans, but will do if people want it in stable.
Max Khon [Thu, 23 Jan 2003 20:07:40 +0000 (20:07 +0000)]
- restore an ability to write log of added users (default to
/var/log/adduser, disabled if empty or adduserlog="no")
- do not ask for password in configure mode
- print $passwdtype instead of password in configure mode
- add DATECMD, GREPCMD (not overridable but with full path)
Tony Finch [Fri, 8 Nov 2002 22:04:31 +0000 (22:04 +0000)]
Clarify the unique groups scheme by mentioning that the 002 umask
is instead of the usual 022 umask, and explain that what the scheme
still prevents is unwanted changes, not prying eyes.
While I'm here, mess with the phrasing and line-breaks a bit.
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.