CC = gcc -std=c99 -pedantic -Wall -O -s -D_POSIX_SOURCE=1 -D_BSD_SOURCE=1 DEST0 = ../../bin/chroot+setuidgid DEST1 = ../../cgi/wrapper DEST2 = ../../cgi/wrapper2 # for Brian Kim, June 2013 # BK = ../../cgi/bk UID = 0 GID = 0 PROG = /vecr/bin/view.pl PROG2 = /vecr/bin/view2.pl all: chroot+setuidgid wrapper wrapper2 bk chroot+setuidgid: chroot+setuidgid.c $(CC) -o chroot+setuidgid -s -DSTDOUT chroot+setuidgid.c wrapper: chroot+setuidgid.c Makefile $(CC) -o wrapper -s \ -DUID=$(UID) -DGID=$(GID) -DPROG=\"$(PROG)\" \ -DPUTENV_COURSE=1 \ chroot+setuidgid.c wrapper2: chroot+setuidgid.c Makefile $(CC) -o wrapper2 -s \ -DUID=$(UID) -DGID=$(GID) -DPROG=\"$(PROG2)\" \ -DPUTENV_COURSE=1 \ chroot+setuidgid.c bk: chroot+setuidgid.c Makefile $(CC) -o bk -s \ -DUID=2016 -DGID=2016 -DPROG=\"/sites/vecr2/main.php\" \ -DPUTENV_COURSE=1 \ chroot+setuidgid.c install: install_chroot+setuidgid install_wrapper install_wrapper2 install_chroot+setuidgid: chroot+setuidgid Makefile rm -f $(DEST0) cp chroot+setuidgid $(DEST0) chown root:root $(DEST0) chmod 111 $(DEST0) install_wrapper: wrapper Makefile rm -f $(DEST1) cp wrapper $(DEST1) chown root:apache $(DEST1) chmod 4110 $(DEST1) install_wrapper2: wrapper2 Makefile rm -f $(DEST2) cp wrapper2 $(DEST2) chown root:apache $(DEST2) chmod 4110 $(DEST2) install_bk: bk Makefile rm -f $(BK) cp bk $(BK) chown root:apache $(BK) chmod 4110 $(BK) clean: rm -f a.out core chroot+setuidgid wrapper wrapper2 bk