3 # Patch managed by http://www.holgerschurig.de/patcher.html
6 Index: fush-0-9-0/configure.in
7 ===================================================================
8 --- fush-0-9-0.orig/configure.in 2004-01-25 18:52:01.000000000 -0600
9 +++ fush-0-9-0/configure.in 2005-01-18 13:41:06.000000000 -0600
11 # Checks for header files.
14 -AC_CHECK_HEADERS([fcntl.h stdlib.h string.h sys/ioctl.h sys/param.h syslog.h unistd.h string.h sys/types.h syslog.h glob.h time.h errno.h libutil.h termios.h])
15 +AC_CHECK_HEADERS([fcntl.h stdlib.h string.h sys/ioctl.h sys/param.h syslog.h unistd.h string.h sys/types.h syslog.h glob.h time.h errno.h libutil.h pty.h termios.h])
17 # Checks for typedefs, structures, and compiler characteristics.
22 AC_CHECK_TYPE( mode_t, unsigned short )
23 +AC_CHECK_DECLS( [user_from_uid], [], [], [
25 +# include <libutil.h>
27 +if test x"$HAVE_DECL_USER_FROM_UID" = "x"; then
28 + PWCACHE_OBJS="pwcache.o"
30 +AC_SUBST(PWCACHE_OBJS)
32 # Checks for library functions.
34 Index: fush-0-9-0/src/fushtools.c
35 ===================================================================
36 --- fush-0-9-0.orig/src/fushtools.c 2004-01-25 18:52:01.000000000 -0600
37 +++ fush-0-9-0/src/fushtools.c 2005-01-18 13:41:30.000000000 -0600
44 +# include <libutil.h>
48 +# include "pwcache.h"
52 extern List g_replace;
53 Index: fush-0-9-0/src/pwcache.c
54 ===================================================================
55 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
56 +++ fush-0-9-0/src/pwcache.c 2005-01-18 15:38:02.000000000 -0600
58 +// Copyright (C) 1992-1998 by Michael K. Johnson, johnsonm@redhat.com
59 +// Note: most likely none of his code remains
61 +// Copyright 2002, Albert Cahalan
63 +// This file is placed under the conditions of the GNU Library
64 +// General Public License, version 2, or any later version.
65 +// See file COPYING for information on distribution conditions.
68 +#include <sys/types.h>
75 +// might as well fill cache lines... else we waste memory anyway
77 +#define HASHSIZE 64 /* power of 2 */
78 +#define HASH(x) ((x) & (HASHSIZE - 1))
81 +#define NAMELENGTH "19"
83 +static struct pwbuf {
86 + char name[NAMESIZE];
89 +char *user_from_uid(uid_t uid, int nouser)
95 + p = &pwhash[HASH(uid)];
97 + if ((*p)->uid == uid)
101 + *p = (struct pwbuf *) malloc(sizeof(struct pwbuf));
104 + if ((pw = getpwuid(uid)) == NULL)
108 + sprintf((*p)->name, "#%d", uid);
110 + sprintf((*p)->name, "%-." NAMELENGTH "s", pw->pw_name);
115 +static struct grpbuf {
116 + struct grpbuf *next;
118 + char name[NAMESIZE];
119 +} *grphash[HASHSIZE];
121 +char *group_from_gid(gid_t gid, int nogroup)
127 + g = &grphash[HASH(gid)];
129 + if ((*g)->gid == gid)
130 + return((*g)->name);
133 + *g = (struct grpbuf *) malloc(sizeof(struct grpbuf));
136 + if ((gr = getgrgid(gid)) == NULL)
140 + sprintf((*g)->name, "#%d", gid);
142 + sprintf((*g)->name, "%-." NAMELENGTH "s", gr->gr_name);
146 Index: fush-0-9-0/src/pwcache.h
147 ===================================================================
148 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
149 +++ fush-0-9-0/src/pwcache.h 2005-01-18 13:45:17.000000000 -0600
151 +#ifndef PROCPS_PROC_PWCACHE_H
152 +#define PROCPS_PROC_PWCACHE_H
154 +#include <sys/types.h>
156 +extern char *user_from_uid(uid_t uid, int nouser);
157 +extern char *group_from_gid(gid_t gid, int nogroup);
160 Index: fush-0-9-0/src/Makefile.in
161 ===================================================================
162 --- fush-0-9-0.orig/src/Makefile.in 2004-01-25 18:52:01.000000000 -0600
163 +++ fush-0-9-0/src/Makefile.in 2005-01-18 13:37:23.000000000 -0600
166 CFLAGS = -Wall @CFLAGS@ @CPPFLAGS@ @DEFS@
167 LDFLAGS = @LDFLAGS@ @LIBS@
168 -OBJS = fush.o fushtools.o fuparse.o md5.o linklist.o
169 +OBJS = fush.o fushtools.o fuparse.o md5.o linklist.o @PWCACHE_OBJS@
170 ADMOBJS = fushadmin.o md5.o