Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-3]: src/lib/libtelnet Pull up revision 1.2 (requested by lukem in...



details:   https://anonhg.NetBSD.org/src/rev/f0d070db20eb
branches:  netbsd-3
changeset: 576524:f0d070db20eb
user:      tron <tron%NetBSD.org@localhost>
date:      Sat Jul 09 22:55:46 2005 +0000

description:
Pull up revision 1.2 (requested by lukem in ticket #536):
Use getpwnam_r. From john nemeth.

diffstat:

 lib/libtelnet/sra.c |  7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diffs (25 lines):

diff -r e9b4a25781f9 -r f0d070db20eb lib/libtelnet/sra.c
--- a/lib/libtelnet/sra.c       Sat Jul 09 22:53:06 2005 +0000
+++ b/lib/libtelnet/sra.c       Sat Jul 09 22:55:46 2005 +0000
@@ -32,7 +32,7 @@
 #ifdef notdef
 __FBSDID("$FreeBSD: src/contrib/telnet/libtelnet/sra.c,v 1.16 2002/05/06 09:48:02 markm Exp $");
 #else
-__RCSID("$NetBSD: sra.c,v 1.1.2.3 2005/05/07 11:47:22 tron Exp $");
+__RCSID("$NetBSD: sra.c,v 1.1.2.4 2005/07/09 22:55:46 tron Exp $");
 #endif
 
 #ifdef SRA
@@ -423,9 +423,10 @@
 static int
 isroot(const char *usr)
 {
-       struct passwd *pwd;
+       struct passwd pws, *pwd;
+       char pwbuf[1024];
 
-       if ((pwd=getpwnam(usr))==NULL)
+       if (getpwnam_r(usr, &pws, pwbuf, sizeof(pwbuf), &pwd) != 0)
                return 0;
        return (!pwd->pw_uid);
 }



Home | Main Index | Thread Index | Old Index