Ticket #12658: patch-lib_impersonation.cpp

File patch-lib_impersonation.cpp, 886 bytes (added by Thomas Klausner, 6 months ago)
Line 
1$NetBSD: patch-lib_impersonation.cpp,v 1.1 2022/02/07 10:48:26 wiz Exp $
2
3Hide Linux-specific stuff in ifdef __Linux__
4
5--- lib/impersonation.cpp.orig 2021-12-08 15:10:58.000000000 +0000
6+++ lib/impersonation.cpp
7@@ -7,7 +7,7 @@
8 #include <optional>
9 #include <tuple>
10
11-#if FZ_UNIX
12+#if FZ_UNIX && defined(__Linux__)
13 #include <crypt.h>
14 #include <shadow.h>
15 #endif
16@@ -58,7 +58,7 @@ passwd_holder get_passwd(fz::native_stri
17 return ret;
18 }
19
20-#if FZ_UNIX
21+#if FZ_UNIX && defined(__Linux__)
22 struct shadow_holder {
23 shadow_holder() = default;
24 shadow_holder(shadow_holder const&) = delete;
25@@ -150,7 +150,7 @@ std::vector<gid_t> get_supplementary(std
26
27 bool check_auth(fz::native_string const& username, fz::native_string const& password)
28 {
29-#if FZ_UNIX
30+#if FZ_UNIX && defined(__Linux__)
31 auto shadow = get_shadow(username);
32 if (shadow.shadow_) {
33 struct crypt_data data{};