aboutsummaryrefslogtreecommitdiff
path: root/sshfs.c
diff options
context:
space:
mode:
authorJulio Merino <jmmv@meroh.net>2016-02-08 21:26:53 -0500
committerJulio Merino <jmmv@meroh.net>2016-02-08 21:26:53 -0500
commit27e7029148aa24803af8f40ea916213a381c1967 (patch)
treefe25030c857d438fd309191acbedeac62087b35b /sshfs.c
parent30e90ae0800a16992d4a349d1fe9c3f5e3566f56 (diff)
downloadsshfs-27e7029148aa24803af8f40ea916213a381c1967.tar
sshfs-27e7029148aa24803af8f40ea916213a381c1967.tar.gz
sshfs-27e7029148aa24803af8f40ea916213a381c1967.tar.bz2
sshfs-27e7029148aa24803af8f40ea916213a381c1967.zip
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.
Diffstat (limited to 'sshfs.c')
-rw-r--r--sshfs.c2
1 files changed, 0 insertions, 2 deletions
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++) {