1 diff -Nru zsh-4.0.2/Src/hashtable.c zsh-4.0.2.new/Src/hashtable.c
2 --- zsh-4.0.2/Src/hashtable.c Sat May 19 11:22:07 2001
3 +++ zsh-4.0.2.new/Src/hashtable.c Wed Jul 11 20:26:52 2001
5 /* Named Directory Hash Table Functions */
6 /****************************************/
9 -# include <rpcsvc/nis.h>
12 -# include <rpc/types.h>
13 -# include <rpc/rpc.h>
14 -# include <rpcsvc/ypclnt.h>
15 -# include <rpcsvc/yp_prot.h>
19 /* hash table containing named directories */
22 @@ -1194,121 +1183,11 @@
23 /* Add all the usernames in the password file/database *
24 * to the named directories table. */
28 -add_userdir(nis_name table, nis_object *object, void *userdata)
30 - if (object->zo_data.objdata_u.en_data.en_cols.en_cols_len >= 6) {
31 - static char name[40], dir[PATH_MAX + 1];
32 - register entry_col *ec =
33 - object->zo_data.objdata_u.en_data.en_cols.en_cols_val;
34 - register int nl = minimum(ec[0].ec_value.ec_value_len, 39);
35 - register int dl = minimum(ec[5].ec_value.ec_value_len, PATH_MAX);
37 - memcpy(name, ec[0].ec_value.ec_value_val, nl);
39 - memcpy(dir, ec[5].ec_value.ec_value_val, dl);
42 - adduserdir(name, dir, ND_USERNAME, 1);
49 -add_userdir(int status, char *key, int keylen, char *val, int vallen, char *dummy)
53 - if (status != YP_TRUE)
56 - if (vallen > keylen && *(p = val + keylen) == ':') {
58 - if ((de = strrchr(p, ':'))) {
60 - if ((d = strrchr(p, ':'))) {
62 - adduserdir(val, d, ND_USERNAME, 1);
68 -# endif /* HAVE_NIS */
69 -#endif /* HAVE_NIS_PLUS */
73 fillnameddirtable(HashTable ht)
76 -#if defined(HAVE_NIS) || defined(HAVE_NIS_PLUS)
78 - char buf[BUFSIZ], *p, *d, *de;
79 - int skipping, oldct = nameddirtab->ct, usepwf = 1;
81 -# ifndef HAVE_NIS_PLUS
82 - char domain[YPMAXDOMAIN];
83 - struct ypall_callback cb;
85 - /* Get potential matches from NIS and cull those without local accounts */
86 - if (getdomainname(domain, YPMAXDOMAIN) == 0) {
87 - cb.foreach = (int (*)()) add_userdir;
89 - yp_all(domain, PASSWD_MAP, &cb);
91 -# else /* HAVE_NIS_PLUS */
92 - /* Maybe we should turn this string into a #define'd constant...? */
94 - nis_list("passwd.org_dir", EXPAND_NAME|ALL_RESULTS|FOLLOW_LINKS|FOLLOW_PATH,
97 - if (nameddirtab->ct == oldct) {
98 - /* Using NIS or NIS+ didn't add any user directories. This seems
99 - * fishy, so we fall back to using getpwent(). If we don't have
100 - * that, we only use the passwd file. */
101 -#ifdef HAVE_GETPWENT
106 - /* loop through the password file/database *
107 - * and add all entries returned. */
108 - while ((pw = getpwent()) && !errflag)
109 - adduserdir(pw->pw_name, pw->pw_dir, ND_USERNAME, 1);
113 -#endif /* HAVE_GETPWENT */
116 - /* Don't forget the non-NIS matches from the flat passwd file */
117 - if ((pwf = fopen(PASSWD_FILE, "r")) != NULL) {
119 - while (fgets(buf, BUFSIZ, pwf) != NULL) {
120 - if (strchr(buf, '\n') != NULL) {
122 - if ((p = strchr(buf, ':')) != NULL) {
124 - if ((de = strrchr(p, ':'))) {
126 - if ((d = strrchr(p, ':'))) {
127 - if (*++d && buf[0])
128 - adduserdir(buf, d, ND_USERNAME, 1);
140 -#else /* no NIS or NIS_PLUS */
144 @@ -1321,7 +1200,6 @@
147 #endif /* HAVE_GETPWENT */
152 diff -Nru zsh-4.0.2/acconfig.h zsh-4.0.2.new/acconfig.h
153 --- zsh-4.0.2/acconfig.h Tue Jun 26 12:08:54 2001
154 +++ zsh-4.0.2.new/acconfig.h Wed Jul 11 20:23:55 2001
156 /* Define this to be the location of your password file */
157 #define PASSWD_FILE "/etc/passwd"
159 -/* Define this to be the name of your NIS/YP password *
160 - * map (if applicable) */
161 -#define PASSWD_MAP "passwd.byname"
163 /* Define to 1 if you want user names to be cached */
164 #define CACHE_USERNAMES 1
166 /* Define if your system defines TIOCGWINSZ in sys/ioctl.h. */
167 #undef GWINSZ_IN_SYS_IOCTL
169 -/* Define to 1 if you have NIS */
172 -/* Define to 1 if you have NISPLUS */
173 -#undef HAVE_NIS_PLUS
175 /* Define to 1 if you have RFS superroot directory. */
176 #undef HAVE_SUPERROOT
178 diff -Nru zsh-4.0.2/zshconfig.ac zsh-4.0.2.new/zshconfig.ac
179 --- zsh-4.0.2/zshconfig.ac Wed Jul 11 20:34:10 2001
180 +++ zsh-4.0.2.new/zshconfig.ac Wed Jul 11 20:35:02 2001
185 -dnl Some systems (Solaris 2.x, Linux Redhat 5.x) require
186 -dnl libnsl (Network Services Library) to find yp_all
188 -AC_SEARCH_LIBS(yp_all, nsl)
190 -dnl I am told that told that unicos reqire these for nis_list
191 -if test `echo $host_os | sed 's/^\(unicos\).*/\1/'` = unicos; then
192 - LIBS="-lcraylm -lkrb -lnisdb -lnsl -lrpcsvc $LIBS"
195 if test "x$dynamic" = xyes; then
196 AC_CHECK_LIB(dl, dlopen)
198 @@ -1191,27 +1181,6 @@
199 AC_DEFINE(USE_GETCWD)
205 -AC_CACHE_CHECK(for NIS, zsh_cv_sys_nis,
206 -[test -f /usr/bin/ypcat && /usr/bin/ypcat passwd.byname > /dev/null 2>&1 && \
207 -zsh_cv_sys_nis=yes || zsh_cv_sys_nis=no])
208 -if test $zsh_cv_sys_nis = yes; then
209 - AC_DEFINE(HAVE_NIS)
212 -dnl -----------------
213 -dnl CHECK FOR NISPLUS
214 -dnl -----------------
215 -AC_CACHE_CHECK(for NIS+, zsh_cv_sys_nis_plus,
216 -[test $ac_cv_func_nis_list = yes && test -f /usr/bin/nisls && \
217 - /usr/bin/nisls > /dev/null 2>&1 && \
218 -zsh_cv_sys_nis_plus=yes || zsh_cv_sys_nis_plus=no])
219 -if test $zsh_cv_sys_nis_plus = yes; then
220 - AC_DEFINE(HAVE_NIS_PLUS)
223 dnl ----------------------------------------
224 dnl CHECK FOR LOCATION OF {U,W}TMP{,X} FILES
225 dnl ----------------------------------------