diff --git a/src/Makefile b/src/Makefile index d9624de..9834b3e 100644 --- a/src/Makefile +++ b/src/Makefile @@ -170,12 +170,6 @@ byte_diff.o: byte.h byte_diff.c compile byte_rchr.o: byte.h byte_rchr.c compile ./compile byte_rchr.c -chkshsgr: chkshsgr.o load - ./load chkshsgr - -chkshsgr.o: chkshsgr.c compile - ./compile chkshsgr.c - choose: choose.sh warn-auto.sh rm -f choose cat warn-auto.sh choose.sh \ @@ -232,11 +226,6 @@ hassgact.h: choose compile hassgact.h1 hassgact.h2 load trysgact.c hassgprm.h: choose compile hassgprm.h1 hassgprm.h2 load trysgprm.c ./choose cl trysgprm hassgprm.h1 hassgprm.h2 > hassgprm.h -hasshsgr.h: chkshsgr choose compile hasshsgr.h1 hasshsgr.h2 load \ -tryshsgr.c warn-shsgr - ./chkshsgr || ( cat warn-shsgr; exit 1 ) - ./choose clr tryshsgr hasshsgr.h1 hasshsgr.h2 > hasshsgr.h - haswaitp.h: choose compile haswaitp.h1 haswaitp.h2 load trywaitp.c ./choose cl trywaitp haswaitp.h1 haswaitp.h2 > haswaitp.h @@ -292,9 +281,6 @@ pathexec_run.o: compile env.h error.h gen_alloc.h pathexec.h \ pathexec_run.c str.h stralloc.h ./compile pathexec_run.c -prot.o: compile hasshsgr.h prot.c prot.h - ./compile prot.c - readclose.o: compile error.h gen_alloc.h readclose.c readclose.h \ stralloc.h ./compile readclose.c @@ -372,7 +358,7 @@ subgetopt.o: compile subgetopt.c subgetopt.h ./compile subgetopt.c sysdeps: compile direntry.h hasflock.h hasmkffo.h hassgact.h \ -hassgprm.h hasshsgr.h haswaitp.h iopause.h load select.h systype \ +hassgprm.h haswaitp.h iopause.h load select.h systype \ uint64.h reboot_system.h uw_tmp.h socket.lib rm -f sysdeps cat systype compile load socket.lib >>sysdeps @@ -385,7 +371,6 @@ uint64.h reboot_system.h uw_tmp.h socket.lib grep sysdep iopause.h >>sysdeps grep sysdep hasmkffo.h >>sysdeps grep sysdep hasflock.h >>sysdeps - grep sysdep hasshsgr.h >>sysdeps grep sysdep reboot_system.h >>sysdeps grep sysdep uw_tmp.h >>sysdeps cat sysdeps @@ -444,7 +429,7 @@ buffer_get.o buffer_put.o buffer_read.o buffer_write.o coe.o env.o \ error.o error_str.o fd_copy.o fd_move.o fifo.o lock_ex.o lock_exnb.o \ makelib ndelay_off.o ndelay_on.o open_append.o open_read.o \ open_trunc.o open_write.o openreadclose.o pathexec_env.o \ -pathexec_run.o prot.o readclose.o seek_set.o sgetopt.o sig.o \ +pathexec_run.o readclose.o seek_set.o sgetopt.o sig.o \ sig_block.o sig_catch.o sig_pause.o stralloc_cat.o stralloc_catb.o \ stralloc_cats.o stralloc_eady.o stralloc_opyb.o stralloc_opys.o \ stralloc_pend.o strerr_die.o strerr_sys.o subgetopt.o wait_nohang.o \ @@ -454,7 +439,7 @@ wait_pid.o coe.o env.o error.o error_str.o fd_copy.o fd_move.o fifo.o lock_ex.o \ lock_exnb.o ndelay_off.o ndelay_on.o open_append.o open_read.o \ open_trunc.o open_write.o openreadclose.o pathexec_env.o \ - pathexec_run.o prot.o readclose.o seek_set.o sgetopt.o sig.o \ + pathexec_run.o readclose.o seek_set.o sgetopt.o sig.o \ sig_block.o sig_catch.o sig_pause.o stralloc_cat.o stralloc_catb.o \ stralloc_cats.o stralloc_eady.o stralloc_opyb.o stralloc_opys.o \ stralloc_pend.o strerr_die.o strerr_sys.o subgetopt.o wait_nohang.o \ @@ -465,4 +450,3 @@ wait_nohang.o: compile haswaitp.h wait_nohang.c wait_pid.o: compile error.h haswaitp.h wait_pid.c ./compile wait_pid.c - diff --git a/src/TARGETS b/src/TARGETS index 46981ce..2a50be3 100644 --- a/src/TARGETS +++ b/src/TARGETS @@ -49,8 +49,6 @@ byte_copy.o byte_cr.o byte_diff.o byte_rchr.o -chkshsgr -chkshsgr.o choose coe.o compile @@ -68,7 +66,6 @@ hasflock.h hasmkffo.h hassgact.h hassgprm.h -hasshsgr.h haswaitp.h iopause.h iopause.o @@ -85,7 +82,6 @@ open_write.o openreadclose.o pathexec_env.o pathexec_run.o -prot.o readclose.o scan_ulong.o seek_set.o diff --git a/src/chkshsgr.c b/src/chkshsgr.c deleted file mode 100644 index 31eda67..0000000 --- a/src/chkshsgr.c +++ /dev/null @@ -1,13 +0,0 @@ -/* Public domain. */ - -#include -#include - -int main() -{ - gid_t x[4]; - - x[0] = x[1] = 0; - if (getgroups(1,x) == 0) if (setgroups(1,x) == -1) _exit(1); - _exit(0); -} diff --git a/src/chpst.c b/src/chpst.c index d597b68..20bf027 100644 --- a/src/chpst.c +++ b/src/chpst.c @@ -8,7 +8,6 @@ #include "strerr.h" #include "str.h" #include "uidgid.h" -#include "prot.h" #include "strerr.h" #include "scan.h" #include "fmt.h" @@ -80,7 +79,7 @@ void suidgid(char *user, unsigned int ext) { } if (setgroups(ugid.gids, ugid.gid) == -1) fatal("unable to setgroups"); if (setgid(*ugid.gid) == -1) fatal("unable to setgid"); - if (prot_uid(ugid.uid) == -1) fatal("unable to setuid"); + if (setuid(ugid.uid) == -1) fatal("unable to setuid"); } void euidgid(char *user, unsigned int ext) { diff --git a/src/hasshsgr.h1 b/src/hasshsgr.h1 deleted file mode 100644 index 3806277..0000000 --- a/src/hasshsgr.h1 +++ /dev/null @@ -1,3 +0,0 @@ -/* Public domain. */ - -/* sysdep: -shortsetgroups */ diff --git a/src/hasshsgr.h2 b/src/hasshsgr.h2 deleted file mode 100644 index 5624ed0..0000000 --- a/src/hasshsgr.h2 +++ /dev/null @@ -1,4 +0,0 @@ -/* Public domain. */ - -/* sysdep: +shortsetgroups */ -#define HASSHORTSETGROUPS 1 diff --git a/src/prot.c b/src/prot.c deleted file mode 100644 index 66cdc05..0000000 --- a/src/prot.c +++ /dev/null @@ -1,25 +0,0 @@ -/* Public domain. */ - -#include "hasshsgr.h" -#include "prot.h" - -#include -#include -#include - -int prot_gid(gid_t gid) -{ -#ifdef HASSHORTSETGROUPS - short x[2]; - x[0] = gid; x[1] = 73; /* catch errors */ - if (setgroups(1,x) == -1) return -1; -#else - if (setgroups(1,&gid) == -1) return -1; -#endif - return setgid(gid); /* _should_ be redundant, but on some systems it isn't */ -} - -int prot_uid(uid_t uid) -{ - return setuid(uid); -} diff --git a/src/prot.h b/src/prot.h deleted file mode 100644 index b9fa6c8..0000000 --- a/src/prot.h +++ /dev/null @@ -1,11 +0,0 @@ -/* Public domain. */ - -#ifndef PROT_H -#define PROT_H - -#include - -extern int prot_gid(gid_t); -extern int prot_uid(uid_t); - -#endif diff --git a/src/tryshsgr.c b/src/tryshsgr.c deleted file mode 100644 index c5ed6d6..0000000 --- a/src/tryshsgr.c +++ /dev/null @@ -1,16 +0,0 @@ -/* Public domain. */ - -int main() -{ - short x[4]; - - x[0] = x[1] = 1; - if (getgroups(1,x) == 0) if (setgroups(1,x) == -1) _exit(1); - - if (getgroups(1,x) == -1) _exit(1); - if (x[1] != 1) _exit(1); - x[1] = 2; - if (getgroups(1,x) == -1) _exit(1); - if (x[1] != 2) _exit(1); - _exit(0); -} diff --git a/src/warn-shsgr b/src/warn-shsgr deleted file mode 100644 index 37c351e..0000000 --- a/src/warn-shsgr +++ /dev/null @@ -1,3 +0,0 @@ -Oops. Your getgroups() returned 0, and setgroups() failed; this means -that I can't reliably do my shsgr test. Please either ``make'' as root -or ``make'' while you're in one or more supplementary groups.