ssid-0.1/0000755000014400001440000000000010513654206011002 5ustar argusersssid-0.1/Makefile0000644000014400001440000000204510513654206012443 0ustar argusers# ssid - simple setsid # (C)opyright MMVI Anselm R. Garbe include config.mk SRC = ssid.c OBJ = ${SRC:.c=.o} all: options ssid options: @echo ssid build options: @echo "CFLAGS = ${CFLAGS}" @echo "LDFLAGS = ${LDFLAGS}" @echo "CC = ${CC}" @echo "LD = ${LD}" .c.o: @echo CC $< @${CC} -c ${CFLAGS} $< ${OBJ}: config.mk ssid: ${OBJ} @echo LD $@ @${LD} -o $@ ${OBJ} ${LDFLAGS} @strip $@ clean: @echo cleaning @rm -f ssid ${OBJ} ssid-${VERSION}.tar.gz dist: clean @echo creating dist tarball @mkdir -p ssid-${VERSION} @cp -R LICENSE Makefile README config.mk ${SRC} ssid-${VERSION} @tar -cf ssid-${VERSION}.tar ssid-${VERSION} @gzip ssid-${VERSION}.tar @rm -rf ssid-${VERSION} install: all @echo installing executable file to ${DESTDIR}${PREFIX}/bin @mkdir -p ${DESTDIR}${PREFIX}/bin @cp -f ssid ${DESTDIR}${PREFIX}/bin @chmod 755 ${DESTDIR}${PREFIX}/bin/ssid uninstall: @echo removing executable file from ${DESTDIR}${PREFIX}/bin @rm -f ${DESTDIR}${PREFIX}/bin/ssid .PHONY: all options clean dist install uninstall ssid-0.1/LICENSE0000644000014400001440000000212410513654206012006 0ustar argusersMIT/X Consortium License (C)opyright MMV-MMVI Anselm R. Garbe Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ssid-0.1/README0000644000014400001440000000063310513654206011664 0ustar argusersssid - simple setsid ==================== ssid is an extremly simple setsid replacement. Installation ------------ Edit config.mk to match your local setup. ssid is installed into /usr/local by default. Afterwards enter the following command to build and install ssid (if necessary as root): $ make clean install Running ssid ------------ Simply invoke the 'ssid' command with the required arguments. ssid-0.1/config.mk0000644000014400001440000000054610513654206012605 0ustar argusers# ssid version VERSION = 0.1 # Customize below to fit your system # paths PREFIX = /usr/local # includes and libs INCS = -I. -I/usr/include LIBS = -L/usr/lib -lc # flags CFLAGS = -Os ${INCS} -DVERSION=\"${VERSION}\" LDFLAGS = ${LIBS} #CFLAGS = -g -Wall -O2 ${INCS} -DVERSION=\"${VERSION}\" #LDFLAGS = -g ${LIBS} # compiler and linker CC = cc LD = ${CC} ssid-0.1/ssid.c0000644000014400001440000000134510513654206012113 0ustar argusers/* (C)opyright MMVI Anselm R. Garbe * See LICENSE file for license details. */ #include #include #include #include int main(int argc, char *argv[]) { if(argc < 2) { fputs("usage: ssid [-v] cmd [arg ...]\n", stderr); exit(EXIT_FAILURE); } else if(!strncmp(argv[1], "-v", 3)) { fputs("ssid-"VERSION", (C)opyright MMVI Anselm R. Garbe\n", stdout); exit(EXIT_SUCCESS); } if(getpgrp() == getpid()) { switch(fork()){ case -1: perror("ssid: fork"); exit(1); case 0: break; default: exit(0); } } if(setsid() < 0) { perror("ssid: setsid"); exit(1); } execvp(argv[1], argv + 1); perror("ssid: execvp"); exit(1); return 0; }