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