Bug 47390 - Updated Port: security/fakeident
Summary: Updated Port: security/fakeident
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-ports-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-01-23 09:40 UTC by Dean Hollister
Modified: 2003-01-30 03:56 UTC (History)
0 users

See Also:


Attachments
file.diff (1.50 KB, patch)
2003-01-23 09:40 UTC, Dean Hollister
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dean Hollister 2003-01-23 09:40:05 UTC
Updated Port: security/fakeident - rc.d script and localbase fix
Comment 1 corecode@corecode.ath.cx 2003-01-23 09:56:42 UTC
Lately Dean Hollister told:

> diff -ruN fakeident.old/Makefile fakeident/Makefile
[...]
>  do-install:
> -	$(INSTALL) -m 755 -o root -g wheel $(WRKSRC)/identd $(PREFIX)/sbin
> -	$(INSTALL) -m 755 -o root -g wheel $(WRKSRC)/fakeident.sh $(PREFIX)/etc/rc.d
> +	$(INSTALL) -m 755 -o root -g wheel $(WRKSRC)/identd $(LOCALBASE)/sbin
> +	$(INSTALL) -m 755 -o root -g wheel $(FILESDIR)/fakeident.sh $(LOCALBASE)/etc/rc.d

are you sure about this? seems like making this not PREFIX clean.
better use:

${INSTALL_PROGRAM} ${WRKSRC}/identd ${PREFIX}/sbin
${INSTALL_SCRIPT} ${FILESDIR}/fakeident.sh ${PREFIX}/etc/rc.d

> diff -ruN fakeident.old/files/fakeident.sh fakeident/files/fakeident.sh
[...]
> +stop)
> +    kill -9 `cat /var/run/identd.pid` && echo -n ' fakeidentd'
> +    ;;

how about checking for /var/run/identd.pid existance?
otherwise stopping a not running fakeidentd will produce an ugly error
message:
cat: /var/run/identd.pid: No such file or directory

cheers
  simon

-- 
/"\   http://corecode.ath.cx/#donate
\ /
 \     ASCII Ribbon Campaign
/ \  Against HTML Mail and News
Comment 2 Dean Hollister 2003-01-23 10:00:08 UTC
At 10:56 23/01/2003 +0100, Simon 'corecode' Schubert wrote:

>how about checking for /var/run/identd.pid existance?
>otherwise stopping a not running fakeidentd will produce an ugly error
>message:
>cat: /var/run/identd.pid: No such file or directory  simon--

The problem is that the identd daemon doesn't remove this file upon 
exiting, as a result, a stop will return a no such process error anyway.

Kind of a case of 6 of one, half a dozen of the other...

That said, it's certainly feasible to check for the existence of the pid 
file, and if it exists, send a kill to the pid in it and then rm the file, 
all within the rc.d script.

Regards,

d.
Comment 3 Dean Hollister 2003-01-23 10:07:17 UTC
Following diff I believe addresses all issues satisfactorily now. :-)

diff -ruN fakeident.old/Makefile fakeident/Makefile
--- fakeident.old/Makefile	Thu Jan 23 17:24:23 2003
+++ fakeident/Makefile	Thu Jan 23 17:22:05 2003
@@ -7,6 +7,7 @@

 PORTNAME=	fakeident
 PORTVERSION=	1.7
+PORTREVISION=	1
 CATEGORIES=	security
 MASTER_SITES=	http://www.wa.apana.org.au/~dean/sources/ \
 		ftp://ftp.wa.apana.org.au/pub/pc/unix/packages/
@@ -26,7 +27,7 @@
 	@echo ""

 do-install:
-	$(INSTALL) -m 755 -o root -g wheel $(WRKSRC)/identd $(PREFIX)/sbin
-	$(INSTALL) -m 755 -o root -g wheel $(WRKSRC)/fakeident.sh $(PREFIX)/etc/rc.d
+	$(INSTALL) -m 755 -o root -g wheel $(WRKSRC)/identd $(LOCALBASE)/sbin
+	$(INSTALL) -m 755 -o root -g wheel $(FILESDIR)/fakeident.sh $(LOCALBASE)/etc/rc.d

 .include <bsd.port.mk>
diff -ruN fakeident.old/files/fakeident.sh fakeident/files/fakeident.sh
--- fakeident.old/files/fakeident.sh	Thu Jan  1 08:00:00 1970
+++ fakeident/files/fakeident.sh	Thu Jan 23 18:04:15 2003
@@ -0,0 +1,32 @@
+#! /bin/sh
+#
+
+PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin
+
+# This can be changed as desired.
+# The username does not need to exist anywhere in your system.
+
+USERNAME=nobody
+
+if ! PREFIX=$(expr $0 : "\(/.*\)/etc/rc\.d/$(basename $0)\$"); then
+    echo "$0: Cannot determine the PREFIX" >&2
+    exit 1
+fi
+
+case "$1" in
+start)
+    $PREFIX/sbin/identd $USERNAME && echo -n ' fakeidentd'
+    ;;
+
+stop)
+    if [ -r /var/run/identd.pid ] ; then
+    kill -9 `cat /var/run/identd.pid` >>/dev/null 2>&1
+    rm -f /var/run/identd.pid
+    fi
+    ;;
+
+*)
+    echo "Usage: `basename $0` {start|stop}" >&2
+    exit 64
+    ;;
+esac
Comment 4 corecode@corecode.ath.cx 2003-01-23 10:14:15 UTC
Lately Dean Hollister told:

> Following diff I believe addresses all issues satisfactorily now. :-)
> 
> diff -ruN fakeident.old/Makefile fakeident/Makefile
[...]
>  do-install:
> -	$(INSTALL) -m 755 -o root -g wheel $(WRKSRC)/identd $(PREFIX)/sbin
> -	$(INSTALL) -m 755 -o root -g wheel $(WRKSRC)/fakeident.sh $(PREFIX)/etc/rc.d
> +	$(INSTALL) -m 755 -o root -g wheel $(WRKSRC)/identd $(LOCALBASE)/sbin
> +	$(INSTALL) -m 755 -o root -g wheel $(FILESDIR)/fakeident.sh $(LOCALBASE)/etc/rc.d

uhm, i don't want to appear as being a nitpicky bitchy person, but
please install into ${PREFIX}
and while you're at it you may use ${INSTALL_PROGRAM} and
${INSTALL_SCRIPT} to get the owners and modes set as desired

> diff -ruN fakeident.old/files/fakeident.sh fakeident/files/fakeident.sh
[...]
> +stop)
> +    if [ -r /var/run/identd.pid ] ; then
> +    kill -9 `cat /var/run/identd.pid` >>/dev/null 2>&1
> +    rm -f /var/run/identd.pid
> +    fi
> +    ;;

very nice

cheers
  simon

-- 
/"\   http://corecode.ath.cx/#donate
\ /
 \     ASCII Ribbon Campaign
/ \  Against HTML Mail and News
Comment 5 Dean Hollister 2003-01-23 10:26:27 UTC
Ok... How about....

diff -ruN fakeident.old/Makefile fakeident/Makefile
--- fakeident.old/Makefile	Thu Jan 23 17:24:23 2003
+++ fakeident/Makefile	Thu Jan 23 18:24:24 2003
@@ -7,6 +7,7 @@

 PORTNAME=	fakeident
 PORTVERSION=	1.7
+PORTREVISION=	1
 CATEGORIES=	security
 MASTER_SITES=	http://www.wa.apana.org.au/~dean/sources/ \
 		ftp://ftp.wa.apana.org.au/pub/pc/unix/packages/
@@ -26,7 +27,7 @@
 	@echo ""

 do-install:
-	$(INSTALL) -m 755 -o root -g wheel $(WRKSRC)/identd $(PREFIX)/sbin
-	$(INSTALL) -m 755 -o root -g wheel $(WRKSRC)/fakeident.sh $(PREFIX)/etc/rc.d
+	$(INSTALL_SCRIPT) $(WRKSRC)/identd $(PREFIX)/sbin
+	$(INSTALL_SCRIPT) $(FILESDIR)/fakeident.sh $(PREFIX)/etc/rc.d

 .include <bsd.port.mk>
diff -ruN fakeident.old/files/fakeident.sh fakeident/files/fakeident.sh
--- fakeident.old/files/fakeident.sh	Thu Jan  1 08:00:00 1970
+++ fakeident/files/fakeident.sh	Thu Jan 23 18:04:15 2003
@@ -0,0 +1,32 @@
+#! /bin/sh
+#
+
+PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin
+
+# This can be changed as desired.
+# The username does not need to exist anywhere in your system.
+
+USERNAME=nobody
+
+if ! PREFIX=$(expr $0 : "\(/.*\)/etc/rc\.d/$(basename $0)\$"); then
+    echo "$0: Cannot determine the PREFIX" >&2
+    exit 1
+fi
+
+case "$1" in
+start)
+    $PREFIX/sbin/identd $USERNAME && echo -n ' fakeidentd'
+    ;;
+
+stop)
+    if [ -r /var/run/identd.pid ] ; then
+    kill -9 `cat /var/run/identd.pid` >>/dev/null 2>&1
+    rm -f /var/run/identd.pid
+    fi
+    ;;
+
+*)
+    echo "Usage: `basename $0` {start|stop}" >&2
+    exit 64
+    ;;
+esac
Comment 6 Edwin Groothuis freebsd_committer freebsd_triage 2003-01-30 03:55:48 UTC
State Changed
From-To: open->closed

Commited, thanks!