Commit Graph

73 Commits

Author SHA1 Message Date
peter
16271b5bfa Add experimental front ends to the kinfo_vmentry and kinfo_filedesc
sysctls.
2008-11-30 22:40:14 +00:00
scf
3396c8ff44 Fixed style issues with variable ordering and naming, spacing and
parentheses.

Fixed alignment issue in gr_dup() in its assignment of gr_mem using a
struct to force alignment without performing alignment mathematics.  This
was noticed recently with libutil was built with WARNS=6 on platform such
as sparc64.

Added checks to gr_dup(), gr_equal() and gr_make() to prevent segfaults
when examining struct group's with the struct members pointing to NULL's.

With fix of alignment issue, restore WARNS?=6.

Reviewed by:	des
MFC after:	1 week
2008-11-23 23:26:12 +00:00
des
8dd958ae17 Comment out WARNS. There are too many alignment issues in libutil. 2008-11-05 11:06:10 +00:00
des
52c1c041c4 Disconnect gr_util.c from the build. It isn't documented or used anywhere
in the tree, and due to unsafe pointer arithmetic, it will most likely crash
on architectures with strict alignment requirements.
2008-11-05 10:45:39 +00:00
des
07619c0f0d libutil now builds at WARNS level 6.
MFC after:	3 weeks
2008-11-04 13:51:15 +00:00
jhb
b3f9efd84f Merge hexdump(9) to userland as hexdump(3) in libutil. I'm tired of doing
this by hand in userland utilities.

MFC after:	1 month
2008-07-01 22:30:57 +00:00
scf
cab3742f10 Add four utility functions related to struct grp processing modeled in-part
after similar calls related to struct pwd in libutil/pw_util.c:
  - gr_equal()
    Perform a deep comparison of two struct grp's.  It does a thorough, yet
    unoptimized comparison of all the members regardless of order.

  - gr_make()
    Create a string (see group(5)) from a struct grp.

  - gr_dup()
    Duplicate a struct grp.  Returns a value that is a single contiguous
    block of memory.

  - gr_scan()
    Create a struct grp from a string (as produced by gr_make()).

MFC after:	3 weeks
2008-04-23 00:49:13 +00:00
pjd
cc12b6df61 Implement expand_number(3), which is the opposite of humanize_number(3), ie.
a number in human-readable form is converted to int64_t, for example:
123b -> 123
10k -> 10240
16G -> 17179869184

First version submitted by:	Eric Anderson <anderson@freebsd.org>
Approved by:	re (bmah)
2007-09-01 06:19:11 +00:00
deischen
ff36458e08 Bump library versions in preparation for 7.0.
Ok'd by:	kan
2007-05-21 02:49:08 +00:00
des
5d25ea6b62 I'm tired of seeing this done incorrectly and non-portably, so add a
flopen(3) function which reliably opens and locks a file.

MFC after:	3 weeks
2007-05-10 14:43:31 +00:00
yar
c6e8412606 style.Makefile(5) is good for our eyes. 2006-07-27 12:36:46 +00:00
akiyama
f9f3be843b Specify default path for SHLIBDIR before bsd.own.mk does.
This fix shared library installed correct place.
2006-06-11 09:14:06 +00:00
delphij
1489501378 Don't build IPv6 support if we have choosen not to have it. 2006-06-09 18:11:29 +00:00
ume
2d16d1ab8e Bump library majro version for gethostbyaddr(3). 2006-05-21 15:15:21 +00:00
des
748c235cfd Add utility functions for checking if a given kernel module is loaded,
and loading it.
2006-02-18 11:25:28 +00:00
pjd
a5fe3401b9 Add a family of functions for reliable pidfiles handling.
Idea from:	jmg
Discussed on:	arch@
2005-08-24 17:21:38 +00:00
kensmith
f97f77429f Bump the shared library version number of all libraries that have not
been bumped since RELENG_5.

Reviewed by:	ru
Approved by:	re (not needed for commit check but in principle...)
2005-07-22 17:19:05 +00:00
pjd
d207894810 Add humanize_number(3) to libutil for formating numbers into a human
readable form.

Obtained from:	NetBSD
2004-05-24 22:19:27 +00:00
kientzle
48517ca7da Back out the "clean_environment()" function from libutil.
Further contemplation has convinced me that this was
not going to really solve the problem of environment-poisoning
without raising serious administrative headaches.  There
must be a better way...
2004-02-29 22:13:28 +00:00
kientzle
8b8fb9aae5 Add a clean_environment call to libutil.
This function removes all environment variables except
the ones listed on a "whitelist."

The function accepts two whitelist arguments.
If the first is NULL, a built-in default list will be
used.  This allows callers to get a variety of behaviors:
  * Default screening: provide NULL for both lists
  * Custom screening: provide a custom list for the first argument
  * Modified default screening: provide NULL for first arg,
     list of additional variables to preserve in the second arg

Idea from: Jacques Vidrine

MFC after: 2 weeks
2004-02-26 22:41:47 +00:00
rwatson
ba0d21ac7c Bump the major version on libtuil. libutil now relies on the mac_*
symbols exported by newer versions of libc, and so we want applications
depending on the newer library code to be required to link against the
newer libc.

Discussed with:	scottl, kris, imp
2003-11-12 21:56:07 +00:00
markm
4d1565cf18 Remove a GCC specifig CFLAG. We should be using WARNS=? for this.
WARNS=? is not added here at this point, because I've not tested
it on enough platforms, and I don't want to break builds.
2003-10-18 09:58:39 +00:00
obrien
372364ee0f style.Makefile(5) 2003-08-18 15:25:39 +00:00
gordon
5901302929 Stage 3 of dynamic root support. Make all the libraries needed to run
binaries in /bin and /sbin installed in /lib. Only the versioned files
reside in /lib, the .so symlink continues to live /usr/lib so the
toolchain doesn't need to be modified.
2003-08-17 08:28:46 +00:00
peter
0a7f0ba37e Zap now-unused SHLIB_MINOR 2002-09-28 00:25:32 +00:00
sobomax
43c345ecb4 Backout previous delta (addition of -I${.CURDIR}/../../sys).
Submitted by:	bde
2002-06-26 13:25:23 +00:00
sobomax
d2858dfb8c Add -I${.CURDIR}/../../sys into CFLAGS, which should fix the world broken
by RLIMIT_VMEM addition.
2002-06-26 10:33:10 +00:00
des
ac9ea0e5ca Add passwd manipulation code based on parts of vipw and chpass.
Sponsored by:	DARPA, NAI Labs
2002-05-08 00:50:07 +00:00
rwatson
a86bfc340f o Reflect repo-copy of extattr.[c3] from libutil to libc, moving
extattr namespace routines to the libc/posix1e directory.  While
  the extattr calls are not strictly POSIX.1e, POSIX.1e wasn't
  strictly ever approved, so I think that's OK.

Obtained from:	TrustedBSD Project
2001-11-16 05:09:45 +00:00
assar
6ea84229c5 remove emalloc,ecalloc,erealloc,estrdup 2001-07-23 12:42:07 +00:00
assar
8668d65218 add ecalloc, emalloc, erealloc, estrdup - versions of the e-less
functions that exit instead of failing
2001-07-22 22:26:37 +00:00
dd
4d18dfe3ca Add a manual page for extattr_string_to_namespace and
extattr_namespace_to_string.

Reviewed by:	rwatson
2001-06-24 23:54:46 +00:00
ru
52a9144c8b Removed -I${.CURDIR}/.../sys from CFLAGS. 2001-05-18 13:41:42 +00:00
ru
25ef23ac1c MAN[1-9] -> MAN. 2001-03-27 17:27:19 +00:00
rwatson
f843a4812b 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.

Obtained from:	TrustedBSD Project
2001-03-15 03:00:39 +00:00
brian
8a3521bf30 Move trimdomain() into it's own source file and tidy things up a bit.
Fix disorder in the Makefile.

Reviewed (mostly) by: bde
2001-03-14 20:51:15 +00:00
green
4873d87d03 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.
2000-10-27 01:19:02 +00:00
brian
5990f9fefc Move setproctitle() from libutil to libc (after a repo-copy)
and bump __FreeBSD_version to 500012 to mark the occasion.

setproctitle() is prototyped in unistd.h as opposed to stdlib.h
where OpenBSD and NetBSD have it.

Reviewed by: peter
2000-09-02 01:51:36 +00:00
green
678850dbf8 Stick login_setcryptfmt() in its own file to make pulling in of
-lcrypt only happen if truly necessary.
2000-08-23 03:45:57 +00:00
green
67c40ef892 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 :)

Reviewed by:	peter
2000-08-22 02:15:54 +00:00
shin
4cef96843a Update major version.
Now libutil depends on libc.so.4, so needs to update the major version.
    Without this, old binaries which use libutil and build with libc.so.3
    will coredump on recent 4.0.

Solicited comment for cvs-committers and there seems to be no objection.

Approved by: jkh
2000-02-14 03:55:27 +00:00
joe
f1a9497df5 Historically file flags (schg, uschg, etc) have been converted from
string to u_long and back using two functions, flags_to_string and
string_to_flags, which co-existed with 'ls'.  As time has progressed
more and more other tools have used these private functions to
manipulate the file flags.

Recently I moved these functions from /usr/src/bin/ls to libutil,
but after some discussion with bde it's been decided that they
really ought to go in libc.

There are two already existing libc functions for manipulating file
modes:  setmode and getmode.  In keeping with these flags_to_string
has been renamed getflags and string_to_flags to setflags.

The manual page could probably be improved upon ;)
2000-01-27 21:17:01 +00:00
shin
fc29f7bcf7 several tcp apps IPv6 update
-inetd
 -rshd
 -rlogind
 -telnetd
 -rsh
 -rlogin

Reviewed by: freebsd-arch, cvs-committers
Obtained from: KAME project
2000-01-25 14:52:10 +00:00
rgrimes
c127d0e61e Replace beforeinstall target with new variables used by .mk system.
Reviewed by:	marcel, and make world
2000-01-14 07:57:47 +00:00
joe
a381d987c4 Moved flags_to_string and string_to_flags into libutil. It's used in
many places nowadays.
1999-12-30 13:15:15 +00:00
peter
e8ea19d78e Connect fparseln(3) for mailwrapper(8) 1999-12-29 17:50:34 +00:00
jkoshy
df1840f5b6 Link manual page for login_getpwclass(3) to login_cap(3).
PR:             docs/14673
Submitted by:   Andrew <andrew@ugh.net.au>
1999-11-04 08:33:18 +00:00
sheldonh
a9521339a7 Axe LOGIN_CAP_AUTH.
PR:	10115
Reported by:	Gene Skonicki <gene@cif.rochester.edu>
Requested by:	jdp
1999-08-13 16:51:40 +00:00
sheldonh
c532a2c93a Fix commented out CFLAGS addition for LOGIN_CAP_AUTH, which was missing
a make -D option.

PR:	12591
Submitted by:	Craig Leres <leres@ee.lbl.gov>
1999-07-12 14:27:58 +00:00
ache
cb803ec709 add MLINKS for two functions used from login_auth.c
comment out unused functions from login_auth.3
1999-04-24 16:30:30 +00:00