Brad Davis
ecc3c92f90
Replace the pw(1) calls with a variable, to make it easier to to change across all the tests as needed.
...
Reviewed by: will
2014-11-19 23:07:46 +00:00
Simon J. Gerraty
9268022b74
Merge from head@274682
2014-11-19 01:07:58 +00:00
Brad Davis
f3bcbf2399
Clean up some language
...
Reviewed by: will
2014-11-17 15:44:00 +00:00
Brad Davis
45ba9627e4
Add a test for locking and unlocking user accounts
...
Submitted by: Robert O'Neil <oneil.rs@gmail.com>
Reviewed by: will
2014-11-15 05:12:30 +00:00
Baptiste Daroussin
90edef4fe0
Fix wrong message when using pw -V with a non existent directory
...
Add a regression test about it
PR: 194971
Submitted by: Freddy DISSAUX <bugzilla@dsx.bsdsx.fr>
2014-11-12 22:27:53 +00:00
Enji Cooper
e5f33ae3e7
Require root when running the pw_delete and pw_modify test programs (pw(8)
...
requires it)
2014-11-03 09:26:39 +00:00
Enji Cooper
bf1e083e01
Integrate usr.sbin/useradd/t_useradd.sh from NetBSD into FreeBSD as pw_test
...
- Suffix useradd/userdel commands with pw
- Remove the atf_expect_fail for bin/39546
Phabric: D921
Reviewed by: brd
Sponsored by: EMC / Isilon Storage Division
2014-11-03 06:07:55 +00:00
Baptiste Daroussin
6e6c53f063
Fix renaming a group via the gr_copy function
...
Add a regression test to pw(8) because the bug was discovered via using:
pw groupmod
PR: 187189
Reported by: mcdouga9@egr.msu.edu
Tested by: mcdouga9@egr.msu.edu
Patch by: Marc de la Gueronniere
2014-10-28 16:27:29 +00:00
Baptiste Daroussin
0def1c7441
Ensure pw userdel -u <invalid> do not try to remove root
...
Check the uid passed is actually a number as early as possible
MFC after: 1 week
2014-10-28 15:46:22 +00:00
Baptiste Daroussin
3b640d6bfc
Fix atf syntax
2014-10-28 15:33:15 +00:00
Baptiste Daroussin
156ebc2878
Do not delete the group wheel when bad argument is passed to pw groupdel -g
...
Check that the -g argument is actually a number, if not report an error.
This argument is converted without checking with atoi(3) later so without this
check it converts any alpha entries into 0 meaning it deletes the group wheel
Add a regression test about it
PR: 90114
Reported by: bkoenig@cs.tu-berlin.de
MFC after: 1 week
2014-10-28 14:54:04 +00:00
Baptiste Daroussin
6697d7663b
Fix a regression in pw usermod -G list
...
The user was perperly adding the to different groups from "list" but was not
removed from the other groups it could have belong to.
While here add a regression test about this bug
PR: 185666
Reported by: sub.mesa@gmail.com
MFC after: 1 week
2014-10-28 14:19:17 +00:00
Baptiste Daroussin
fb7830888d
When a group is renamed then the group has been invalidated for sure.
...
In that case get the group information using the new name.
Add a regression test about this bug
PR: 193704
Reported by: az
2014-10-28 11:20:30 +00:00
Dag-Erling Smørgrav
25f5ad760c
Two more places where login_setcryptfmt() defaults to MD5 were missed
...
in r252688.
MFC after: 3 days
2014-10-09 17:39:11 +00:00
Brad Davis
4630309ca3
- Add some tests for modifying groups
...
Reviewed by: will
2014-10-06 00:16:23 +00:00
Brad Davis
a85f6c3043
- Add a test for bug 191427 where pw(8) will go into an infinite loop
...
Reviewed by: will
MFC after: 1 month
2014-10-02 19:53:37 +00:00
Simon J. Gerraty
ee7b0571c2
Merge head from 7/28
2014-08-19 06:50:54 +00:00
Mateusz Guzik
75ad9daa46
pw: fix up deletion of users from groups
...
Previuosly given 'foo,bar' members, removing 'foo' would result in an
infinite loop.
PR: 191427
Submitted by: Voradesh Yenbut <yenbut cs.washington.edu>
MFC after: 1 week
2014-06-27 18:51:19 +00:00
Baptiste Daroussin
b425ee4eb7
Fix changing the username
...
PR: 189172
Submitted by: fullermd@over-yonder.net
MFC after: 1 week
2014-06-20 10:38:08 +00:00
Baptiste Daroussin
113f96dd0b
Removed compatibility with pre FreeBSD 2.2 pw_mkdb command
...
Fix some broken indentattion
PR: 189173
Submitted by: fullermd@over-yonder.net
MFC after: 1 week
2014-06-20 10:34:32 +00:00
Simon J. Gerraty
fae50821ae
Updated dependencies
2014-05-16 14:09:51 +00:00
Simon J. Gerraty
76b28ad6ab
Updated dependencies
2014-05-10 05:16:28 +00:00
Simon J. Gerraty
3b8f084595
Merge head
2014-04-28 07:50:45 +00:00
Baptiste Daroussin
c145c34c09
Simplify reading pw.conf(5) by using getline(3)
2014-04-22 21:07:56 +00:00
Devin Teske
933db55545
Fix pw(8) deletion of group "username" on userdel even if group "username"
...
is not associated with user "username". E.g., user "foo" has primary group
"wheel" and is unassociated with group "foo", yet userdel would delete the
group "foo" when deleting user "foo" (despite the fact that user "foo" is
not associated with group "foo" in any way).
Patch committed with minor style(9) changes.
PR: bin/169471
Submitted by: Alexander Pyhalov <apyhalov@gmail.com>
2014-03-13 18:16:42 +00:00
Julian Elischer
bbd054cb33
Part 2 of bug 187310.. had to commit separately due to local confusion.
...
Don't let pw crash when give certain input.
PR: 187310
Submitted by: Kim Shrier
MFC after: 1 week
2014-03-06 19:58:03 +00:00
Julian Elischer
5691bbf05d
Stop pw(8) from segfaulting when given certain input
...
PR:187310
Submitted by: Kim Shrier
Obtained from: bug
MFC after: 1 week
2014-03-06 19:26:08 +00:00
Simon J. Gerraty
d1d0158641
Merge from head
2013-09-05 20:18:59 +00:00
Dag-Erling Smørgrav
d28832a05e
Fall back to sha512 if passwd_format is not set.
...
MFC after: 3 days
2013-07-04 07:59:11 +00:00
Dag-Erling Smørgrav
a05aa38cb1
There is no reason to disallow setting the password or account expiry
...
date to the current date.
MFC after: 3 days
2013-07-03 09:48:24 +00:00
Tim Kientzle
1d47232e08
Fix -Wunsequenced warning
...
Submitted by: dt71@gmx.com
2013-06-29 15:54:17 +00:00
Joel Dahl
37b983c09b
mdoc sweep
2013-05-13 18:13:50 +00:00
Simon J. Gerraty
7cf3a1c6b2
Updated dependencies
2013-03-11 17:21:52 +00:00
Simon J. Gerraty
f5f7c05209
Updated dependencies
2013-02-16 01:23:54 +00:00
David E. O'Brien
d9a447559b
Sync with HEAD.
2013-02-08 16:10:16 +00:00
Daniel Eischen
605e5bbc41
Prevent a null pointer dereference in pw userdel when deleting
...
a user whose group != username.
2013-02-01 05:19:49 +00:00
Eitan Adler
535460c7dc
Remove unused variables
...
Approved by: cperciva
MFC After: 3 days
2013-01-16 05:03:49 +00:00
Mateusz Guzik
1f09eec3f8
pw: free group returned by gr_add
2013-01-06 21:56:58 +00:00
Baptiste Daroussin
b3075010f8
Simplify vnextgrent and vnextpwent reusing pw_scan and gr_scan from libutil.
2012-12-27 19:43:29 +00:00
Baptiste Daroussin
0c50344969
Fix a regression in "pw group show" introduced r242349:
...
print a newline after printing each group line.
PR: bin/174731
Submitted by: Jan Beich <jbeich@tormail.org>
2012-12-27 14:44:13 +00:00
Baptiste Daroussin
460a6dac0b
Simplify the code by using the new gr_add function
2012-12-27 14:35:06 +00:00
Baptiste Daroussin
ae61f4dda6
Simplify copying of group members by using memcpy
...
Submitted by: Christoph Mallon <christoph.mallon@gmx.de>
2012-12-26 23:16:24 +00:00
Baptiste Daroussin
c195c1ba19
Fix off-by-one error in memory allocation: j entries, one new and a null
...
terminator is j + 2.
Submitted by: Christoph Mallon <christoph.mallon@gmx.de>
2012-12-26 23:14:33 +00:00
Baptiste Daroussin
0083d61abc
In case of the deletion of a user those whole database has to be regenerated,
...
otherwise the user planned to be deleted remain in the pwd.db while removed from
the plain text password file.
2012-12-26 18:28:17 +00:00
Baptiste Daroussin
dc0f2b4217
Fix creating a user and adding it to a group
...
Reported by: "Sam Fourman Jr." <sfourman@gmail.com>, dim
2012-12-26 18:14:45 +00:00
Eitan Adler
fa65b91ab3
Simplify string duplication: use strdup instead of malloc + strcpy
...
Submitted by: db
Approved by: cperciva
MFC after: 2 weeks
2012-12-05 13:56:56 +00:00
Eitan Adler
dae7204032
Avoid overflowing the file buffer
...
Submitted by: db
Approved by: cperciva
MFC after: 2 weeks
2012-12-05 13:56:52 +00:00
Eitan Adler
91d073903e
Use strdup instead of malloc + strcpy
...
Submitted by: db
Approved by: cperciva
MFC after: 2 weeks
2012-12-05 13:56:49 +00:00
Eitan Adler
6c3c59886c
Avoid overflow of file buffer
...
Submitted by: db
Approved by: cperciva
MFC after: 2 weeks
2012-12-05 13:56:46 +00:00
Eitan Adler
61fd27bb3b
Remove useless check for NULL prior to free.
...
Approved by: cperciva
MFC after: 2 weeks
2012-12-05 13:56:43 +00:00
Baptiste Daroussin
4efe6c741d
In NIS mode first chmod(2) the temporary file and is succeed then rename(2)
2012-11-20 14:05:46 +00:00
Baptiste Daroussin
7a43850530
Correctly set the password file mode after renaming in NIS mode
2012-11-20 10:59:41 +00:00
Simon J. Gerraty
23090366f7
Sync from head
2012-11-04 02:52:03 +00:00
Baptiste Daroussin
fb2db03194
Teach pw(8) about how to use pw/gr API to reduce code duplication
...
MFC after: 2 months
2012-10-30 08:00:53 +00:00
Baptiste Daroussin
e7e5ec8773
Do not treat empty name as an uid 0
...
Reported by: Robert Bonomi <bonomi@mail.r-bonomi.com>
2012-10-01 17:00:33 +00:00
Baptiste Daroussin
e6e9c14bdf
Remove useless atoi(3), previous strspn(3) makes sure that a_name->val is a
...
number.
This also allow pw user show to work as expected.
PR: bin/172112
Submitted by: "Ilya A. Arkhipov" <rum1cro@yandex.ru>
MFC after: 1 month
2012-10-01 16:42:07 +00:00
Kevin Lo
ba670ce023
Make sure that each va_start has one and only one matching va_end,
...
especially in error cases.
2012-09-28 07:51:30 +00:00
Marcel Moolenaar
7750ad47a9
Sync FreeBSD's bmake branch with Juniper's internal bmake branch.
...
Requested by: Simon Gerraty <sjg@juniper.net>
2012-08-22 19:25:57 +00:00
Kevin Lo
29dcf726d2
Handle NULL return from crypt(3). Mostly from DragonFly
2012-02-22 06:27:20 +00:00
Kevin Lo
76a387fbba
readlink len-1
2012-02-14 10:17:03 +00:00
Ulrich Spörlein
3df5ecac8c
Spelling fixes for usr.sbin/
2011-12-30 10:58:14 +00:00
Eitan Adler
19e1bf2997
- document the -l option to usermod
...
PR: docs/161588
Submitted by: "Luchesar V. ILIEV" <luchesar.iliev@gmail.com>
Approved by: gjb
MFC after: 1 week
2011-12-22 03:36:54 +00:00
Dimitry Andric
5893527d84
In usr.sbin/pw/pw_user.c, use the correct printf length modifier for a
...
ptrdiff_t.
MFC after: 1 week
2011-12-17 23:46:47 +00:00
Xin LI
cfc3f46787
Backout r223115 which potentially caused a POLA violation, by restoring
...
historic behavior (create the default base directory in pw.conf) before
I came up with a better fix for this.
Requested by: nwhitehorn
Approved by: re (kib)
2011-07-31 03:00:00 +00:00
Xin LI
6a635ff4b4
Don't attempt to create the base directory when -d is specified.
...
MFC after: 1 month
2011-06-15 19:09:58 +00:00
Jung-uk Kim
644af48df6
Stop hard-coding default directory mode as 0777.
2011-03-08 20:13:29 +00:00
Jung-uk Kim
110df1daa0
Do not let pw.conf(5) or -M option affect creation of basehome, e.g., /home.
...
When the basehome does not exist, it creates all intermediate directories as
required, which is logically equivalent to mkdir(1) with -m and -p options.
However, it modifies all intermediate directories, not just the final home
directory unlike mkdir. This problem was introduced in two revisions, i.e.,
r1.59 (SVN r167919) and r1.60 (SVN r168044).
MFC after: 1 month
2011-02-04 19:49:02 +00:00
Ulrich Spörlein
0d9deed52c
mdoc: drop redundant .Pp and .LP calls
...
They have no effect when coming in pairs, or before .Bl/.Bd
2010-10-08 12:40:16 +00:00
Jung-uk Kim
85a3024411
Revert the unrelated patch crept in the previous commit.
2010-10-05 18:47:51 +00:00
Jung-uk Kim
e116381d02
Prefer pmap_unmapbios() over pmap_unmapdev(). The binary does not change
...
after this because pmap_unmapbios() is a macro for pmap_unmapdev() on amd64.
2010-10-05 18:38:23 +00:00
Ed Schouten
71ccf09269
The last big commit: let usr.sbin/ use WARNS=6 by default.
2010-01-02 11:07:44 +00:00
Ed Schouten
41d6f23028
Make pw(8) build without <utmp.h>.
...
The size of the username record in utmp files should not influence the
maximum username length. Right now ut_user/ut_name is big enough, so in
this case it's dead code anyway.
2009-12-06 01:27:28 +00:00
Andrey A. Chernov
f70f5c2077
Use arc4random_uniform() to avoid "modulo bias"
...
Remove pw_getrand() unneded now: arc4random_uniform() is stronger then
pw_getrand()'s MD5 tricks (inactive) and its active version, mixing
arc4random() bytes in one, not make things better at all.
2008-08-16 15:41:03 +00:00
John Baldwin
c746f22dea
Before updating the password database, the pw(8) utility first performs a
...
sanity check by invoking "pwd_mkdb -C". However, if this failed it
silently returned success. Fix this so it fails the update operation
instead.
MFC after: 1 week
2008-07-17 13:47:59 +00:00
Antoine Brodin
e8e8c216d0
- Increase the size of the salt in pw(8) from 8 to 32 (same as in pam_unix(8)).
...
This makes blowfish password hashes look normal when set using
pw(8)/adduser(8). [1]
- Make it possible to have a '/' in the salt.
PR: 121146 [1]
Submitted by: Jaakko Heinonen [1]
Approved by: rwatson (mentor)
MFC after: 1 month
2008-05-27 19:04:31 +00:00
Sean Farley
bc991a6d5f
Add the groupmod '-d' option to pw to allow the deletion of existing users
...
from a group without the need to perform the same operation by replacing
the existing list via the '-M' option. The '-M' option requires someone
to fetch the existing members with pw, deleting the undesired members from
the list and sending the altered list back to pw.
Approved by: wes (mentor)
MFC after: 5 days
2008-02-23 01:25:22 +00:00
Sean Farley
72d1b828b3
style(9) (verified no object changes)
...
Approved by: wes (mentor)
MFC after: 5 days
2008-02-23 01:17:42 +00:00
Mike Makonnen
40ab104eaa
Clarify in what formats the grouplist for the '-G' switch may be accepted.
...
Submitted by: Eygene Ryabinkin <rea-fbsd@codelabs.ru>
2008-01-25 15:54:14 +00:00
Lukas Ertl
1b692a8c44
Do the right thing with symlinks in the skeleton directory.
...
PR: bin/63659
2007-03-30 13:18:52 +00:00
Lukas Ertl
e57f8ca5cd
Accept passwords which contain whitespace.
...
PR: bin/53434
2007-03-30 12:57:25 +00:00
Lukas Ertl
85204142eb
Add home directory creation mode to pw.conf(5) and be a bit
...
more specific about the effect of the current umask on -M.
2007-03-30 11:23:10 +00:00
Lukas Ertl
1dd634b049
Add -M argument to usage() output.
2007-03-30 10:02:47 +00:00
Lukas Ertl
eebbeceec9
Introduce the new option -M to allow to set the permissions of
...
the user's newly created home directory. If omitted, it's derived
from the current umask.
PR: bin/16880, bin/83253 (partially), bin/104248
MFC in: 1 month
2007-03-26 23:29:20 +00:00
Tom Rhodes
fd59f59ae3
Better mdoc(7). Bump doc date.
...
Kicked by: ru
2006-10-09 19:01:02 +00:00
Tom Rhodes
31e224dd37
Note the naming convention of files in share/skel and explain the "dot"
...
prefix is removed.
PR: 103828
2006-10-09 17:57:40 +00:00
Maxim Konovalov
04cfd91b6a
o Fix groupadd getopt line and make 'pw groupadd -o' work.
...
PR: bin/100684
Submitted by: Devon H. O'Dell
MFC after: 3 weeks
2006-09-18 14:00:39 +00:00
Pawel Jakub Dawidek
49630c2335
Change /home symbolic link, so it will point to usr/home instead of /usr/home.
...
Previous symlink was confusing:
# cd /jails/virtual_system_1/home
# realpath .
/usr/home
...and slower.
OK'ed by: rwatson, phk
2005-07-31 08:25:53 +00:00
Stefan Farfeleder
18b51f792f
Remove unused variables.
2005-04-09 14:59:10 +00:00
Stefan Farfeleder
3ce1d6bb59
The variable `arglist' has internal linkage in pw.c, don't declare it as extern
...
here.
2005-02-10 09:05:27 +00:00
Ruslan Ermilov
59a3c79da6
Sort sections.
2005-01-18 20:02:45 +00:00
Ruslan Ermilov
a866e17077
Added the EXIT STATUS section where appropriate.
2005-01-17 07:44:44 +00:00
Stefan Farfeleder
2475565a7a
Don't rely on NULL being a pointer, add a cast before passing it to a variadic
...
function.
2004-10-03 14:40:27 +00:00
Ruslan Ermilov
07bfccd71e
Mechanically kill hard sentence breaks.
2004-07-02 23:13:00 +00:00
Robert Drehmel
b8938b667e
Use strlcpy(3) to replace the idiomatic
...
strncpy(d, s, l);
d[l - 1] = '\0';
statements.
2004-06-17 14:07:16 +00:00
Robert Drehmel
1040317076
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.
Spotted by: Richard Caley <rjc@interactive.co.uk>
2004-06-17 10:29:12 +00:00
Ken Smith
fc1007e186
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.
PR: bin/23501
Submitted by: Alex Kapranoff <alex (at) kapran (dot) bitmcnit (dot) bryansk (dot) su>
Approved by: rwatson (mentor)
MFC after: 5 days
2004-03-08 20:31:37 +00:00
Ian Dowse
87d6b5caf6
Add a -H <fd>' option that is like
-h <fd>', but accepts an already
...
encrypted password on the specified file descriptor.
PR: bin/22033
MFC after: 2 weeks
2004-01-11 18:28:08 +00:00
Ruslan Ermilov
fe08efe680
mdoc(7): Use the new feature of the .In macro.
2003-09-08 19:57:22 +00:00
Philippe Charnier
860f0df364
The .Xr utility. Spelling. Put NIS under .Tn
2003-06-08 14:28:38 +00:00
Tom Rhodes
0603fbc3ae
Add information about the log file.
...
PR: 35575
Submitted by: "Simon L. Nielsen" <simon@nitro.dk> (original version)
2003-05-08 00:28:36 +00:00
David E. O'Brien
052238b16c
style.Makefile(5)
2003-04-04 17:49:21 +00:00
Andrey A. Chernov
c6c9094f0c
There is no sense to use random random() and arc4random() in the same program.
...
Switch to arc4random() completely.
2003-02-11 02:17:11 +00:00
Garance A Drosehn
84a0950aea
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.
2003-01-28 01:21:57 +00:00
Max Khon
41a1582349
Do not expose password if it is empty and PWF_STANDARD format is requested
...
MFC after: 1 week
2003-01-23 19:51:48 +00:00
Ruslan Ermilov
8d5d039f80
Uniformly refer to a file system as "file system".
...
Approved by: re
2002-12-12 17:26:04 +00:00
Philippe Charnier
490d5836b5
The .Nm utility
2002-07-14 14:47:15 +00:00
Alfred Perlstein
379e7b73a6
de-__P()
2002-07-11 19:07:35 +00:00
Dima Dorfman
d5a3b1ed7d
Lists follow a colon, not a semicolon.
2002-06-30 04:51:04 +00:00
SADA Kenji
f587582238
`pw useradd' could be used with -w without -D option.
...
PR: docs/39770
Submitted by: sada
Approved by: dd
2002-06-26 05:09:12 +00:00
David Malone
9836536581
Print a long with %ld not %d. (We possibly should be using %j here, but
...
that can be fixed when the many other warnings here are being fixed.)
PR: 39741
Submitted by: Dan Lukes <dan@obluda.cz>
MFC after: 1 week
2002-06-24 11:33:17 +00:00
Dima Dorfman
466c257c1f
In the words of the submitter:
...
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>
2002-04-05 08:39:31 +00:00
Dima Dorfman
4731d0764a
Document the -7 option for usershow.
...
PR: 36735
Submitted by: Mike DeGraw-Bertsch <mbertsch@radioactivedata.org>
2002-04-05 08:31:17 +00:00
Giorgos Keramidas
16b4ad5200
Merge a duplicate description of the -L option into the first one.
...
PR: docs/34782
MFC after: 1 week
2002-03-08 00:36:36 +00:00
Jacques Vidrine
2b0dfba578
Use correct mode for temporary file.
...
Reported by: ryan beasley <ryanb@goddamnbastard.org>
2001-12-20 16:03:04 +00:00
Andrey A. Chernov
b84320f22e
Change rmskey() to rmopie() - we don't have skey anymore
2001-10-19 10:45:14 +00:00
Dima Dorfman
2be196f14c
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.
PR: 29892
2001-09-03 14:12:42 +00:00
Dima Dorfman
912e378232
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.
2001-08-30 06:32:17 +00:00
Joerg Wunsch
5c6a35107b
Properly initialize the random number generator in pw_getpass().
...
Right now, the automatically generated passwords have been rather
predictable. :-(
MFC after: 1 day
2001-08-21 13:33:20 +00:00
Joerg Wunsch
19c6903f17
Fix a typo in a variable name that made pw(8) coredump when using
...
USE_MD5RAND.
MFC after: 2 days
2001-08-21 10:29:01 +00:00
Brian Somers
2313781df2
Handle snprintf() returning < 0 (not just -1)
...
MFC after: 2 weeks
2001-08-20 15:09:34 +00:00
Brian Somers
36c1612b5e
Handle snprintf() returning -1.
...
MFC after: 2 weeks
2001-08-20 13:24:39 +00:00
David E. O'Brien
90e655ea4e
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.
2001-07-20 06:20:32 +00:00
David E. O'Brien
ac24b049cc
Remove GCC'isms in CFLAGS.
2001-07-20 04:23:13 +00:00
Dima Dorfman
f247324df7
Remove whitespace at EOL.
2001-07-15 08:06:20 +00:00
Dima Dorfman
70d51341bf
mdoc(7) police: remove extraneous .Pp before and/or after .Sh.
2001-07-09 09:54:33 +00:00
Brian Somers
7bc6d0158f
Fix the type of the NULL arg to execl()
...
Idea from: Theo de Raadt <deraadt@openbsd.org>
2001-07-09 09:24:06 +00:00
Ruslan Ermilov
ce9c7e7f4b
Don't override the default BINMODE.
...
Submitted by: bde
2001-07-05 15:25:05 +00:00
Kris Kennaway
cab0fb4e48
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.
MFC after: 1 week
2001-07-05 08:01:15 +00:00
Dima Dorfman
2694efd413
Include missing header files which define functions for which gcc has
...
builtints (e.g., exit, strcmp).
2001-06-24 20:25:23 +00:00
Dima Dorfman
1ab562901c
CND has been unused for two years, and RND has been unused for five
...
years; remove them from CFLAGS.
PR: 23712
Submitted by: Volker Stolz <stolz@i2.informatik.rwth-aachen.de>
2001-06-19 00:39:29 +00:00
Ruslan Ermilov
345e52e742
- Backout botched attempt to introduce MANSECT feature.
...
- MAN[1-9] -> MAN.
2001-03-26 14:42:20 +00:00
Andrey A. Chernov
b01e74b72e
Use %c for expire/change dates
2001-03-21 13:46:09 +00:00
Ruslan Ermilov
08657612d8
mdoc(7) police: simplify bogus ``.Ql Fl'' constructs.
2001-03-16 14:11:41 +00:00
Dima Dorfman
ed6fd55a59
Document the lock and unlock commands. This fixes a segmentation fault.
...
PR: 25187
Approved by: nik
2001-03-14 03:24:30 +00:00
Dima Dorfman
e468afb48d
Document the lock and unlock commands.
...
PR: 25187
Approved by: nik
2001-03-14 03:22:28 +00:00
Kris Kennaway
27540537e8
Switch from using rand() or random() to a stronger, more appropriate PRNG
...
(random() or arc4random())
Reviewed by: bde
2001-03-05 02:15:38 +00:00
Ruslan Ermilov
610a5778c5
mdoc(7) police: split punctuation characters + misc fixes.
2001-02-01 16:44:04 +00:00
Ruslan Ermilov
1bfea903ed
Prepare for mdoc(7)NG.
2001-01-16 09:39:23 +00:00
Peter Wemm
e311d7d06c
Fix typo: s/memberhip/membership/
...
Submitted by: Peter Avalos <pavalos@theshell.com>
2001-01-02 04:01:59 +00:00
Ben Smithurst
d0d78e1303
Convert to use the <sys/queue.h> macros rather than fiddling with the queue
...
structure internals.
Reviewed by: markm
2000-12-29 18:04:54 +00:00
Doug Barton
fc308a5491
Make the comment generated in /etc/pw.conf match reality
...
PR: misc/23451
Submitted by: Ben Rosengart, ben@narcissus.net
2000-12-18 01:35:56 +00:00
David E. O'Brien
1a37aa566b
Add `_PATH_DEVZERO'.
...
Use _PATH_* where where possible.
2000-12-09 09:35:55 +00:00
Ruslan Ermilov
e97407b4f2
mdoc(7) police: use the new features of the Nm macro.
2000-11-20 20:10:44 +00:00
Brian Feldman
04c9749ff0
Add working and easy crypt(3)-switching. Yes, we need a whole new API
...
for crypt(3) by now. In any case:
Add crypt_set_format(3) + documentation to -lcrypt.
Add login_setcryptfmt(3) + documentation to -lutil.
Support for switching crypt formats in passwd(8).
Support for switching crypt formats in pw(8).
The simple synopsis is:
edit login.conf; add a passwd_format field set to "des" or "md5"; go nuts :)
Reviewed by: peter
2000-08-22 02:15:54 +00:00
David Nugent
d37861da7a
Move test for -w flag outside of the code dealing with -D (defaults).
...
This should cause -w's argument not to be ignored in the usermod case,
so it will affect modification of the user's password instead of using
the pw.conf (or internal default=no '*') password method.
PR: bin/11168
2000-07-20 05:11:56 +00:00
David Nugent
f707b0d536
Allow -g with an empty argument in the -D case. This allows -g "" to set
...
no default group (and thus fall back to user-based groups instead).
PR: bin/5717
2000-07-20 04:37:00 +00:00
David Nugent
e4ac984548
Fix another missed case where usermod would not set the "modified" flag:
...
-h - to set no password. But only mark modified if the account is not
already locked (i.e. first char of crypt password field is '*').
PR: bin/19999
2000-07-20 00:09:29 +00:00
David Nugent
670eb236c0
Catch up to the fact that we now have tcsh in the tree.
2000-07-16 01:46:26 +00:00
David Nugent
1994f5c7aa
Support propogation of file flags when building a homedir from the
...
skeleton directory.
sprintf() -> snprintf() cleanup.
PR: bin/8756
Submitted by: "Nickolay N. Dudorov" <nnd@itfs.nsk.su>
2000-07-13 23:52:49 +00:00
David Nugent
affc28f940
Fix breakage introduced by bypassing update for additional 'mod'
...
functionality when nothing had actually changed; -d changes would
not set the 'something had changed flag'. Actually test for a
change in homedir.
PR: bin/19649
2000-07-03 12:13:10 +00:00
David Nugent
34b4610b7b
Don't dereference NULL in the userdel case.
2000-06-26 01:11:44 +00:00
Andrey A. Chernov
39610c7229
Localize ctype too.
...
Add weekday to showuser expired fields
2000-06-24 13:36:13 +00:00
Andrey A. Chernov
e7161f368a
Localize time/date.
...
Use ISO 8601 date in logs.
Fix wrong argument type in ctype functions.
2000-06-22 16:48:41 +00:00
David Nugent
6b13b96dad
Fix obvious braino in assignment statement. usermod -g should work again.
...
PR: 17877
Submitted by: pius@zyan.com
2000-06-18 02:48:56 +00:00
David Nugent
c4e667b9d7
Be a little more strict about handling command line args. This allows user and
...
group names like 'help' 'mod' 'user' 'group' etc. to work correctly without
requiring the -n style invocation.
PR: misc/17069
2000-06-18 02:39:17 +00:00
David Nugent
25fa020ea5
Fix a long-standing bug in the rename case previously masked by another bug
...
just fixed in .db file updating.
2000-06-18 02:18:15 +00:00
David Nugent
f52bcb0a5c
Second and hopefully final fix to .db sync when renaming a user; we must run
...
a full reindex in this case to remove the old record. #ifdef -u capability
since this is available on FreeBSD only.
PR: bin/16418
Problem pointed out by: Masachika ISHIZUKA <ishizuka@ish.org>
2000-06-18 02:16:07 +00:00
David Nugent
6a1eaeca35
Fix db syncronization when username is changed with -l under usermod.
...
pw(8) was calling pwd_mkdb -u oldusername instead of newusername, so
the update appears to have failed until the next full pwd_mkdb
syncronization.
PR: bin/16418
2000-06-06 07:33:00 +00:00
Jake Burkholder
e39756439c
Back out the previous change to the queue(3) interface.
...
It was not discussed and should probably not happen.
Requested by: msmith and others
2000-05-26 02:09:24 +00:00
Jake Burkholder
740a1973a6
Change the way that the queue(3) structures are declared; don't assume that
...
the type argument to *_HEAD and *_ENTRY is a struct.
Suggested by: phk
Reviewed by: phk
Approved by: mdodd
2000-05-23 20:41:01 +00:00
Sheldon Hearn
4e86fcacf6
Remove more single-space hard sentence breaks.
2000-03-02 14:54:02 +00:00
Sheldon Hearn
f2e366a105
Remove single-space hard sentence breaks. These degrade the quality
...
of the typeset output, tend to make diffs harder to read and provide
bad examples for new-comers to mdoc.
2000-03-01 14:09:25 +00:00
David Nugent
923dc0b2c3
Portability fixes for other bsd4.4 derivatives.
2000-01-15 00:20:22 +00:00
Peter Wemm
6e2578e4c4
Revert the libcrypt/libmd stuff back to how it was. This should not have
...
happened as it was working around problems elsewhere (ie: binutils/ld
not doing the right thing according to the ELF design). libcrypt has
been adjusted to not need the runtime -lmd. It's still not quite right
(ld is supposed to work damnit) but at least it doesn't impact all the
users of libcrypt in Marcel's cross-build model.
1999-12-18 13:55:17 +00:00
Marcel Moolenaar
7c99ddf2cc
Add libmd (or move it after libcrypt). We don't want the linker to be
...
smart because it will definitely get it wrong. This popped up during
cross-linking.
1999-12-16 10:55:45 +00:00
David Nugent
05c30f03e6
Don't try updating the passwd file if no data has changed. This allows things
...
like "pw usermod <name> -m" to work for non-local NIS users; since no attempt
is made to update the password entry, the home directory will be created and
populated as expected without error.
1999-10-26 15:07:20 +00:00
David Nugent
2399cd14a7
Add new functionality "lock" and "unlock" to provide a simple password
...
locking mechanism for users. This works by prepending the string
"*LOCKED*" to the password field in master.passwd to prevent successful
decoding.
1999-10-26 08:34:09 +00:00
David Nugent
480207ab3d
Missed statement in password update relating to the previous change
...
to fileupdate() which prevented pwd_mkdb(1) from being run.
1999-10-26 08:30:20 +00:00
David Nugent
c190a0f584
Clean up error handling in fileupdate(), which now returns 0 on success
...
instead of a boolean. This replicated through he front-end sub-functions
relating to add, delete, modify entries in passwd & group files
Errno is now preserved so output of errc()/warnc() will be less obfuscated
by subsequent errors when reporting the problem.
Add more intelligent error handling when attempting to modify/delete NIS
entries with no corresponding local database entry.
[MFC to stable in a couple of weeks to keep both in sync]
1999-10-26 04:27:14 +00:00
Sheldon Hearn
8ca1dc4b47
Only do a full pwd_mkdb for deletions; other operations may use the -u
...
option as an optimization.
PR: 13346
Submitted by: Neil Blakey-Milner <nbm@rucus.ru.ac.za>
1999-08-30 10:35:38 +00:00
Peter Wemm
97d92980a9
$Id$ -> $FreeBSD$
1999-08-28 01:35:59 +00:00
David Nugent
479bcf69f7
Remove some more warnings.
1999-07-28 12:49:34 +00:00
David Nugent
2bffe0d58e
Fix date parsing to allow '0' (none) date value.
1999-03-15 08:16:01 +00:00
David Nugent
f35227220f
Add the ability to print user records in unix version 7 (old) format.
1999-03-02 00:53:33 +00:00
David Nugent
7291e2179c
Fix minor nit with command line parsing for pw -V DIR action.
1999-02-23 11:01:50 +00:00
David Nugent
e3921b2795
Fix tpyo (sic) and missing 'else' (bad cut n' paste).
1999-02-23 10:35:47 +00:00
David Nugent
5f12594a29
1) Do not blindly ignore file update errors which may occur due to concurrent
...
updating
2) Add -V <etcdir>, which allows maintaining user/group database in alternate
locations other than /etc.
1999-02-23 07:15:11 +00:00
Dag-Erling Smørgrav
c8e126f7f0
Don't assume a_name is a number just because the first character
...
is a digit.
PR: bin/9484
Submitted by: Matthew D. Fuller <fullermd@futuresouth.com>
1999-02-08 21:26:44 +00:00
David Nugent
08fe832b6e
Remove bogus file locking in main().
1999-01-08 10:52:38 +00:00
Bill Fumerola
9fb99cddfc
-Clarification of last commit-
...
The char that the random letters and numbers are being pulled from is
ended with a '\0'. Using sizeof() includes this '\0' in the 'pool' of
possible characters. This patch decrements by one the size so we don't
accidently end the new password prematurly.
1999-01-04 14:07:53 +00:00
Bill Fumerola
5d1711220c
Let's make sure we're at the end of the password string before we apply a \0
...
and terminate it. This patch ensures passwords will be the correct length of 8,
which is what is implied in the source (but not reflected in the man page).
PR: bin/7817
Reviewed by: Alfred Perlstein <bright@hotjobs.com>
Submitted by: Hiroshi Nishikawa <nis@pluto.dti.ne.jp>
1999-01-02 04:37:46 +00:00
Joerg Wunsch
524245066d
Fix the spelling of `FreeBSD'.
...
Submitted by: Peter Philipp <pjp@bsd-daemon.net>
1998-12-27 12:01:07 +00:00
David E. O'Brien
2887f586f0
Remove useless `BINOWN=root' now that it is the default.
1998-09-19 22:42:14 +00:00
Joseph Koshy
7ecd7a42c5
Fix inappropriate use of .Ql macro.
...
PR: docs/7905
Submitted by: kuma@jp.freebsd.org
1998-09-18 04:45:43 +00:00
Joseph Koshy
06f64964ea
The `group{del,mod,show}' take require a '[group|gid]' argument.
...
PR: docs/7788
1998-08-31 04:49:04 +00:00
Nate Williams
5e91a8ac91
- On second thought, attempt to get the read-only lock, but don't
...
consider it a exit failure if it doesn't work. This means that root
processes can safely get the lock, but normal processes can still use
the 'pw' utility to get information (which may change out from under
them.)
1998-08-04 22:31:26 +00:00
Nate Williams
2a6797aae2
- Removed read-only lock from 'pw'. This removes portions of the FIX
...
from PR/6787, but allow non-root users to use pw to get password
information. However, this should be safe since the fixes for
disallowing multiple instances from modifying the DB are still intact.
Bug noted by: dima@best.net (Dima Ruban)
1998-08-04 22:20:11 +00:00
Nate Williams
73375325b1
Fix race condition in pw caused by multiple instances of pwd_mkdb being
...
run at the same time.
Notes:
The fileupdate function is still somewhat broken. Instead of
returning a failure code if it can't modify the original file it
renames the .new file and continues as though nothing is wrong.
This will cause the lock on the original file to be lost and could
lead to a similar race condition. I left that portion of the code
alone since I feel that the maintainer of the code would have a
better concept of how he wants to handle errors in that function
than I do.
PR: bin/6787
Submitted by: Craig Spannring <cts@internetcds.com>
1998-07-16 17:18:25 +00:00
Philippe Charnier
325970a9ff
.Nm pw -> .Nm.
1998-03-23 08:28:12 +00:00
Steve Price
137db389ed
Overhaul this manpage - removing typos, awkward phrasing, and addressing
...
a few technical faults.
PR: 5692
Submitted by: dannyman@arh0300.urh.uiuc.edu
1998-02-14 18:33:37 +00:00
Wolfram Schneider
27f8f85b7e
pwd_mkdb option '-c' was renamed to -C some weeks ago.
...
PR: bin/5715
Submitted by: dannyman <dannyman@arh0300.urh.uiuc.edu>
1998-02-11 23:31:24 +00:00
Tim Vanderhoek
dfb9495b2a
Use consistent spelling,
...
writeable -> writable (recall prior debate over this? :-)
initialise -> initialize
recognise -> recognize
Merry Christmas! :)
1997-12-25 09:36:42 +00:00
Philippe Charnier
1dcc6ec750
Use err(3) instead of local redefinition. Add rcsid string.
1997-10-10 06:23:42 +00:00
David Nugent
d3329f56fa
Unquote default group in pw.conf.
...
PR: 4365
Submitted by: "Andrew L. Moore" <alm@mclink.com>
1997-09-01 09:33:08 +00:00
David Nugent
5e779680a9
Fix -p switch.
1997-08-01 15:06:21 +00:00
David Nugent
fa7e83d492
getuid() -> geteuid().
1997-07-17 08:37:47 +00:00
Andrey A. Chernov
687ee69a2a
Remove srandomdev fallback code
1997-06-14 00:27:03 +00:00
David Nugent
57ae32e5e8
Fixes skeleton directory test-it-is-a-directory logic.
...
PR: 3666
Reviewed by:
Submitted by: iaint@css.tuu.utas.edu.au
Obtained from:
1997-05-24 10:41:49 +00:00
Andrey A. Chernov
a200d18a76
Initialize RNG only once
...
Use srandomdev() now
1997-03-24 15:09:41 +00:00
Andrey A. Chernov
f2a6c90b00
Fix srandom arg according to Lite2
1997-03-11 14:11:43 +00:00
Daniel O'Callaghan
3a7e707703
Typo fix 'and' -> 'an'.
...
This is a 2.2 candidate.
1997-03-04 07:55:43 +00:00
Andrey A. Chernov
08a77c42e1
Back out MAXLOGNAME fix, Bruce points that copyinstr require NUL
1997-03-03 07:59:54 +00:00
Andrey A. Chernov
431efa59e3
Fix MAXLOGNAME usage, the code has wrong assumption that
...
it must be NUL terminated
1997-03-02 21:36:17 +00:00
Peter Wemm
476602a9d0
Revert $FreeBSD$ to $Id$
1997-02-22 16:15:28 +00:00
David Nugent
e56644ad0e
Yet another formatting consistency check.
1997-02-07 11:31:42 +00:00
David Nugent
e57b5686c6
Fix useage of MAXLOGNAME to include terminating NUL, by using
...
max(MAXLOGNAME-1,UT_NAMESIZE).
Tidy up "pretty" printing format for longer usernames.
1997-02-07 10:58:13 +00:00
Wolfram Schneider
bfd34a4a60
Sort cross references.
1997-01-20 00:03:00 +00:00
Jordan K. Hubbard
1130b656e5
Make the long-awaited change from $Id$ to $FreeBSD$
...
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.
1997-01-14 07:20:47 +00:00
David Nugent
f1d684fad9
Adds optional NIS passwd file updating and optionally rebuilding
...
NIS maps.
Suggested by: Peter Wemm
1997-01-05 07:15:37 +00:00
David Nugent
c7fefa0352
Remove duplicated #include.
1997-01-05 04:54:24 +00:00
David Nugent
9d8caa0abd
Fix reference /etc/acct/pw.conf -> /etc/pw.conf.
...
Pointed-Out-By: Peter Wemm.
1997-01-05 04:05:22 +00:00
David Nugent
f2400d4658
Implemented /home -> /usr/home symlink kludge.
...
If home basedir would be created in the root partition, create
it under /usr instead, and symlink /basedir -> /usr/basedir.
1997-01-03 04:42:18 +00:00
David Nugent
39791ab333
1) Base home directory is created if it does not already exist if
...
useradd -m or useradd -D -b are used.
2) Hyphen allowed in username if not first character. Fix trivial
bug in error fmt string.
3) /etc/skeykeys updating changed to do 'inplace' update, commenting
out a username rather than removing it completely.
1996-12-30 11:52:34 +00:00
David Nugent
b5cc56ab27
Correct file modes on updated /etc/skeykeys.
1996-12-23 02:27:29 +00:00
David Nugent
0970881ff6
1) 200 users per group limitation removed and pw
...
will handle lines of any length in /etc/group.
2) Fixed bug with usermod -d not updating user's home
directory.
3) Minor formatting display changes/fixes with *show -P.
1996-12-21 15:35:45 +00:00
David Nugent
5e75134d21
Bugfix (cosmetic) for output of generated passwords.
1996-12-20 10:45:39 +00:00
David Nugent
d9b711b719
Allow 8-bit characters in the passwd gecos field, and adds a paragraph
...
to the mangpage explaining the consequences (to be updated at a later
date after login class conf support is added).
1996-12-19 15:22:45 +00:00
David Nugent
2e3db6fbe0
Changes to password generator: fallback to MD5 generator disabled
...
(/dev/urandom used by default under FreeBSD), and implemented a
"portable" but less secure generator for other systems.
Add display of expiry/password change dates in -P user display.
1996-12-17 14:15:35 +00:00
David Nugent
a36f769f47
Submitted by: proff@iq.org
...
Minor fix for security patch.
1996-12-17 01:43:30 +00:00
David Nugent
b7d2ba7cb8
Reviewed by: davidn@blaze.net.au
...
Submitted by: proff@iq.org
Security patch for better random password generation.
1996-12-16 17:37:58 +00:00
Joerg Wunsch
669d204645
Update from David, reflecting Wolfram's wishes regarding limitation of
...
the allowable character set.
Submitted by: David Nugent
1996-12-11 15:10:47 +00:00
Joerg Wunsch
db34a7105c
Merg-o-matic.
1996-12-11 00:07:19 +00:00
Joerg Wunsch
ad7cf975be
Copyright update by the author, to be more in line with our sample
...
copyright.
Submitted by: David Nugent
1996-12-10 23:59:04 +00:00
Joerg Wunsch
9fd0dafc15
Merge from the vendor-branch.
1996-12-10 00:21:28 +00:00
Joerg Wunsch
48aee7f33a
Upgrade from the author, reflecting all my wishes resulting out of the
...
sysinstall use of this tool (plus some bug fixes).
2.2 candidate...
Submitted by: David Nugent <davidn@nserver.usn.blaze.net.au>
1996-12-09 23:55:27 +00:00
Mike Pritchard
053375e81b
Minor spelling/mdoc/style fixes.
1996-12-09 16:44:13 +00:00
Joerg Wunsch
d6f907dc7a
pw(8) -- a backend utility to manage the user and group databases.
...
sysinstall's new User&group menu will use it, hence it's a 2.2
candidate despite of providing new functionality.
Submitted by: David L. Nugent, <davidn@blaze.net.au>
1996-12-09 14:05:35 +00:00