summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2020-02-05 17:40:57 +0100
committerMax Rees <maxcrees@me.com>2020-06-02 19:00:38 -0500
commitb0da9ea5446226f799dcd91fc473f1c3d332852a (patch)
tree615ab9124c86f759962b7f074ccfc987c369bb33
parent4d132ee3b898448df42a206156f0f0e0f75bef44 (diff)
downloadca-certificates-b0da9ea5446226f799dcd91fc473f1c3d332852a.tar.gz
ca-certificates-b0da9ea5446226f799dcd91fc473f1c3d332852a.tar.bz2
ca-certificates-b0da9ea5446226f799dcd91fc473f1c3d332852a.tar.xz
ca-certificates-b0da9ea5446226f799dcd91fc473f1c3d332852a.zip
update-ca: insert newline between certs
There may be certificates that lack a trailing newline, which is allowed in the certificate format. We work around that by inject a newline after each cert. see https://gitlab.alpinelinux.org/alpine/aports/issues/8379
-rw-r--r--update-ca.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/update-ca.c b/update-ca.c
index 2b3195b..0260f83 100644
--- a/update-ca.c
+++ b/update-ca.c
@@ -191,6 +191,7 @@ static void proc_localglobaldir(const char *fullpath, struct hash *h, int tmpfil
fprintf(stderr, "Warning! Cannot hash: %s\n", fullpath);
if (!copyfile(fullpath, tmpfile_fd))
fprintf(stderr, "Warning! Cannot copy to bundle: %s\n", fullpath);
+ write(tmpfile_fd, "\n", 1);
free(actual_file);
}
@@ -260,7 +261,7 @@ static bool dir_readfiles(struct hash* d, const char* path,
DIR *dp = opendir(path);
if (!dp)
return false;
-
+
struct dirent *dirp;
while ((dirp = readdir(dp)) != NULL) {
if (str_begins(dirp->d_name, "."))