summaryrefslogtreecommitdiffstats
path: root/lib/libutil
Commit message (Collapse)AuthorAgeFilesLines
* Use src.opts.mk in preference to bsd.own.mk except where we need stuffimp2014-05-061-1/+1
| | | | from the latter.
* Fix a typo.markj2014-05-031-1/+1
| | | | MFC after: 3 days
* libutil/pw_util.3: Fix two prototypes.eadler2014-02-131-2/+2
| | | | | | Reported by: marino Obtained from: DragonFlyBSD (e82b5d3dfa969bfcda5ffadceccc682b6bdcd077) MFC After: 3 days
* Indicate that expand_number is case-insensitive.eadler2013-11-121-1/+2
| | | | Reviewed by: -scsi
* Mention in login.conf.5 which fields may be infinite and how to specifify ↵eadler2013-10-271-0/+10
| | | | | | | | | | infinity. The number of ways to indicate this confuses people. PR: docs/100196 Reported by: "Dr. Markus Waldeck" <waldeck@gmx.de> Reported by: Jamie Landeg Jones <jamie.landeg.jones@gmail.com>
* All man pages refer to FreeBSD so there is no need to mention "In .Fx"eadler2013-10-271-3/+1
|
* Add a resource limit for the total number of kqueues available to thekib2013-10-212-0/+2
| | | | | | | | | | | | | | | | | | user. Kqueue now saves the ucred of the allocating thread, to correctly decrement the counter on close. Under some specific and not real-world use scenario for kqueue, it is possible for the kqueues to consume memory proportional to the square of the number of the filedescriptors available to the process. Limit allows administrator to prevent the abuse. This is kernel-mode side of the change, with the user-mode enabling commit following. Reported and tested by: pho Discussed with: jmg Sponsored by: The FreeBSD Foundation MFC after: 2 weeks
* don't assert on bad args, instead return an error..jmg2013-10-072-37/+54
| | | | | | | | | | | | | | | Since so many programs don't check return value, always NUL terminate the buf... fix rounding when using base 1024 (the bug that started it all)... add a set of test cases so we can make sure that things don't break in the future... Thanks to Clifton Royston for testing and the test program... Approved by: re (hrs, glebius) MFC after: 1 week
* The round of expand_number() cleanups.pluknet2013-08-301-29/+10
| | | | | | | | | o Fix range error checking to detect overflow when uint64_t < uintmax_t. o Remove a non-functional check for no valid digits as pointed out by Bruce. o Remove a rather pointless comment describing what the function does. o Clean up a bunch of style bugs. Brucified by: bde
* libutil: Use O_CLOEXEC for internal file descriptors from open().jilles2013-08-285-9/+12
|
* Reset errno before strtoumax() call to properly detect ERANGE.pluknet2013-08-211-0/+7
| | | | | | | | Restore saved errno if strtoumax() call is successful. Reported by: ache Reviewed by: jilles MFC after: 1 week
* Check strtoumax(3) for ERANGE in case of non-prefixed string.pluknet2013-08-211-0/+4
| | | | | OK'd by: silence on current@ MFC after: 1 week
* Fix -Wunsequenced warningkientzle2013-06-291-1/+1
| | | | Submitted by: dt71@gmx.com
* When pidptr was passed as NULL to pidfile_open(3), we were returningpjd2013-03-141-13/+18
| | | | | | | | | EAGAIN/EWOULDBLOCK when another daemon was running and had the pidfile open. We should return EEXIST in that case, fix it. Reported by: Dirk Engling <erdgeist@erdgeist.org> Reviewed by: jhb, Dirk Engling <erdgeist@erdgeist.org> MFC after: 1 week
* commit correct tested fix for gr_util.cdb2013-03-091-46/+58
| | | | Approved by: theraven
* Cleanup gr_add() so it does not leak memdb2013-03-072-53/+86
| | | | | | | | | This is part of ongoing work on sbin/pw M libutil.h M gr_util.c Approved by: theraven
* Fixed documented prototype of kinfo_getproc(3).ru2013-03-011-2/+2
|
* libutil: fix typo in comment for gr_fini.mjg2013-01-131-1/+1
| | | | Submitted by: Christoph Mallon <christoph.mallon gmx.de>
* libutil: utilize strsep instead of strcat in a loop in gr_makemjg2013-01-131-6/+10
| | | | Submitted by: Christoph Mallon <christoph.mallon gmx.de>
* libutil: move group_line_format into the scop of its only user.mjg2013-01-131-2/+1
| | | | Submitted by: Christoph Mallon <christoph.mallon gmx.de>
* libutil: eliminate 'found' variable in gr_equalmjg2013-01-131-8/+5
| | | | Submitted by: Christoph Mallon <christoph.mallon gmx.de>
* Simplify pointing dst after the end of all the gr_mem pointers in newgrbapt2012-12-281-2/+1
| | | | | Submitted by: pjd Reviewed by: db
* errno = ENOMEM was supposed to be removed not return (NULL);bapt2012-12-281-1/+1
| | | | Submitted by: gcooper
* malloc() sets errno to ENOMEM already.bapt2012-12-281-5/+1
| | | | Submitted by: Christoph Mallon <christoph.mallon@gmx.de>
* Do not leave parts of the new group uninitialized in gr_dup().bapt2012-12-281-0/+4
| | | | | Submitted by: Christoph Mallon <christoph.mallon@gmx.de> Reported by: pjd
* avoid arithmetic on uintptr_tbapt2012-12-271-1/+1
| | | | | Submitted by: pjd Reviewed by: jilles
* cast to uintptr_t to properly calculate offsetbapt2012-12-271-1/+1
| | | | | Reported by: mdf Submitted by: db
* Add O_CLOEXEC to flopenbapt2012-12-272-2/+2
| | | | Requested by: jilles
* gr_dup: simplify duplication of groupbapt2012-12-271-21/+20
| | | | Submitted by: db
* - Clean up previous gr_add use malloc instead of callocbapt2012-12-272-5/+4
| | | | | | - Fix tinderbox error Submitted by: db
* New gr_add function to provide a clean and safe method to append a new memberbapt2012-12-272-0/+42
| | | | | | into an existing group. Submitted by: db
* Use flopen(3) instead of open(2) + flock(2)bapt2012-12-272-9/+4
|
* only rename(2) after chmod(2) has succeedbapt2012-11-201-7/+3
| | | | | | report error if chmod(2) fails Reported by: jh
* change mode the group file to 0644 after a successfull rename(2)bapt2012-11-201-1/+8
|
* Fix typobapt2012-11-031-1/+1
|
* Correct attribution.des2012-10-311-3/+8
|
* Minor mdoc and language fixes.joel2012-10-301-3/+2
|
* Removed unnecessary bits in the header that shows where I stole the templatebapt2012-10-301-3/+0
|
* Document the pw_util(3) functionsbapt2012-10-302-1/+299
| | | | Reviewed by: des, gjb
* backout r242319, racy and not done in the right placebapt2012-10-292-18/+0
| | | | Reported by: Garrett Cooper <yanegomi@gmail.com>
* make pw_init and gr_init fail if the specified master password or group file isbapt2012-10-292-0/+20
| | | | | | a directory. MFC after: 1 month
* Fix IEC / SI binary prefixes (Ki, Mi, Gi, etc) production by humanize_number(3)bapt2012-09-121-1/+1
| | | | | | PR: bin/171487 Submitted by: matthew MFC after: 1 week
* Switch the default password hash from md5 to sha512.des2012-06-191-1/+1
| | | | MFC after: 1 week
* Revert user comparison back to user names as some user can share uids (root/toorbapt2012-06-191-6/+13
| | | | | | | | | | | for example) get the username information from old_pw structures to still allow renaming of a user. Reported by: Claude Buisson <clbuisson@orange.fr> Approved by: des (mentor) MFC after: 3 weeks
* Finally nuke auth.conf, nine years after it was deprecated. The onlydes2012-06-125-127/+7
| | | | | | | | | | | | | | | | | | thing it was still used for was to set the "global default" password hash. Since the stock auth.conf contained nothing but comments, the global default was actually the first algorithm in crypt(3)'s list, which happens to be DES; I take the fact that nobody noticed as proof that it was not used outside of crypt(3). The only other use in our tree was in the Kerberos support code in in tinyware's passwd(1). I removed that code in an earlier commit; it would not have compiled anyway, as it only supported Kerberos IV. The auth_getval() function is now a stub that always returns NULL, which has the same effect as a functional auth_getval() with an empty auth.conf. MFC after: 3 weeks
* Document that we also support sha256 and sha512.des2012-06-081-1/+3
| | | | MFC after: 1 week
* General mdoc(7) and typo fixes.gjb2012-05-121-1/+2
| | | | | | PR: 167804 Submitted by: Nobuyuki Koganemaru (kogane!jp.freebsd.org) MFC after: 3 days
* mdoc: terminate quoted strings.joel2012-03-301-53/+53
|
* mandoc complains loudly when <TAB>s are misused in columnated lists. Fixjoel2012-03-291-1/+1
| | | | | this syntax violation and while I'm here also convert <TAB> to Ta and adjust quotation marks in order to prevent this problem in the future.
* Remove trailing whitespace per mdoc lint warningeadler2012-03-292-4/+4
| | | | | | | Disussed with: gavin No objection from: doc Approved by: joel MFC after: 3 days
OpenPOWER on IntegriCloud