From owner-freebsd-audit Fri Jan 19 1:40:16 2001 Delivered-To: freebsd-audit@freebsd.org Received: from mailout03.sul.t-online.com (mailout03.sul.t-online.com [194.25.134.81]) by hub.freebsd.org (Postfix) with ESMTP id D4F0637B69E for ; Fri, 19 Jan 2001 01:39:57 -0800 (PST) Received: from fwd01.sul.t-online.com by mailout03.sul.t-online.com with smtp id 14JY1U-0003wT-04; Fri, 19 Jan 2001 10:39:56 +0100 Received: from neutron.cichlids.com (520050424122-0001@[62.225.192.125]) by fmrl01.sul.t-online.com with esmtp id 14JY1D-0F2jtQC; Fri, 19 Jan 2001 10:39:39 +0100 Received: from cichlids.cichlids.com (cichlids.cichlids.com [192.168.0.10]) by neutron.cichlids.com (Postfix) with ESMTP id B13D3AB0C for ; Fri, 19 Jan 2001 10:41:25 +0100 (CET) Received: by cichlids.cichlids.com (Postfix, from userid 1001) id 21E5C14A70; Fri, 19 Jan 2001 10:39:40 +0100 (CET) Date: Fri, 19 Jan 2001 10:39:40 +0100 To: audit@freebsd.org Subject: oinit with compile time option shell/init script Message-ID: <20010119103939.A8500@cichlids.cichlids.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i X-PGP-Fingerprint: 44 28 CA 4C 46 5B D3 A8 A8 E3 BA F3 4E 60 7D 7F X-PGP-at: finger alex@big.endian.de X-Verwirrung: Dieser Header dient der allgemeinen Verwirrung. From: alex@big.endian.de (Alexander Langer) X-Sender: 520050424122-0001@t-dialin.net Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Hello! I'd like to change oinit so that you can give the init-script as compile-time option. This way it can be abused for other uses as picobsd. cvs server: Diffing . Index: Makefile =================================================================== RCS file: /home/ncvs/src/release/picobsd/tinyware/oinit/Makefile,v retrieving revision 1.2 diff -u -r1.2 Makefile --- Makefile 1999/08/28 01:33:57 1.2 +++ Makefile 2001/01/19 09:38:53 @@ -1,9 +1,19 @@ # $FreeBSD: src/release/picobsd/tinyware/oinit/Makefile,v 1.2 1999/08/28 01:33:57 peter Exp $ # -PROG=oinit -#CFLAGS+=-DUSE_HISTORY -CFLAGS+=-DOINIT_RC=\"/etc/oinit.rc\" -#LDADD=-lutil -ledit -ltermcap +PROG= oinit + +SH_PATH?= /bin/sh +SH_NAME?= -sh +SH_ARG?= /etc/rc + +CFLAGS= -DSH_PATH=\"${SH_PATH}\" -DSH_NAME=\"${SH_NAME}\" \ + -DSH_ARG=\"${SH_ARG}\" + + +#CFLAGS+= -DUSE_HISTORY +#CFLAGS+= -DOINIT_RC=\"/etc/oinit.rc\" + +#LDADD= -lutil -ledit -ltermcap LDADD=-lutil NOMAN=yes Index: oinit.c =================================================================== RCS file: /home/ncvs/src/release/picobsd/tinyware/oinit/oinit.c,v retrieving revision 1.5 diff -u -r1.5 oinit.c --- oinit.c 2000/12/09 09:35:37 1.5 +++ oinit.c 2001/01/19 09:38:54 @@ -599,6 +599,15 @@ * normal /etc/rc interpreted by Bourne shell. */ #ifndef OINIT_RC +#ifndef SH_NAME +#define SH_NAME "-sh" +#endif +#ifndef SH_PATH +#define SH_PATH _PATH_BSHELL +#endif +#ifndef SH_ARG +#define SH_ARG "/etc/rc" +#endif void runcom() { @@ -617,10 +626,10 @@ dup2(fd,1); dup2(fd,2); if(fd>2) close(fd); - argv[0]="-sh"; - argv[1]="/etc/rc"; + argv[0]=SH_NAME; + argv[1]=SH_ARG; argv[2]=0; - execvp("/bin/sh",argv); + execvp(SH_PATH,argv); printf("runcom(): %s\n",strerror(errno)); _exit(1); } -- cat: /home/alex/.sig: No such file or directory To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message