Commit Graph

473 Commits

Author SHA1 Message Date
Casper Dik
a4812cdf24 Fix getpeereid() compilation on Solaris
The code in getpeereid() is unlikely to compile as ucred_t is an opaque
struct (ucred_t * works but ucred_t does not). Either you need to give
a pointer initialized to NULL and getpeerucred() allocates a new ucred
or you call it with an allocated ucred as in this patch.

Signed-off-by: Guillem Jover <guillem@hadrons.org>
2013-05-27 04:05:17 +02:00
Guillem Jover
d3a09e1cf4 Switch dehumanize_number() to use expand_number()
The function is a duplicate of expand_number(), but covering less
prefixes and with a slightly different function signature.

Spotted-by: Peter da Silva <resuna@gmail.com>
2013-05-27 04:03:14 +02:00
Guillem Jover
330b569fe3 test: Add new humanize unit test 2013-05-27 03:41:48 +02:00
Guillem Jover
8c26c40ad2 test: Add setproctitle() unit test 2013-05-27 03:24:23 +02:00
Guillem Jover
e9933255d4 Make setproctitle() available in 0.2 and 0.5 version nodes
Make the 0.5 version the default, so that code wanting the actual
implemented version can get a proper versioned depdendency. For code
linked against the old version, make it available as an alias.
2013-05-27 03:24:22 +02:00
Guillem Jover
c984dacd65 Implement sendmail semantics for setproctitle()
Prefix the title with "progname: ", and skip it if the format string
starts with '-' (which gets skipped on output too).
2013-05-27 03:24:20 +02:00
Guillem Jover
35785f8dd1 Modify setproctitle() to conform to project coding style
Use local getprogname()/setprogname() instead of reimplementing them
locally. Use clearenv() if available, not just on glibc. Use bool
instead of _Bool. Use paranthesis on sizeof. Fold the SPT_MIN macro
into spt_min(). Make spt_init() static. Avoid unnecessary gotos.
2013-05-27 03:20:17 +02:00
William Ahern
2a0260d08c Add a setproctitle() implementation
Taken from libnostd.

Signed-off-by: Guillem Jover <guillem@hadrons.org>
2013-05-27 02:49:29 +02:00
Guillem Jover
f8d52ead5e Add x32 support to nlist() 2013-05-27 02:49:29 +02:00
Guillem Jover
cf683a275a Add arm64 (aka aarch64) to nlist() 2013-05-27 02:49:28 +02:00
Guillem Jover
7196b4dcca test: Add new fgetln() and fgetwln() unit test 2013-05-27 02:49:28 +02:00
Guillem Jover
a97ce513e0 Add new fgetwln() function
Man page taken from FreeBSD.
2013-05-27 02:49:28 +02:00
Strake
ee0489eb2b Add new fparseln() function
Taken from NetBSD.

[guillem@hadrons.org:
 - Import from NetBSD instead of FreeBSD to get a 3-clause BSD license,
   instead of a 4-clause one.
 - Define compatibility macros.
 - Change library from libc to libbsd and header in man page.
 - Add copyright information to COPYING.
 - Add symbol to map file. ]

Signed-off-by: Guillem Jover <guillem@hadrons.org>
2013-05-27 02:47:32 +02:00
Guillem Jover
cb7bc0d85e Add file buffer pool support to fgetln()
This avoids buffer overwrites during concurrent or intermixed calls to
fgetln() when using more than one different stream (currently 32), which
the original interface supports natively by using an internal buffer
from the FILE structure. Although this workaround is rudimentary, it
should cover most of the theoretically problematic cases.
2013-05-27 02:12:51 +02:00
Guillem Jover
1be0bdb2c9 Add new strnstr() function
Taken from FreeBSD.
2013-05-27 02:12:43 +02:00
Guillem Jover
ff0d700df0 Add new wcslcat() and wcslcpy() functions
Taken from FreeBSD.
2013-05-27 02:11:59 +02:00
Guillem Jover
3862764872 Coalesce identical BSD-2-clause licenses 2013-05-21 04:13:55 +02:00
Guillem Jover
918a4dba4a Release libbsd 0.4.2 2012-06-27 09:15:15 +02:00
Guillem Jover
444bd1fbb8 man: Use minus signs and hyphens consistently
Any string that can be copy & pasted into a terminal, for example,
needs to correctly use minus signs (escaped dashes), instead of the
default hyphen.
2012-06-27 09:13:39 +02:00
Guillem Jover
1d69ae1cd5 man: Recode flopen(3) to UTF-8
Spotted-by: Eric Smith <eric@brouhaha.com>
2012-06-04 05:47:26 +02:00
Guillem Jover
14524b545d build: Set default compiler variables from configure
This centralizes the setting so there's no duplication anymore,
makes sure the user supplied variables are never overridden, and
are only set when using gcc.

Reported-by: Samuli Suominen <ssuominen@gentoo.org>
2012-06-03 07:46:00 +02:00
Guillem Jover
c21d788fea Release libbsd 0.4.1 2012-06-01 08:28:00 +02:00
Guillem Jover
fdcae57707 build: Set runtimelibdir to libdir
This makes sure the install-exec-hook under src works as expected even
when no runtimelibdir was specified, otherwise the symlinks end up
pointing to non-existing targets.

Reported-by: Ryan Mullen <rmmullen@gmail.com>
2012-06-01 08:27:33 +02:00
Guillem Jover
e9e4a60d7e build: Use MKDIR_P variable instead of literal «mkdir -p» 2012-06-01 08:15:00 +02:00
Guillem Jover
309c82a016 Release libbsd 0.4.0 2012-05-29 07:33:16 +02:00
Guillem Jover
cd67cb1417 Use implicit <md5.h> from overlay instead explicit <bsd/md5.h>
This was assuming an installed <bsd/md5.h> on the system, due to the
build system not including -Iinclude/ anymore.

Regression introduced in commit 901ed630fc.
2012-05-29 07:31:06 +02:00
Guillem Jover
1b5b1cd52a Move mdX.3 man page to section 3bsd
This makes sure there will be no collisions on systems where a mdX.3
provided by a third party is already present.
2012-05-29 04:51:45 +02:00
Guillem Jover
ddefaae330 Do not quote man page titles 2012-05-29 04:51:45 +02:00
Guillem Jover
e7f3976088 Add email address to my name 2012-05-29 04:51:45 +02:00
Guillem Jover
e59ac2c96c Clarify that the 4-clause BSD licenses are only for man pages 2012-05-29 04:51:45 +02:00
Guillem Jover
7cfa7e4304 Add new man page for tree(3)
Taken from FreeBSD.
2012-05-29 04:51:34 +02:00
Guillem Jover
7620fef70b Remove UC Berkeley advertising clause
As per <ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change>.
2012-05-29 04:51:34 +02:00
Guillem Jover
08139dd50e Add new man pages for bitstring(3) and queue(3)
Taken from FreeBSD.
2012-05-29 04:51:16 +02:00
Guillem Jover
d90ce079f7 Add new man pages for getprogname(3) and setprogname(3)
Taken from FreeBSD.
2012-05-29 04:51:16 +02:00
Guillem Jover
c1d086c224 Add new man page for setproctitle(3)
Taken from FreeBSD.
2012-05-29 04:51:16 +02:00
Guillem Jover
e37293a18a Add <bitstring.h> for compatibility with NetBSD and OpenBSD 2012-05-29 04:51:16 +02:00
Guillem Jover
34bf1068a2 test: Add a unit test for endian encoder/decoder 2012-05-29 04:51:16 +02:00
Robert Millan
4eab0cc351 Add inline endian encoding/decoding functions
Taken from FreeBSD.

Signed-off-by: Guillem Jover <guillem@hadrons.org>
2012-05-29 04:51:09 +02:00
Guillem Jover
752997462a Base getprogname() on program_invocation_short_name presence instead of glibc 2012-05-29 04:51:04 +02:00
Guillem Jover
d5d9186937 Base fpurge() implementation on __fpurge presence instead of glibc 2012-05-29 04:51:04 +02:00
Guillem Jover
f8e8063079 Base fgetln() implementation on getline presence instead of glibc 2012-05-29 04:51:04 +02:00
Guillem Jover
786d143920 test: Add new overlay unit test 2012-05-29 04:51:04 +02:00
Guillem Jover
866f73af91 Move overlay inclusions outside of header protection
Glibc tends to include standard headers with special definitions
that make few declarations or macros visible, this stomps over the
overlay #include_next <> logic.

Based-on-patch-by: Robert Millan <rmh@debian.org>
2012-05-29 04:51:04 +02:00
Guillem Jover
f71d8e0501 Remove bogus deprecation warning from <getopt.h> 2012-05-29 04:51:04 +02:00
Guillem Jover
0b96e1a218 Remove deprecated compatibility includes in headers 2012-05-29 04:51:04 +02:00
Guillem Jover
109cafb393 Remove deprecated headers 2012-05-29 04:51:04 +02:00
Robert Millan
6434858314 Add new expand_number() function
Taken from FreeBSD.

[guillem@hadrons.org:
 - Include <stdint.h> in <bsd/libutil.h>. ]

Signed-off-by: Guillem Jover <guillem@hadrons.org>
2012-05-29 04:50:55 +02:00
Guillem Jover
943939d0e5 Add new closefrom() function
Code taken from sudo, man page from FreeBSD.
2012-05-29 04:36:23 +02:00
Guillem Jover
3d614131b5 Base errc() and warnc() on vwarnc() and verrc() respectively 2012-05-29 04:36:23 +02:00
Guillem Jover
8723226040 Use system __progname variable in progname module if available 2012-05-29 04:36:23 +02:00