summaryrefslogtreecommitdiffstats
path: root/libutil
Commit message (Collapse)AuthorAgeFilesLines
* Add support for a new login capability, cpumask which allows loginBrooks Davis2008-07-251-1/+2
| | | | sessions to be pinned to cpus by login class.
* 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-232-0/+241
| | | | | | | | | | | | | | | | | | | 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)
* Back out previous commit until I figure out why my regression test fails.Dag-Erling Smørgrav2007-08-031-7/+4
| | | | Approved by: re (kensmith)
* Use fcntl(2)-style locks instead of less-portable flock(2)-style locks.Dag-Erling Smørgrav2007-08-031-4/+7
| | | | Approved by: re (kensmith)
* Update some comments, mostly regarding LOGIN_MECLASS and ~/.login_conf.Yaroslav Tykhiy2007-06-141-8/+18
|
* Nit: avoid shadowing truncate(2) with a local variable.Dag-Erling Smørgrav2007-05-231-3/+3
|
* Fix stupid braino in previous commit.Dag-Erling Smørgrav2007-05-231-1/+1
|
* If (flags & O_TRUNC), don't truncate the file until we've successfullyDag-Erling Smørgrav2007-05-231-1/+11
| | | | | | locked it. MFC after: 3 weeks
* Well gag me with a spoon... I'm so used to working at high WARNS levelsDag-Erling Smørgrav2007-05-102-1/+5
| | | | that I make stupid fundamental mistakes like this when I don't.
* Remove superfluous unexpanded RCS tag.Dag-Erling Smørgrav2007-05-101-2/+0
|
* DTRT when O_NONBLOCK is specified.Dag-Erling Smørgrav2007-05-101-4/+7
| | | | MFC after: 3 weeks
* I'm tired of seeing this done incorrectly and non-portably, so add aDag-Erling Smørgrav2007-05-102-0/+92
| | | | | | flopen(3) function which reliably opens and locks a file. MFC after: 3 weeks
* Remove California Regent's clause 3, per letterWarner Losh2007-01-091-4/+0
|
* Minor comment fix.Thomas Quinot2006-09-081-1/+1
|
* (pw_copy): Handle the case of a malformed line in master.passwdThomas Quinot2006-09-041-2/+11
| | | | | | | | (copy it silently, do not dereference NULL pointer). PR: bin/102848 Reviewed by: security-officer (cperciva) MFC after: 1 week
* 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@
* Properly spell default in a comment.Tom Rhodes2005-04-221-1/+1
|
* Grammar in a comment.Ruslan Ermilov2004-12-181-1/+1
|
* Add humanize_number(3) to libutil for formating numbers into a humanPawel Jakub Dawidek2004-05-241-0/+11
| | | | | | readable form. Obtained from: NetBSD
* Don't depend on NULL's expansion being a pointer, cast it before it is passedStefan Farfeleder2004-05-181-3/+4
| | | | | | to variadic functions. Approved by: das (mentor)
* Bring the description for login_getclassbyname in sync with the function'sDiomidis Spinellis2004-05-111-3/+4
| | | | | | | arguments. The function has as a second argument a struct passwd * pointer, not a directory name. MFC after: 2 weeks
* Add the clean_environment call to libutil.h also.Tim Kientzle2004-02-261-0/+2
| | | | MFC after: 2 weeks
* (mostly) Clean up some const warnings here. The code takes some libertiesPeter Wemm2003-10-261-8/+9
| | | | | because it is the originator of various const strings and knows that they came from malloc.
* ANSIfy, WARNSify, CONSTify. Bit of style(9)-ify.Mark Murray2003-10-185-74/+79
|
* Tidy up. Sort headers.Mark Murray2003-06-142-10/+9
|
* Brucify.Dag-Erling Smørgrav2003-04-101-4/+8
|
* Correctly detect the case where a password entry was changed while we wereDag-Erling Smørgrav2003-04-091-2/+7
| | | | | | preparing to edit it. PR: bin/50563
* Apply the correct fix for bin/50679: don't mess around with process groupsDag-Erling Smørgrav2003-04-091-13/+19
| | | | | | | or the tty, just block selected signals in the parent like system(3) does. Many thanks to bde for his assistance in finding the correct solution. PR: bin/50679
* Band-aid for the "^C kills the editor" problem. I haven't yet found theDag-Erling Smørgrav2003-04-081-10/+6
| | | | | | | | proper way to fix this. The way this works is to prepend "exec " to the editor command to eliminate the "shell in the middle" which prevents us from properly reawakening the editor after a SIGTSTP. PR: bin/50679
* Make pw_edit() use /bin/sh to interpret the EDITOR environmentDavid Schultz2003-03-171-2/+12
| | | | | | | variable. PR: 48748 Reviewed by: mike (mentor)
* Don't forget to '\n'-terminate new entries. This unbreaks chpass -a.Dag-Erling Smørgrav2002-10-291-1/+2
| | | | Submitted by: joerg
* Replace various spelling with FALLTHROUGH which is lint()ablePhilippe Charnier2002-08-251-1/+1
|
* Add LOGIN_SETMAC, which will indicate to the user context management codeRobert Watson2002-08-161-1/+2
| | | | | | | | that it should also set the user's default MAC label, if available and permitted. Obtained from: TrustedBSD Project Sponsored by: DARPA, NAI Labs
* Whitespace cleanup--it's not style(9), but it is consistent. PrepRobert Watson2002-08-111-3/+3
| | | | | | | for MAC-related commits to the login infrastructure. Obtained from: TrustedBSD Project Sponsored by: DARPA, NAI Labs
* Be more clear in error messages.Nick Hibma2002-06-231-4/+9
| | | | | | | Distinguish between a held lock and a failed lock op. If rpc.lockd is not running on a diskless client this makes clearer what the problem is.
* If no old_pw was passed to pw_copy, compare just the name.Dag-Erling Smørgrav2002-05-081-1/+2
| | | | Sponsored by: DARPA, NAI Labs
* Add passwd manipulation code based on parts of vipw and chpass.Dag-Erling Smørgrav2002-05-082-82/+433
| | | | Sponsored by: DARPA, NAI Labs
* Make mppath and masterpasswd pointers instead of arrays, and initializeDag-Erling Smørgrav2002-04-171-2/+4
| | | | | | | | | them to point at static strings that contain the default paths. This makes 'vipw -d' work again (I broke it in rev 1.21; apologies for taking so long to fix it.) Spotted by: Olivier Houchard <doginou@cognet.ci0.org> Sponsored by: DARPA, NAI Labs
* Remove bogus reference to _use_yp.Dag-Erling Smørgrav2002-04-151-9/+1
|
* Const poisoning.Ruslan Ermilov2002-04-083-14/+14
|
* Remove multi-line __P() usage.David E. O'Brien2002-03-221-8/+7
|
* Remove __P() usage.David E. O'Brien2002-03-212-64/+64
|
* Remove a bogus cast.Dag-Erling Smørgrav2002-03-061-1/+1
|
* #include <stddef.h> for the definition of NULL instead of depending onBruce Evans2002-02-251-1/+3
| | | | | | namespace pollution 2 layers deep in <sys/stat.h>. Sorted includes.
* ANSIfy and constify.Dag-Erling Smørgrav2002-02-051-17/+15
| | | | Sponsored by: DARPA, NAI Labs
* Add __FBSDID()s to libutilMatthew Dillon2001-09-303-6/+8
|