From: Tobias Brunner Date: Wed, 4 Aug 2010 13:59:15 +0000 (+0200) Subject: Fixed loading of secrets with IDs. X-Git-Tag: 4.5.0~576 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=744b83c7c99527093e837c9345a93546a4a85921;p=thirdparty%2Fstrongswan.git 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. --- diff --git a/src/libcharon/plugins/stroke/stroke_cred.c b/src/libcharon/plugins/stroke/stroke_cred.c index 8dd0bb0311..e9087dc72a 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));