diff options
| author | Michael Forney <mforney@mforney.org> | 2016-04-18 02:26:16 -0700 |
|---|---|---|
| committer | Michael Forney <mforney@mforney.org> | 2016-04-18 02:27:17 -0700 |
| commit | 98dba7002932e3f76ee907b92aa2911a88c3e36e (patch) | |
| tree | 11ff3815839db1643e2acac732b944f05eff8bd8 /core/openbsd/patch | |
| parent | b4bc94979483c44d91e32f1728d05d0fac4eaea5 (diff) | |
Add pax from OpenBSD 5.9
Diffstat (limited to 'core/openbsd/patch')
6 files changed, 272 insertions, 0 deletions
diff --git a/core/openbsd/patch/0001-fts-Avoid-d_namlen.patch b/core/openbsd/patch/0001-fts-Avoid-d_namlen.patch new file mode 100644 index 00000000..f0224439 --- /dev/null +++ b/core/openbsd/patch/0001-fts-Avoid-d_namlen.patch @@ -0,0 +1,50 @@ +From dffe7fa7b5c16e95af5b7a274e256197c716c41b Mon Sep 17 00:00:00 2001 +From: Michael Forney <mforney@mforney.org> +Date: Sun, 17 Apr 2016 23:50:15 -0700 +Subject: [PATCH] fts: Avoid d_namlen + +--- + lib/libc/gen/fts.c | 11 +++++++---- + 1 file changed, 7 insertions(+), 4 deletions(-) + +diff --git a/lib/libc/gen/fts.c b/lib/libc/gen/fts.c +index e042b9f..caf679e 100644 +--- a/lib/libc/gen/fts.c ++++ b/lib/libc/gen/fts.c +@@ -557,6 +557,7 @@ fts_build(FTS *sp, int type) + int nitems, cderrno, descend, level, nlinks, nostat, doadjust; + int saved_errno; + char *cp; ++ size_t namlen; + + /* Set current node pointer. */ + cur = sp->fts_cur; +@@ -655,11 +656,13 @@ fts_build(FTS *sp, int type) + if (!ISSET(FTS_SEEDOT) && ISDOT(dp->d_name)) + continue; + +- if (!(p = fts_alloc(sp, dp->d_name, (size_t)dp->d_namlen))) ++ namlen = strlen(dp->d_name); ++ ++ if (!(p = fts_alloc(sp, dp->d_name, namlen))) + goto mem1; +- if (dp->d_namlen >= maxlen) { /* include space for NUL */ ++ if (namlen >= maxlen) { /* include space for NUL */ + oldaddr = sp->fts_path; +- if (fts_palloc(sp, dp->d_namlen +len + 1)) { ++ if (fts_palloc(sp, namlen +len + 1)) { + /* + * No more memory for path or structures. Save + * errno, free up the current structure and the +@@ -685,7 +688,7 @@ mem1: saved_errno = errno; + + p->fts_level = level; + p->fts_parent = sp->fts_cur; +- p->fts_pathlen = len + dp->d_namlen; ++ p->fts_pathlen = len + namlen; + if (p->fts_pathlen < len) { + /* + * If we wrap, free up the current structure and +-- +2.8.0 + diff --git a/core/openbsd/patch/0002-fts-Add-some-includes.patch b/core/openbsd/patch/0002-fts-Add-some-includes.patch new file mode 100644 index 00000000..55a40d3a --- /dev/null +++ b/core/openbsd/patch/0002-fts-Add-some-includes.patch @@ -0,0 +1,46 @@ +From 3346d32277e367ad3b229dfec4b5f11ebafed9fb Mon Sep 17 00:00:00 2001 +From: Michael Forney <mforney@mforney.org> +Date: Mon, 18 Apr 2016 01:25:29 -0700 +Subject: [PATCH] fts: Add some includes + +--- + include/fts.h | 2 ++ + lib/libc/gen/fts.c | 2 ++ + 2 files changed, 4 insertions(+) + +diff --git a/include/fts.h b/include/fts.h +index eaf6be0..a5b3aff 100644 +--- a/include/fts.h ++++ b/include/fts.h +@@ -35,6 +35,8 @@ + #ifndef _FTS_H_ + #define _FTS_H_ + ++#include <sys/cdefs.h> ++ + typedef struct { + struct _ftsent *fts_cur; /* current node */ + struct _ftsent *fts_child; /* linked list of children */ +diff --git a/lib/libc/gen/fts.c b/lib/libc/gen/fts.c +index caf679e..dc6d3d7 100644 +--- a/lib/libc/gen/fts.c ++++ b/lib/libc/gen/fts.c +@@ -31,6 +31,7 @@ + + #include <sys/param.h> /* ALIGN */ + #include <sys/stat.h> ++#include <sys/types.h> + + #include <dirent.h> + #include <errno.h> +@@ -39,6 +40,7 @@ + #include <limits.h> + #include <stdlib.h> + #include <string.h> ++#include <time.h> + #include <unistd.h> + + #define MAXIMUM(a, b) (((a) > (b)) ? (a) : (b)) +-- +2.8.0 + diff --git a/core/openbsd/patch/0003-pax-Use-setpwent-and-setgrent.patch b/core/openbsd/patch/0003-pax-Use-setpwent-and-setgrent.patch new file mode 100644 index 00000000..82a082ad --- /dev/null +++ b/core/openbsd/patch/0003-pax-Use-setpwent-and-setgrent.patch @@ -0,0 +1,52 @@ +From d9671f40b5ffc56b2c6ef449bd5eaaefdf538518 Mon Sep 17 00:00:00 2001 +From: Michael Forney <mforney@mforney.org> +Date: Sun, 17 Apr 2016 23:46:28 -0700 +Subject: [PATCH] pax: Use setpwent and setgrent + +--- + bin/pax/cache.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/bin/pax/cache.c b/bin/pax/cache.c +index a0d38cb..8f2fc2a 100644 +--- a/bin/pax/cache.c ++++ b/bin/pax/cache.c +@@ -191,7 +191,7 @@ name_uid(uid_t uid, int frc) + * No entry for this uid, we will add it + */ + if (!pwopn) { +- setpassent(1); ++ setpwent(); + ++pwopn; + } + if (ptr == NULL) +@@ -257,7 +257,7 @@ name_gid(gid_t gid, int frc) + * No entry for this gid, we will add it + */ + if (!gropn) { +- setgroupent(1); ++ setgrent(); + ++gropn; + } + if (ptr == NULL) +@@ -324,7 +324,7 @@ uid_name(char *name, uid_t *uid) + } + + if (!pwopn) { +- setpassent(1); ++ setpwent(); + ++pwopn; + } + +@@ -387,7 +387,7 @@ gid_name(char *name, gid_t *gid) + } + + if (!gropn) { +- setgroupent(1); ++ setgrent(); + ++gropn; + } + if (ptr == NULL) +-- +2.8.0 + diff --git a/core/openbsd/patch/0004-pax-Set-listf-to-stderr-in-main.patch b/core/openbsd/patch/0004-pax-Set-listf-to-stderr-in-main.patch new file mode 100644 index 00000000..d04b5acb --- /dev/null +++ b/core/openbsd/patch/0004-pax-Set-listf-to-stderr-in-main.patch @@ -0,0 +1,34 @@ +From 67cc439f1b0db14d106ea1b6b96d66c6b6c7e15a Mon Sep 17 00:00:00 2001 +From: Michael Forney <mforney@mforney.org> +Date: Mon, 18 Apr 2016 00:13:51 -0700 +Subject: [PATCH] pax: Set listf to stderr in main + +--- + bin/pax/pax.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/bin/pax/pax.c b/bin/pax/pax.c +index 6d70b7a..51a36c9 100644 +--- a/bin/pax/pax.c ++++ b/bin/pax/pax.c +@@ -91,7 +91,7 @@ int docrc; /* check/create file crc */ + char *dirptr; /* destination dir in a copy */ + char *argv0; /* root of argv[0] */ + sigset_t s_mask; /* signal mask for cleanup critical sect */ +-FILE *listf = stderr; /* file pointer to print file list to */ ++FILE *listf; /* file pointer to print file list to */ + int listfd = STDERR_FILENO; /* fd matching listf, for sighandler output */ + char *tempfile; /* tempfile to use for mkstemp(3) */ + char *tempbase; /* basename of tempfile to use for mkstemp(3) */ +@@ -222,6 +222,8 @@ main(int argc, char **argv) + char *tmpdir; + size_t tdlen; + ++ listf = stderr; ++ + /* + * Keep a reference to cwd, so we can always come back home. + */ +-- +2.8.0 + diff --git a/core/openbsd/patch/0005-pax-Add-some-includes.patch b/core/openbsd/patch/0005-pax-Add-some-includes.patch new file mode 100644 index 00000000..9153eac5 --- /dev/null +++ b/core/openbsd/patch/0005-pax-Add-some-includes.patch @@ -0,0 +1,63 @@ +From 9b164bcbe8ce53a6e3840dfb9da9b25a73103f47 Mon Sep 17 00:00:00 2001 +From: Michael Forney <mforney@mforney.org> +Date: Mon, 18 Apr 2016 01:27:29 -0700 +Subject: [PATCH] pax: Add some includes + +--- + bin/pax/ar_subs.c | 1 + + bin/pax/file_subs.c | 1 + + bin/pax/gen_subs.c | 1 + + bin/pax/sel_subs.c | 1 + + 4 files changed, 4 insertions(+) + +diff --git a/bin/pax/ar_subs.c b/bin/pax/ar_subs.c +index b95b1c2..91b8436 100644 +--- a/bin/pax/ar_subs.c ++++ b/bin/pax/ar_subs.c +@@ -44,6 +44,7 @@ + #include <errno.h> + #include <unistd.h> + #include <stdlib.h> ++#include <time.h> + #include "pax.h" + #include "extern.h" + +diff --git a/bin/pax/file_subs.c b/bin/pax/file_subs.c +index 1f27d28..b7239c8 100644 +--- a/bin/pax/file_subs.c ++++ b/bin/pax/file_subs.c +@@ -36,6 +36,7 @@ + + #include <sys/time.h> + #include <sys/stat.h> ++#include <sys/types.h> + #include <err.h> + #include <errno.h> + #include <fcntl.h> +diff --git a/bin/pax/gen_subs.c b/bin/pax/gen_subs.c +index cd857dc..ae5843e 100644 +--- a/bin/pax/gen_subs.c ++++ b/bin/pax/gen_subs.c +@@ -43,6 +43,7 @@ + #include <stdlib.h> + #include <string.h> + #include <vis.h> ++#include <time.h> + #include "pax.h" + #include "extern.h" + +diff --git a/bin/pax/sel_subs.c b/bin/pax/sel_subs.c +index fc9194d..7bdbe46 100644 +--- a/bin/pax/sel_subs.c ++++ b/bin/pax/sel_subs.c +@@ -44,6 +44,7 @@ + #include <stdlib.h> + #include <string.h> + #include <unistd.h> ++#include <time.h> + #include "pax.h" + #include "sel_subs.h" + #include "extern.h" +-- +2.8.0 + diff --git a/core/openbsd/patch/0006-tar-Default-to-stdin.patch b/core/openbsd/patch/0006-tar-Default-to-stdin.patch new file mode 100644 index 00000000..bac0f61f --- /dev/null +++ b/core/openbsd/patch/0006-tar-Default-to-stdin.patch @@ -0,0 +1,27 @@ +From aa22c87e415d844f17991477187d607dac4a9371 Mon Sep 17 00:00:00 2001 +From: Michael Forney <mforney@mforney.org> +Date: Mon, 18 Apr 2016 01:16:12 -0700 +Subject: [PATCH] tar: Default to stdin + +--- + bin/pax/options.c | 4 +--- + 1 file changed, 1 insertion(+), 3 deletions(-) + +diff --git a/bin/pax/options.c b/bin/pax/options.c +index adb7f4a..89d29bb 100644 +--- a/bin/pax/options.c ++++ b/bin/pax/options.c +@@ -877,9 +877,7 @@ tar_options(int argc, char **argv) + + if (!fstdin && ((arcname == NULL) || (*arcname == '\0'))) { + arcname = getenv("TAPE"); +- if ((arcname == NULL) || (*arcname == '\0')) +- arcname = _PATH_DEFTAPE; +- else if ((arcname[0] == '-') && (arcname[1]== '\0')) { ++ if ((arcname == NULL) || (*arcname == '\0') || (arcname[0] == '-') && (arcname[1]== '\0')) { + arcname = NULL; + fstdin = 1; + } +-- +2.8.0 + |
