Taken from: https://groups.google.com/g/linux.debian.bugs.dist/c/mX4GpUJih4k. --- a/configure.ac +++ b/configure.ac @@ -132,6 +132,16 @@ if test "$os_unix" = "yes"; then AC_CHECK_FUNCS([getpeereid]) AC_CHECK_FUNCS([getpeerucred]) AC_CHECK_FUNCS([issetugid]) + case "$host_os" in + kfreebsd*-gnu | gnu*) + have_getpeereid=no + AC_CHECK_LIB(bsd, getpeereid, have_getpeereid=yes) + if test "x$have_getpeereid" = "xyes"; then + AC_DEFINE([HAVE_GETPEEREID], [1], [have getpeereid]) + AC_SEARCH_LIBS([getpeereid], [bsd]) + fi + ;; + esac AC_CACHE_CHECK([for thread-local storage class], [ac_cv_tls_keyword], --- a/common/unix-peer.c +++ b/common/unix-peer.c @@ -47,6 +47,11 @@ # include #endif +#ifdef HAVE_GETPEEREID +/* Declare getpeereid from /usr/include/bsd/unistd.h */ +extern int getpeereid(int s, uid_t *euid, gid_t *egid); +#endif + /* Returns the unix domain socket peer information. * Returns zero on success. */ @@ -73,7 +78,8 @@ p11_get_upeer_id (int cfd, uid_t *uid, u *pid = cr.pid; #elif defined(HAVE_GETPEEREID) - /* *BSD/MacOSX */ + /* *BSD/MacOSX/kFreeBSD/Hurd */ + uid_t euid; gid_t egid; 530884'>refslogtreecommitdiff
path: root/nix/libutil/util.hh
AgeCommit message (Expand)Author
2020-12-08daemon: 'Agent' constructor takes a list of environment variables....* nix/libutil/util.hh (struct Agent)[Agent]: Add 'env' parameter. * nix/libutil/util.cc (Agent::Agent): Honor it. Ludovic Courtès
2020-09-14daemon: Move 'Agent' to libutil....* nix/libstore/build.cc (DerivationGoal::tryBuildHook): Add "offload" to 'args' and pass settings.guixProgram as the first argument to Agent::Agent. (pathNullDevice, commonChildInit, Agent, Agent::Agent) (Agent::~Agent): Move to... * nix/libutil/util.cc: ... here. * nix/libutil/util.hh (struct Agent, commonChildInit): New declarations. Ludovic Courtès
2020-01-12daemon: Account for deleted store files when deduplication is on....Previously, a store item that is a regular file would not be accounted for in the 'bytesFreed' value computed by 'deletePath' because its 'st_nlink' count would always be >= 2. This commit fixes that. * nix/libutil/util.hh (deletePath): Add optional 'linkThreshold' argument. * nix/libutil/util.cc (_deletePath): Add 'linkThreshold' argument and honor it. Pass it down in recursive call. (deletePath): Add 'linkThreshold' and honor it. * nix/libstore/gc.cc (LocalStore::deleteGarbage): Pass 'linkThreshold' argument to 'deletePath', with a value of 2 when PATH is a store item and deduplication is on. Ludovic Courtès
2017-08-18nix: Remove unused function....* nix/libutil/util.hh: * nix/libutil/util.cc (decodeOctalEscaped): Remove unused and buggy function. Andy Wingo