From 00960d8695e35faf6176f452fa09b5fef7b3d623 Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Sat, 2 Apr 2016 13:48:20 +0100 Subject: [PATCH] Windows: condition setprocessacl() on lack of -DNO_SECURITY. We also have the special-purpose -DUNPROTECT to disable just the ACL changes, but if you want to compile without any Windows security API support at all (e.g. experimentally building against winelib) then it's easier not to have to specify both defines separately. --- windows/window.c | 2 +- windows/winpgen.c | 2 +- windows/winpgnt.c | 2 +- windows/winplink.c | 2 +- windows/winsftp.c | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/windows/window.c b/windows/window.c index fc51e57f..d8119e0d 100644 --- a/windows/window.c +++ b/windows/window.c @@ -395,7 +395,7 @@ int WINAPI WinMain(HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show) * Protect our process */ { -#ifndef UNPROTECT +#if !defined UNPROTECT && !defined NO_SECURITY char *error = NULL; if (! setprocessacl(error)) { char *message = dupprintf("Could not restrict process ACL: %s", diff --git a/windows/winpgen.c b/windows/winpgen.c index 277c0914..bff5ae87 100644 --- a/windows/winpgen.c +++ b/windows/winpgen.c @@ -1543,7 +1543,7 @@ int WINAPI WinMain(HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show) } } -#ifndef UNPROTECT +#if !defined UNPROTECT && !defined NO_SECURITY /* * Protect our process. */ diff --git a/windows/winpgnt.c b/windows/winpgnt.c index 3e47e690..bffc01f9 100644 --- a/windows/winpgnt.c +++ b/windows/winpgnt.c @@ -1174,7 +1174,7 @@ int WINAPI WinMain(HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show) } } -#ifndef UNPROTECT +#if !defined UNPROTECT && !defined NO_SECURITY /* * Protect our process. */ diff --git a/windows/winplink.c b/windows/winplink.c index 759a71c0..a0458b39 100644 --- a/windows/winplink.c +++ b/windows/winplink.c @@ -498,7 +498,7 @@ int main(int argc, char **argv) } } -#ifndef UNPROTECT +#if !defined UNPROTECT && !defined NO_SECURITY /* * Protect our process. */ diff --git a/windows/winsftp.c b/windows/winsftp.c index a0341274..572aa48c 100644 --- a/windows/winsftp.c +++ b/windows/winsftp.c @@ -735,7 +735,7 @@ char *ssh_sftp_get_cmdline(const char *prompt, int no_fds_ok) void platform_psftp_post_option_setup(void) { -#ifndef UNPROTECT +#if !defined UNPROTECT && !defined NO_SECURITY /* * Protect our process. */