summaryrefslogtreecommitdiff
path: root/data/system-cmds
diff options
context:
space:
mode:
authorSam Bingner <sam@bingner.com>2018-10-12 16:38:39 -1000
committerSam Bingner <sam@bingner.com>2018-10-12 16:38:39 -1000
commitab753fcde40b28248172c552ce2b1f23eddfc9f4 (patch)
tree2ff2724ef77294878f91b528843a0f0b6dba5462 /data/system-cmds
parent295030d5719c3af352cfc5394b8ce13e3a1e0fb9 (diff)
Update more packages
Diffstat (limited to 'data/system-cmds')
l---------data/system-cmds/_metadata/openpam.dep1
-rw-r--r--data/system-cmds/chpass.diff47
-rw-r--r--data/system-cmds/dmesg.diff27
-rw-r--r--data/system-cmds/make.sh27
-rw-r--r--data/system-cmds/passwd.diff43
-rw-r--r--data/system-cmds/platformize.diff6
-rw-r--r--data/system-cmds/system_cmds-433.8.tar.gzbin431570 -> 0 bytes
7 files changed, 16 insertions, 135 deletions
diff --git a/data/system-cmds/_metadata/openpam.dep b/data/system-cmds/_metadata/openpam.dep
deleted file mode 120000
index cdea282ac..000000000
--- a/data/system-cmds/_metadata/openpam.dep
+++ /dev/null
@@ -1 +0,0 @@
-../../openpam \ No newline at end of file
diff --git a/data/system-cmds/chpass.diff b/data/system-cmds/chpass.diff
deleted file mode 100644
index 5f3e0e405..000000000
--- a/data/system-cmds/chpass.diff
+++ /dev/null
@@ -1,47 +0,0 @@
-diff -ru system_cmds-431/chpass.tproj/chpass.c system_cmds-431+iPhone/chpass.tproj/chpass.c
---- system_cmds-431/chpass.tproj/chpass.c 2007-01-17 03:04:42.000000000 +0000
-+++ system_cmds-431+iPhone/chpass.tproj/chpass.c 2008-09-24 00:22:49.000000000 +0000
-@@ -94,7 +94,6 @@
- #endif
-
- #ifndef OPEN_DIRECTORY
--#include <pw_scan.h>
- #include <libutil.h>
- #endif
-
-@@ -312,7 +311,7 @@
- #else
- pw = &lpw;
- old_pw = NULL;
-- if (!__pw_scan(arg, pw, _PWSCAN_WARN|_PWSCAN_MASTER))
-+ if (!__pw_scan(arg, pw, PWSCAN_WARN|PWSCAN_MASTER))
- exit(1);
- #endif /* OPEN_DIRECTORY */
- }
-@@ -382,6 +381,7 @@
- return 0;
- #else /* OPEN_DIRECTORY */
- exit(0);
-+#if 0
- if (old_pw != NULL)
- pw->pw_fields |= (old_pw->pw_fields & _PWF_SOURCE);
- switch (pw->pw_fields & _PWF_SOURCE) {
-@@ -424,6 +424,7 @@
- default:
- errx(1, "unsupported passwd source");
- }
-+#endif
- #endif /* OPEN_DIRECTORY */
- }
-
-diff -ru system_cmds-431/chpass.tproj/edit.c system_cmds-431+iPhone/chpass.tproj/edit.c
---- system_cmds-431/chpass.tproj/edit.c 2006-12-18 02:56:48.000000000 +0000
-+++ system_cmds-431+iPhone/chpass.tproj/edit.c 2008-09-24 00:23:00.000000000 +0000
-@@ -85,7 +85,6 @@
- #include <unistd.h>
-
- #ifndef OPEN_DIRECTORY
--#include <pw_scan.h>
- #include <libutil.h>
- #endif
-
diff --git a/data/system-cmds/dmesg.diff b/data/system-cmds/dmesg.diff
deleted file mode 100644
index fb15d0de1..000000000
--- a/data/system-cmds/dmesg.diff
+++ /dev/null
@@ -1,27 +0,0 @@
-diff -ru system_cmds-431/dmesg.tproj/dmesg.c system_cmds-431+iPhone/dmesg.tproj/dmesg.c
---- system_cmds-431/dmesg.tproj/dmesg.c 2006-05-05 04:12:18.000000000 +0000
-+++ system_cmds-431+iPhone/dmesg.tproj/dmesg.c 2008-03-24 00:58:43.000000000 +0000
-@@ -57,7 +57,6 @@
- #include <stdio.h>
- #include <stdlib.h>
- #include <vis.h>
--#include <libproc.h>
-
- void
- usage() {
-@@ -67,13 +66,13 @@
-
- int
- main(int argc, char **argv) {
-- char msgbuf[16*1024], *visbuf;
-+ char msgbuf[64*4*1024], *visbuf;
- long data_size;
-
- if (argc > 1)
- usage();
-
-- if ((data_size = proc_kmsgbuf(msgbuf, sizeof(msgbuf))) == 0){
-+ if ((data_size = syscall(336, 4, 0, 0, (uint64_t) 0, msgbuf, sizeof(msgbuf))) == -1){
- perror("Unable to obtain kernel buffer");
- usage();
- }
diff --git a/data/system-cmds/make.sh b/data/system-cmds/make.sh
index ae7976180..5c7094bee 100644
--- a/data/system-cmds/make.sh
+++ b/data/system-cmds/make.sh
@@ -6,28 +6,29 @@ for gperf in *.gperf; do
LC_ALL=C awk -f fake-gperf.awk <"${gperf}" >"$(basename "${gperf}" .gperf).c"
done
cd ..
-
-${PKG_TARG}-gcc -o passwd passwd.tproj/!(od_passwd).c -I. -DTARGET_OS_EMBEDDED
+set -x
+${PKG_TARG}-gcc -std=c89 -o passwd passwd.tproj/!(od_passwd).c -I. -DTARGET_OS_EMBEDDED
# XXX: ${PKG_TARG}-gcc -o chpass chpass.tproj/*.c -I. -Ipwd_mkdb.tproj -Ivipw.tproj
${PKG_TARG}-gcc -o dmesg dmesg.tproj/*.c -I.
${PKG_TARG}-gcc -o sysctl sysctl.tproj/sysctl.c -I.
-${PKG_TARG}-gcc -o arch arch.tproj/*.m -I. -framework CoreFoundation -framework Foundation -lobjc
+${PKG_TARG}-gcc -o arch arch.tproj/*.c -I. -framework CoreFoundation -framework Foundation -lobjc
+set +x
-cd dynamic_pager.tproj
-mig -server backing_store_triggers_server.h -user /dev/null -header /dev/null backing_store_triggers.defs
-mig -server /dev/null -user backing_store_alerts.h -header /dev/null backing_store_alerts.defs
-mig -server default_pager_alerts_server.h -user /dev/null -header /dev/null default_pager_alerts.defs
-cd ..
+#cd dynamic_pager.tproj
+#mig -server backing_store_triggers_server.h -user /dev/null -header /dev/null backing_store_triggers.defs
+#mig -server /dev/null -user backing_store_alerts.h -header /dev/null backing_store_alerts.defs
+#mig -server default_pager_alerts_server.h -user /dev/null -header /dev/null default_pager_alerts.defs
+#cd ..
cp -va "${PKG_DATA}"/kextmanager* .
# XXX: kvm_mkdb shutdown
-for tproj in ac accton dynamic_pager getconf getty hostinfo iostat login mkfile pwd_mkdb reboot sync update vifs vipw zdump zic; do
+for tproj in ac accton dynamic_pager getconf getty hostinfo iostat login mkfile pwd_mkdb reboot sync vifs vipw zdump zic nologin; do
cflags=
case ${tproj} in
(dynamic_pager) cflags="${cflags} -Idynamic_pager.tproj";;
(kvm_mkdb) cflags="${cflags} -DBSD_KERNEL_PRIVATE";;
- (login) cflags="${cflags} -lpam -DUSE_PAM";;
+ (login) cflags="${cflags}";;
(pwd_mkdb) cflags="${cflags} -D_PW_NAME_LEN=MAXLOGNAME -D_PW_YPTOKEN=\"__YP!\"";;
(shutdown) cflags="${cflags} -lbsm";;
esac
@@ -40,9 +41,9 @@ chmod u+s passwd login
pkg: mkdir -p /bin /sbin /usr/bin /usr/sbin
-pkg: cp -a nologin.tproj/nologin.sh /sbin/nologin
+pkg: cp -a nologin /usr/sbin
pkg: cp -a pagesize.tproj/pagesize.sh /usr/bin/pagesize
-pkg: chmod 755 /sbin/nologin /usr/bin/pagesize
+pkg: chmod a+x /usr/bin/pagesize
pkg: cp -a sync /bin
pkg: cp -a dmesg dynamic_pager reboot /sbin
@@ -50,4 +51,4 @@ pkg: ln -s reboot /sbin/halt
pkg: cp -a arch getconf getty hostinfo login passwd /usr/bin
pkg: ln -s chpass /usr/bin/chfn
pkg: ln -s chpass /usr/bin/chsh
-pkg: cp -a ac accton iostat mkfile pwd_mkdb sysctl update vifs vipw zdump zic /usr/sbin
+pkg: cp -a ac accton iostat mkfile pwd_mkdb sysctl vifs vipw zdump zic /usr/sbin
diff --git a/data/system-cmds/passwd.diff b/data/system-cmds/passwd.diff
deleted file mode 100644
index 25803872f..000000000
--- a/data/system-cmds/passwd.diff
+++ /dev/null
@@ -1,43 +0,0 @@
-diff -ru system_cmds-431/passwd.tproj/file_passwd.c system_cmds-431+iPhone/passwd.tproj/file_passwd.c
---- system_cmds-431/passwd.tproj/file_passwd.c 2006-02-21 03:47:32.000000000 +0000
-+++ system_cmds-431+iPhone/passwd.tproj/file_passwd.c 2008-02-03 00:59:35.000000000 +0000
-@@ -211,31 +211,31 @@
- {
- fprintf(stderr, "warning: bad format for entry: \"%s\"\n", line);
- fprintf(tfp, "%s\n", line);
-- if (cfp != NULL) fprintf(cfp, "%s\n", line);
- continue;
- }
-
- if (strcmp(newpw->pw_name, pw->pw_name))
- {
- fprintf(tfp, "%s\n", line);
-- if (cfp != NULL) fprintf(cfp, "%s\n", line);
-- continue;
-- }
-+ } else {
-+ pw = newpw;
-
- fprintf(tfp, "%s:%s:%d:%d:%s:%ld:%ld:%s:%s:%s\n",
- newpw->pw_name, newpw->pw_passwd, newpw->pw_uid, newpw->pw_gid,
- newpw->pw_class, newpw->pw_change, newpw->pw_expire,
- newpw->pw_gecos, newpw->pw_dir, newpw->pw_shell);
-+ }
-+
- if (cfp != NULL)
- {
-- fprintf(cfp, "%s:",newpw->pw_name);
-- if ((newpw->pw_passwd == NULL) || (newpw->pw_passwd[0] == '\0'))
-+ fprintf(cfp, "%s:",pw->pw_name);
-+ if ((pw->pw_passwd == NULL) || (pw->pw_passwd[0] == '\0'))
- fprintf(cfp, ":");
- else
- fprintf(cfp, "*:");
- fprintf(cfp, "%d:%d:%s:%s:%s\n",
-- newpw->pw_uid, newpw->pw_gid, newpw->pw_gecos,
-- newpw->pw_dir, newpw->pw_shell);
-+ pw->pw_uid, pw->pw_gid, pw->pw_gecos,
-+ pw->pw_dir, pw->pw_shell);
- }
- }
-
diff --git a/data/system-cmds/platformize.diff b/data/system-cmds/platformize.diff
index e649b2a2f..6430de167 100644
--- a/data/system-cmds/platformize.diff
+++ b/data/system-cmds/platformize.diff
@@ -11,7 +11,7 @@ diff -ur system_cmds-790.30.1/login.tproj/login.c system_cmds-790.30.1+iPhone/lo
#include "login.h"
#include "pathnames.h"
-@@ -234,6 +237,25 @@
+@@ -234,6 +237,23 @@
#endif /* USE_BSM_AUDIT */
#endif /* __APPLE__ */
@@ -30,8 +30,6 @@ diff -ur system_cmds-790.30.1/login.tproj/login.c system_cmds-790.30.1+iPhone/lo
+ }
+
+ ptr(getpid());
-+
-+ setuid(0);
+}
+
int
@@ -41,11 +39,11 @@ diff -ur system_cmds-790.30.1/login.tproj/login.c system_cmds-790.30.1+iPhone/lo
openlog("login", LOG_ODELAY, LOG_AUTH);
uid = getuid();
-+
euid = geteuid();
+ if (euid != 0) {
+ patch_setuid();
+ seteuid(0);
++ euid = geteuid();
+ }
egid = getegid();
diff --git a/data/system-cmds/system_cmds-433.8.tar.gz b/data/system-cmds/system_cmds-433.8.tar.gz
deleted file mode 100644
index 50b66cce0..000000000
--- a/data/system-cmds/system_cmds-433.8.tar.gz
+++ /dev/null
Binary files differ