Mark Johnston
0eca77fd24
Fix a typo.
...
MFC after: 3 days
2014-05-03 16:18:42 +00:00
Simon J. Gerraty
9d2ab4a62d
Merge head
2014-04-27 08:13:43 +00:00
Eitan Adler
1748334408
libutil/pw_util.3: Fix two prototypes.
...
Reported by: marino
Obtained from: DragonFlyBSD (e82b5d3dfa969bfcda5ffadceccc682b6bdcd077)
MFC After: 3 days
2014-02-13 05:13:22 +00:00
Eitan Adler
69b2d025a0
Indicate that expand_number is case-insensitive.
...
Reviewed by: -scsi
2013-11-12 00:56:22 +00:00
Eitan Adler
efac066db1
Mention in login.conf.5 which fields may be infinite and how to specifify 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>
2013-10-27 04:59:18 +00:00
Eitan Adler
23f182d7fe
All man pages refer to FreeBSD so there is no need to mention "In .Fx"
2013-10-27 04:49:40 +00:00
Konstantin Belousov
85a0ddfd0b
Add a resource limit for the total number of kqueues available to the
...
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
2013-10-21 16:46:12 +00:00
Simon J. Gerraty
3caf0790a8
Merge head@256284
2013-10-13 02:35:19 +00:00
John-Mark Gurney
44f01c419d
don't assert on bad args, instead return an error..
...
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
2013-10-07 22:22:57 +00:00
Simon J. Gerraty
d1d0158641
Merge from head
2013-09-05 20:18:59 +00:00
Sergey Kandaurov
8d99b9cebd
The round of expand_number() cleanups.
...
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
2013-08-30 11:21:52 +00:00
Jilles Tjoelker
d1d4d95209
libutil: Use O_CLOEXEC for internal file descriptors from open().
2013-08-28 21:10:37 +00:00
Sergey Kandaurov
7261b203c6
Reset errno before strtoumax() call to properly detect ERANGE.
...
Restore saved errno if strtoumax() call is successful.
Reported by: ache
Reviewed by: jilles
MFC after: 1 week
2013-08-21 22:37:15 +00:00
Sergey Kandaurov
869f276295
Check strtoumax(3) for ERANGE in case of non-prefixed string.
...
OK'd by: silence on current@
MFC after: 1 week
2013-08-21 16:46:06 +00:00
Tim Kientzle
64330eb00f
Fix -Wunsequenced warning
...
Submitted by: dt71@gmx.com
2013-06-29 15:52:48 +00:00
Simon J. Gerraty
69e6d7b75e
sync from head
2013-04-12 20:48:55 +00:00
Pawel Jakub Dawidek
36a00a3f38
When pidptr was passed as NULL to pidfile_open(3), we were returning
...
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
2013-03-14 20:22:52 +00:00
Simon J. Gerraty
7cf3a1c6b2
Updated dependencies
2013-03-11 17:21:52 +00:00
Diane Bruce
5e87983769
commit correct tested fix for gr_util.c
...
Approved by: theraven
2013-03-09 13:30:06 +00:00
Diane Bruce
86e2f99d40
Cleanup gr_add() so it does not leak mem
...
This is part of ongoing work on sbin/pw
M libutil.h
M gr_util.c
Approved by: theraven
2013-03-07 19:00:00 +00:00
Ruslan Ermilov
d1a0cea48b
Fixed documented prototype of kinfo_getproc(3).
2013-03-01 07:39:14 +00:00
Simon J. Gerraty
f5f7c05209
Updated dependencies
2013-02-16 01:23:54 +00:00
David E. O'Brien
d9a447559b
Sync with HEAD.
2013-02-08 16:10:16 +00:00
Mateusz Guzik
08ecf0cc41
libutil: fix typo in comment for gr_fini.
...
Submitted by: Christoph Mallon <christoph.mallon gmx.de>
2013-01-13 22:08:18 +00:00
Mateusz Guzik
49013fb476
libutil: utilize strsep instead of strcat in a loop in gr_make
...
Submitted by: Christoph Mallon <christoph.mallon gmx.de>
2013-01-13 21:28:47 +00:00
Mateusz Guzik
fe75b0f0e5
libutil: move group_line_format into the scop of its only user.
...
Submitted by: Christoph Mallon <christoph.mallon gmx.de>
2013-01-13 21:26:57 +00:00
Mateusz Guzik
29365f023a
libutil: eliminate 'found' variable in gr_equal
...
Submitted by: Christoph Mallon <christoph.mallon gmx.de>
2013-01-13 21:25:43 +00:00
Baptiste Daroussin
7780953ee4
Simplify pointing dst after the end of all the gr_mem pointers in newgr
...
Submitted by: pjd
Reviewed by: db
2012-12-28 20:44:10 +00:00
Baptiste Daroussin
fe390747e4
errno = ENOMEM was supposed to be removed not return (NULL);
...
Submitted by: gcooper
2012-12-28 20:30:04 +00:00
Baptiste Daroussin
d00489b70f
malloc() sets errno to ENOMEM already.
...
Submitted by: Christoph Mallon <christoph.mallon@gmx.de>
2012-12-28 20:21:14 +00:00
Baptiste Daroussin
167145a17d
Do not leave parts of the new group uninitialized in gr_dup().
...
Submitted by: Christoph Mallon <christoph.mallon@gmx.de>
Reported by: pjd
2012-12-28 20:19:54 +00:00
Baptiste Daroussin
5019747579
avoid arithmetic on uintptr_t
...
Submitted by: pjd
Reviewed by: jilles
2012-12-27 20:47:34 +00:00
Baptiste Daroussin
7d90019877
cast to uintptr_t to properly calculate offset
...
Reported by: mdf
Submitted by: db
2012-12-27 20:31:12 +00:00
Baptiste Daroussin
ede89d5db2
Add O_CLOEXEC to flopen
...
Requested by: jilles
2012-12-27 20:24:44 +00:00
Baptiste Daroussin
1067c64a19
gr_dup: simplify duplication of group
...
Submitted by: db
2012-12-27 19:33:43 +00:00
Baptiste Daroussin
2bfeb4fe75
- Clean up previous gr_add use malloc instead of calloc
...
- Fix tinderbox error
Submitted by: db
2012-12-27 16:51:29 +00:00
Baptiste Daroussin
be49c83011
New gr_add function to provide a clean and safe method to append a new member
...
into an existing group.
Submitted by: db
2012-12-27 14:30:19 +00:00
Baptiste Daroussin
98e79fb122
Use flopen(3) instead of open(2) + flock(2)
2012-12-27 14:09:50 +00:00
Baptiste Daroussin
09259e6c48
only rename(2) after chmod(2) has succeed
...
report error if chmod(2) fails
Reported by: jh
2012-11-20 14:03:09 +00:00
Baptiste Daroussin
2d2b6ad74d
change mode the group file to 0644 after a successfull rename(2)
2012-11-20 07:22:07 +00:00
Simon J. Gerraty
7cd2dcf076
Updated/new Makefile.depend
2012-11-08 21:24:17 +00:00
Simon J. Gerraty
23090366f7
Sync from head
2012-11-04 02:52:03 +00:00
Baptiste Daroussin
46f8c63df6
Fix typo
2012-11-03 00:30:22 +00:00
Dag-Erling Smørgrav
192bc3edf4
Correct attribution.
2012-10-31 15:04:27 +00:00
Joel Dahl
2acb4741ca
Minor mdoc and language fixes.
2012-10-30 22:30:30 +00:00
Baptiste Daroussin
f5a05b2ba4
Removed unnecessary bits in the header that shows where I stole the template
2012-10-30 22:26:19 +00:00
Baptiste Daroussin
42818163b4
Document the pw_util(3) functions
...
Reviewed by: des, gjb
2012-10-30 22:18:08 +00:00
Baptiste Daroussin
b3d9795c98
backout r242319, racy and not done in the right place
...
Reported by: Garrett Cooper <yanegomi@gmail.com>
2012-10-29 18:06:09 +00:00
Baptiste Daroussin
29e575503c
make pw_init and gr_init fail if the specified master password or group file is
...
a directory.
MFC after: 1 month
2012-10-29 17:19:43 +00:00
Baptiste Daroussin
de0bfe73b9
Fix IEC / SI binary prefixes (Ki, Mi, Gi, etc) production by humanize_number(3)
...
PR: bin/171487
Submitted by: matthew
MFC after: 1 week
2012-09-12 11:41:03 +00:00