diff options
author | Tobias Brunner <tobias@strongswan.org> | 2010-08-04 15:59:15 +0200 |
---|---|---|
committer | Tobias Brunner <tobias@strongswan.org> | 2010-08-04 16:03:46 +0200 |
commit | 744b83c7c99527093e837c9345a93546a4a85921 (patch) | |
tree | 39d9042a74e3307ed4e260839bb258766b114edc | |
parent | dca2d89209ade805002df9ea2525887624a302bb (diff) | |
download | strongswan-744b83c7c99527093e837c9345a93546a4a85921.tar.bz2 strongswan-744b83c7c99527093e837c9345a93546a4a85921.tar.xz |
Fixed loading of secrets with IDs.
Since the ID string is manually terminated by a null character, write
permission is required for the mmapped ipsec.secrets.
-rw-r--r-- | src/libcharon/plugins/stroke/stroke_cred.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libcharon/plugins/stroke/stroke_cred.c b/src/libcharon/plugins/stroke/stroke_cred.c index 8dd0bb031..e9087dc72 100644 --- a/src/libcharon/plugins/stroke/stroke_cred.c +++ b/src/libcharon/plugins/stroke/stroke_cred.c @@ -1141,7 +1141,7 @@ static void load_secrets(private_stroke_cred_t *this, char *file, int level, close(fd); return; } - addr = mmap(NULL, sb.st_size, PROT_READ, MAP_PRIVATE, fd, 0); + addr = mmap(NULL, sb.st_size, PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, 0); if (addr == MAP_FAILED) { DBG1(DBG_LIB, "mapping '%s' failed: %s", file, strerror(errno)); |