millert
d0d2e5a2ff
Change pw_copy(3) to take a 3rd arguement, the existing passwd entry.
This allows an application to only update a password entry if it is
in the state it expects. Additionally, if the old passwd struct
is specified the new one may have a different pw_name field since
matching is done on the original. Adapted from FreeBSD.
20 years ago
deraadt
0c743cc175
ansi and protos
21 years ago
millert
679cd5d050
Remove the advertising clause in the UCB license which Berkeley
rescinded 22 July 1999. Proofed by myself and Theo.
21 years ago
deraadt
876bf51192
knf
21 years ago
millert
f3a8ddc140
Throw an error if the username field is empty; noticed by mpech@
21 years ago
deraadt
d3c9af5aa3
more asprintf; millert ok
21 years ago
deraadt
8ccc7922d7
asprintf; millert ok
21 years ago
millert
ca00f6f3e4
mark pw_error() __dead since it exits
22 years ago
deraadt
695e261e2d
%u for uid/gid; millert ok
22 years ago
fgsch
fb18813faf
some -Wall and spaces cleanup, scsi.c left.
some brave soul should look at it.
22 years ago
deraadt
5cdc7e2335
strlcpy and KNF
22 years ago
mpech
c68a3ac420
Clean up after pw_file().
millert@ ok
deraadt@ ok to commit
22 years ago
millert
b68c09e067
Part one of userland __P removal. Done with a simple regexp with some minor hand editing to make comments line up correctly. Another pass is forthcoming that handles the cases that could not be done automatically.
23 years ago
millert
1e2fd73b66
Use the volatile specifier to fix warnings about variables being
clobbered by longjmp / vfork instead of the gcc "(void)&foo;" hack.
23 years ago
deraadt
a3de80a1d8
save errno in signal handler
23 years ago
millert
dc64978377
Change the second arg to pw_mkdb() from a boolean flag to a set of
bit flags ORed together. Currently the only flags defined are
_PASSWORD_SECUREONLY and _PASSWORD_OMITV7 but this is enough to
cause pw_mkdb() to run pwd_mkdb with the options we want.
With this change we no longer generate the old V7 passwd file when
only the extra fields in master.passwd (or the encrypted password)
have changed. There are other programs that could probably use
the _PASSWORD_OMITV7 flag; they will be converted at a future date.
23 years ago
millert
5caca03abd
Add new 'secureonly' arg to pw_mkdb() to correspond to pwd_mkdb's new -s
flag and crank the library major due to the interface change.
23 years ago
aaron
426796c9a3
Plug memory leak in pw_copy(); millert@ ok
23 years ago
deraadt
431f8263a1
correct type on last arg to execl(); nordin@cse.ogi.edu
23 years ago
millert
e6c1e8b9f9
Fix a problem introduced by the printf format sweep. Passing a NULL
pw_error() is prefectly legal but now we have to check for it explicity
(it was handled implicitly before since warn(name) would become warn(NULL)).
24 years ago
millert
2a2d694747
Add a username argument to pw_mkdb to match 'pwd_mkdb -u username'.
Crank the shlib major number due to the interface change.
24 years ago
provos
45cd33a8a6
close fd for pw_lck on exec, okay deraadt@
24 years ago
millert
8859c18d03
warnx?/errx? paranoia (use "%s" not a bare string unless it is a
constant). These are not security holes but it is worth fixing
them anyway both for robustness and so folks looking for examples
in the tree are not misled into doing something potentially dangerous.
Furthermore, it is a bad idea to assume that pathnames will not
include '%' in them and that error routines don't return strings
with '%' in them (especially in light of the possibility of locales).
24 years ago
deraadt
71c0d453e0
preserve errno; christos
26 years ago
millert
d854eef346
Use UID_MAX, not UINT_MAX. Rename remove_trailing_space() to trim_whitespace() since it trims from both ends, not just the rear.
26 years ago
millert
b242cec8db
add missing endusershell()
26 years ago
deraadt
f261344077
do not wait if vfork() fails
27 years ago
millert
8e693f1039
-Wall
27 years ago
millert
df03ebbc5d
Go back to old file locking method, O_EXLOCK method has too many problems
27 years ago
millert
bb1bed96be
pw_mkdb() now returns -1 if ptmp is size 0.
27 years ago
millert
b65904d4d9
Work around bug in open(2) wrt O_TRUNC and O_SHLOCK|O_EXLOCK.
27 years ago
deraadt
e5f3150688
fix yes/no prompt code for EOF case; wosch@freebsd
27 years ago
millert
b46ec22f4b
Use O_EXLOCK option of open(2) to open /etc/ptmp with an exclusive
lock. This fixes a DOS bug where a user could run passwd(1) and
send it a SIGKILL, thus leaving /etc/ptmp in place.
27 years ago
niklas
58f7db1ec4
Add support to handle password files in directories other than /etc
27 years ago
provos
ed82a932ef
give only default values when asked for.
28 years ago
provos
4a31344e5c
added password configuration access function, used to determine
password cipher type at the moment
28 years ago
provos
b221745579
when using strsep you should be aware that the delimiter will be replaced
by a nifty '0', so you cant check for a colon instead and dump some
I am sorry, Dave. I can't do that.
28 years ago
deraadt
b08d7f8fef
permit 32-bit uid/gid, help from millert
28 years ago
deraadt
89ddbb9597
vfork w/ exit botch
28 years ago
deraadt
a34e8e5c6d
do not unexpectedly unlink the ptmp file; also support SIG*STOP cleanly
with our changes which permit "EDITOR=emacs -nw" to work.
28 years ago
downsj
b2f1975b66
util.h: new resting place
opendev.h: ok, so I merged it with util.h
opendev.h: use util.h
everything else: use "util.h"
28 years ago
deraadt
c153de987d
system() $EDITOR safely
28 years ago
deraadt
a5010d31aa
libutil
28 years ago