summaryrefslogtreecommitdiff
path: root/net/libfilezilla/patches/patch-lib_impersonation.cpp
blob: 7486eb13c23535caea122d908ab375a74d9de54b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
$NetBSD: patch-lib_impersonation.cpp,v 1.4 2022/07/21 11:31:23 wiz Exp $

Hide Linux-specific stuff in ifdef __Linux__
https://trac.filezilla-project.org/ticket/12658

--- lib/impersonation.cpp.orig	2022-07-08 13:18:44.000000000 +0000
+++ lib/impersonation.cpp
@@ -7,7 +7,7 @@
 #include <optional>
 #include <tuple>
 
-#if FZ_UNIX
+#if FZ_UNIX && defined(__Linux__)
 #include <crypt.h>
 #include <shadow.h>
 #endif
@@ -98,7 +98,7 @@ std::optional<gid_t> get_group(native_st
 	return {};
 }
 
-#if FZ_UNIX
+#if FZ_UNIX && defined(__Linux__)
 struct shadow_holder {
 	shadow_holder() = default;
 	shadow_holder(shadow_holder const&) = delete;
@@ -190,7 +190,7 @@ std::vector<gid_t> get_supplementary(std
 
 bool check_auth(native_string const& username, native_string const& password)
 {
-#if FZ_UNIX
+#if FZ_UNIX && defined(__Linux__)
 	auto shadow = get_shadow(username);
 	if (shadow.shadow_) {
 		struct crypt_data data{};