The fix involves:
- Removing HAVE_STRFTIME from config.h.w32
- Adding strftime.c to the makefile
- Defining timezone and tzname to their windows equivalent
for the compile of this module
95eb83c424 ("roken: Add roken_get_username() and friends")
failed to copy the username C-String NUL terminator. As a result
a "DOMAIN\user" is returned as "userIN\user".
Change-Id: I10027e4eef18364074eecf385fa9fab1ae68dbe7
The rk_UNCONST macro exists because neither __DECONST nor uintptr_t
are available on all platforms (for example, AIX).
Change-Id: Ie36f0dd7a9ce454d411761ee4dbd6fc1f7c6692c
b10ad7eb57
("roken: strtoll.c negation is a no-op on unsigned integer")
broke strtoll() by failing to assign 'ret' in the success case.
Change-Id: I30535d83a2bef305140f1a6bd1ed2eeba23db9b9
strtoull() returns an unsigned long long. However, then the input
string represents a negative number the return value is supposed to
be the unsigned representation of the negative value. Before applying
the negation the value must be cast to (long long).
Change-Id: Icf9e75400ff736819b1f7e0e6fb3c8abd707a23a
strtoll() returns a signed long long not an unsigned long long.
When applying the negation for negatives the value must be cast
from unsigned to signed and then stored in a signed variable
before returning it.
Change-Id: If568afd2509d27c7bf206ca59d32ca150cb34857
__declspec not _declspec
Include "err.h" not <err.h>
Include "roken.h" before "err.h"
Indent "#if" as "# if" within roken.h.in when CPP rules must be copied
into the generated "roken.h".
Correct verr() attribute to be ROKEN_LIB_NORETURN_FUNCTION.
Change-Id: I4289ecaba4a097175b4a5a1cde529b59038c72e3
fix breakage introduced by 6341132175
("roken: fix build breakage, AT_HWCAP2 may be undefined (#446)").
Detected by Coverity.
Change-Id: Iefdb73d4392e5184a69a99208945ece6b7b8ecb3
When WIN32 is undefined an unreachable code warning was generated
since "/bin/sh" is returned as the default resposne.
Change-Id: I757c9d05db62c1d52fee0e510259098d73273a84
When arc4random() is available, rk_random_init() does not have to
call arc4random_stir(). ac4random_stir() will be called as a result
of the first call to arc4random().
Change-Id: I6f4a3be7c39752746657945ed15896472908f889
We add roken_get_{shell, username, appdatadir, homedir}() functions. These use
a combination of secure_getenv(), getpwuid_r(), getlogin_r(), or various WIN32
functions to get this information.
Use roken_get_appdatadir() instead of roken_get_homedir() when looking for
dotfiles.
We no longer use it since removing ftp from appl/.
Note that expansion of ~username/ couldn't have been working because
k_getpwnam() was being called with an unsigned short * that was forcibly
cast to char *, but it really was shorts, not chars... Anyone who ever
feels like reviving lib/roken/glob.[ch] will want to fix that...
The Solaris auxval test fails, because Solaris uses different preprocessor
symbols (and numbers) for its UID and GID auxval types.
Note that issuid() could simply be an alias of issetugid() on Solaris, so
perhaps this is not necessary.
In VC15 GetVersionEx has been deprecated. In order to continue to
support Win2K use the undeprecated VerifyVersionInfoW API
(available since Win2K).
Inline helper functions used in latest Win10 SDK to simplify code.
GetSystemTimeAsFileTime() has 16ms precision.
GetSystemTimePreciseAsFileTime() has <1ns precision but is only available
on Windows 8 or later.
This change dynamically loads GetSystemTimePreciseAsFileTime() if it is
available.
Change-Id: Ib9c616c01948384e6b256ac9b6023f1e39673613
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
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.
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.