Commit Graph

67 Commits

Author SHA1 Message Date
davidn
8ec6947593 Portability fixes for other bsd4.4 derivatives. 2000-01-15 00:20:22 +00:00
peter
96af418f42 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
3239491159 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
f7ccb2973e 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
1eb57a5aee 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
d846dabde7 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
81f9461104 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
fd1054a4b0 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
b6784c4210 $Id$ -> $FreeBSD$ 1999-08-28 01:35:59 +00:00
davidn
fc1c90c001 Remove some more warnings. 1999-07-28 12:49:34 +00:00
davidn
606c2612fb Fix date parsing to allow '0' (none) date value. 1999-03-15 08:16:01 +00:00
davidn
c01a7e63d1 Add the ability to print user records in unix version 7 (old) format. 1999-03-02 00:53:33 +00:00
davidn
8e69beb04e Fix minor nit with command line parsing for pw -V DIR action. 1999-02-23 11:01:50 +00:00
davidn
91b9d16383 Fix tpyo (sic) and missing 'else' (bad cut n' paste). 1999-02-23 10:35:47 +00:00
davidn
dc804219b0 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
30e1d1ca5e 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
7f23232c65 Remove bogus file locking in main(). 1999-01-08 10:52:38 +00:00
billf
2bd2de496a -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
d727ae5c4c 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
5ccfff9699 Fix the spelling of `FreeBSD'.
Submitted by:	Peter Philipp <pjp@bsd-daemon.net>
1998-12-27 12:01:07 +00:00
obrien
7a3df171b6 Remove useless `BINOWN=root' now that it is the default. 1998-09-19 22:42:14 +00:00
jkoshy
590a441741 Fix inappropriate use of .Ql macro.
PR:		docs/7905
Submitted by:	kuma@jp.freebsd.org
1998-09-18 04:45:43 +00:00
jkoshy
32bad8ffcc The `group{del,mod,show}' take require a '[group|gid]' argument.
PR: docs/7788
1998-08-31 04:49:04 +00:00
nate
be1f7e24d7 - 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
b45dd84cc0 - 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
717f8cfcdf 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
050befcd72 .Nm pw -> .Nm. 1998-03-23 08:28:12 +00:00
steve
f945136751 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
03b7e1e827 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
b298ef3a0e 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
1b2a43aa3f Use err(3) instead of local redefinition. Add rcsid string. 1997-10-10 06:23:42 +00:00
davidn
fc548d56d0 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
eb14663e40 Fix -p switch. 1997-08-01 15:06:21 +00:00
davidn
c42f9f595d getuid() -> geteuid(). 1997-07-17 08:37:47 +00:00
ache
3eb72e5222 Remove srandomdev fallback code 1997-06-14 00:27:03 +00:00
davidn
9cbae70c69 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
ec758b2cd3 Initialize RNG only once
Use srandomdev() now
1997-03-24 15:09:41 +00:00
ache
8db013e86b Fix srandom arg according to Lite2 1997-03-11 14:11:43 +00:00
danny
281ac46ea4 Typo fix 'and' -> 'an'.
This is a 2.2 candidate.
1997-03-04 07:55:43 +00:00
ache
26e48e5f06 Back out MAXLOGNAME fix, Bruce points that copyinstr require NUL 1997-03-03 07:59:54 +00:00
ache
f625b97409 Fix MAXLOGNAME usage, the code has wrong assumption that
it must be NUL terminated
1997-03-02 21:36:17 +00:00
peter
32d6b795de Revert $FreeBSD$ to $Id$ 1997-02-22 16:15:28 +00:00
davidn
f004e0d880 Yet another formatting consistency check. 1997-02-07 11:31:42 +00:00
davidn
23e88dfc02 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
wosch
00e37028d0 Sort cross references. 1997-01-20 00:03:00 +00:00
jkh
9c0cd3f9df 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
davidn
5e162a50e5 Adds optional NIS passwd file updating and optionally rebuilding
NIS maps.

Suggested by:	Peter Wemm
1997-01-05 07:15:37 +00:00
davidn
5f2ec6a024 Remove duplicated #include. 1997-01-05 04:54:24 +00:00
davidn
a67c0871a6 Fix reference /etc/acct/pw.conf -> /etc/pw.conf.
Pointed-Out-By: Peter Wemm.
1997-01-05 04:05:22 +00:00
davidn
be419e50a6 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