]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
swanctl: Concatenate relative certificate paths correctly on Windows
authorMartin Willi <martin@revosec.ch>
Thu, 15 May 2014 13:12:35 +0000 (15:12 +0200)
committerMartin Willi <martin@revosec.ch>
Wed, 4 Jun 2014 13:53:09 +0000 (15:53 +0200)
src/swanctl/commands/load_conns.c

index d418cd3a484102f0979d0fb4768a59cf2986db01..c551601df72250f9a96c1013836d5799454431ab 100644 (file)
@@ -102,16 +102,18 @@ static void add_file_list_key(vici_req_t *req, char *key, char *value)
        enumerator = enumerator_create_token(value, ",", " ");
        while (enumerator->enumerate(enumerator, &token))
        {
-               if (*token != '/')
+               if (!path_absolute(token))
                {
                        if (streq(key, "certs"))
                        {
-                               snprintf(buf, sizeof(buf), "%s/%s", SWANCTL_X509DIR, token);
+                               snprintf(buf, sizeof(buf), "%s%s%s",
+                                                SWANCTL_X509DIR, DIRECTORY_SEPARATOR, token);
                                token = buf;
                        }
                        if (streq(key, "cacerts"))
                        {
-                               snprintf(buf, sizeof(buf), "%s/%s", SWANCTL_X509CADIR, token);
+                               snprintf(buf, sizeof(buf), "%s%s%s",
+                                                SWANCTL_X509CADIR, DIRECTORY_SEPARATOR, token);
                                token = buf;
                        }
                }