From 4bf076391245450e2667eb60510b94faeb686a7f Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Mon, 24 Sep 2018 17:18:26 +0200 Subject: update-ca: fix build with newer musl musl removed SYMLINK_MAX define[1]. Use PATH_MAX instead for symlink target. [1]: http://git.musl-libc.org/cgit/musl/commit/?id=767f7a1091af3a3dcee2f7a49d0713359a81961c --- update-ca.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'update-ca.c') diff --git a/update-ca.c b/update-ca.c index 641fd64..7bb4f1b 100644 --- a/update-ca.c +++ b/update-ca.c @@ -196,7 +196,7 @@ static void proc_localglobaldir(const char *fullpath, struct hash *h, int tmpfil static void proc_etccertsdir(const char* fullpath, struct hash* h, int tmpfile_fd) { - char linktarget[SYMLINK_MAX]; + char linktarget[PATH_MAX]; ssize_t linklen; linklen = readlink(fullpath, linktarget, sizeof(linktarget)-1); -- cgit v1.2.3-70-g09d2 From 4d132ee3b898448df42a206156f0f0e0f75bef44 Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Wed, 5 Feb 2020 14:42:38 +0100 Subject: update-ca: fix compiler warning --- update-ca.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'update-ca.c') diff --git a/update-ca.c b/update-ca.c index 7bb4f1b..2b3195b 100644 --- a/update-ca.c +++ b/update-ca.c @@ -330,7 +330,7 @@ int main(int a, char **v) free(tmpfile); /* Execute run-parts */ - static const char *run_parts_args[] = { "run-parts", RUNPARTSDIR, 0 }; + static char *const run_parts_args[] = { "run-parts", RUNPARTSDIR, 0 }; execve("/usr/bin/run-parts", run_parts_args, NULL); execve("/bin/run-parts", run_parts_args, NULL); perror("run-parts"); -- cgit v1.2.3-70-g09d2 From b0da9ea5446226f799dcd91fc473f1c3d332852a Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Wed, 5 Feb 2020 17:40:57 +0100 Subject: 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 --- update-ca.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'update-ca.c') 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, ".")) -- cgit v1.2.3-70-g09d2