Commit Graph

1998 Commits

Author SHA1 Message Date
Daria Phoebe Brashear
7333c2c945 roken: parse_units returns void
despite the fact that the called function returns void,
returning a result here throws an error with solaris cc.

just call the function and don't return
2018-04-19 13:12:59 -04:00
Jeffrey Altman
dcc880cf7c roken: issuid always call rk_getauxval
Instead of calling getauxval(), always call rk_getauxval() to ensure consistent behavior within roken.
2018-04-04 12:54:13 -04:00
Daria Phoebe Brashear
6aece8ea06 getauxval: fall through to auxv gfter getauxval errno test
if when we need to determine if getauxval sets errno, we determine it doesn't
after getting a 0 return code, make sure we return a value, since we didn't
previously. fall through to code we'd otherwise have called in this case
above.
2018-04-04 12:54:13 -04:00
Jeffrey Altman
7ee3cc6855 Update parse_units.c 2018-04-04 11:27:23 -04:00
Harald Barth
7a2767e610 Make parse_units() handle trailing whitespace
Skipping any trailing whitespace characters
2018-04-04 11:27:23 -04:00
Viktor Dukhovni
b860b70ada Fix missing rk_ prefix 2017-10-17 03:11:55 -04:00
Nicolas Williams
496022fa37 Fix lib/roken parse_* warnings 2017-10-11 16:45:51 -05:00
David Mulder
2548b3b8aa Solaris 8 x86 uses ->d_fd not ->dd_fd or dirfd() 2017-09-25 18:26:35 -05:00
Roland C. Dowdeswell
8c18131c13 Have roken.h #include <util.h> to find emalloc on some platforms. 2017-09-25 18:01:19 -05:00
Viktor Dukhovni
aef3843b55 Add missing semicolons 2017-08-23 17:06:29 -04:00
Viktor Dukhovni
d73ec2510a Try to avoid parse_{time,units,flags} symbol conflicts
On Debian stretch systems PAM modules linked against Heimdal run into
symbol conflicts with parse_time() in systemd libraries.  We redefine
parse_time() and friends to rk_parse_time(), ... while keeping the old
names for ABI compatibility with existing clients.

The legacy names should eventually be droppped.
2017-08-23 15:09:11 -05:00
Nicolas Williams
2c913b4bf7 Fix typo in d999ac7 2017-05-29 00:49:58 -05:00
Nicolas Williams
d999ac7026 Quiet warning about rk_getprocauxval() 2017-05-28 16:58:38 -05:00
Viktor Dukhovni
2d968c5c88 Fix test-auxval typos hidden by platform dependence 2017-05-27 00:08:00 -05:00
Nicolas Williams
123f702001 lib/roken: add fseeko()/ftello() 2017-05-26 23:24:30 -04:00
Nicolas Williams
4a9591af92 Quiet windows warning about struct passwd 2017-05-26 23:24:30 -04:00
Nicolas Williams
28934a3bc8 Revert "roken: refactor rk_getauxval"; broke build
This reverts commit cb1ab5b5fc.
2017-05-16 13:05:20 -05:00
Jeffrey Altman
cb1ab5b5fc roken: refactor rk_getauxval
Refactor rk_getauxval() to remove duplicate code and to ensure
that a value is always returned.

Change-Id: I3b452dbc11802169e2c96e7ad16e714e7a880450
2017-04-29 13:55:25 -04:00
Jeffrey Altman
18f3115f78 roken: fix rk_getauxval missing stack variable
if defined(HAVE_GETAUXVAL) && !defined(GETAUXVAL_SETS_ERRNO) the
stack variable declaration for 'a' is missing:

  const auxv_t *a

Declare 'a' so that Heimdal can build again.

Change-Id: If64dd497f240688b76f3dd6139ac68c2ff149a0e
2017-04-29 01:05:57 -04:00
Nicolas Williams
7dfad1ab0b Use secure_getenv() instead of issuid() 2017-04-17 18:02:30 -04:00
Nicolas Williams
cf4efe8de6 Add secure_getenv.c 2017-04-17 18:02:30 -04:00
Nicolas Williams
90110f5553 Revamp issuid() 2017-04-17 18:02:30 -04:00
Nicolas Williams
650ffdc964 Revamp lib/roken/getauxval.c 2017-04-17 18:02:30 -04:00
Nicolas Williams
f867a12aa9 Test rk_get*auxval() 2017-03-31 18:56:04 -05:00
Nicolas Williams
707b2372d2 Further improvements to issuid() 2017-03-31 18:56:04 -05:00
Nicolas Williams
6a0f45c4d7 Use __attribute__ ((__name__)) form
Protect against macros named noreturn and so on.
2017-03-13 18:39:41 -04:00
Jeffrey Altman
c7129a9562 roken: pidfile -> rk_pidfile
Commit 7dc4481ed2 which changed from
pidfile -> rk_pidfile was incomplete.  Must handle the NO_PIDFILE case.

Change-Id: Ifc0b135e1fa7abdf4e370ad4b8fe2eb1305760f5
2017-01-20 17:54:12 -05:00
Viktor Dukhovni
f1bc9f2ff9 Avoid pidfile() missing prototype warnings 2016-12-19 20:55:08 -05:00
Viktor Dukhovni
7dc4481ed2 Avoid interposing pidfile(), use rk_pidfile() instead 2016-12-19 19:10:49 -05:00
Nicolas Williams
63f22421c8 Fix lib/roken can't find pidfile() (#230) 2016-12-16 12:05:51 -06:00
Nicolas Williams
3e65dfbc32 Fix make dist missing files (#228) 2016-12-15 12:15:56 -06:00
Viktor Dukhovni
a1c505309c More extensive SRV order tests
Based largely on initial version by Nico.
2016-12-12 19:42:11 -05:00
Viktor Dukhovni
32f8564296 Fix incorrect scaling of weight 0 SRV records
Loosely based on patch by Nico.
2016-12-12 17:51:13 -05:00
Nicolas Williams
87b234e154 roken_detach_prep() close pipe 2016-12-06 22:44:23 -06:00
Nicolas Williams
d609264a00 Only rm pidfile if PID matches 2016-12-06 22:44:23 -06:00
Nicolas Williams
a6e8ff2ae5 pidfile(): write newline too 2016-12-06 22:44:23 -06:00
Nicolas Williams
12eb54d03f rk_pidfile() should call pidfile() if HAVE_PIDFILE
This is necessary so we can use --detach in tests even on NetBSD and
OpenBSD.
2016-12-06 22:44:23 -06:00
Jeffrey Altman
2f62c7c77e roken: rk_undumpdata free allocation on error
Do not return allocated memory and an error code.
Free it instead so as to avoid memory leaks.

Change-Id: I47d42be0f6bc52062c57c00c37b665ee2f2811ce
2016-11-19 02:08:58 -05:00
Nicolas Williams
1c81ddf4e2 Round #2 of scan-build warnings cleanup 2016-11-16 17:03:14 -06:00
Nicolas Williams
953dc07391 Round #1 of scan-build warnings cleanup 2016-11-15 21:27:20 -06:00
Viktor Dukhovni
da8052fefc Don't scale SRV weights when none have weight zero 2016-11-13 15:22:17 +11:00
Viktor Dukhovni
ee8b2b4253 Drop code that's been dead for 10 years or more 2016-11-13 05:36:11 +11:00
Viktor Dukhovni
c8753450b1 Fix (linux) compiler warnings in libroken 2016-11-13 03:41:33 +11:00
Roland C. Dowdeswell
eb682c1bf4 Fix weight zero entries when ordering SRV RR results.
In lib/roken/resolve.c, we find rk_dns_srv_order() which re-orders
the results of an SRV RR lookup by the algorithm in RFC2782.  We
note that the algorithm doesn't behave according to the RFC w.r.t.
entries of weight zero.  We solve this by scaling out the remaining
weights by the number of zeros we find at a particular priority
level and acting like the zero weights have a weight of one.
2016-11-10 04:45:07 -05:00
Roland C. Dowdeswell
44a1a2a273 Fix bias in ordering SRV RR results by weight.
In lib/roken/resolve.c, we find rk_dns_srv_order() which re-orders
the results of an SRV RR lookup by the algorithm in RFC2782.  We
fix a bias in the random weight sorting by changing the order of
operations when selecting rnd.  rnd should be a non-zero random
number less than the sum of the weights at a particular priority,
but zero was included as a legitimate output thus biasing the
selection process.  rk_random() % sum is still biased as a 32
bit int modulo a number which doesn't divide 2^32 does not have
a uniform distribution, but the bias should be small enough to
live with for our purposes here.
2016-11-10 04:45:07 -05:00
Roland C. Dowdeswell
8b93901db7 lib/roken/simple_exec_w32.c: forgot to assign tmp var back to original
after calling realloc(3).
2016-11-08 17:20:42 -05:00
Ed Maste
54e85ad099 Remove duplicate symbols from libroken version-script.map
Commit efed5633 (r24759) prefixed some symbols with rk_, but
introduced 6 duplicate symbols in the version script (because the
rk_-prefixed versions of the symbols were already present).
2016-07-21 14:36:59 -04:00
Viktor Dukhovni
9f0e64d5b8 Revert inadvertent change 2016-02-28 20:34:26 -05:00
Nicolas Williams
b4cf4de807 Fix warnings (clang 3.6) 2016-02-26 01:04:31 -06:00
Nicolas Williams
0271b171e5 Add bswap64() 2016-02-16 20:49:33 -06:00