Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 18 Feb 1998 07:37:46 +0100 (CET)
From:      Martin Kammerhofer <dada@sbox.tu-graz.ac.at>
To:        FreeBSD-gnats-submit@FreeBSD.ORG
Subject:   bin/5778: missing newline in output of id -p
Message-ID:  <199802180637.HAA09054@localhost.tu-graz.ac.at>

next in thread | raw e-mail | index | archive | help

>Number:         5778
>Category:       bin
>Synopsis:       missing newline in output of id -p
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:
>Keywords:
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Feb 17 23:00:04 PST 1998
>Last-Modified:
>Originator:     Martin Kammerhofer
>Organization:
Graz University of Technology
>Release:        FreeBSD 2.2.5-STABLE i386
>Environment:

	nothing special

>Description:

	if id -p is called with euid != ruid then
	output is missing a '\n'.
	This is ugly and confusing. 	

>How-To-Repeat:

<ttyp3 />su
<ttyp3 /#cp /usr/bin/id /tmp
<ttyp3 /#chown daemon:mail /tmp/id
<ttyp3 /#chmod ug+s /tmp/id
<ttyp3 /#/tmp/id -p
login	dada
uid	root
euid	daemonrgid	wheel
groups	wheel mail wheel

>Fix:

fixing id(1) should take less time than it took me typing this PR :)
	
Index: id.c
===================================================================
RCS file: /home/dada/cvsroot/src/id.c,v
retrieving revision 1.1.1.1
diff -u -K -r1.1.1.1 id.c
--- id.c	1998/02/18 06:17:44	1.1.1.1
+++ id.c	1998/02/18 06:21:03
@@ -174,9 +174,9 @@
 
 		if ((eid = geteuid()) != rid)
 			if ((pw = getpwuid(eid)))
-				(void)printf("euid\t%s", pw->pw_name);
+				(void)printf("euid\t%s\n", pw->pw_name);
 			else
-				(void)printf("euid\t%u", eid);
+				(void)printf("euid\t%u\n", eid);
 		if ((rid = getgid()) != (eid = getegid()))
 			if ((gr = getgrgid(rid)))
 				(void)printf("rgid\t%s\n", gr->gr_name);
>Audit-Trail:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199802180637.HAA09054>