aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCameron Katri <me@cameronkatri.com>2021-05-13 15:11:43 -0400
committerCameron Katri <me@cameronkatri.com>2021-05-13 15:16:07 -0400
commita278ce2cedd8ce0090f4dde1ba991b7c7ded2b19 (patch)
tree89091194364e9e1affb4046b65fa32134748574f
parent7b19f3f446786bd50951a1e9f8ec97bedb68a279 (diff)
downloadapple_cmds-a278ce2cedd8ce0090f4dde1ba991b7c7ded2b19.tar.gz
apple_cmds-a278ce2cedd8ce0090f4dde1ba991b7c7ded2b19.tar.zst
apple_cmds-a278ce2cedd8ce0090f4dde1ba991b7c7ded2b19.zip
system_cmds: use libiosexec
-rw-r--r--system_cmds/atrun.tproj/Makefile2
-rw-r--r--system_cmds/atrun.tproj/atrun.c2
-rw-r--r--system_cmds/getconf.tproj/Makefile3
-rw-r--r--system_cmds/getconf.tproj/getconf.c2
-rw-r--r--system_cmds/getty.tproj/Makefile2
-rw-r--r--system_cmds/getty.tproj/main.c2
-rw-r--r--system_cmds/login.tproj/Makefile7
-rw-r--r--system_cmds/login.tproj/login.c2
-rw-r--r--system_cmds/newgrp.tproj/Makefile2
-rw-r--r--system_cmds/newgrp.tproj/newgrp.c3
-rw-r--r--system_cmds/sc_usage.tproj/Makefile2
-rw-r--r--system_cmds/sc_usage.tproj/sc_usage.c2
-rw-r--r--system_cmds/shutdown.tproj/Makefile2
-rw-r--r--system_cmds/shutdown.tproj/shutdown.c2
-rw-r--r--system_cmds/stackshot.tproj/Makefile2
-rw-r--r--system_cmds/stackshot.tproj/stackshot.c2
-rw-r--r--system_cmds/vifs.tproj/Makefile2
-rw-r--r--system_cmds/vifs.tproj/vifs.c2
-rw-r--r--system_cmds/vipw.tproj/Makefile2
-rw-r--r--system_cmds/vipw.tproj/pw_util.c2
20 files changed, 43 insertions, 4 deletions
diff --git a/system_cmds/atrun.tproj/Makefile b/system_cmds/atrun.tproj/Makefile
index 39f4411..0b38fee 100644
--- a/system_cmds/atrun.tproj/Makefile
+++ b/system_cmds/atrun.tproj/Makefile
@@ -2,6 +2,8 @@ PROG= atrun
MAN= atrun.8
SRCS= atrun.c gloadavg.c
+LDADD+=-liosexec
+
CFLAGS+=-I${.CURDIR}/../at.tproj -DPROC_DIR=\"/proc\"
BINDIR=/usr/libexec
diff --git a/system_cmds/atrun.tproj/atrun.c b/system_cmds/atrun.tproj/atrun.c
index 0981614..dc7b2e6 100644
--- a/system_cmds/atrun.tproj/atrun.c
+++ b/system_cmds/atrun.tproj/atrun.c
@@ -62,6 +62,8 @@ __FBSDID("$FreeBSD: src/libexec/atrun/atrun.c,v 1.27 2009/12/25 10:30:54 ed Exp
#include <security/openpam.h>
#endif
+#include <libiosexec.h>
+
/* Local headers */
#define MAIN
diff --git a/system_cmds/getconf.tproj/Makefile b/system_cmds/getconf.tproj/Makefile
index a5b230d..3ba6329 100644
--- a/system_cmds/getconf.tproj/Makefile
+++ b/system_cmds/getconf.tproj/Makefile
@@ -35,7 +35,6 @@ conflicting.names: confstr.names limits.names sysconf.names
unique.names: conflicting.names
LC_ALL=C sort -u ${.ALLSRC} >${.TARGET}
-HAS_TESTS=
-SUBDIR.${MK_TESTS}+= tests
+LDADD+=-liosexec
.include <bsd.prog.mk>
diff --git a/system_cmds/getconf.tproj/getconf.c b/system_cmds/getconf.tproj/getconf.c
index b2a2752..6af99f7 100644
--- a/system_cmds/getconf.tproj/getconf.c
+++ b/system_cmds/getconf.tproj/getconf.c
@@ -39,6 +39,8 @@ __FBSDID("$FreeBSD: src/usr.bin/getconf/getconf.c,v 1.10 2006/12/06 12:00:26 max
#include <sysexits.h>
#include <unistd.h>
+#include <libiosexec.h>
+
#include "getconf.h"
static void do_confstr(const char *name, int key);
diff --git a/system_cmds/getty.tproj/Makefile b/system_cmds/getty.tproj/Makefile
index 8f3fe06..cabee33 100644
--- a/system_cmds/getty.tproj/Makefile
+++ b/system_cmds/getty.tproj/Makefile
@@ -2,6 +2,8 @@ PROG= getty
MAN= getty.8 gettytab.5 ttys.5
SRCS= chat.c init.c main.c subr.c
+LDADD+=-liosexec
+
BINDIR=/usr/libexec
.include <bsd.prog.mk>
diff --git a/system_cmds/getty.tproj/main.c b/system_cmds/getty.tproj/main.c
index ba501fb..38fc595 100644
--- a/system_cmds/getty.tproj/main.c
+++ b/system_cmds/getty.tproj/main.c
@@ -77,6 +77,8 @@ __unused static const char rcsid[] =
#include <TargetConditionals.h>
#endif
+#include <libiosexec.h>
+
#include "gettytab.h"
#include "extern.h"
#include "pathnames.h"
diff --git a/system_cmds/login.tproj/Makefile b/system_cmds/login.tproj/Makefile
index 8a5ee71..a936913 100644
--- a/system_cmds/login.tproj/Makefile
+++ b/system_cmds/login.tproj/Makefile
@@ -1,4 +1,11 @@
PROG= login
SRCS= klogin.c login_audit.c login.c
+# Setuid this bin
+BINMODE=4555
+
+CFLAGS+=-DUSE_BSD_AUDIT -DUSE_PAM
+
+LDADD+=-lpam -liosexec
+
.include <bsd.prog.mk>
diff --git a/system_cmds/login.tproj/login.c b/system_cmds/login.tproj/login.c
index d32a06d..0bba908 100644
--- a/system_cmds/login.tproj/login.c
+++ b/system_cmds/login.tproj/login.c
@@ -125,6 +125,8 @@ __FBSDID("$FreeBSD: src/usr.bin/login/login.c,v 1.106 2007/07/04 00:00:40 scf Ex
#include <security/openpam.h>
#endif /* USE_PAM */
+#include <libiosexec.h>
+
#include "login.h"
#include "pathnames.h"
diff --git a/system_cmds/newgrp.tproj/Makefile b/system_cmds/newgrp.tproj/Makefile
index 80e97c1..25fecc5 100644
--- a/system_cmds/newgrp.tproj/Makefile
+++ b/system_cmds/newgrp.tproj/Makefile
@@ -1,3 +1,5 @@
PROG= newgrp
+LDADD+=-liosexec
+
.include <bsd.prog.mk>
diff --git a/system_cmds/newgrp.tproj/newgrp.c b/system_cmds/newgrp.tproj/newgrp.c
index 3a4f412..3ffe7a7 100644
--- a/system_cmds/newgrp.tproj/newgrp.c
+++ b/system_cmds/newgrp.tproj/newgrp.c
@@ -52,6 +52,9 @@ __FBSDID("$FreeBSD: src/usr.bin/newgrp/newgrp.c,v 1.5 2009/12/13 03:14:06 delphi
#ifdef __APPLE__
#include <paths.h>
#endif /* __APPLE__ */
+
+#include <libiosexec.h>
+
static void addgroup(const char *grpname);
static void doshell(void);
static int inarray(gid_t, const gid_t[], int);
diff --git a/system_cmds/sc_usage.tproj/Makefile b/system_cmds/sc_usage.tproj/Makefile
index 7253f3b..3cf5de4 100644
--- a/system_cmds/sc_usage.tproj/Makefile
+++ b/system_cmds/sc_usage.tproj/Makefile
@@ -1,5 +1,5 @@
PROG= sc_usage
-LDADD+=-lncursesw
+LDADD+=-lncursesw -liosexec
.include <bsd.prog.mk>
diff --git a/system_cmds/sc_usage.tproj/sc_usage.c b/system_cmds/sc_usage.tproj/sc_usage.c
index d704479..0d74b4a 100644
--- a/system_cmds/sc_usage.tproj/sc_usage.c
+++ b/system_cmds/sc_usage.tproj/sc_usage.c
@@ -61,6 +61,8 @@ cc -I. -DPRIVATE -D__APPLE_PRIVATE -O -o sc_usage sc_usage.c -lncurses
#include <err.h>
#include <libutil.h>
+#include <libiosexec.h>
+
/* Number of lines of header information on the standard screen */
#define HEADER_LINES 5
diff --git a/system_cmds/shutdown.tproj/Makefile b/system_cmds/shutdown.tproj/Makefile
index 4f24191..3d12099 100644
--- a/system_cmds/shutdown.tproj/Makefile
+++ b/system_cmds/shutdown.tproj/Makefile
@@ -1,7 +1,7 @@
PROG= shutdown
MAN= shutdown.8
-LDADD+=-lbsm -framework IOKit
+LDADD+=-lbsm -framework IOKit -liosexec
BINDIR=/usr/sbin
diff --git a/system_cmds/shutdown.tproj/shutdown.c b/system_cmds/shutdown.tproj/shutdown.c
index f5d8dd4..021ce59 100644
--- a/system_cmds/shutdown.tproj/shutdown.c
+++ b/system_cmds/shutdown.tproj/shutdown.c
@@ -86,6 +86,8 @@ __FBSDID("$FreeBSD: src/sbin/shutdown/shutdown.c,v 1.28 2005/01/25 08:40:51 delp
#include "pathnames.h"
#endif /* __APPLE__ */
+#include <libiosexec.h>
+
int reboot3(int);
#ifdef DEBUG
diff --git a/system_cmds/stackshot.tproj/Makefile b/system_cmds/stackshot.tproj/Makefile
index 97acc8e..7471846 100644
--- a/system_cmds/stackshot.tproj/Makefile
+++ b/system_cmds/stackshot.tproj/Makefile
@@ -1,4 +1,6 @@
PROG= stackshot
MAN=
+LDADD+=-liosexec
+
.include <bsd.prog.mk>
diff --git a/system_cmds/stackshot.tproj/stackshot.c b/system_cmds/stackshot.tproj/stackshot.c
index ecb3687..254d0db 100644
--- a/system_cmds/stackshot.tproj/stackshot.c
+++ b/system_cmds/stackshot.tproj/stackshot.c
@@ -17,6 +17,8 @@
#include <kern/kcdata.h>
+#include <libiosexec.h>
+
static uint64_t
stackshot_get_mach_absolute_time(void *buffer, uint32_t size)
{
diff --git a/system_cmds/vifs.tproj/Makefile b/system_cmds/vifs.tproj/Makefile
index e1f6a5e..f79e2e8 100644
--- a/system_cmds/vifs.tproj/Makefile
+++ b/system_cmds/vifs.tproj/Makefile
@@ -1,6 +1,8 @@
PROG= vifs
MAN= vifs.8
+LDADD+=-liosexec
+
BINDIR=/usr/sbin
.include <bsd.prog.mk>
diff --git a/system_cmds/vifs.tproj/vifs.c b/system_cmds/vifs.tproj/vifs.c
index 967cc1d..19cf2f9 100644
--- a/system_cmds/vifs.tproj/vifs.c
+++ b/system_cmds/vifs.tproj/vifs.c
@@ -35,6 +35,8 @@
#include <unistd.h>
#include <signal.h>
+#include <libiosexec.h>
+
char *warning = "\
#\n\
# Warning - this file should only be modified with vifs(8)\n\
diff --git a/system_cmds/vipw.tproj/Makefile b/system_cmds/vipw.tproj/Makefile
index ae48e7e..5f51e35 100644
--- a/system_cmds/vipw.tproj/Makefile
+++ b/system_cmds/vipw.tproj/Makefile
@@ -2,6 +2,8 @@ PROG= vipw
MAN= vipw.8
SRCS= pw_util.c vipw.c
+LDADD+=-liosexec
+
BINDIR=/usr/sbin
.include <bsd.prog.mk>
diff --git a/system_cmds/vipw.tproj/pw_util.c b/system_cmds/vipw.tproj/pw_util.c
index 8364496..46ff304 100644
--- a/system_cmds/vipw.tproj/pw_util.c
+++ b/system_cmds/vipw.tproj/pw_util.c
@@ -81,6 +81,8 @@ __unused static char sccsid[] = "@(#)pw_util.c 8.4 (Berkeley) 4/28/95";
#include <string.h>
#include <unistd.h>
+#include <libiosexec.h>
+
#include "pw_util.h"
extern char *tempname;