Robert Drehmel [Thu, 28 Apr 2005 12:44:02 +0000 (12:44 +0000)]
- Act according to the documentation (man page):
When adding users from a preformatted file, do not exit
silently when empty lines or lines starting with a '#'
are encountered - ignore them instead.
- Fix a spelling error in a comment.
Mike Makonnen [Sat, 28 Aug 2004 14:32:10 +0000 (14:32 +0000)]
Also, match the full path to the special nologin shell.
Previously, it would recognize it as a valid shell only
if the basename (nologin) was specified. Now, it will
recognize both the basename and the full path.
NOTE: The full path as adduser(8) understands it is /usr/sbin/nologin.
There is a symlink, /sbin/nologin, but that's deprecated and
only there for backwards compatibility.
Robert Drehmel [Thu, 17 Jun 2004 10:29:12 +0000 (10:29 +0000)]
Fix a bug which occurred when the home directory given by the
-d option was equal to the one already saved and which caused
the pw utility to avoid updating values passed by other options
processed before the -d option in the code path.
Bring the description for login_getclassbyname in sync with the function's
arguments. The function has as a second argument a struct passwd * pointer,
not a directory name.
Tom Rhodes [Tue, 30 Mar 2004 22:31:22 +0000 (22:31 +0000)]
Fix today's faux pas by:
Removing the -compact option passed to .Bl macro to avoid useless .Pp macros;
Adding a missing period;
Using .Xr with .Nd since makewhatis(1) has no support for cases where the Xref is absent.
Mike Makonnen [Tue, 16 Mar 2004 13:46:29 +0000 (13:46 +0000)]
o Add an -S option to not attempt to ascertain the validity of a shell.
o Add a -D option to not attempt to create the home directory.
o Treat the /nonexistent home directory specially. It means the user has
no home directory and it should not be created.
o Update Copyright year and my email.
Ken Smith [Mon, 8 Mar 2004 20:31:37 +0000 (20:31 +0000)]
Shift file locking to source file instead of temp file. This fixes
data buffering issue that corrupts files if two pw(8)'s run at the
same time as well as changing pw(8) so it uses the same locking
mechanism as PAM, vipw(8), pwd_mkdb(8), etc.
Remove unused includes. Make it WARNS=6 friendly. Concerning bin/2442, make
a new function dup_shell() to replace ok_shell() and make it unconditionnally
strdup() its result to make the caller's code simplier. Change ok_shell() to
just return an integer value suitable for tests (it was used mainly for that
purpose). Do not use strdup() in the caller's code but rely on dup_shell()
that will do the job for us.
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