Lucio Andrés Illanes Albornoz b0e81e
diff --git a/pax/file_subs.c b/pax/file_subs.c
Lucio Andrés Illanes Albornoz b0e81e
index be8d065..41ffd57 100644
Lucio Andrés Illanes Albornoz b0e81e
--- a/pax/file_subs.c
Lucio Andrés Illanes Albornoz b0e81e
+++ b/pax/file_subs.c
Lucio Andrés Illanes Albornoz b0e81e
@@ -823,7 +823,7 @@ set_attr(const struct file_times *ft, int force_times, mode_t mode,
Lucio Andrés Illanes Albornoz b0e81e
 	 * so do *not* use O_NOFOLLOW.  The dev+ino check will
Lucio Andrés Illanes Albornoz b0e81e
 	 * protect us from evil.
Lucio Andrés Illanes Albornoz b0e81e
 	 */
Lucio Andrés Illanes Albornoz b0e81e
-	fd = open(ft->ft_name, O_RDONLY | O_DIRECTORY);
Lucio Andrés Illanes Albornoz b0e81e
+	fd = open(ft->ft_name, O_RDWR | O_DIRECTORY);
Lucio Andrés Illanes Albornoz b0e81e
 	if (fd == -1) {
Lucio Andrés Illanes Albornoz b0e81e
 		if (!in_sig)
Lucio Andrés Illanes Albornoz b0e81e
 			syswarn(1, errno, "Unable to restore mode and times"
Lucio Andrés Illanes Albornoz 57d9e1
diff --git a/libopenbsd/pwd.c b/libopenbsd/pwd.c
Lucio Andrés Illanes Albornoz 57d9e1
index d087150..5d29e3f 100644
Lucio Andrés Illanes Albornoz 57d9e1
--- a/libopenbsd/pwd.c
Lucio Andrés Illanes Albornoz 57d9e1
+++ b/libopenbsd/pwd.c
Lucio Andrés Illanes Albornoz 57d9e1
@@ -20,11 +20,15 @@ gid_from_group(const char *name, gid_t *gid)
Lucio Andrés Illanes Albornoz 57d9e1
 	return 0;
Lucio Andrés Illanes Albornoz 57d9e1
 }
Lucio Andrés Illanes Albornoz 57d9e1
 
Lucio Andrés Illanes Albornoz 57d9e1
+const char group_nogroup[] = "nogroup";
Lucio Andrés Illanes Albornoz 57d9e1
+
Lucio Andrés Illanes Albornoz 57d9e1
 const char *
Lucio Andrés Illanes Albornoz 57d9e1
 group_from_gid(gid_t gid, int nogroup)
Lucio Andrés Illanes Albornoz 57d9e1
 {
Lucio Andrés Illanes Albornoz 57d9e1
-
Lucio Andrés Illanes Albornoz 57d9e1
-	return (getgrgid(gid)->gr_name);
Lucio Andrés Illanes Albornoz 57d9e1
+	struct group *grp;
Lucio Andrés Illanes Albornoz 57d9e1
+	return (grp =getgrgid(gid))
Lucio Andrés Illanes Albornoz 57d9e1
+		? grp->gr_name
Lucio Andrés Illanes Albornoz 57d9e1
+		: group_nogroup;
Lucio Andrés Illanes Albornoz 57d9e1
 }
Lucio Andrés Illanes Albornoz 57d9e1
 
Lucio Andrés Illanes Albornoz 57d9e1
 int
Lucio Andrés Illanes Albornoz 2dbeae
--- baseutils/pax/Makefile.orig	2020-05-24 11:18:45.017286972 +0100
Lucio Andrés Illanes Albornoz 2dbeae
+++ baseutils/pax/Makefile	2020-06-02 09:56:05.077777147 +0100
Lucio Andrés Illanes Albornoz 2dbeae
@@ -2,7 +2,7 @@
Lucio Andrés Illanes Albornoz 2dbeae
 
Lucio Andrés Illanes Albornoz 2dbeae
 CC ?=		cc
Lucio Andrés Illanes Albornoz 2dbeae
 CFLAGS ?=	-O2 -pipe
Lucio Andrés Illanes Albornoz 2dbeae
-CFLAGS +=	-I../libopenbsd -include openbsd.h
Lucio Andrés Illanes Albornoz 2dbeae
+override CFLAGS +=	-I../libopenbsd -include openbsd.h
Lucio Andrés Illanes Albornoz 2dbeae
 
Lucio Andrés Illanes Albornoz 2dbeae
 LIBS =	../libopenbsd/libopenbsd.a
Lucio Andrés Illanes Albornoz 2dbeae
 
Lucio Andrés Illanes Albornoz f303ba
@@ -18,12 +18,7 @@
Lucio Andrés Illanes Albornoz f303ba
 	${CC} ${LDFLAGS} -o ${PROG} ${OBJS} ${LIBS}
Lucio Andrés Illanes Albornoz f303ba
 
Lucio Andrés Illanes Albornoz f303ba
 install:
Lucio Andrés Illanes Albornoz f303ba
-	install -c -s -m 555 ${PROG} ${PREFIX}/bin/${PROG}
Lucio Andrés Illanes Albornoz f303ba
-	install -c -s -m 555 ${PROG} ${PREFIX}/bin/tar
Lucio Andrés Illanes Albornoz f303ba
-	install -c -s -m 555 ${PROG} ${PREFIX}/bin/cpio
Lucio Andrés Illanes Albornoz f303ba
-	install -c -m 444 ${PROG}.1 ${MANDIR}/man1
Lucio Andrés Illanes Albornoz f303ba
-	install -c -m 444 tar.1 ${MANDIR}/man1
Lucio Andrés Illanes Albornoz f303ba
-	install -c -m 444 cpio.1 ${MANDIR}/man1
Lucio Andrés Illanes Albornoz f303ba
+	
Lucio Andrés Illanes Albornoz f303ba
 
Lucio Andrés Illanes Albornoz f303ba
 clean:
Lucio Andrés Illanes Albornoz f303ba
 	rm -f ${PROG} ${OBJS}
Lucio Andrés Illanes Albornoz 2dbeae
--- baseutils/libopenbsd/Makefile.orig	2020-05-24 11:18:44.985288127 +0100
Lucio Andrés Illanes Albornoz 2dbeae
+++ baseutils/libopenbsd/Makefile	2020-06-02 10:07:01.438320324 +0100
Lucio Andrés Illanes Albornoz 2dbeae
@@ -2,7 +2,7 @@
Lucio Andrés Illanes Albornoz 2dbeae
 
Lucio Andrés Illanes Albornoz 2dbeae
 CC ?=		cc
Lucio Andrés Illanes Albornoz 2dbeae
 CFLAGS ?=	-O2 -pipe
Lucio Andrés Illanes Albornoz 2dbeae
-CFLAGS +=	-I.
Lucio Andrés Illanes Albornoz 2dbeae
+override CFLAGS +=	-I.
Lucio Andrés Illanes Albornoz 2dbeae
 
Lucio Andrés Illanes Albornoz 2dbeae
 LIB =	libopenbsd.a
Lucio Andrés Illanes Albornoz 2dbeae
 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 \