diff --git configure.ac configure.ac
index 54599e1..3b4b213 100644
|
|
AC_CHECK_FUNCS(posix_fadvise)
|
81 | 81 | |
82 | 82 | AC_CHECK_FUNCS(poll pipe2 accept4) |
83 | 83 | |
| 84 | AC_CHECK_FUNCS(getspnam_r crypt_r, impersonation=1, impersonation=0) |
| 85 | |
84 | 86 | # eventfd is preferred over selfpipe, half the descriptors after all. |
85 | 87 | CHECK_EVENTFD |
86 | 88 | |
… |
… |
AC_SUBST(LIBFILEZILLA_LINGUAS_MO)
|
365 | 367 | AM_CONDITIONAL(FZ_WINDOWS, test "$windows" = "1") |
366 | 368 | AM_CONDITIONAL(FZ_MAC, test "$mac" = "1") |
367 | 369 | AM_CONDITIONAL(FZ_UNIX, test "$unix" = "1") |
| 370 | AM_CONDITIONAL(FZ_IMPERSONATION, test "$impersonation" = "1") |
368 | 371 | AM_CONDITIONAL(HAVE_CPPUNIT, [test "$have_cppunit" = "yes"]) |
369 | 372 | AM_CONDITIONAL([LOCALES_ONLY], [test "$localesonly" = "yes"]) |
370 | 373 | AM_CONDITIONAL([LOCALES], [test "$locales" = "yes"]) |
diff --git demos/Makefile.am demos/Makefile.am
index 15dc949..1b3ee7d 100644
|
|
list_LDADD += $(libdeps)
|
56 | 56 | list_DEPENDENCIES = ../lib/libfilezilla.la |
57 | 57 | |
58 | 58 | if FZ_UNIX |
| 59 | if FZ_IMPERSONATION |
59 | 60 | noinst_PROGRAMS += impersonation |
60 | 61 | |
61 | 62 | impersonation_SOURCES = impersonation.cpp |
… |
… |
impersonation_LDADD += $(libdeps)
|
71 | 72 | |
72 | 73 | impersonation_DEPENDENCIES = ../lib/libfilezilla.la |
73 | 74 | endif |
| 75 | endif |
74 | 76 | |
75 | 77 | dist_noinst_DATA = \ |
76 | 78 | demo_events.vcxproj \ |
diff --git lib/impersonation.cpp lib/impersonation.cpp
index 58a3780..1e71483 100644
|
|
|
1 | 1 | #include "libfilezilla/impersonation.hpp" |
2 | 2 | |
3 | | #if FZ_UNIX |
| 3 | #if FZ_UNIX && FZ_IMPERSONATION |
4 | 4 | |
5 | 5 | #include "libfilezilla/buffer.hpp" |
6 | 6 | |
diff --git lib/process.cpp lib/process.cpp
index 118108e..7ccea60 100644
|
|
public:
|
429 | 429 | } |
430 | 430 | } |
431 | 431 | |
432 | | #if FZ_UNIX |
| 432 | #if FZ_UNIX && FZ_IMPERSONATION |
433 | 433 | if (it && *it) { |
434 | 434 | if (!set_process_impersonation(*it)) { |
435 | 435 | _exit(1); |