summaryrefslogtreecommitdiff
path: root/openbsd-compat/openbsd-compat.h
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2021-02-18 11:25:38 +1100
committerDamien Miller <djm@mindrot.org>2021-02-18 11:27:09 +1100
commit845fe9811c047063d935eca89188ed55c993626b (patch)
treedd72f0b7da07b8566cb25d3c88fde488ddf01ca0 /openbsd-compat/openbsd-compat.h
parentd0763c8d566119cce84d9806e419badf20444b02 (diff)
downloadopenssh-git-845fe9811c047063d935eca89188ed55c993626b.tar.gz
prefer login_getpwclass() to login_getclass()
FreeBSD has login_getpwclass() that does some special magic for UID=0. Prefer this to login_getclass() as its easier to emulate the former with the latter. Based on FreeBSD PR 37416 via Ed Maste; ok dtucker@
Diffstat (limited to 'openbsd-compat/openbsd-compat.h')
-rw-r--r--openbsd-compat/openbsd-compat.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/openbsd-compat/openbsd-compat.h b/openbsd-compat/openbsd-compat.h
index 50bac587..542ae58d 100644
--- a/openbsd-compat/openbsd-compat.h
+++ b/openbsd-compat/openbsd-compat.h
@@ -48,6 +48,10 @@
#include "blf.h"
#include "fnmatch.h"
+#if defined(HAVE_LOGIN_CAP) && !defined(HAVE_LOGIN_GETPWCLASS)
+# define login_getpwclass(pw) login_getclass(pw->pw_class)
+#endif
+
#ifndef HAVE_BASENAME
char *basename(const char *path);
#endif