NetBSD Problem Report #10982

Received: (qmail 28473 invoked from network); 10 Sep 2000 20:20:29 -0000
Message-Id: <200009102020.e8AKKFk04674@lwle5.radiologie.rad.klinikum.rwth-aachen.de>
Date: Sun, 10 Sep 2000 22:20:15 +0200 (MEST)
From: kilbi@rad.rwth-aachen.de
Reply-To: kilbi@rad.rwth-aachen.de
To: gnats-bugs@gnats.netbsd.org
Subject: '/etc/security' fails if login names start with '-' (nis)
X-Send-Pr-Version: 3.95

>Number:         10982
>Category:       security
>Synopsis:       /ect/security cannot handle login names starting with '-' (nis)
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    security-officer
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Sep 10 20:21:00 +0000 2000
>Closed-Date:    Sun Sep 10 21:28:45 +0000 2000
>Last-Modified:  Sun Sep 10 21:28:45 +0000 2000
>Originator:     
>Release:        all NetBSD releases / snapshots I ever had starting with 1.2
>Organization:

>Environment:
	E. g. NetBSD/i386, NetBSD/alpha, NetBSD/sparc, v1.4.x, v.1.5..


>Description:
	If having deactivated nis accounts in '/etc/{master.,}passwd' like

	  -rad:*:0:0:::
	  +:*:0:0:::

	'/ect/security' fails with a

	  printf: illegal option -- r

	because '-rad' is handled as an option by 'printf'

>How-To-Repeat:
	see above
>Fix:

	Replace 'printf' with 'printf --' at least in the following
	sensitive places (diff file);

--- /usr/src/etc/security	Sat Jul 15 19:42:24 2000
+++ security.new	Sun Sep 10 21:55:11 2000
@@ -331,7 +331,7 @@
 	while read uid homedir; do
 		if [ -f ${homedir}/.rhosts ] ; then
 			rhost=`ls -ldgT ${homedir}/.rhosts`
-			printf "$uid: $rhost\n"
+			printf -- "$uid: $rhost\n"
 		fi
 	done > $OUTPUT
 	if [ -s $OUTPUT ] ; then
@@ -342,7 +342,7 @@
 	while read uid homedir; do
 		if [ -f ${homedir}/.rhosts -a -r ${homedir}/.rhosts ] && \
 		    cat -f ${homedir}/.rhosts | egrep '\+' > /dev/null ; then
-			printf "$uid: + in .rhosts file.\n"
+			printf -- "$uid: + in .rhosts file.\n"
 		fi
 	done < $MPBYPATH > $OUTPUT
 	if [ -s $OUTPUT ] ; then
@@ -358,7 +358,7 @@
 	while read uid homedir; do
 		if [ -d ${homedir}/ ] ; then
 			file=`ls -ldgT ${homedir}`
-			printf "$uid $file\n"
+			printf -- "$uid $file\n"
 		fi
 	done < $MPBYPATH |
 	awk '$1 != $4 && $4 != "root" \
@@ -379,7 +379,7 @@
 		for f in $list ; do
 			file=${homedir}/${f}
 			if [ -f $file ] ; then
-				printf "$uid $f `ls -ldgT $file`\n"
+				printf -- "$uid $f `ls -ldgT $file`\n"
 			fi
 		done
 	done < $MPBYPATH |
@@ -404,7 +404,7 @@
 		for f in $list ; do
 			file=${homedir}/${f}
 			if [ -f $file ] ; then
-				printf "$uid $f `ls -ldgT $file`\n"
+				printf -- "$uid $f `ls -ldgT $file`\n"
 			fi
 		done
 	done < $MPBYPATH |

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: christos 
State-Changed-When: Sun Sep 10 17:28:33 EDT 2000 
State-Changed-Why:  
fixed, thanks 
>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.