summaryrefslogtreecommitdiffstats
path: root/libutil/libutil.h
Commit message (Collapse)AuthorAgeFilesLines
* Merge hexdump(9) to userland as hexdump(3) in libutil. I'm tired of doingJohn Baldwin2008-07-011-0/+8
| | | | | | this by hand in userland utilities. MFC after: 1 month
* Add four utility functions related to struct grp processing modeled in-partSean Farley2008-04-231-0/+7
| | | | | | | | | | | | | | | | | | | 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
* Constify the first argument to expand_number() so that it canJohn Birrell2007-11-181-1/+1
| | | | be called with a const without the compiler grisling.
* Implement expand_number(3), which is the opposite of humanize_number(3), ie.Pawel Jakub Dawidek2007-09-011-0/+1
| | | | | | | | | | 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)
* Well gag me with a spoon... I'm so used to working at high WARNS levelsDag-Erling Smørgrav2007-05-101-1/+1
| | | | that I make stupid fundamental mistakes like this when I don't.
* I'm tired of seeing this done incorrectly and non-portably, so add aDag-Erling Smørgrav2007-05-101-0/+1
| | | | | | flopen(3) function which reliably opens and locks a file. MFC after: 3 weeks
* Add utility functions for checking if a given kernel module is loaded,Dag-Erling Smørgrav2006-02-181-0/+5
| | | | and loading it.
* Add a family of functions for reliable pidfiles handling.Pawel Jakub Dawidek2005-08-241-0/+17
| | | | | Idea from: jmg Discussed on: arch@
* Add humanize_number(3) to libutil for formating numbers into a humanPawel Jakub Dawidek2004-05-241-0/+11
| | | | | | readable form. Obtained from: NetBSD
* Add the clean_environment call to libutil.h also.Tim Kientzle2004-02-261-0/+2
| | | | MFC after: 2 weeks
* ANSIfy, WARNSify, CONSTify. Bit of style(9)-ify.Mark Murray2003-10-181-6/+4
|
* Add passwd manipulation code based on parts of vipw and chpass.Dag-Erling Smørgrav2002-05-081-0/+29
| | | | Sponsored by: DARPA, NAI Labs
* Remove multi-line __P() usage.David E. O'Brien2002-03-221-8/+7
|
* Remove __P() usage.David E. O'Brien2002-03-211-17/+17
|
* remove emalloc,ecalloc,erealloc,estrdupAssar Westerlund2001-07-231-4/+0
|
* add ecalloc, emalloc, erealloc, estrdup - versions of the e-lessAssar Westerlund2001-07-221-0/+4
| | | | functions that exit instead of failing
* o Slap some "_"'s in front of variable names relating to extattr functions,Robert Watson2001-03-221-3/+3
| | | | | | so as not to pollute application namespace. Submitted by: bde
* o Rename "namespace" argument to "attrnamespace" as namespace is a C++Robert Watson2001-03-191-2/+3
| | | | | | | | reserved word, causing breakage when a C++ program included libutil.h This change will be propagated elsewhere shortly. Submitted by: jkh Obtained from: TrustedBSD Project
* o To support new EA interface with explicit namespaces, introduce twoRobert Watson2001-03-151-0/+2
| | | | | | | | | | | 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
* Added PROPERTY_MAX_VALUE and PROPERTY_MAX_NAME defines to libutil.h soMurray Stokely2000-11-081-0/+3
| | | | | | | that applications know how large of a buffer they must allocate before calling property_find(). Also added a $FreeBSD$ tag while I'm here. Approved by: jkh
* Constify the arg to logout(3). It is const-safe.Peter Wemm2000-09-041-1/+1
| | | | (cosmetic: drop some "register" qualifications too.)
* Move setproctitle() from libutil to libc (after a repo-copy)Brian Somers2000-09-021-1/+0
| | | | | | | | | 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
* Use a more conventional copyright message.Peter Wemm2000-01-261-9/+14
|
* several tcp apps IPv6 updateYoshinobu Inoue2000-01-251-0/+3
| | | | | | | | | | | | -inetd -rshd -rlogind -telnetd -rsh -rlogin Reviewed by: freebsd-arch, cvs-committers Obtained from: KAME project
* Connect fparseln(3) for mailwrapper(8)Peter Wemm1999-12-291-0/+10
|
* $Id$ -> $FreeBSD$Peter Wemm1999-08-281-1/+1
|
* Add realhostname() - a function to correctly lookupBrian Somers1999-04-061-1/+9
| | | | | a name by address and ensure that the name resolves back to the original address.
* Declare setproctitle() as printf0-like.Bruce Evans1998-12-161-2/+2
|
* o move path in libutil.h to paths.hJordan K. Hubbard1998-10-091-2/+2
| | | | | o make property_read() take a fd instead to avoid stdio.h mess o update auth to new interface.
* Take the path spec back out.Jordan K. Hubbard1998-10-091-4/+1
|
* remove stdio.h include; I forgot Bruce's cardinal rule that header filesJordan K. Hubbard1998-10-081-2/+1
| | | | | | shouldn't include other ones (which, unfortunately, is also a hellish rule since he broke interfaces like sysctl this way by requiring undocumented header files to be included just in order to be able to use them now - SIGH!).
* Add a simple mechanism for reading property lists from files (whichJordan K. Hubbard1998-10-071-1/+16
| | | | | | | I'll convert sysinstall to use shortly) and a simple call which uses this mechanism to implement an /etc/auth.conf file. I'll let Mark Murray handle the format and checkin of the sample auth.conf file. Reviewed by: markm
* Add missing uu_lock_txfr() prototypeAndrey A. Chernov1998-06-051-1/+2
|
* Trim a domain part for wtmp as same as showed by "netstat -r".Atsushi Murai1998-06-011-2/+2
| | | | | | | | | | | | | Here is a some example for avoiding a confusion. It asssumes a logged host domain is "spec.co.jp". All example is longer than UT_HOSTNAMELEN value. 1) turbo.tama.spec.co.jp: 192.19.0.2 -> trubo.tama 2) turbo.tama.foo.co.jp : 192.19.0.2 -> 192.19.0.2 3) specgw.spec.co.jp : 202.32.13.1 -> specgw Submitted by: Atsushi Murai <amurai@spec.co.jp>
* Add uu_lock_txfr() to transfer ownership of a successfulBrian Somers1998-05-281-1/+3
| | | | uu_lock() to another process.
* The parameters to logwtmp should be const char'sPaul Traina1997-09-041-2/+2
|
* Remove login_progok()Brian Somers1997-08-311-2/+1
| | | | Suggested by: guido
* Add full support for determining if a userBrian Somers1997-08-271-1/+2
| | | | is restricted from running a given program.
* Implement canonical locking protocolAndrey A. Chernov1997-08-101-2/+4
| | | | Suggested by: joerg
* Now I really understand the reason for the style.9 rule about not havingPeter Wemm1997-05-191-14/+14
| | | | | | | visible type names in prototypes in user space headers. libutil.h generates warnings with -Wall over the use of "const char *ttyname". It's lucky it wasn't a #define conflict. Is a single '_' prefix acceptable? or does it need to be two?
* Make uu_* const correct.Brian Somers1997-05-121-4/+4
| | | | Suggested by: joerg
* Summary of login.conf support changes:David Nugent1997-05-101-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | o Incorporated BSDI code and enhancements, better logging for error checking (which has been shown to be a problem, and is therefore justified, imho); also some minor things we were missing, including better quad_t math, which checks for under/overflows. o setusercontext() now allows user resource limit overrides, but does this AFTER dropping root privs, to restrict the user to droping hard limits and set soft limits within the kernel's allowed user limits. o umask() only set once, and only if requested. o add _secure_path(), and use in login.conf to guard against symlinks etc. and non-root owned or non-user owned files being used. Derived from BSDI contributed code. o revamped authentication code to BSDI's latest api, which includes deleting authenticate() and adding auth_check() and a few other functions. This is still marked as depecated in BSDI, but is included for completeness. No other source in the tree uses this anyway, so it is now bracketed with #ifdef LOGIN_CAP_AUTH which is by default not defined. Only auth_checknologin() and auth_cat() are actually used in module login_auth.c. o AUTH_NONE definition removed (collided with other includes in the tree). [bde] o BSDI's login_getclass() now accepts a char *classname parameter rather than struct passwd *pwd. We now do likewise, but added login_getpwclass() for (sort of) backwards compatiblity, namely because we handle root as a special case for the default class. This will require quite a few changes elsewhere in the source tree. o We no longer pretend to support rlim_t as a long type. o Revised code formatting to be more bsd-ish style.
* Remove the syslog stuff, and allow various return valuesBrian Somers1997-03-311-1/+9
| | | | | | | | | in uu_lock(). Add uu_lockerr() for turning the results of uu_lock into something printable. Remove bogus section in man page about race conditions allowing both processes to get the lock. Include libutil.h and use uu_lock() correctly where it should. Suggested by: ache@freebsd.org
* Move uucplock into libutil and create a manual page.Brian Somers1997-03-301-1/+3
|
* Revert $FreeBSD$ to $Id$Peter Wemm1997-02-221-1/+1
|
* Make the long-awaited change from $Id$ to $FreeBSD$Jordan K. Hubbard1997-01-141-1/+1
| | | | | | | | 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.
* Finally document the interfaces found in libutil. While being here,Joerg Wunsch1996-12-291-1/+3
| | | | | | | | | also add the missing declaration of forkpty() to libutil.h. Btw., the calling interface for login(3) is crude. Some better abstraction is needed, perhaps similar to logwtmp(3). 2.2 candidate, but i'll wait for the spelling police first. :)
* Bump libutil revision after recent addition of setproctitle().Peter Wemm1996-01-011-0/+44
Install (optional) libutil.h with prototypes for the functions and document this in the man page. minor cleanups to the various routines, include the prototype file, declare return codes etc.