Robert Watson [Mon, 19 Mar 2001 05:04:30 +0000 (05:04 +0000)]
o Rename "namespace" argument to "attrnamespace" as namespace is a C++
reserved word, causing breakage when a C++ program included libutil.h
This change will be propagated elsewhere shortly.
Robert Watson [Thu, 15 Mar 2001 03:00:39 +0000 (03:00 +0000)]
o To support new EA interface with explicit namespaces, introduce two
utility functions which convert between string namespace names and
numeric constants used by the interface. Right now, two namespaces
are supported, EXTATTR_NAMESPACE_SYSTEM ("system") and
EXTATTR_NAMESPACE_USER ("user"). These functions are used by
various userland EA utilities, rather than hard coding the routines
all over the place.
Doug Barton [Sun, 17 Dec 2000 23:42:45 +0000 (23:42 +0000)]
* Fix a long line that I introduced in the last commit
* Backslash escape non-alphanumeric chars in the login name so that perl
doesn't choke on things like '$'.
Doug Barton [Tue, 21 Nov 2000 05:52:35 +0000 (05:52 +0000)]
If a user is in the database, rmuser ought to be able to remove them.
Address this by using getpwnam(), thus killing several birds with
the same stone. My fix is slightly more aggressive than the
originators. :)
Murray Stokely [Wed, 8 Nov 2000 11:57:03 +0000 (11:57 +0000)]
Added PROPERTY_MAX_VALUE and PROPERTY_MAX_NAME defines to libutil.h so
that applications know how large of a buffer they must allocate before
calling property_find(). Also added a $FreeBSD$ tag while I'm here.
Brian Feldman [Fri, 27 Oct 2000 01:19:02 +0000 (01:19 +0000)]
Fix problems people were having with large -O levels with GCC and
getting libutil/libcrypt to work properly. I've determined that GCC
thinks it can inline all functions, including weak-symboled ones, if
it feels like it.
Create a new stub.c and move any stubs there to prevent inlining.
Thanks to jdp and William S. Duncanson for helping me finally find the
problem.
Jacques Vidrine [Wed, 6 Sep 2000 18:16:48 +0000 (18:16 +0000)]
Add nsswitch support. By creating an /etc/nsswitch.conf file, you can
configure FreeBSD so that various databases such as passwd and group can be
looked up using flat files, NIS, or Hesiod.
= Hesiod has been added to libc (see hesiod(3)).
= A library routine for parsing nsswitch.conf and invoking callback
functions as specified has been added to libc (see nsdispatch(3)).
= The following C library functions have been modified to use nsdispatch:
. getgrent, getgrnam, getgrgid
. getpwent, getpwnam, getpwuid
. getusershell
. getaddrinfo
. gethostbyname, gethostbyname2, gethostbyaddr
. getnetbyname, getnetbyaddr
. getipnodebyname, getipnodebyaddr, getnodebyname, getnodebyaddr
= host.conf has been removed from src/etc. rc.network has been modified
to warn that host.conf is no longer used at boot time. In addition, if
there is a host.conf but no nsswitch.conf, the latter is created at boot
time from the former.
Brian Feldman [Tue, 22 Aug 2000 02:15:54 +0000 (02:15 +0000)]
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 :)
Complete migration of aliases file to /etc/mail/aliases.
The maintainers of share/examples/diskless/README.TEMPLATING and mergemaster
have been contacted so those may be updated as well.
David Nugent [Thu, 20 Jul 2000 05:11:56 +0000 (05:11 +0000)]
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
David Nugent [Thu, 20 Jul 2000 04:37:00 +0000 (04:37 +0000)]
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
David Nugent [Thu, 20 Jul 2000 00:09:29 +0000 (00:09 +0000)]
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
David Nugent [Thu, 13 Jul 2000 23:52:49 +0000 (23:52 +0000)]
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>
David Nugent [Mon, 3 Jul 2000 12:13:10 +0000 (12:13 +0000)]
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
David Nugent [Sun, 18 Jun 2000 02:39:17 +0000 (02:39 +0000)]
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
David Nugent [Sun, 18 Jun 2000 02:16:07 +0000 (02:16 +0000)]
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>
David Nugent [Tue, 6 Jun 2000 07:33:00 +0000 (07:33 +0000)]
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.
Use an MD5 checksum to test for file changes; the previous method
of using file mtimes could result in chpasss(1) erroneously
detecting that no changes were made for non-interactive edits.
Paul Richards [Thu, 9 Mar 2000 18:11:16 +0000 (18:11 +0000)]
Fix various unsigned vs signed errors that caused problems with uids
and gids bigger than 16 bits. Added checks for uids and gids that are
bigger than 32 bits.
Approved by: jkh (partly, this fix is bigger than I first intended)
Sheldon Hearn [Wed, 1 Mar 2000 14:09:25 +0000 (14:09 +0000)]
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.
Sheldon Hearn [Wed, 1 Mar 2000 12:20:22 +0000 (12:20 +0000)]
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.
Peter Wemm [Sat, 18 Dec 1999 13:55:17 +0000 (13:55 +0000)]
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.
Marcel Moolenaar [Thu, 16 Dec 1999 10:55:45 +0000 (10:55 +0000)]
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.
Sheldon Hearn [Thu, 2 Dec 1999 16:39:15 +0000 (16:39 +0000)]
Replace the -q option to pwd_mkdb with a test for PW_SCAN_BIG_IDS in
the environment. This allows big ID warnings to be suppressed for
vipw and chpass as well.
Since the environment variable test is only performed for callers
of pw_scan() that do not set pw_big_ids_warning, the test can still
be overriden. Currently, chpass and pwd_mkdb are the only users
of pw_scan() and neither of them overrides the environment variable
test.
Eivind Eklund [Mon, 22 Nov 1999 12:42:38 +0000 (12:42 +0000)]
Allow empty UIDs if we are processing NIS records. I am not entirely
happy with how this end up and will re-visit the entire empty field
problem, but this patch solves the NIS problem for now.
Submitted by: Dan Nelson <dan@emsphone.com>
PR: 14865,14984
David Nugent [Tue, 26 Oct 1999 15:07:20 +0000 (15:07 +0000)]
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.
David Nugent [Tue, 26 Oct 1999 08:34:09 +0000 (08:34 +0000)]
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.
David Nugent [Tue, 26 Oct 1999 04:27:14 +0000 (04:27 +0000)]
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]
Andrew Gallatin [Wed, 20 Oct 1999 15:20:00 +0000 (15:20 +0000)]
fix a serious bug where, on alpha, due to a an int/long type mismatch,
the uid arg to use_yp() was getting clobbered by the call to my_yp_match().
This led to a problem where a NIS user could edit root's passwd information.
Warner Losh [Sun, 25 Apr 1999 22:37:58 +0000 (22:37 +0000)]
More egcs warning fixes:
o main returns int not void
o use return 0 at end of main when needed
o use braces to avoid potentially ambiguous else
o don't default to type int
o #ifdef 0 -> #if 0