aboutsummaryrefslogtreecommitdiff
path: root/lib/libutil
Commit message (Collapse)AuthorAgeFilesLines
...
* | | | | | | | Use src.opts.mk in preference to bsd.own.mk except where we need stuffWarner Losh2014-05-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | from the latter. Notes: svn path=/head/; revision=265420
* | | | | | | | Fix a typo.Mark Johnston2014-05-031-1/+1
| |_|_|_|_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MFC after: 3 days Notes: svn path=/head/; revision=265276
* | | | | | | libutil/pw_util.3: Fix two prototypes.Eitan Adler2014-02-131-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reported by: marino Obtained from: DragonFlyBSD (e82b5d3dfa969bfcda5ffadceccc682b6bdcd077) MFC After: 3 days Notes: svn path=/head/; revision=261824
* | | | | | | Indicate that expand_number is case-insensitive.Eitan Adler2013-11-121-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reviewed by: -scsi Notes: svn path=/head/; revision=258026
* | | | | | | Mention in login.conf.5 which fields may be infinite and how to specifify ↵Eitan Adler2013-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> Notes: svn path=/head/; revision=257205
* | | | | | | All man pages refer to FreeBSD so there is no need to mention "In .Fx"Eitan Adler2013-10-271-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Notes: svn path=/head/; revision=257204
* | | | | | | Add a resource limit for the total number of kqueues available to theKonstantin Belousov2013-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 Notes: svn path=/head/; revision=256850
* | | | | | don't assert on bad args, instead return an error..John-Mark Gurney2013-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 Notes: svn path=/head/; revision=256130
* | | | | The round of expand_number() cleanups.Sergey Kandaurov2013-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 Notes: svn path=/head/; revision=255069
* | | | | libutil: Use O_CLOEXEC for internal file descriptors from open().Jilles Tjoelker2013-08-285-9/+12
| | | | | | | | | | | | | | | | | | | | Notes: svn path=/head/; revision=255007
* | | | | Reset errno before strtoumax() call to properly detect ERANGE.Sergey Kandaurov2013-08-211-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Restore saved errno if strtoumax() call is successful. Reported by: ache Reviewed by: jilles MFC after: 1 week Notes: svn path=/head/; revision=254621
* | | | | Check strtoumax(3) for ERANGE in case of non-prefixed string.Sergey Kandaurov2013-08-211-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | OK'd by: silence on current@ MFC after: 1 week Notes: svn path=/head/; revision=254600
* | | | | Fix -Wunsequenced warningTim Kientzle2013-06-291-1/+1
| |_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | Submitted by: dt71@gmx.com Notes: svn path=/head/; revision=252376
* | | | When pidptr was passed as NULL to pidfile_open(3), we were returningPawel Jakub Dawidek2013-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 Notes: svn path=/head/; revision=248281
* | | | commit correct tested fix for gr_util.cDiane Bruce2013-03-091-46/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Approved by: theraven Notes: svn path=/head/; revision=248102
* | | | Cleanup gr_add() so it does not leak memDiane Bruce2013-03-072-53/+86
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is part of ongoing work on sbin/pw M libutil.h M gr_util.c Approved by: theraven Notes: svn path=/head/; revision=247919
* | | | Fixed documented prototype of kinfo_getproc(3).Ruslan Ermilov2013-03-011-2/+2
| |_|/ |/| | | | | | | | Notes: svn path=/head/; revision=247534
* | | libutil: fix typo in comment for gr_fini.Mateusz Guzik2013-01-131-1/+1
| | | | | | | | | | | | | | | | | | | | | Submitted by: Christoph Mallon <christoph.mallon gmx.de> Notes: svn path=/head/; revision=245390
* | | libutil: utilize strsep instead of strcat in a loop in gr_makeMateusz Guzik2013-01-131-6/+10
| | | | | | | | | | | | | | | | | | | | | Submitted by: Christoph Mallon <christoph.mallon gmx.de> Notes: svn path=/head/; revision=245387
* | | libutil: move group_line_format into the scop of its only user.Mateusz Guzik2013-01-131-2/+1
| | | | | | | | | | | | | | | | | | | | | Submitted by: Christoph Mallon <christoph.mallon gmx.de> Notes: svn path=/head/; revision=245386
* | | libutil: eliminate 'found' variable in gr_equalMateusz Guzik2013-01-131-8/+5
| | | | | | | | | | | | | | | | | | | | | Submitted by: Christoph Mallon <christoph.mallon gmx.de> Notes: svn path=/head/; revision=245385
* | | Simplify pointing dst after the end of all the gr_mem pointers in newgrBaptiste Daroussin2012-12-281-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | Submitted by: pjd Reviewed by: db Notes: svn path=/head/; revision=244780
* | | errno = ENOMEM was supposed to be removed not return (NULL);Baptiste Daroussin2012-12-281-1/+1
| | | | | | | | | | | | | | | | | | | | | Submitted by: gcooper Notes: svn path=/head/; revision=244779
* | | malloc() sets errno to ENOMEM already.Baptiste Daroussin2012-12-281-5/+1
| | | | | | | | | | | | | | | | | | | | | Submitted by: Christoph Mallon <christoph.mallon@gmx.de> Notes: svn path=/head/; revision=244778
* | | Do not leave parts of the new group uninitialized in gr_dup().Baptiste Daroussin2012-12-281-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | Submitted by: Christoph Mallon <christoph.mallon@gmx.de> Reported by: pjd Notes: svn path=/head/; revision=244777
* | | avoid arithmetic on uintptr_tBaptiste Daroussin2012-12-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Submitted by: pjd Reviewed by: jilles Notes: svn path=/head/; revision=244747
* | | cast to uintptr_t to properly calculate offsetBaptiste Daroussin2012-12-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Reported by: mdf Submitted by: db Notes: svn path=/head/; revision=244745
* | | Add O_CLOEXEC to flopenBaptiste Daroussin2012-12-272-2/+2
| | | | | | | | | | | | | | | | | | | | | Requested by: jilles Notes: svn path=/head/; revision=244744
* | | gr_dup: simplify duplication of groupBaptiste Daroussin2012-12-271-21/+20
| | | | | | | | | | | | | | | | | | | | | Submitted by: db Notes: svn path=/head/; revision=244742
* | | - Clean up previous gr_add use malloc instead of callocBaptiste Daroussin2012-12-272-5/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | - Fix tinderbox error Submitted by: db Notes: svn path=/head/; revision=244739
* | | New gr_add function to provide a clean and safe method to append a new memberBaptiste Daroussin2012-12-272-0/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | into an existing group. Submitted by: db Notes: svn path=/head/; revision=244736
* | | Use flopen(3) instead of open(2) + flock(2)Baptiste Daroussin2012-12-272-9/+4
| | | | | | | | | | | | Notes: svn path=/head/; revision=244735
* | | only rename(2) after chmod(2) has succeedBaptiste Daroussin2012-11-201-7/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | report error if chmod(2) fails Reported by: jh Notes: svn path=/head/; revision=243334
* | | change mode the group file to 0644 after a successfull rename(2)Baptiste Daroussin2012-11-201-1/+8
| |/ |/| | | | | Notes: svn path=/head/; revision=243328
* | Fix typoBaptiste Daroussin2012-11-031-1/+1
| | | | | | | | Notes: svn path=/head/; revision=242503
* | Correct attribution.Dag-Erling Smørgrav2012-10-311-3/+8
| | | | | | | | Notes: svn path=/head/; revision=242398
* | Minor mdoc and language fixes.Joel Dahl2012-10-301-3/+2
| | | | | | | | Notes: svn path=/head/; revision=242383
* | Removed unnecessary bits in the header that shows where I stole the templateBaptiste Daroussin2012-10-301-3/+0
| | | | | | | | Notes: svn path=/head/; revision=242382
* | Document the pw_util(3) functionsBaptiste Daroussin2012-10-302-1/+299
| | | | | | | | | | | | | | Reviewed by: des, gjb Notes: svn path=/head/; revision=242381
* | backout r242319, racy and not done in the right placeBaptiste Daroussin2012-10-292-18/+0
| | | | | | | | | | | | | | Reported by: Garrett Cooper <yanegomi@gmail.com> Notes: svn path=/head/; revision=242324
* | make pw_init and gr_init fail if the specified master password or group file isBaptiste Daroussin2012-10-292-0/+20
| | | | | | | | | | | | | | | | | | a directory. MFC after: 1 month Notes: svn path=/head/; revision=242319
* | Fix IEC / SI binary prefixes (Ki, Mi, Gi, etc) production by humanize_number(3)Baptiste Daroussin2012-09-121-1/+1
| | | | | | | | | | | | | | | | | | PR: bin/171487 Submitted by: matthew MFC after: 1 week Notes: svn path=/head/; revision=240391
* | Switch the default password hash from md5 to sha512.Dag-Erling Smørgrav2012-06-191-1/+1
| | | | | | | | | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=237269
* | Revert user comparison back to user names as some user can share uids (root/toorBaptiste Daroussin2012-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 Notes: svn path=/head/; revision=237268
* | Finally nuke auth.conf, nine years after it was deprecated. The onlyDag-Erling Smørgrav2012-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 Notes: svn path=/head/; revision=236965
* | Document that we also support sha256 and sha512.Dag-Erling Smørgrav2012-06-081-1/+3
|/ | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=236751
* General mdoc(7) and typo fixes.Glen Barber2012-05-121-1/+2
| | | | | | | | | PR: 167804 Submitted by: Nobuyuki Koganemaru (kogane!jp.freebsd.org) MFC after: 3 days Notes: svn path=/head/; revision=235337
* mdoc: terminate quoted strings.Joel Dahl2012-03-301-53/+53
| | | | Notes: svn path=/head/; revision=233698
* mandoc complains loudly when <TAB>s are misused in columnated lists. FixJoel Dahl2012-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. Notes: svn path=/head/; revision=233665
* Remove trailing whitespace per mdoc lint warningEitan Adler2012-03-292-4/+4
| | | | | | | | | | Disussed with: gavin No objection from: doc Approved by: joel MFC after: 3 days Notes: svn path=/head/; revision=233648