From a881cf90771d10cd05b5ffb812991da20dc2018e Mon Sep 17 00:00:00 2001 From: Michael Forney Date: Sat, 23 Apr 2016 15:23:47 -0700 Subject: Drop setpassent/setgroupent patch and define them in terms of setpwent and setgrent --- core/openbsd/include/grp.h | 2 + core/openbsd/include/pwd.h | 2 + .../0003-pax-Set-listf-to-stderr-in-main.patch | 34 ++++++++++++ .../patch/0003-pax-Use-setpwent-and-setgrent.patch | 52 ------------------ .../openbsd/patch/0004-pax-Add-some-includes.patch | 63 ++++++++++++++++++++++ .../0004-pax-Set-listf-to-stderr-in-main.patch | 34 ------------ .../openbsd/patch/0005-pax-Add-some-includes.patch | 63 ---------------------- core/openbsd/patch/0005-tar-Default-to-stdin.patch | 27 ++++++++++ core/openbsd/patch/0006-tar-Default-to-stdin.patch | 27 ---------- 9 files changed, 128 insertions(+), 176 deletions(-) create mode 100644 core/openbsd/include/grp.h create mode 100644 core/openbsd/include/pwd.h create mode 100644 core/openbsd/patch/0003-pax-Set-listf-to-stderr-in-main.patch delete mode 100644 core/openbsd/patch/0003-pax-Use-setpwent-and-setgrent.patch create mode 100644 core/openbsd/patch/0004-pax-Add-some-includes.patch delete mode 100644 core/openbsd/patch/0004-pax-Set-listf-to-stderr-in-main.patch delete mode 100644 core/openbsd/patch/0005-pax-Add-some-includes.patch create mode 100644 core/openbsd/patch/0005-tar-Default-to-stdin.patch delete mode 100644 core/openbsd/patch/0006-tar-Default-to-stdin.patch diff --git a/core/openbsd/include/grp.h b/core/openbsd/include/grp.h new file mode 100644 index 00000000..49f4dfd4 --- /dev/null +++ b/core/openbsd/include/grp.h @@ -0,0 +1,2 @@ +#include_next +#define setgroupent(n) setgrent() diff --git a/core/openbsd/include/pwd.h b/core/openbsd/include/pwd.h new file mode 100644 index 00000000..e859a8d1 --- /dev/null +++ b/core/openbsd/include/pwd.h @@ -0,0 +1,2 @@ +#include_next +#define setpassent(n) setpwent() diff --git a/core/openbsd/patch/0003-pax-Set-listf-to-stderr-in-main.patch b/core/openbsd/patch/0003-pax-Set-listf-to-stderr-in-main.patch new file mode 100644 index 00000000..05dfacad --- /dev/null +++ b/core/openbsd/patch/0003-pax-Set-listf-to-stderr-in-main.patch @@ -0,0 +1,34 @@ +From 922ea08ad2487192bf46b077ec62d6924973c492 Mon Sep 17 00:00:00 2001 +From: Michael Forney +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/0003-pax-Use-setpwent-and-setgrent.patch b/core/openbsd/patch/0003-pax-Use-setpwent-and-setgrent.patch deleted file mode 100644 index 82a082ad..00000000 --- a/core/openbsd/patch/0003-pax-Use-setpwent-and-setgrent.patch +++ /dev/null @@ -1,52 +0,0 @@ -From d9671f40b5ffc56b2c6ef449bd5eaaefdf538518 Mon Sep 17 00:00:00 2001 -From: Michael Forney -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-Add-some-includes.patch b/core/openbsd/patch/0004-pax-Add-some-includes.patch new file mode 100644 index 00000000..8254b737 --- /dev/null +++ b/core/openbsd/patch/0004-pax-Add-some-includes.patch @@ -0,0 +1,63 @@ +From 140c41d57f7bef789f4a0ea0db0426c1b3f0f38f Mon Sep 17 00:00:00 2001 +From: Michael Forney +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 + #include + #include ++#include + #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 + #include ++#include + #include + #include + #include +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 + #include + #include ++#include + #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 + #include + #include ++#include + #include "pax.h" + #include "sel_subs.h" + #include "extern.h" +-- +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 deleted file mode 100644 index d04b5acb..00000000 --- a/core/openbsd/patch/0004-pax-Set-listf-to-stderr-in-main.patch +++ /dev/null @@ -1,34 +0,0 @@ -From 67cc439f1b0db14d106ea1b6b96d66c6b6c7e15a Mon Sep 17 00:00:00 2001 -From: Michael Forney -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 deleted file mode 100644 index 9153eac5..00000000 --- a/core/openbsd/patch/0005-pax-Add-some-includes.patch +++ /dev/null @@ -1,63 +0,0 @@ -From 9b164bcbe8ce53a6e3840dfb9da9b25a73103f47 Mon Sep 17 00:00:00 2001 -From: Michael Forney -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 - #include - #include -+#include - #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 - #include -+#include - #include - #include - #include -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 - #include - #include -+#include - #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 - #include - #include -+#include - #include "pax.h" - #include "sel_subs.h" - #include "extern.h" --- -2.8.0 - diff --git a/core/openbsd/patch/0005-tar-Default-to-stdin.patch b/core/openbsd/patch/0005-tar-Default-to-stdin.patch new file mode 100644 index 00000000..ffbb3977 --- /dev/null +++ b/core/openbsd/patch/0005-tar-Default-to-stdin.patch @@ -0,0 +1,27 @@ +From 0578803f33e11349628ff98a2834bb0dae6fc4f4 Mon Sep 17 00:00:00 2001 +From: Michael Forney +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 + diff --git a/core/openbsd/patch/0006-tar-Default-to-stdin.patch b/core/openbsd/patch/0006-tar-Default-to-stdin.patch deleted file mode 100644 index bac0f61f..00000000 --- a/core/openbsd/patch/0006-tar-Default-to-stdin.patch +++ /dev/null @@ -1,27 +0,0 @@ -From aa22c87e415d844f17991477187d607dac4a9371 Mon Sep 17 00:00:00 2001 -From: Michael Forney -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 - -- cgit v1.2.3