From 27e7029148aa24803af8f40ea916213a381c1967 Mon Sep 17 00:00:00 2001 From: Julio Merino Date: Mon, 8 Feb 2016 21:26:53 -0500 Subject: Unconditionally mlock the password in memory Revision b4023a19 added an mlock call to ensure the sshfs password is kept in memory, but did so only for OS X. This is a good idea in general, so let's remove the condition. --- sshfs.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'sshfs.c') diff --git a/sshfs.c b/sshfs.c index c97282e..84b2359 100644 --- a/sshfs.c +++ b/sshfs.c @@ -3567,7 +3567,6 @@ static int read_password(void) perror("Failed to allocate locked page for password"); return -1; } -#ifdef __APPLE__ if (mlock(sshfs.password, size) != 0) { memset(sshfs.password, 0, size); munmap(sshfs.password, size); @@ -3575,7 +3574,6 @@ static int read_password(void) perror("Failed to allocate locked page for password"); return -1; } -#endif /* __APPLE__ */ /* Don't use fgets() because password might stay in memory */ for (n = 0; n < max_password; n++) { -- cgit v1.2.3