summaryrefslogtreecommitdiffhomepage
path: root/patches/openbsd_baseutils.local.patch
blob: b6138350176f4da42613055b166ffeb64a4f3b4f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
diff --git a/pax/file_subs.c b/pax/file_subs.c
index be8d065..41ffd57 100644
--- a/pax/file_subs.c
+++ b/pax/file_subs.c
@@ -823,7 +823,7 @@ set_attr(const struct file_times *ft, int force_times, mode_t mode,
 	 * so do *not* use O_NOFOLLOW.  The dev+ino check will
 	 * protect us from evil.
 	 */
-	fd = open(ft->ft_name, O_RDONLY | O_DIRECTORY);
+	fd = open(ft->ft_name, O_RDWR | O_DIRECTORY);
 	if (fd == -1) {
 		if (!in_sig)
 			syswarn(1, errno, "Unable to restore mode and times"
diff --git a/libopenbsd/pwd.c b/libopenbsd/pwd.c
index d087150..5d29e3f 100644
--- a/libopenbsd/pwd.c
+++ b/libopenbsd/pwd.c
@@ -20,11 +20,15 @@ gid_from_group(const char *name, gid_t *gid)
 	return 0;
 }
 
+const char group_nogroup[] = "nogroup";
+
 const char *
 group_from_gid(gid_t gid, int nogroup)
 {
-
-	return (getgrgid(gid)->gr_name);
+	struct group *grp;
+	return (grp =getgrgid(gid))
+		? grp->gr_name
+		: group_nogroup;
 }
 
 int
--- baseutils/pax/Makefile.orig	2020-05-24 11:18:45.017286972 +0100
+++ baseutils/pax/Makefile	2020-06-02 09:56:05.077777147 +0100
@@ -2,7 +2,7 @@
 
 CC ?=		cc
 CFLAGS ?=	-O2 -pipe
-CFLAGS +=	-I../libopenbsd -include openbsd.h
+override CFLAGS +=	-I../libopenbsd -include openbsd.h
 
 LIBS =	../libopenbsd/libopenbsd.a
 
@@ -18,12 +18,7 @@
 	${CC} ${LDFLAGS} -o ${PROG} ${OBJS} ${LIBS}
 
 install:
-	install -c -s -m 555 ${PROG} ${PREFIX}/bin/${PROG}
-	install -c -s -m 555 ${PROG} ${PREFIX}/bin/tar
-	install -c -s -m 555 ${PROG} ${PREFIX}/bin/cpio
-	install -c -m 444 ${PROG}.1 ${MANDIR}/man1
-	install -c -m 444 tar.1 ${MANDIR}/man1
-	install -c -m 444 cpio.1 ${MANDIR}/man1
+	
 
 clean:
 	rm -f ${PROG} ${OBJS}
--- baseutils/libopenbsd/Makefile.orig	2020-05-24 11:18:44.985288127 +0100
+++ baseutils/libopenbsd/Makefile	2020-06-02 10:07:01.438320324 +0100
@@ -2,7 +2,7 @@
 
 CC ?=		cc
 CFLAGS ?=	-O2 -pipe
-CFLAGS +=	-I.
+override CFLAGS +=	-I.
 
 LIB =	libopenbsd.a
 OBJS =	arc4random.o basename.o dirname.o e_atan2.o e_exp.o e_fmod.o e_log.o e_log10.o e_pow.o e_rem_pio2.o e_sqrt.o errc.o fgetln.o \