From 744b83c7c99527093e837c9345a93546a4a85921 Mon Sep 17 00:00:00 2001 From: Tobias Brunner Date: Wed, 4 Aug 2010 15:59:15 +0200 Subject: [PATCH] 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. --- src/libcharon/plugins/stroke/stroke_cred.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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));