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

Re: chown: root: invaid user name (Re: another 1.5V snapshot/20010524)



筒井です。

<E1593FX-0007fv-00@ruri.iri.co.jp>の記事において
tsubai@iri.co.jpさんは書きました。

> >  とりあえず、この getpwent.c の中の関数だけ直しておけば、当
> >面はいいと思うのですが、send-pr して下さいというのは
> >getpwent.c だけでなく全部きちんと、という意味ですよね。
> 
> まあできればそうなんですが、getpwent.c だけでもよいです。

sun3 とか newsmips とかもサイズがあふれてて libhack は必須なので
なんとなく libhack の下の必要そうなもの全部直してみました。
が、直しただけで力尽きてしまったので藤原さんの方で
(サイズがどう変化するかも含めて)確認して頂けるとありがたいです。

問題ないようなら commit します。
---
Izumi Tsutsui
tsutsui@ceres.dti.ne.jp

Index: getcap.c
===================================================================
RCS file: /cvsroot/basesrc/distrib/utils/libhack/getcap.c,v
retrieving revision 1.2
diff -u -r1.2 getcap.c
--- getcap.c	1999/03/13 19:11:54	1.2
+++ getcap.c	2001/06/14 13:02:29
@@ -50,6 +50,19 @@
 #endif
 #endif /* LIBC_SCCS and not lint */
 
+#ifdef __weak_alias
+#define cgetcap			_cgetcap
+#define cgetclose		_cgetclose
+#define cgetent			_cgetent
+#define cgetfirst		_cgetfirst
+#define cgetmatch		_cgetmatch
+#define cgetnext		_cgetnext
+#define cgetnum			_cgetnum
+#define cgetset			_cgetset
+#define cgetstr			_cgetstr
+#define cgetustr		_cgetustr
+#endif
+
 #include <sys/types.h>
 #include <ctype.h>
 #include <errno.h>	
@@ -69,6 +82,19 @@
 #define RECOK	(char)0
 #define TCERR	(char)1
 #define	SHADOW	(char)2
+
+#ifdef __weak_alias
+__weak_alias(cgetcap,_cgetcap)
+__weak_alias(cgetclose,_cgetclose)
+__weak_alias(cgetent,_cgetent)
+__weak_alias(cgetfirst,_cgetfirst)
+__weak_alias(cgetmatch,_cgetmatch)
+__weak_alias(cgetnext,_cgetnext)
+__weak_alias(cgetnum,_cgetnum)
+__weak_alias(cgetset,_cgetset)
+__weak_alias(cgetstr,_cgetstr)
+__weak_alias(cgetustr,_cgetustr)
+#endif
 
 static size_t	 topreclen;	/* toprec length */
 static char	*toprec;	/* Additional record specified by cgetset() */
Index: getgrent.c
===================================================================
RCS file: /cvsroot/basesrc/distrib/utils/libhack/getgrent.c,v
retrieving revision 1.3
diff -u -r1.3 getgrent.c
--- getgrent.c	1999/03/13 19:08:44	1.3
+++ getgrent.c	2001/06/14 13:02:29
@@ -39,11 +39,31 @@
  * and then gutted, leaving only /etc/group support.
  */
 
+#include <sys/cdefs.h>
+
+#ifdef __weak_alias
+#define endgrent		_endgrent
+#define getgrent		_getgrent
+#define getgrgid		_getgrgid
+#define getgrnam		_getgrnam
+#define setgrent		_setgrent
+#define setgroupent		_setgroupent
+#endif
+
 #include <sys/types.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 #include <grp.h>
+
+#ifdef __weak_alias
+__weak_alias(endgrent,_endgrent)
+__weak_alias(getgrent,_getgrent)
+__weak_alias(getgrgid,_getgrgid)
+__weak_alias(getgrnam,_getgrnam)
+__weak_alias(setgrent,_setgrent)
+__weak_alias(setgroupent,_setgroupent)
+#endif
 
 static FILE *_gr_fp;
 static struct group _gr_group;
Index: gethost.c
===================================================================
RCS file: /cvsroot/basesrc/distrib/utils/libhack/gethost.c,v
retrieving revision 1.6
diff -u -r1.6 gethost.c
--- gethost.c	2001/04/28 14:56:42	1.6
+++ gethost.c	2001/06/14 13:02:29
@@ -60,15 +60,9 @@
 
 #include <sys/cdefs.h>
 
-#if defined(__weak_alias)
-/* From namespace.h: */
-#define gethostbyaddr	_gethostbyaddr
-#define gethostbyname	_gethostbyname
-#define gethostname	_gethostname
-
-__weak_alias(gethostbyaddr,_gethostbyaddr);
-__weak_alias(gethostbyname,_gethostbyname);
-__weak_alias(gethostbyname2,gethostbyname);
+#ifdef __weak_alias
+#define gethostbyaddr		_gethostbyaddr
+#define gethostbyname		_gethostbyname
 #endif
 
 #include <sys/param.h>
@@ -82,6 +76,11 @@
 #include <ctype.h>
 #include <errno.h>
 #include <string.h>
+
+#ifdef __weak_alias
+__weak_alias(gethostbyaddr,_gethostbyaddr);
+__weak_alias(gethostbyname,_gethostbyname);
+#endif
 
 #define	MAXALIASES	35
 #define	MAXADDRS	35
Index: getnet.c
===================================================================
RCS file: /cvsroot/basesrc/distrib/utils/libhack/getnet.c,v
retrieving revision 1.1
diff -u -r1.1 getnet.c
--- getnet.c	1997/12/12 03:05:59	1.1
+++ getnet.c	2001/06/14 13:02:31
@@ -45,6 +45,13 @@
  * and then gutted, leaving only stubs.
  */
 
+#include <sys/cdefs.h>
+
+#ifdef __weak_alias
+#define getnetbyaddr		_getnetbyaddr
+#define getnetbyname		_getnetbyname
+#endif
+
 #include <sys/param.h>
 #include <sys/socket.h>
 #include <netinet/in.h>
@@ -57,6 +64,11 @@
 #include <ctype.h>
 #include <errno.h>
 #include <string.h>
+
+#ifdef __weak_alias
+__weak_alias(getnetbyaddr,_getnetbyaddr)
+__weak_alias(getnetbyname,_getnetbyname)
+#endif
 
 struct netent *
 getnetbyaddr(net, net_type)
Index: getnetgr.c
===================================================================
RCS file: /cvsroot/basesrc/distrib/utils/libhack/getnetgr.c,v
retrieving revision 1.3
diff -u -r1.3 getnetgr.c
--- getnetgr.c	1999/03/13 19:08:44	1.3
+++ getnetgr.c	2001/06/14 13:02:31
@@ -1,6 +1,22 @@
 /*	$NetBSD: getnetgr.c,v 1.3 1999/03/13 19:08:44 sommerfe Exp $	*/
 
+#include <sys/cdefs.h>
+
+#ifdef __weak_alias
+#define endnetgrent		_endnetgrent
+#define innetgr			_innetgr
+#define getnetgrent		_getnetgrent
+#define setnetgrent		_setnetgrent
+#endif
+
 #include <netgroup.h>
+
+#ifdef __weak_alias
+__weak_alias(endnetgrent,_endnetgrent)
+__weak_alias(getnetgrent,_getnetgrent)
+__weak_alias(innetgr,_innetgr)
+__weak_alias(setnetgrent,_setnetgrent)
+#endif
 
 /*
  * Just stub these out, so it looks like
Index: getpwent.c
===================================================================
RCS file: /cvsroot/basesrc/distrib/utils/libhack/getpwent.c,v
retrieving revision 1.3
diff -u -r1.3 getpwent.c
--- getpwent.c	1999/03/13 19:08:44	1.3
+++ getpwent.c	2001/06/14 13:02:31
@@ -35,10 +35,30 @@
  * Needed by programs like: rsh, rlogin
  */
 
+#include <sys/cdefs.h>
+
+#ifdef __weak_alias
+#define endpwent		_endpwent
+#define getpwent		_getpwent
+#define getpwnam		_getpwnam
+#define getpwuid		_getpwuid
+#define setpassent		_setpassent
+#define setpwent		_setpwent
+#endif
+
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 #include <pwd.h>
+
+#ifdef __weak_alias
+__weak_alias(endpwent,_endpwent)
+__weak_alias(getpwent,_getpwent)
+__weak_alias(getpwnam,_getpwnam)
+__weak_alias(getpwuid,_getpwuid)
+__weak_alias(setpassent,_setpassent)
+__weak_alias(setpwent,_setpwent)
+#endif
 
 #define	PWNULL	(struct passwd *)0
 #define MAXFIELD 8
Index: opendir.c
===================================================================
RCS file: /cvsroot/basesrc/distrib/utils/libhack/opendir.c,v
retrieving revision 1.2
diff -u -r1.2 opendir.c
--- opendir.c	1999/05/23 22:08:17	1.2
+++ opendir.c	2001/06/14 13:02:31
@@ -33,6 +33,12 @@
  * SUCH DAMAGE.
  */
 
+#include <sys/cdefs.h>
+
+#ifdef __weak_alias
+#define opendir			_opendir
+#endif
+
 #include <sys/param.h>
 #include <sys/mount.h>
 #include <sys/stat.h>
@@ -43,6 +49,10 @@
 #include <stdlib.h>
 #include <string.h>
 #include <unistd.h>
+
+#ifdef __weak_alias
+__weak_alias(opendir,_opendir)
+#endif
 
 /*
  * Open a directory.
Index: strsignal.c
===================================================================
RCS file: /cvsroot/basesrc/distrib/utils/libhack/strsignal.c,v
retrieving revision 1.2
diff -u -r1.2 strsignal.c
--- strsignal.c	1999/05/27 05:41:15	1.2
+++ strsignal.c	2001/06/14 13:02:31
@@ -33,9 +33,19 @@
  * SUCH DAMAGE.
  */
 
+#include <sys/cdefs.h>
+
+#ifdef __weak_alias
+#define strsignal		_strsignal
+#endif
+
 #include <stdio.h>
 #include <signal.h>
 #include <unistd.h>
+
+#ifdef __weak_alias
+__weak_alias(strsignal,_strsignal)
+#endif
 
 /*
  * Simplified from the libc version.