Commit Graph

490 Commits

Author SHA1 Message Date
christos
8c97c569de include ecalloc() from our anonymous user. 2006-10-20 17:40:39 +00:00
christos
284c960b4d typo from our anonymous user. 2006-10-20 17:40:18 +00:00
christos
40c48e4f33 prevent empty else. 2006-10-15 19:34:51 +00:00
christos
ebed6f0b8c add volatile to prevent gcc clobbering. 2006-10-15 19:33:52 +00:00
christos
2979ced6e8 - Instead of wondering if to syslog an error, do so, but in the called
function.
- use snprintf instead of sprintf.
2006-10-15 19:33:03 +00:00
christos
e7acb44bcf Allow escaping of the separators using a double backslash 2006-10-14 18:53:11 +00:00
pooka
34a6a097c3 add util.h to SYNOPSIS 2006-10-06 15:31:20 +00:00
christos
5863dc6ef1 Coverity CID 4159: Don't memset() needlessly. 2006-09-27 16:20:03 +00:00
wiz
8d8d8f2ebd Slight wording improvement, sort SEE ALSO, remove trailing dot in SEE ALSO. 2006-09-02 23:43:47 +00:00
christos
ec0bdc9542 make this compilable as a tool. 2006-08-28 20:46:26 +00:00
christos
568f6f6f30 Only use __RCSID if we have it. 2006-08-26 23:17:43 +00:00
christos
6e90deb9cb Efun source. 2006-08-26 18:11:45 +00:00
christos
e72710e561 Add efun(3) 2006-08-26 18:11:12 +00:00
drochner
f5015685d4 mention error return value, like getrawpartition(3) 2006-05-26 12:36:59 +00:00
wiz
cb3fc8886b \- is a minus. 2006-05-25 10:56:08 +00:00
christos
dc46554fdb Document that this can fail. 2006-05-25 00:41:24 +00:00
elad
2675cb7714 Allow explicit length by checking it only if we have a length above 0. 2006-04-01 14:51:17 +00:00
elad
f77bbf7c65 set all fields to -1 after allocation, this makes it easier to write
policies.
2006-03-30 18:11:17 +00:00
wiz
c2cc4b2716 Consistently use .Va for errno. Quote "-" for PostScript output. 2006-03-23 19:31:37 +00:00
wiz
c2f9369ee7 Remove trailing whitespace, add 'and' in enumeration. 2006-03-23 19:30:27 +00:00
elad
d7e635e034 plug leaks, coverity cids 1618, 1619. 2006-03-20 17:32:17 +00:00
elad
2b9c10de57 Set errno on failure, and man-page updates. 2006-03-19 22:58:21 +00:00
christos
a3f80bb48f - Don't trash error number returned by the handler; return it instead.
- Add default cases and return EINVAL
- Don't check for NULL arguments and return EFAULT. Let it core-dump instead.
  (or add DIAGASSERT)
- Coverity CID 799: Don't dereference m and n if they are known to be NULL.
  Bail out sooner with EINVAL.
2006-03-19 22:18:25 +00:00
christos
b3044379df Clarify errno's returned by those functions. 2006-03-19 21:56:04 +00:00
christos
6b99850ef0 Coverity CID 1209: Avoid negative close. While I am there fix bugs (open
returning 0 is ok). Reorganize code to factor out common parts, cleanup
syscall checking and error code return.
2006-03-19 21:55:37 +00:00
wiz
bade1adbc5 Fix typo. 2006-02-24 21:07:29 +00:00
wiz
8b9018d2d9 Mark up NULL (with Dv). 2006-02-24 21:06:50 +00:00
elad
bca69c49bf needs assert.h to compile. 2006-02-19 23:13:14 +00:00
elad
f0dd749f9b add _DIAGASSERT as requested by mrg@. 2006-02-19 20:46:29 +00:00
elad
5cd336ae07 When loading a policy with an "nclasses" option, always set the min/max
values for the various character classes to allow any number, just in
case. Also note about that in the man-page.

This makes it easier to use the "nclasses" option.

Note that alternatively we could just memset() to 0xff when doing the
load, but that might lead to more unexpected behavior.
2006-02-18 16:45:01 +00:00
elad
cf6eceb4e7 Don't expose struct pw_policy and use pw_policy_t, use malloc, man-page
fixups.

As discussed on source-changes@.

Okay yamt@, thorpej@.
2006-02-18 16:32:45 +00:00
elad
378a5a27de Some stuff that's been sitting in my tree for too long...
Improve the pw_policy(3) API by splitting it to two functions, one to load
the policy from /etc/passwd.conf and another to test passwords against the
policy.

Some bug fixes, more consistent code, and man-page updates.

Minor for libutil bumped.
2006-02-18 10:52:48 +00:00
christos
349633b5fa make setuserenv and setuserpath take an environment setting function and
an environment pointer and expose them.
bump version.
2005-12-20 21:32:20 +00:00
elad
02197be174 Lint warnings. 2005-09-17 01:51:21 +00:00
elad
769541972d Rename struct pw_policy -> struct pw_policy_handler. 2005-09-16 22:38:48 +00:00
elad
44b5bc7c94 Add pw_policy.3.
From Hisashi T Fujinaka, thanks!
2005-09-14 18:45:40 +00:00
elad
8d6270e665 Introduce pw_policy(3), an easily extendable way of defining password
policies and enforcing them in programs.

Man-page written with much help and tips from David Maxwell, Hubert
Feyrer, and Thomas Klausner.

This bumps libutil minor to 7.

XXX: Need default policy to go in /etc/passwd.conf, and integration
     into local/yp/PAM password changing code.

PR/10206.
2005-09-14 11:36:52 +00:00
christos
3ff3472e11 Use the re-entrant getgr*_r functions. From John Nemeth. 2005-09-14 02:12:34 +00:00
wiz
e315aa9a2a Avoid duplicate if. 2005-09-10 21:55:35 +00:00
elad
232f61fabb Lint warnings. 2005-08-27 16:55:59 +00:00
elad
75beed7e53 Make this compile without warnings. 2005-08-19 10:10:08 +00:00
elad
dd3453b45c Make pw_getconf(3) set errno so we have indication on what went wrong.
Document possible errno values in the manpage.
2005-08-18 21:07:23 +00:00
wiz
98fcd5ac03 Fix capso in Dd argument. 2005-05-16 18:49:24 +00:00
thorpej
f2b0a44663 u_short -> uint16_t 2005-05-15 21:01:34 +00:00
wiz
0bb532e823 Bump date for previous; add commas to make
sentences more readable.
2005-04-13 23:08:03 +00:00
drochner
1a771b22ec Allow for a login.conf file without an explicite "default" class
definition.
The login.conf(5) manpage states that the "default" class is used
*if it exists*.
2005-04-13 20:32:42 +00:00
atatat
a9321bb19a Add the 'A' and 'P' format specifiers which use getaddrinfo(3) to turn
numbers into names (if possible).  Also add the '?' format modifier
that elides the "N/A" if that's what you would normally get.
2005-04-09 02:05:47 +00:00
mycroft
ebfdf0c012 If TIOCPTMGET fails, close /dev/ptm. 2005-01-19 01:54:09 +00:00
christos
163d05f57d PR/28792: FUKAUMI Naoki: passwd: Couldn't generate salt: Invalid argument
I broke the case where /etc/passwd.conf was empty.
2005-01-15 03:07:56 +00:00
dyoung
4d24861fc9 For consistency of sockaddr_snprintf(3) with snprintf(3) and
snprintb(3), do not count the terminating NUL in the return value.
Update the regression tests to match.  Approved by christos@.
2005-01-13 00:44:25 +00:00
christos
4c3e77eff3 add pw_getpwconf(), bump. 2005-01-12 03:34:33 +00:00
christos
ca7489bf5c Avoid spinning if writing to a pty returns 0. This happened to me when
I had a pty with a suspended sshd (why?).
2005-01-08 06:43:16 +00:00
christos
f1a325d103 Unbreak setuserpath(); from Nick Hudson. 2004-12-20 18:42:03 +00:00
wiz
ff7ab08a15 Mmm, API changes without date bumps... bump date for constification. 2004-12-11 16:50:56 +00:00
christos
a5c1a01ed9 WARNS=3; fix cast-qual issues. 2004-12-11 06:41:15 +00:00
christos
70756f97e8 Constify; the api was completely broken before. 2004-12-11 06:40:42 +00:00
peter
192aae95b5 Add missing LIBRARY section.
ok wiz@
2004-12-01 00:06:46 +00:00
christos
5a55e0c902 Don't give write privileges at all if the tty group is missing. 2004-11-25 02:49:46 +00:00
christos
db5d4e2d6a I really want to kill the hard-coding of _TTY_GID. Set the group to the
primary group of the user if the group tty does not exist.
2004-11-24 22:17:19 +00:00
christos
6845cdfbb8 fix the header. 2004-11-21 03:04:14 +00:00
wiz
7a3b0ef281 Formatting fixes, and a typo fix. 2004-11-20 23:29:33 +00:00
christos
1fe49f768f Add a manual page. 2004-11-20 03:06:09 +00:00
christos
09ad64e21f check for getnameinfo error correctly; thanks to Peter Postma. 2004-11-19 22:05:23 +00:00
christos
eb6484700a Add sockaddr_snprintf; XXX: Needs a man page. 2004-11-19 21:37:19 +00:00
dsl
ece723d1ec Add if_media.c, functions for converting media to/from strings.
(from ifconfig.c)
2004-11-11 20:36:28 +00:00
christos
d07f9e79e8 - don't complain if the pty is of the form pts/n
- fix off by one error in iovlen bounds checking
- print the function name in the error message and make the
  error messages consistent
- knf
2004-11-10 17:00:41 +00:00
christos
2611d5a68f KNF; Simplify some logic, so that lines don't wrap. Explain why we
break, continue, or return from the tty scanning loops.
2004-09-18 20:14:22 +00:00
yamt
2936303c19 openpty: just check errors of syscalls,
instead of checking permission beforehand in userland.
2004-09-18 16:44:38 +00:00
wiz
245c7e5202 New sentence, new line. 2004-08-04 15:07:37 +00:00
thorpej
7c161da819 - Rename pw_copy() to pw_copyx(), make it return a success/failure code,
and add "errbuf" and "errbufsz" parameters so that errors can be handled
  gracefully, rather than simply exiting the process.
- Add a pw_copy() wrapper around pw_copyx() to preserve old behavior for
  apps that use it.
- Bump shlib version to 7.4.
2004-08-03 23:29:04 +00:00
christos
92cd5ee20c Don't allow openpty to succeed if the caller is non-superuser.
XXX: we cross-reference ptm 4 which does not exist (yet)
2004-06-18 02:42:57 +00:00
christos
f099fa154d use the pty multiplexor if it exists. 2004-05-27 03:12:48 +00:00
lukem
2ebcc58148 sbsize should be parsed as R_CSIZE so that suffixes work correctly.
Fix from Christian Biere in PR [lib/25504].

(XXX: the R_CSIZE parsing should be changed to using strsuftollx(3))
2004-05-09 23:28:11 +00:00
christos
dea77b1806 sprinkle const 2004-04-23 15:23:26 +00:00
matt
d07ed6425d Add sbsize login capability. 2004-04-18 18:21:43 +00:00
wiz
f343a3e8ab Use pid_t for pids. From Jeff Ito in PR 24854. 2004-03-29 11:52:39 +00:00
wiz
f05e6f1a3a occured -> occurred. From Peter Postma. 2004-02-24 15:12:51 +00:00
lukem
171d653219 Overhaul how `build.sh tools' are used:
*	Rename "config.h" to "nbtool_config.h" and
	HAVE_CONFIG_H to HAVE_NBTOOL_CONFIG_H.
	This makes in more obvious in the source when we're using
	tools/compat/config.h versus "standard autoconf" config.h

    *	Consistently move the inclusion of nbtool_config.h to before
    	<sys/cdefs.h> so that the former can provide __RCSID() (et al),
    	and there's no need to protect those macros any more.

These changes should make it easier to "tool-ify" a program by adding:
	#if HAVE_NBTOOL_CONFIG_H
	#include "nbtool_config.h"
	#endif
to the top of the source files (for the general case).
2003-10-27 00:12:41 +00:00
christos
5028fe3e04 delint pointer casts. 2003-10-25 07:31:27 +00:00
christos
ad96bb0dec remove unused variable 2003-10-25 07:31:12 +00:00
fvdl
bada5458de Don't use NULL to compare against an int. 2003-10-21 00:55:05 +00:00
fvdl
03831599c1 The last argument to sysctl is a size_t, not a pointer; don't pass NULL. 2003-10-21 00:47:46 +00:00
itojun
c469f0373f initialize 'res' to NULL 2003-09-08 20:54:48 +00:00
itojun
0676396691 plug possible memory leak. from openbsd 2003-09-08 16:19:40 +00:00
agc
eb7c1594f1 Move UCB-licensed code from 4-clause to 3-clause licence.
Patches provided by Joel Baker in PR 22280, verified by myself.
2003-08-07 16:42:00 +00:00
salo
99410184e7 netbsd.org->NetBSD.org 2003-07-26 19:24:24 +00:00
wiz
6e5644d28c Aq Pa instead of Pa Aq. 2003-06-27 13:58:51 +00:00
agc
4acc601512 Minor grammatical correction. 2003-05-06 07:38:19 +00:00
christos
63c4aa480d PR/7885: Kip Rugger: ttylock(3) ignores flags and locker parameters 2003-04-21 00:39:40 +00:00
wiz
472351e13d Use
.In header.h
instead of
.Fd #include \*[Lt]header.h\*[Gt]
Much easier to read and write, and supported by groff for ages.
Okayed by ross.
2003-04-16 13:34:34 +00:00
wiz
44b6aa4c8b Mostly mdoc improvements, some typos. 2003-04-16 12:53:37 +00:00
christos
8099c8302c add functions to retrieve option values. 2003-04-11 17:36:57 +00:00
perry
8cb755776e runnning->running from Igor Sobrado, PR misc/19814 2003-03-31 18:49:45 +00:00
lukem
9b087b0ba0 Clear O_NONBLOCK correctly (previous code probably only worked because
O_NONBLOCK and F_SETFL are the same value).
Obtained from FreeBSD PR 8681 via FreeBSD's usr.bin/wall/ttymsg.c 1.5.
2003-03-27 12:04:57 +00:00
wiz
2c30441d13 Try to get some consistency in the used macros; other minor fixes. 2003-03-22 15:46:47 +00:00
jdolecek
1edd42a9d2 move getmntopts(3) to libutil, build and install also it's manpage
bump libutil minor
adjust individual mount_*/Makefile to use libutil getmntopts(3)
2003-03-22 12:43:57 +00:00
grant
104b35fe93 'NetBSD.org' and some mdoc fixes. 2003-02-14 16:29:11 +00:00
petrov
2bb9ea7350 strcmp needs string.h. 2003-02-14 04:03:27 +00:00
fvdl
a3ff3a3038 Bump daddr_t to 64 bits. Replace it with int32_t in all places where
it was used on-disk, so that on-disk formats remain the same.
Remove ufs_daddr_t and ufs_lbn_t for the time being.
2003-01-24 21:55:02 +00:00
atatat
dd0a8acd21 The next release will be 2.0, not 1.7. 2003-01-19 21:25:36 +00:00
wiz
1035faff1d writable, not writeable. 2003-01-06 20:30:28 +00:00
wiz
1b3497f4e1 Sync with other libutil man pages. 2002-12-22 02:19:15 +00:00
wiz
2e0828a8a8 Misc fixes. 2002-12-18 20:21:11 +00:00
scw
4f0fde8807 Bump minor number for getlabel{sector,offset}() addition. 2002-12-12 09:46:49 +00:00
scw
0c83fd4944 Add getlabelsector() and getlabeloffset() as wrappers around the
KERN_LABELSECTOR and KERN_LABELOFFSET sysctls.
2002-12-12 09:45:32 +00:00
lukem
b1e79510cf - Migrate fparseln(3) from libutil to libc, where it should have been in
the first place...
- Bump libutil major (to 7.0) and libc minor (to 12.91).
2002-11-30 03:04:44 +00:00
itojun
5d1183fefb use strlcpy/cat 2002-11-16 23:30:32 +00:00
wiz
a5338d0c0c Spell out month name in .Dd. Use .Fn instead of .Fo/.Fc and .Fa's. 2002-10-12 22:19:25 +00:00
elric
448f621758 Added two functions disklabel_dkcksum() and disklabel_scan() to libutil
so that they can be shared by disklabel(8) and cgdconfig(8).
2002-10-12 20:53:15 +00:00
wiz
e5caf371d2 dynamically with two l. 2002-10-02 10:48:26 +00:00
wiz
27adb020b8 New sentence, new line. From Robert Elz. 2002-10-01 19:36:30 +00:00
jdolecek
961e3a840f put utmpx/wtmpx routines to separate files, so that programs overriding the
utmp/wtmp routines could still be linked static
fixes e.g. static build of ftpd
2002-09-27 20:42:46 +00:00
wiz
4a47c952db Add documentation for utmpx and some related functions.
Thanks for some explanations to christos, and for some STANDARDS hints
to Klaus Klein.
2002-09-27 15:02:24 +00:00
wennmach
ced9268418 s/_PASSWD_NOCHG/_PASSWORD_NOCHG/
s/_PASSWD_NOEXP/_PASSWORD_NOEXP/
2002-09-26 11:47:35 +00:00
christos
d0a6aa04fc Add rcsid, config.h 2002-09-20 21:11:11 +00:00
christos
4ac3045a5a Add snprintb(3) inspired from bitmask_snprintf(9), but made to look like
more like snprintf(3). Discussed with thorpej.
2002-09-20 21:10:10 +00:00
christos
d571f02f7d Don't bother calling secure_path() is kernel == _PATH_UNIX. If you are going
to default to it and use it anyway, why do the security check?
2002-09-12 14:42:15 +00:00
tron
ef63cbff6b Bump minor number to 3 because there are already systems with
"libutil.so.6.2" to avoid further problems.
2002-08-23 10:34:02 +00:00
abs
a086fb2909 Move humanize_number(3) from libutil to libc as per discussion on tech-misc
Revert minor number bump on libutil (with note to skip it next update), and
bump libc.
2002-08-22 17:24:08 +00:00
lukem
ec5dbc56b8 Explicitly move setting of NOxxx and USE_SHLIBDIR to the top of the
Makefile (before including <bsd.own.mk>)
2002-08-19 14:55:14 +00:00
lukem
ebb6fc9eb8 Use ${NETBSDSRCDIR}/some/path instead of ${.CURDIR}/../../some/path (etc).
(Reduces make output by ~ 20%)
2002-08-19 09:41:27 +00:00
itojun
2abe377059 defend against malicious line in ut_line, which could cause unwanted
writes to anything under /dev.  revoke setuid/gid privs earlier.
From: xs@kittenz.org
2002-08-16 20:21:48 +00:00
enami
38540fc05e Cosmetic changes. 2002-08-15 04:47:12 +00:00
gmcgarry
3e5aabbe90 Clarify what functionality _is_ included and _should be_ included in libutil. 2002-08-12 20:03:05 +00:00
martin
ab77398ff9 Do not assume int64_t is printable with %qd - on 64 bit ports it isn't.
Use %lld instead and cast the args to (long long) explicitly.

I'm not sure about our policy vs. the C99 format string macros in
basesrc - should we use those here?
2002-08-12 09:06:59 +00:00
thorpej
214fe87eb9 Actually bump the shlib version to 6.2 as abs intended to. 2002-08-10 01:51:43 +00:00
wiz
91223bd061 Actually, the page was last modified today. 2002-08-08 17:04:32 +00:00
wiz
8afa8486fc Minor cleanup, correct HISTORY. 2002-08-08 17:03:46 +00:00
abs
35a808e4e8 Add humanize_number.3 from Tomas Svensson in PR lib/15508.
Bump version of libutil
2002-08-08 16:50:35 +00:00
wiz
4068c80842 Fix Fn argument. 2002-08-06 12:58:45 +00:00
christos
8720535dd6 add utmpx/wtmpx processing routines. 2002-07-27 23:49:23 +00:00
yamt
673cbedc13 import CAVEATS sections from OpenBSD.
with little tweak by me.
2002-07-10 14:37:12 +00:00
simonb
9a430fa482 Correct the list of pseudo-terminals in the FILES section. 2002-05-30 01:42:58 +00:00
wiz
5f7ebe2497 Grammar fix, and drop a .Pp after a section header. 2002-05-22 10:22:41 +00:00
itojun
0ee7a49136 if called multiple times with different names, only the last pid file
will be kept
2002-05-22 07:37:26 +00:00
itojun
c2c2980f42 change return type of pidfile(3) to int (-1 on error), to inform caller
of errors.  behavior now in sync with openbsd implementation.
(see tech-userlevel and bsd-api-discuss)
2002-05-22 07:31:40 +00:00
ad
8cde67eba2 Back out previous - it will come as a surprise to many users. 2002-04-17 11:14:28 +00:00
perry
1e77807ee4 Per discussion on tech-security and tech-userlevel, upgrade default
passwd type to md5. Note that with the passwd.conf facility, one may
easily "downgrade" the default to type old if one wishes, and that
existing passwds continue to work as before -- this only changes the
default for new passwds.
2002-04-15 03:06:46 +00:00
atatat
d76e3cd5fe Fix openpty() so that it correctly scans the entire list of possible
ttys.  The new ttys (g-zA-Z) are "optional", since they may not be
present, and their absence is not a "fatal" error.
2002-03-09 20:09:28 +00:00
wiz
d8711c438f Drop trailing empty line. 2002-02-20 11:34:42 +00:00
wiz
b6bb7c0546 Sort sections. 2002-02-20 11:34:14 +00:00
ross
814f296b77 Generate <>& symbolically. 2002-02-07 07:00:09 +00:00
tls
c6652502b9 Add support for up to 930 pty devices (instead of the current 256).
The openpty() routine has been modified to use the extra pty names
before the "traditional" names, so that programs too dumb to use
openpty() will, hopefully, find one of the "traditional" ptys free
even if many others are in use.  The modifications to MAKEDEV are
courtesy Andrew Brown, and are pretty clever: the unit numbers used
by the "traditional" names stay the same, to avoid trouble when
upgrading existing systems.  The unusual use of "dd" to index an
array in MAKEDEV is because no other simple method seemed feasible
using only the programs on the install media for all ports.
2002-02-02 05:48:30 +00:00
lukem
081753574a Add hooks for reachover builds from src/tools/compat. 2002-01-21 23:33:36 +00:00
lukem
efcc9a4c9d * Add user-controlled mk.conf variables
- SHLIBDIR	Location to install shared libraries if ${USE_SHLIBDIR}
			is "yes".  Defaults to "/usr/lib".

	- USE_SHLIBDIR	If "yes", install shared libraries in ${SHLIBDIR}
			instead of ${LIBDIR}.  Defaults to "no".
			Sets ${_LIBSODIR} to the appropriate value.
			This may be set by individual Makefiles as well.

	- SHLINKDIR	Location of shared linker.  Defaults to "/usr/libexec".
			If != "/usr/libexec", change the dynamic-linker
			encoded in shared programs

* Set USE_SHLIBDIR for libraries used by /bin and /sbin:
	libc libcrypt libcrypto libedit libipsec libkvm libm libmi387
	libtermcap libutil libz

* If ${_LIBSODIR} != ${LIBDIR}, add symlinks from ${LIBDIR}/${LIB}.so*
  to ${_LIBSODIR}/${LIB}.so* for compatibility.

* Always install /sbin/init statically (for now)


The net effect of these changes depends on how the variables are set:

  1.)	If nothing is set or changed, there is no change from the
	current behaviour:
		- Static /bin, /sbin, and bits of /usr/*
		- Dynamic rest
		- Shared linker is /usr/libexec/ld*so

  2.)	If the following make variables are set:
		LDSTATIC=
		SHLINKDIR=/lib
		SHLIBDIR=/lib
	Then the behaviour becomes:
		- Dynamic tools
		- .so libraries used by /bin and /sbin are installed to /lib,
		  with symlinks from /usr/lib/lib*so to -> /lib/lib*so
		  where appropriate
		- Shared linker is /lib/ld*so

  3.)	As per 2.), but add the following variable:
		USE_SHLIBDIR=yes
	This forces all .so's to be instaleld in /lib (with compat
	symlinks), not just those tagged by their Makefiles to be.
	Again, compat symlinks are installed
2001-12-28 01:32:37 +00:00
lukem
5463706383 remove referenced to raw (block) and cooked (character) devices, since
opendisk(3) doesn't care. the iscooked parameter just changes which
paths in /dev are tried if the supplied one doesn't work.
2001-12-10 22:50:33 +00:00
lukem
f0061ca489 revert previous.
it appears that i misread the intent of the iscooked parameter when
originally designing this feature with jason, and changing it broke
some programs.
2001-12-10 22:41:52 +00:00
wiz
0d22a58265 Fix pasto in last. 2001-12-07 09:31:34 +00:00
gmcgarry
daf40a326a Fix pastos. 2001-12-07 05:24:28 +00:00
wiz
52c3aaaffd Slight markup improvement. 2001-11-23 08:18:41 +00:00
gmcgarry
f830776687 Add a catch-all man page for libutil. 2001-11-23 06:20:37 +00:00
lukem
9ee8b0ca6a WARNS=2 fix 2001-11-05 15:03:49 +00:00
lukem
b3bf0bffe1 Enforce is iscooked arg;
if zero, a matching path must be of type S_IFCHR, and
	if non-zero, a matching path must be of type S_IFBLK.
2001-11-01 06:53:24 +00:00
lukem
b2a1c14478 - add _PATH_USERMGMT_CONF. resolves [bin/14305]
- add _PATH_PASSWD_CONF to be consistent with almost all other _PATH_xxx_CONF
  defines, and change from using _PATH_PASSWDCONF to the former.  keep the
  latter for compatibility, although arguably it could be removed because
  it was never in a release and was only used in one file in the tree.
2001-10-23 00:25:20 +00:00
taca
2788a3f274 Remove an extra character in a comment block. 2001-10-20 09:20:28 +00:00
tron
2a957ed711 - Don't delete the pidfile if the process executing the cleanup handler
isn't the process who created it.
- If a new basename is supplied remove the an old pidfile if it was created
  by this process and create a new one as suggested by Jason Thorpe.
This fixes PR lib/13357 by Greg A. Woods.
2001-10-19 20:36:59 +00:00
lukem
64cb1ed825 path variations don't occur if there's a / in the path 2001-09-26 07:21:42 +00:00
wiz
f19d54840a Rename secure_path(3) source file from securepath.c to secure_path.c. 2001-08-20 14:47:49 +00:00
wiz
149ced914e Improve formatting, noted by Simon Burge. 2001-08-20 14:26:45 +00:00
wiz
1e378c4c12 precede, not preceed. 2001-08-20 12:00:46 +00:00
ad
cf24a0936c Bump libutil major for pw_mkdb() change. 2001-08-18 19:33:17 +00:00
ad
7e44d4f92b Add two arguments to pw_mkdb(), a la OpenBSD. This is to allow us to pass
the -u and -s options to pwd_mkdb.
2001-08-18 19:31:47 +00:00
mjl
d30f9aefd6 Fix typo 2001-08-15 21:34:06 +00:00
wiz
a9356936b4 seperate -> separate 2001-07-22 13:33:58 +00:00
lukem
4db962fc85 revert over-zealous pcvt cull; we still need to skip ttyv* whilst pccons uses
ttyv0 on some ports (currently; arm32, bebox, i386, prep).  should fix PR 12862.
2001-05-10 01:57:47 +00:00
sommerfeld
22e6ab1ebe Fix typo. 2001-04-12 22:34:31 +00:00
wiz
56d8eaccf3 Fix date, whitespace and punctuation. 2001-04-09 12:11:06 +00:00
jdolecek
2a2ea948de Add a note this appeared in NetBSD 1.6. Pointed out on current-users@
by Geoff Wing.
2001-04-09 09:29:54 +00:00
wiz
b1593d9814 Add getbootfile(3) to libutil, and a man page.
Bump libutil version to 5.5.
2001-04-06 14:31:14 +00:00
cgd
65a1026492 convert to use getprogname() 2001-02-19 22:43:42 +00:00
lukem
d06a762ab2 sprinkle in _DIAGASSERT() as appropriate 2001-01-03 15:41:19 +00:00
cgd
3e7f7ef82d __CONCAT does token pasting, not string concatnation. if something like:
__CONCAT("PATH=",_PATH_STDPATH);
actually works to concantate strings, it's because the preprocessor expands
it into "PATH=""whatever _PATH_STDPATH is" as separate strings, and then
ANSI string concatenation is performed on that.  It's more straightforward
to just use ANSI string concatenation directly, and newer GCCs complain
(rightly) about mis-use of token pasting.
2000-12-19 23:09:02 +00:00
tron
9ef96a455e Fix oversight in last commit. 2000-12-08 21:41:14 +00:00
tron
a3a468eeaf Add two new passwd file update functions:
- The pw_setprefix() function defines the root directory used for passwd
  file updates. If the prefix is set to /newroot pw_lock() will operate on
  /newroot/etc/ptmp afterwards. The default prefix is an empty string.
- The pw_getprefix() function returns the root directory which is currently
  used for passwd file updates.
2000-12-06 13:37:53 +00:00
lukem
279552d3db fix up various .Nm abuses:
- keep the case consistent between the actual name and what's referenced.
  e.g, if it's `foo', don't use '.Nm Foo' at the start of a sentence.
- remove unnecessary `.Nm foo' after the first occurrence (except for
  using `.Nm ""' if there's stuff following, or for the 2nd and so on
  occurrences in a SYNOPSIS
- use Sx, Ic, Li, Em, Sq, and Xr as appropriate
2000-11-07 06:43:24 +00:00
itojun
4c0a48380a /etc/login.conf is optional, so don't return NULL even if
there's none found.  addresses part of PR 11150.  sync with openbsd.
2000-10-12 00:28:33 +00:00
itojun
11ede04dd7 cosmetic; indentation 2000-10-12 00:19:57 +00:00
itojun
5e09a97a4e login_cap.h requires sys/types.h (or should it pull sys/types.h in?) 2000-10-10 13:17:28 +00:00
itojun
982906430e honor behavior of warn(NULL). 2000-10-04 08:40:49 +00:00
sommerfeld
d68f3adec6 Close possible format string attack. 2000-10-03 19:52:39 +00:00
ad
82759dbdf5 Use .{B,Bs,F,N,O}x and fix miscellaneous errors. 2000-09-21 10:43:49 +00:00
ad
88ec60f200 - Pull in <util.h> to get secure_path() declared.
- Resolve preprocessor symbol clash.
2000-09-21 10:15:32 +00:00
ad
300fe58019 Document secure_path() better; in particular, note that it will write
to the system log.
2000-09-19 15:03:20 +00:00
ad
8b2c913445 - Simplify code path.
- Make the first argument to secure_path() constant.
- KNF.
2000-09-18 16:36:33 +00:00
ad
da436beb73 Add a LIBRARY section. 2000-09-18 16:02:41 +00:00
ad
d6682c2a4f PCVT hack is gone. 2000-07-11 12:10:51 +00:00
itohy
f9863c47b3 Correct ctype(3) usage.
Passing "char" value is wrong.  Use "unsigned char" instead.
2000-07-11 06:07:25 +00:00
ad
056b0653ce - More fixes.
- Document the built-in defaults.
2000-07-10 11:21:32 +00:00
ad
e8362050a9 .Fn foo' -> .Fn foo "void"' in SYNOPSIS. 2000-07-10 11:19:16 +00:00
ad
6d078c7044 Remove PCVT hack. 2000-07-10 11:16:38 +00:00
itojun
b596a9b104 rename securepath.3 into secure_path.3, as the function is named secure_path().
it is too hard to guess...
2000-07-07 11:05:06 +00:00
ad
44588903fc Couple of nits. 2000-07-07 10:33:12 +00:00
ad
dbd0d28913 Fix typo. This probably would have stopped passwd(1) working if
/etc/passwd.conf didn't exist.
2000-07-07 10:32:48 +00:00
ad
2a9ac348ae Oops - declare static functions. 2000-07-06 13:39:47 +00:00
ad
240f3596cb Use ':' as group prefix; suggested by hubertf. 2000-07-06 13:09:46 +00:00
ad
8a82d4a86e Bump libutil minor (pw_getconf()). 2000-07-06 11:26:23 +00:00
ad
7b3efebed5 Documentation for pw_getconf(). From OpenBSD. 2000-07-06 11:08:19 +00:00
ad
82be161e7c - Add pw_getconf(). This is used to read configuration information from
passwd.conf. From OpenBSD.
- ANSIfy.
2000-07-06 11:06:12 +00:00
ad
fce98185a9 - __RCSID() police.
- ANSIfy.
- Miscellaneous style changes.
- Shutup lint(1) in one or two cases.
2000-07-05 11:46:40 +00:00
mjl
4d8aac4dbb Correct typos which prevent man pages from being installed.
Fixes PR/10104 by Greg Woods.
2000-05-12 18:31:55 +00:00