Commit Graph

79 Commits

Author SHA1 Message Date
davidn
c85586d6d2 Don't dereference NULL in the userdel case. 2000-06-26 01:11:44 +00:00
ache
659df59b0e Localize ctype too.
Add weekday to showuser expired fields
2000-06-24 13:36:13 +00:00
ache
77729ceb43 Localize time/date.
Use ISO 8601 date in logs.
Fix wrong argument type in ctype functions.
2000-06-22 16:48:41 +00:00
davidn
15756f138e 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
davidn
4a7877f9e8 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
davidn
1553afea75 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
davidn
faaa880c55 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
davidn
bb77488761 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
961b97d434 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
d93fbc9916 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
sheldonh
244b8ead7d Remove more single-space hard sentence breaks. 2000-03-02 14:54:02 +00:00
sheldonh
b2240fc1c0 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
davidn
1b86060031 Portability fixes for other bsd4.4 derivatives. 2000-01-15 00:20:22 +00:00
peter
d44e2d4226 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
e32efbad28 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
davidn
9c3494a4dc 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
davidn
091d630070 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
davidn
297001db2a 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
davidn
7f7ff280d1 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
sheldonh
1f6d5bd10b 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
efabb9ccb1 $Id$ -> $FreeBSD$ 1999-08-28 01:35:59 +00:00
davidn
92f725d0a6 Remove some more warnings. 1999-07-28 12:49:34 +00:00
davidn
d70ee45d7f Fix date parsing to allow '0' (none) date value. 1999-03-15 08:16:01 +00:00
davidn
2b92c5716f Add the ability to print user records in unix version 7 (old) format. 1999-03-02 00:53:33 +00:00
davidn
e0514a77ef Fix minor nit with command line parsing for pw -V DIR action. 1999-02-23 11:01:50 +00:00
davidn
a5b26be1a1 Fix tpyo (sic) and missing 'else' (bad cut n' paste). 1999-02-23 10:35:47 +00:00
davidn
aea1f6bc3c 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
des
6d5fc29071 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
davidn
43bf26e477 Remove bogus file locking in main(). 1999-01-08 10:52:38 +00:00
billf
b9b93bcb85 -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
billf
4d4062708c 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
e35d117052 Fix the spelling of `FreeBSD'.
Submitted by:	Peter Philipp <pjp@bsd-daemon.net>
1998-12-27 12:01:07 +00:00
obrien
0337d32241 Remove useless `BINOWN=root' now that it is the default. 1998-09-19 22:42:14 +00:00
jkoshy
37eda2089d Fix inappropriate use of .Ql macro.
PR:		docs/7905
Submitted by:	kuma@jp.freebsd.org
1998-09-18 04:45:43 +00:00
jkoshy
640c398571 The `group{del,mod,show}' take require a '[group|gid]' argument.
PR: docs/7788
1998-08-31 04:49:04 +00:00
nate
cd5930392d - 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
cb1f81bd1c - 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
e5267d9c1b 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
charnier
b32e728fc6 .Nm pw -> .Nm. 1998-03-23 08:28:12 +00:00
steve
89c1054333 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
wosch
95821ff4ba 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
hoek
100ffb8b0a Use consistent spelling,
writeable -> writable (recall prior debate over this? :-)
	initialise -> initialize
	recognise -> recognize

Merry Christmas! :)
1997-12-25 09:36:42 +00:00
charnier
c4198a70c7 Use err(3) instead of local redefinition. Add rcsid string. 1997-10-10 06:23:42 +00:00
davidn
00e1cd92d7 Unquote default group in pw.conf.
PR: 4365
Submitted by: "Andrew L. Moore" <alm@mclink.com>
1997-09-01 09:33:08 +00:00
davidn
62d9b4dbb4 Fix -p switch. 1997-08-01 15:06:21 +00:00
davidn
9ed136eecd getuid() -> geteuid(). 1997-07-17 08:37:47 +00:00
ache
66946f9305 Remove srandomdev fallback code 1997-06-14 00:27:03 +00:00
davidn
504c6b3f01 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
ache
1941fcfcfb Initialize RNG only once
Use srandomdev() now
1997-03-24 15:09:41 +00:00
ache
c33c7f83d9 Fix srandom arg according to Lite2 1997-03-11 14:11:43 +00:00