]> pere.pagekite.me Git - homepage.git/blob - linux/ypserv-2.8.92-20030611.diff
Generated.
[homepage.git] / linux / ypserv-2.8.92-20030611.diff
1 Changes:
2
3 - Add test for __attribute((unused)) and socklen_t to configure
4 - only look for getrpcport in rpcsvc if it is missing in the existing
5 libraries.
6 - no need to check for or include <poll.h>, as it isn't used any
7 more.
8 - Make some compatibility functions:
9 - A svc_getcaller() returning 'const struct sockaddr_in *', and adapt
10 the code to accept the 'const'.
11 - A real getline().
12 - _rpc_dtablesize() copied from other parts of the code.
13 - Some xdr_* functions copied from other parts of the code.
14 - An inet_pton() with support for IPv4 and inet_aton().
15 - Dummy replacement functions for fgetpwent(), putpwent() and
16 fgetgrent().
17 - Drop unused <pthread.h> from yp.h, because this break on Tru64 UNIX.
18 - Make sure <alloca.h> is properly protected, and make sure
19 <stdlib.h> is included in the files using alloca() as it is
20 needed on Mac OS X.
21 - Move some compatibility code into lib/compat.c
22 - Add some required header files.
23 - Remove the use of uint32_t, as it is unknown on some platforms, and
24 use the return type of the function supplying the value instead.
25 - Try to protect the code handling shadow password files with the
26 proper #ifdefs. This part is untested.
27
28 diff -ur src-2.8.92/acinclude.m4 src-2.8.92-local/acinclude.m4
29 --- src-2.8.92/acinclude.m4 2003-06-05 13:41:45.000000000 +0200
30 +++ src-2.8.92-local/acinclude.m4 2003-06-11 11:58:01.000000000 +0200
31 @@ -35,3 +35,59 @@
32 ;;
33 esac
34 ])
35 +
36 +
37 +dnl
38 +dnl Test for __attribute__ ((unused))
39 +dnl Based on code from the tcpdump version 3.7.2 source.
40 +dnl
41 +
42 +AC_DEFUN(AC_C___ATTRIBUTE__, [
43 +AC_MSG_CHECKING(for __attribute__)
44 +AC_CACHE_VAL(ac_cv___attribute__, [
45 +AC_TRY_COMPILE([
46 +#include <stdlib.h>
47 +],
48 +[
49 +static void foo(void) __attribute__ ((unused));
50 +
51 +static void
52 +foo(void)
53 +{
54 + exit(1);
55 +}
56 +],
57 +ac_cv___attribute__=yes,
58 +ac_cv___attribute__=no)])
59 +if test "$ac_cv___attribute__" = "yes"; then
60 + AC_DEFINE(UNUSED, __attribute__ ((unused)), [define if your compiler has __attribute__ ((unused))])
61 +else
62 + AC_DEFINE(UNUSED,,)
63 +fi
64 +AC_MSG_RESULT($ac_cv___attribute__)
65 +])
66 +
67 +dnl
68 +dnl Check whether sys/socket.h defines type socklen_t. Please note
69 +dnl that some systems require sys/types.h to be included before
70 +dnl sys/socket.h can be compiled.
71 +dnl
72 +dnl Source: http://www.gnu.org/software/ac-archive/htmldoc/type_socklen_t.html
73 +dnl Version: 1.2 (last modified: 2000-07-19)
74 +dnl Author: Lars Brinkhoff <lars@nocrew.org>
75 +dnl Changed by Petter Reinholdtsen to use the new AC_DEFINE() arguments
76 +dnl
77 +AC_DEFUN([TYPE_SOCKLEN_T],
78 +[AC_CACHE_CHECK([for socklen_t], ac_cv_type_socklen_t,
79 +[
80 + AC_TRY_COMPILE(
81 + [#include <sys/types.h>
82 + #include <sys/socket.h>],
83 + [socklen_t len = 42; return 0;],
84 + ac_cv_type_socklen_t=yes,
85 + ac_cv_type_socklen_t=no)
86 +])
87 + if test $ac_cv_type_socklen_t != yes; then
88 + AC_DEFINE([socklen_t], [int], [Define if socklen_t is missing])
89 + fi
90 +])
91 diff -ur src-2.8.92/configure.in src-2.8.92-local/configure.in
92 --- src-2.8.92/configure.in 2003-06-05 17:59:52.000000000 +0200
93 +++ src-2.8.92-local/configure.in 2003-06-11 11:57:46.000000000 +0200
94 @@ -179,9 +179,13 @@
95 AC_CHECK_HEADERS(xcrypt.h crypt.h)
96 fi
97 AC_SUBST(LIBCRYPT)
98 -dnl XXX We need to check at first if it is not in libc or libnsl,
99 -dnl else we could get problems with ypserv on Linux.
100 -dnl AC_CHECK_LIB(rpcsvc, getrpcport)
101 +
102 +AC_CHECK_FUNCS(getrpcport)
103 +if test "$ac_cv_func_getrpcport" = no; then
104 + AC_CHECK_LIB([rpcsvc], [getrpcport],
105 + [ac_cv_func_$1=yes; LIBS="-lrpcsvc $LIBS"])
106 +fi
107 +
108 AC_CHECK_LIB(nsl,gethostbyname)
109 AC_CHECK_LIB(socket,socket)
110 AC_CHECK_LIB(resolv, res_gethostbyname, RESOLV="-lresolv", RESOLV="")
111 @@ -199,12 +203,14 @@
112 AC_HEADER_SYS_WAIT
113 AC_CHECK_HEADERS(fcntl.h paths.h sys/file.h sys/time.h syslog.h unistd.h)
114 AC_CHECK_HEADERS(getopt.h shadow.h rpc/clnt_soc.h rpc/svc_soc.h)
115 -AC_CHECK_HEADERS(netinet/in.h alloca.h poll.h)
116 +AC_CHECK_HEADERS(netinet/in.h alloca.h)
117 AC_CHECK_TYPE(in_addr_t, ,[AC_DEFINE(in_addr_t,int,[Define to int if you don't have in_addr_t])],[#include <netinet/in.h>])
118
119 dnl Checks for typedefs, structures, and compiler characteristics.
120 AC_C_CONST
121 AC_C_INLINE
122 +AC_C___ATTRIBUTE__
123 +TYPE_SOCKLEN_T
124 AC_TYPE_PID_T
125 AC_TYPE_SIZE_T
126 AC_HEADER_TIME
127 diff -ur src-2.8.92/lib/access.c src-2.8.92-local/lib/access.c
128 --- src-2.8.92/lib/access.c 2003-03-03 11:43:39.000000000 +0100
129 +++ src-2.8.92-local/lib/access.c 2003-06-10 15:51:32.000000000 +0200
130 @@ -37,6 +37,7 @@
131 #include "access.h"
132 #include "yp_db.h"
133 #include "yp.h"
134 +#include "compat.h"
135
136 static conffile_t *conf = NULL;
137
138 @@ -130,7 +131,7 @@
139 int
140 is_valid (struct svc_req *rqstp, const char *map, const char *domain)
141 {
142 - struct sockaddr_in *sin;
143 + const struct sockaddr_in *sin;
144 int status;
145 static unsigned long int oldaddr = 0; /* so we dont log multiple times */
146 static int oldstatus = -1;
147 diff -ur src-2.8.92/lib/compat.c src-2.8.92-local/lib/compat.c
148 --- src-2.8.92/lib/compat.c 2003-06-05 14:14:04.000000000 +0200
149 +++ src-2.8.92-local/lib/compat.c 2003-06-11 13:58:13.000000000 +0200
150 @@ -48,9 +48,561 @@
151 #endif /* not HAVE_GETOPT_LONG */
152
153 #if !defined(HAVE_GETDELIM) && !defined(HAVE_GETLINE)
154 +/* copied from cvs 1.11.5 source */
155 +/* getline.c -- Replacement for GNU C library function getline
156 +
157 +Copyright (C) 1993 Free Software Foundation, Inc.
158 +
159 +This program is free software; you can redistribute it and/or
160 +modify it under the terms of the GNU General Public License as
161 +published by the Free Software Foundation; either version 2 of the
162 +License, or (at your option) any later version.
163 +
164 +This program is distributed in the hope that it will be useful, but
165 +WITHOUT ANY WARRANTY; without even the implied warranty of
166 +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
167 +General Public License for more details. */
168 +
169 +/* Written by Jan Brittenson, bson@gnu.ai.mit.edu. */
170 +
171 +#include <sys/types.h>
172 +#include <stdio.h>
173 +#include <assert.h>
174 +#include <errno.h>
175 +
176 +#define GETLINE_NO_LIMIT -1
177 +
178 +#if STDC_HEADERS
179 +#include <stdlib.h>
180 +#else
181 +char *malloc (), *realloc ();
182 +#endif
183 +
184 +/* Always add at least this many bytes when extending the buffer. */
185 +#define MIN_CHUNK 64
186 +
187 +/* Read up to (and including) a TERMINATOR from STREAM into *LINEPTR
188 + + OFFSET (and null-terminate it). If LIMIT is non-negative, then
189 + read no more than LIMIT chars.
190 +
191 + *LINEPTR is a pointer returned from malloc (or NULL), pointing to
192 + *N characters of space. It is realloc'd as necessary.
193 +
194 + Return the number of characters read (not including the null
195 + terminator), or -1 on error or EOF. On a -1 return, the caller
196 + should check feof(), if not then errno has been set to indicate the
197 + error. */
198 +
199 +int
200 +getstr (char **lineptr, size_t *n, FILE *stream, int terminator,
201 + int offset, int limit)
202 +{
203 + int nchars_avail; /* Allocated but unused chars in *LINEPTR. */
204 + char *read_pos; /* Where we're reading into *LINEPTR. */
205 + int ret;
206 +
207 + if (!lineptr || !n || !stream)
208 + {
209 + errno = EINVAL;
210 + return -1;
211 + }
212 +
213 + if (!*lineptr)
214 + {
215 + *n = MIN_CHUNK;
216 + *lineptr = malloc (*n);
217 + if (!*lineptr)
218 + {
219 + errno = ENOMEM;
220 + return -1;
221 + }
222 + *lineptr[0] = '\0';
223 + }
224 +
225 + nchars_avail = *n - offset;
226 + read_pos = *lineptr + offset;
227 +
228 + for (;;)
229 + {
230 + int save_errno;
231 + register int c;
232 +
233 + if (limit == 0)
234 + break;
235 + else
236 + {
237 + c = getc (stream);
238 +
239 + /* If limit is negative, then we shouldn't pay attention to
240 + it, so decrement only if positive. */
241 + if (limit > 0)
242 + limit--;
243 + }
244 +
245 + save_errno = errno;
246 +
247 + /* We always want at least one char left in the buffer, since we
248 + always (unless we get an error while reading the first char)
249 + NUL-terminate the line buffer. */
250 +
251 + assert((*lineptr + *n) == (read_pos + nchars_avail));
252 + if (nchars_avail < 2)
253 + {
254 + if (*n > MIN_CHUNK)
255 + *n *= 2;
256 + else
257 + *n += MIN_CHUNK;
258 +
259 + nchars_avail = *n + *lineptr - read_pos;
260 + *lineptr = realloc (*lineptr, *n);
261 + if (!*lineptr)
262 + {
263 + errno = ENOMEM;
264 + return -1;
265 + }
266 + read_pos = *n - nchars_avail + *lineptr;
267 + assert((*lineptr + *n) == (read_pos + nchars_avail));
268 + }
269 +
270 + if (ferror (stream))
271 + {
272 + /* Might like to return partial line, but there is no
273 + place for us to store errno. And we don't want to just
274 + lose errno. */
275 + errno = save_errno;
276 + return -1;
277 + }
278 +
279 + if (c == EOF)
280 + {
281 + /* Return partial line, if any. */
282 + if (read_pos == *lineptr)
283 + return -1;
284 + else
285 + break;
286 + }
287 +
288 + *read_pos++ = c;
289 + nchars_avail--;
290 +
291 + if (c == terminator)
292 + /* Return the line. */
293 + break;
294 + }
295 +
296 + /* Done - NUL terminate and return the number of chars read. */
297 + *read_pos = '\0';
298 +
299 + ret = read_pos - (*lineptr + offset);
300 + return ret;
301 +}
302 +
303 ssize_t
304 getline (char **lineptr, size_t * n, FILE * stream)
305 {
306 - return 0;
307 + return getstr (lineptr, n, stream, '\n', 0, GETLINE_NO_LIMIT);
308 +}
309 +
310 +int
311 +getline_safe (char **lineptr, size_t *n, FILE *stream, int limit)
312 +{
313 + return getstr (lineptr, n, stream, '\n', 0, limit);
314 +}
315 +
316 +#endif /* not HAVE_GETDELIM and not HAVE_GETLINE */
317 +
318 +#if !defined(HAVE_SVC_GETCALLER) && !defined(svc_getcaller)
319 +const struct sockaddr_in *
320 +svc_getcaller(const SVCXPRT *xprt)
321 +{
322 +# ifdef HAVE_SVC_GETRPCCALLER
323 + const struct netbuf *addr;
324 + addr = svc_getrpccaller(xprt);
325 + fprintf(stderr, "warning: Bogus svc_getcaller() called\n");
326 + /* XXX find out how the result from svc_getrpccaller relates to
327 + svc_getcaller */
328 + return addr;
329 +# else /* not HAVE_SVC_GETRPCCALLER */
330 +# error "Missing both svc_getcaller() and svc_getrpccaller()"
331 +# endif /* not HAVE_SVC_GETRPCCALLER */
332 +}
333 +#endif /* not HAVE_SVC_GETCALLER */
334 +
335 +
336 +#ifndef HAVE__RPC_DTABLESIZE
337 +# if HAVE_GETDTABLESIZE
338 +int _rpc_dtablesize()
339 +{
340 + static int size;
341 +
342 + if (size == 0) {
343 + size = getdtablesize();
344 + }
345 + return (size);
346 +}
347 +# else
348 +# include <sys/resource.h>
349 +int _rpc_dtablesize()
350 +{
351 + static int size = 0;
352 + struct rlimit rlb;
353 +
354 + if (size == 0)
355 + {
356 + if (getrlimit(RLIMIT_NOFILE, &rlb) >= 0)
357 + size = rlb.rlim_cur;
358 + }
359 +
360 + return size;
361 +}
362 +# endif /* not HAVE_GETDTABLESIZE */
363 +#endif /* not HAVE__RPC_DTABLESIZE */
364 +
365 +#ifndef HAVE_INET_ATON
366 +/* Source: http://mail.gnu.org/archive/html/autoconf/2002-08/msg00036.html */
367 +/* $Id: ypserv-2.8.92-20030611.diff,v 1.1 2003/06/11 12:30:47 pere Exp $
368 +**
369 +** Replacement for a missing inet_aton.
370 +**
371 +** Written by Russ Allbery <rra@bogus.example.com>
372 +** This work is hereby placed in the public domain by its author.
373 +**
374 +** Provides the same functionality as the standard library routine
375 +** inet_aton for those platforms that don't have it. inet_aton is
376 +** thread-safe.
377 +*/
378 +
379 +/* #include "config.h" */
380 +/* #include "clibrary.h" */
381 +#include <netinet/in.h>
382 +
383 +/* If we're running the test suite, rename inet_ntoa to avoid conflicts with
384 + the system version. */
385 +#if TESTING
386 +# define inet_aton test_inet_aton
387 +int test_inet_aton(const char *, struct in_addr *);
388 +#endif
389 +
390 +int
391 +inet_aton(const char *s, struct in_addr *addr)
392 +{
393 + unsigned long octet[4], address;
394 + const char *p;
395 + int base, i;
396 + int part = 0;
397 +
398 + if (s == NULL) return 0;
399 +
400 + /* Step through each period-separated part of the address. If we see
401 + more than four parts, the address is invalid. */
402 + for (p = s; *p != 0; part++) {
403 + if (part > 3) return 0;
404 +
405 + /* Determine the base of the section we're looking at. Numbers are
406 + represented the same as in C; octal starts with 0, hex starts
407 + with 0x, and anything else is decimal. */
408 + if (*p == '0') {
409 + p++;
410 + if (*p == 'x') {
411 + p++;
412 + base = 16;
413 + } else {
414 + base = 8;
415 + }
416 + } else {
417 + base = 10;
418 + }
419 +
420 + /* Make sure there's actually a number. (A section of just "0"
421 + would set base to 8 and leave us pointing at a period; allow
422 + that.) */
423 + if (*p == '.' && base != 8) return 0;
424 + octet[part] = 0;
425 +
426 + /* Now, parse this segment of the address. For each digit, multiply
427 + the result so far by the base and then add the value of the
428 + digit. Be careful of arithmetic overflow in cases where an
429 + unsigned long is 32 bits; we need to detect it *before* we
430 + multiply by the base since otherwise we could overflow and wrap
431 + and then not detect the error. */
432 + for (; *p != 0 && *p != '.'; p++) {
433 + if (octet[part] > 0xffffffffUL / base) return 0;
434 +
435 + /* Use a switch statement to parse each digit rather than
436 + assuming ASCII. Probably pointless portability.... */
437 + switch (*p) {
438 + case '0': i = 0; break;
439 + case '1': i = 1; break;
440 + case '2': i = 2; break;
441 + case '3': i = 3; break;
442 + case '4': i = 4; break;
443 + case '5': i = 5; break;
444 + case '6': i = 6; break;
445 + case '7': i = 7; break;
446 + case '8': i = 8; break;
447 + case '9': i = 9; break;
448 + case 'A': case 'a': i = 10; break;
449 + case 'B': case 'b': i = 11; break;
450 + case 'C': case 'c': i = 12; break;
451 + case 'D': case 'd': i = 13; break;
452 + case 'E': case 'e': i = 14; break;
453 + case 'F': case 'f': i = 15; break;
454 + default: return 0;
455 + }
456 + if (i >= base) return 0;
457 + octet[part] = (octet[part] * base) + i;
458 + }
459 +
460 + /* Advance over periods; the top of the loop will increment the
461 + count of parts we've seen. We need a check here to detect an
462 + illegal trailing period. */
463 + if (*p == '.') {
464 + p++;
465 + if (*p == 0) return 0;
466 + }
467 + }
468 + if (part == 0) return 0;
469 +
470 + /* IPv4 allows three types of address specification:
471 +
472 + a.b
473 + a.b.c
474 + a.b.c.d
475 +
476 + If there are fewer than four segments, the final segment accounts for
477 + all of the remaining portion of the address. For example, in the a.b
478 + form, b is the final 24 bits of the address. We also allow a simple
479 + number, which is interpreted as the 32-bit number corresponding to
480 + the full IPv4 address.
481 +
482 + The first for loop below ensures that any initial segments represent
483 + only 8 bits of the address and builds the upper portion of the IPv4
484 + address. Then, the remaining segment is checked to make sure it's no
485 + bigger than the remaining space in the address and then is added into
486 + the result. */
487 + address = 0;
488 + for (i = 0; i < part - 1; i++) {
489 + if (octet[i] > 0xff) return 0;
490 + address |= octet[i] << (8 * (3 - i));
491 + }
492 + if (octet[i] > (0xffffffffUL >> (i * 8))) return 0;
493 + address |= octet[i];
494 + if (addr != NULL) addr->s_addr = htonl(address);
495 + return 1;
496 +}
497 +#endif /* not HAVE_INET_ATON */
498 +
499 +
500 +#ifndef HAVE_INET_PTON
501 +#include <arpa/inet.h>
502 +#include <sys/socket.h>
503 +int
504 +inet_pton(int af, const char *src, void *dst)
505 +{
506 + switch (af) {
507 + case AF_INET:
508 + return inet_aton(src, (struct in_addr *)dst);
509 + break;
510 +#ifdef AF_INET6
511 + case AF_INET6:
512 +#endif /* AF_INET6 */
513 + default:
514 + fprintf(stderr, "warning: Bogus inet_pton() called\n");
515 + errno = EAFNOSUPPORT;
516 + return -1;
517 + break;
518 + }
519 +}
520 +#endif /* not HAVE_INET_PTON */
521 +
522 +#ifndef HAVE_FGETPWENT
523 +struct passwd *
524 +fgetpwent(FILE *stream)
525 +{
526 + fprintf(stderr, "warning: Bogus fgetpwent() called\n");
527 + return NULL;
528 +}
529 +#endif /* not HAVE_FGETPWENT */
530 +
531 +#ifndef HAVE_PUTPWENT
532 +int
533 +putpwent(const struct passwd *p, FILE *stream)
534 +{
535 + fprintf(stderr, "warning: Bogus putpwent() called\n");
536 + return -1;
537 +}
538 +#endif /* not HAVE_PUTPWENT */
539 +
540 +#ifndef HAVE_FGETGRENT
541 +struct group *
542 +fgetgrent(FILE *stream)
543 +{
544 + fprintf(stderr, "warning: Bogus fgetgrent() called\n");
545 + return NULL;
546 +}
547 +#endif /* not HAVE_FGETGRENT */
548 +
549 +#ifndef HAVE_XDR_YPXFRSTAT
550 +#include <rpc/rpc.h>
551 +#include "yp.h"
552 +bool_t
553 +xdr_ypxfrstat(XDR *xdrs, ypxfrstat *objp)
554 +{
555 + if (!xdr_enum(xdrs, (enum_t *)objp))
556 + return FALSE;
557 +
558 + return TRUE;
559 +}
560 +#endif /* not HAVE_XDR_YPXFRSTAT */
561 +
562 +#ifndef HAVE_XDR_DOMAINNAME
563 +#include <rpc/rpc.h>
564 +bool_t
565 +xdr_domainname(XDR *xdrs, domainname *objp)
566 +{
567 + if (!xdr_string(xdrs, objp, YPMAXDOMAIN))
568 + return FALSE;
569 +
570 + return TRUE;
571 +}
572 +#endif /* not HAVE_XDR_DOMAINNAME */
573 +
574 +#ifndef HAVE_XDR_YPRESP_XFR
575 +#include <rpc/rpc.h>
576 +bool_t
577 +xdr_ypresp_xfr(XDR *xdrs, ypresp_xfr *objp)
578 +{
579 + if (!xdr_u_int(xdrs, &objp->transid))
580 + return FALSE;
581 +
582 + if (!xdr_ypxfrstat(xdrs, &objp->xfrstat))
583 + return FALSE;
584 +
585 + return TRUE;
586 +}
587 +#endif /* not HAVE_XDR_YPRESP_XFR */
588 +
589 +#ifndef HAVE_XDR_YPMAP_PARMS
590 +bool_t
591 +xdr_ypmap_parms(XDR *xdrs, ypmap_parms *objp)
592 +{
593 + if (!xdr_domainname(xdrs, &objp->domain))
594 + return (FALSE);
595 + if (!xdr_mapname(xdrs, &objp->map))
596 + return (FALSE);
597 + if (!xdr_u_int(xdrs, &objp->ordernum))
598 + return (FALSE);
599 + if (!xdr_peername(xdrs, &objp->peer))
600 + return (FALSE);
601 + return (TRUE);
602 +}
603 +#endif /* not HAVE_XDR_YPMAP_PARMS */
604 +
605 +
606 +#ifndef HAVE_XDR_YPREQ_XFR
607 +bool_t
608 +xdr_ypreq_xfr(XDR *xdrs, ypreq_xfr *objp)
609 +{
610 + if (!xdr_ypmap_parms(xdrs, &objp->map_parms))
611 + return (FALSE);
612 + if (!xdr_u_int(xdrs, &objp->transid))
613 + return (FALSE);
614 + if (!xdr_u_int(xdrs, &objp->prog))
615 + return (FALSE);
616 + if (!xdr_u_int(xdrs, &objp->port))
617 + return (FALSE);
618 + return (TRUE);
619 +}
620 +#endif /* not HAVE_XDR_YPREQ_XFR */
621 +
622 +#ifndef HAVE_XDR_MAPNAME
623 +bool_t
624 +xdr_mapname (XDR *xdrs, mapname *objp)
625 +{
626 + if (!xdr_string (xdrs, objp, YPMAXMAP))
627 + return FALSE;
628 +
629 + return TRUE;
630 +}
631 +#endif /* not HAVE_XDR_MAPNAME */
632 +
633 +#ifndef HAVE_XDR_PEERNAME
634 +bool_t
635 +xdr_peername (XDR *xdrs, peername *objp)
636 +{
637 + if (!xdr_string (xdrs, objp, YPMAXPEER))
638 + return (FALSE);
639 + return (TRUE);
640 +}
641 +#endif /* not HAVE_XDR_PEERNAME */
642 +
643 +#ifndef HAVE_XDR_YPSTAT
644 +bool_t
645 +xdr_ypstat (XDR *xdrs, ypstat *objp)
646 +{
647 + if (!xdr_enum (xdrs, (enum_t *) objp))
648 + return FALSE;
649 +
650 + return TRUE;
651 +}
652 +#endif /* not HAVE_XDR_YPSTAT */
653 +
654 +#ifndef HAVE_XDR_YPRESP_MASTER
655 +bool_t
656 +xdr_ypresp_master (XDR *xdrs, ypresp_master *objp)
657 +{
658 + if (!xdr_ypstat (xdrs, &objp->stat))
659 + return FALSE;
660 + if (!xdr_peername (xdrs, &objp->peer))
661 + return FALSE;
662 + return TRUE;
663 +}
664 +#endif /* not HAVE_XDR_YPRESP_MASTER */
665 +
666 +#ifndef HAVE_XDR_YPBIND_BINDING
667 +bool_t
668 +xdr_ypbind_binding (XDR *xdrs, ypbind_binding *objp)
669 +{
670 + if (!xdr_opaque (xdrs, objp->ypbind_binding_addr, 4))
671 + return FALSE;
672 + if (!xdr_opaque (xdrs, objp->ypbind_binding_port, 2))
673 + return FALSE;
674 + return TRUE;
675 +}
676 +#endif /* not HAVE_XDR_YPBIND_BINDING */
677 +
678 +#ifndef HAVE_XDR_YPREQ_NOKEY
679 +bool_t
680 +xdr_ypreq_nokey (XDR *xdrs, ypreq_nokey *objp)
681 +{
682 + if (!xdr_domainname (xdrs, &objp->domain))
683 + return FALSE;
684 +
685 + if (!xdr_mapname (xdrs, &objp->map))
686 + return FALSE;
687 +
688 + return TRUE;
689 +}
690 +#endif /* not HAVE_XDR_YPREQ_NOKEY */
691 +
692 +#ifndef HAVE_XDR_YPPUSH_STATUS
693 +bool_t
694 +xdr_yppush_status(XDR *xdrs, yppush_status *objp)
695 +{
696 + if (!xdr_enum(xdrs, (enum_t *)objp))
697 + return (FALSE);
698 + return (TRUE);
699 +}
700 +#endif /* not HAVE_XDR_YPPUSH_STATUS */
701 +
702 +#ifndef HAVE_XDR_YPPUSHRESP_XFR
703 +bool_t
704 +xdr_yppushresp_xfr(XDR *xdrs, yppushresp_xfr *objp)
705 +{
706 + if (!xdr_u_int(xdrs, &objp->transid))
707 + return (FALSE);
708 + if (!xdr_yppush_status(xdrs, &objp->status))
709 + return (FALSE);
710 + return (TRUE);
711 }
712 -#endif /* not HAVE_GETDELIM and not HAVE_GETLINE */
713 +#endif /* not HAVE_XDR_YPPUSHRESP_XFR */
714 diff -ur src-2.8.92/lib/compat.h src-2.8.92-local/lib/compat.h
715 --- src-2.8.92/lib/compat.h 2003-06-05 14:01:07.000000000 +0200
716 +++ src-2.8.92-local/lib/compat.h 2003-06-10 18:52:06.000000000 +0200
717 @@ -19,12 +19,7 @@
718 #ifndef _YPSERV_COMPAT_H
719 #define _YPSERV_COMPAT_H
720
721 -/* __attribute__ is only in GCC */
722 -#ifdef __GNUC__
723 -#define UNUSED __attribute__ ((unused))
724 -#else
725 -#define UNUSED
726 -#endif
727 +#include "config.h"
728
729 #ifndef HAVE_STPCPY
730 char *stpcpy(char *, const char *);
731 @@ -52,7 +47,26 @@
732
733 #if !defined(HAVE_GETDELIM) && !defined(HAVE_GETLINE)
734 /* Use getline() if getdelim() is missing */
735 +#include <unistd.h> /* size_t */
736 +#include <stdio.h> /* FILE */
737 ssize_t getline (char **lineptr, size_t *n, FILE *stream);
738 #endif /* not HAVE_GETDELIM and not HAVE_GETLINE */
739
740 +#ifndef HAVE_SVC_GETCALLER
741 +# include <rpc/rpc.h>
742 +# if !defined(svc_getcaller)
743 +struct sockaddr_in;
744 +const struct sockaddr_in *svc_getcaller(const SVCXPRT *xprt);
745 +# endif
746 +#endif /* not HAVE_SVC_GETCALLER */
747 +
748 +#ifndef HAVE__RPC_DTABLESIZE
749 +int _rpc_dtablesize(void);
750 +#endif
751 +
752 +#ifndef HAVE_INET_PTON
753 +int inet_pton(int af, const char *src, void *dst);
754 +#endif /* not HAVE_INET_PTON */
755 +
756 +
757 #endif /* not _YPSERV_COMPAT_H */
758 diff -ur src-2.8.92/lib/yp.h src-2.8.92-local/lib/yp.h
759 --- src-2.8.92/lib/yp.h 2003-06-05 16:48:11.000000000 +0200
760 +++ src-2.8.92-local/lib/yp.h 2003-06-10 18:54:02.000000000 +0200
761 @@ -8,8 +8,6 @@
762
763 #include <rpc/rpc.h>
764
765 -#include <pthread.h>
766 -
767 #ifdef __cplusplus
768 extern "C" {
769 #endif
770 diff -ur src-2.8.92/lib/ypserv_conf.c src-2.8.92-local/lib/ypserv_conf.c
771 --- src-2.8.92/lib/ypserv_conf.c 2003-06-05 14:02:02.000000000 +0200
772 +++ src-2.8.92-local/lib/ypserv_conf.c 2003-06-10 16:04:07.000000000 +0200
773 @@ -28,7 +28,10 @@
774 #include <sys/types.h>
775 #include <netinet/in.h>
776 #include <arpa/inet.h>
777 +#ifdef HAVE_ALLOCA_H
778 #include <alloca.h>
779 +#endif /* HAVE_ALLOCA_H */
780 +#include <unistd.h>
781
782 #include "log_msg.h"
783 #include "ypserv_conf.h"
784 diff -ur src-2.8.92/makedbm/makedbm.c src-2.8.92-local/makedbm/makedbm.c
785 --- src-2.8.92/makedbm/makedbm.c 2003-06-05 13:41:57.000000000 +0200
786 +++ src-2.8.92-local/makedbm/makedbm.c 2003-06-10 16:06:46.000000000 +0200
787 @@ -22,7 +22,9 @@
788 #include "config.h"
789 #endif
790
791 +#ifdef HAVE_ALLOCA_H
792 #include <alloca.h>
793 +#endif /* HAVE_ALLOCA_H */
794 #include <stdio.h>
795 #include <stdlib.h>
796 #include <string.h>
797 diff -ur src-2.8.92/rpc.yppasswdd/update.c src-2.8.92-local/rpc.yppasswdd/update.c
798 --- src-2.8.92/rpc.yppasswdd/update.c 2003-06-05 13:42:08.000000000 +0200
799 +++ src-2.8.92-local/rpc.yppasswdd/update.c 2003-06-10 18:38:03.000000000 +0200
800 @@ -26,7 +26,10 @@
801 #include <errno.h>
802 #include <unistd.h>
803 #include <string.h>
804 +#ifdef HAVE_ALLOCA_H
805 #include <alloca.h>
806 +#endif /* HAVE_ALLOCA_H */
807 +#include <stdlib.h>
808 #include <sys/stat.h>
809 #include <sys/wait.h>
810 #include <netinet/in.h>
811 @@ -41,6 +44,7 @@
812 #ifdef HAVE_SHADOW_H
813 #include <shadow.h>
814 #endif
815 +#include "compat.h"
816
817 #ifndef CHECKROOT
818 /* Set to 0 if you don't want to check against the root password
819 @@ -188,7 +192,7 @@
820 int retries;
821 static int res; /* I hate static variables */
822 char *logbuf;
823 - struct sockaddr_in *rqhost = svc_getcaller (rqstp->rq_xprt);
824 + const struct sockaddr_in *rqhost = svc_getcaller (rqstp->rq_xprt);
825
826 /* Be careful here with the debug option. You can see the old
827 and new password in clear text !! */
828 @@ -277,6 +281,7 @@
829 }
830 else
831 {
832 +#ifdef HAVE_LCKPWDF
833 /* Lock the passwd file. We retry several times. */
834 retries = 0;
835 while (lckpwdf () && retries < MAX_RETRIES)
836 @@ -291,11 +296,14 @@
837 log_msg ("password file locked");
838 return &res;
839 }
840 +#endif /* HAVE_LCKPWDF */
841
842 res = update_files (yppw, logbuf, &shadow_changed, &passwd_changed,
843 &chfn, &chsh);
844
845 +#ifdef HAVE_LCKPWDF
846 ulckpwdf ();
847 +#endif /* HAVE_LCKPWDF */
848 }
849
850 /* Fork off process to rebuild NIS passwd.* maps. */
851 @@ -359,6 +367,7 @@
852 {
853 if (strcmp (pw->pw_passwd, "x") == 0)
854 {
855 +#ifdef HAVE_GETSPNAM /* shadow password */
856 struct spwd *spw;
857
858 if ((spw = getspnam ("root")) != NULL)
859 @@ -366,6 +375,7 @@
860 rootpass = alloca (strlen (spw->sp_pwdp) + 1);
861 strcpy (rootpass, spw->sp_pwdp);
862 }
863 +#endif /* HAVE_GETSPNAM */
864 }
865 else
866 {
867 @@ -403,6 +413,7 @@
868 chmod (path_passwd_tmp, passwd_stat.st_mode);
869 chown (path_passwd_tmp, passwd_stat.st_uid, passwd_stat.st_gid);
870
871 +#ifdef HAVE_GETSPNAM
872 /* Open the shadow file for reading. */
873 if ((oldsf = fopen (path_shadow, "r")) != NULL)
874 {
875 @@ -427,6 +438,7 @@
876 chmod (path_shadow_tmp, shadow_stat.st_mode);
877 chown (path_shadow_tmp, shadow_stat.st_uid, shadow_stat.st_gid);
878 }
879 +#endif /* HAVE_GETSPNAM */
880
881 /* Loop over all passwd entries */
882 while ((pw = fgetpwent (oldpf)) != NULL)
883 @@ -443,6 +455,7 @@
884 if (oldsf != NULL &&
885 pw->pw_passwd[0] == 'x' && pw->pw_passwd[1] == '\0')
886 {
887 +#ifdef HAVE_GETSPNAM /* shadow password */
888 /* Search for the shadow entry of this user */
889 while ((spw = fgetspent (oldsf)) != NULL)
890 {
891 @@ -464,6 +477,7 @@
892 goto error;
893 }
894 }
895 +#endif /* HAVE_GETSPNAM */
896 }
897
898 /* We don't have a shadow password file or we don't find the
899 @@ -484,6 +498,7 @@
900 yppw->newpw.pw_passwd[1] == '\0') &&
901 yppw->newpw.pw_passwd[0] != '\0')
902 {
903 +#ifdef HAVE_GETSPNAM /* shadow password */
904 if (spw)
905 {
906 /* test if password is expired */
907 @@ -526,6 +541,7 @@
908 }
909 }
910 else /* No shadow entry */
911 +#endif /* HAVE_GETSPNAM */
912 {
913 /* set the new passwd */
914 pw->pw_passwd = yppw->newpw.pw_passwd;
915 @@ -594,9 +610,12 @@
916 if (pw || spw)
917 {
918 unlink (path_passwd_tmp);
919 +#ifdef HAVE_GETSPNAM
920 unlink (path_shadow_tmp);
921 +#endif /* HAVE_GETSPNAM */
922 return 1;
923 }
924 +#ifdef HAVE_GETSPNAM
925 if (*shadow_changed)
926 {
927 unlink (path_shadow_old);
928 @@ -605,6 +624,7 @@
929 }
930 else
931 unlink (path_shadow_tmp);
932 +#endif /* HAVE_GETSPNAM */
933
934 if (*passwd_changed)
935 {
936 diff -ur src-2.8.92/rpc.yppasswdd/yppasswdd.c src-2.8.92-local/rpc.yppasswdd/yppasswdd.c
937 --- src-2.8.92/rpc.yppasswdd/yppasswdd.c 2003-06-05 13:42:08.000000000 +0200
938 +++ src-2.8.92-local/rpc.yppasswdd/yppasswdd.c 2003-06-10 20:03:52.000000000 +0200
939 @@ -34,6 +34,7 @@
940 #include <fcntl.h>
941 #include <syslog.h>
942 #include <stdio.h>
943 +#include <stdlib.h>
944 #include <string.h>
945 #include <errno.h>
946 #include <rpc/rpc.h>
947 diff -ur src-2.8.92/rpc.ypxfrd/ypxfrd.c src-2.8.92-local/rpc.ypxfrd/ypxfrd.c
948 --- src-2.8.92/rpc.ypxfrd/ypxfrd.c 2003-06-05 14:17:26.000000000 +0200
949 +++ src-2.8.92-local/rpc.ypxfrd/ypxfrd.c 2003-06-10 20:06:32.000000000 +0200
950 @@ -76,40 +76,6 @@
951
952 char *progname;
953
954 -#if HAVE__RPC_DTABLESIZE
955 -extern int _rpc_dtablesize(void);
956 -#elif HAVE_GETDTABLESIZE
957 -static int
958 -_rpc_dtablesize()
959 -{
960 - static int size;
961 -
962 - if (size == 0)
963 - {
964 - size = getdtablesize();
965 - }
966 - return (size);
967 -}
968 -#else
969 -
970 -#include <sys/resource.h>
971 -
972 -static int
973 -_rpc_dtablesize()
974 -{
975 - static int size = 0;
976 - struct rlimit rlb;
977 -
978 - if (size == 0)
979 - {
980 - if (getrlimit(RLIMIT_NOFILE, &rlb) >= 0)
981 - size = rlb.rlim_cur;
982 - }
983 -
984 - return size;
985 -}
986 -#endif
987 -
988 /*
989 ** Needed, if we start rpc.ypxfrd from inetd
990 */
991 diff -ur src-2.8.92/rpc.ypxfrd/ypxfrd_server.c src-2.8.92-local/rpc.ypxfrd/ypxfrd_server.c
992 --- src-2.8.92/rpc.ypxfrd/ypxfrd_server.c 2002-12-21 14:53:26.000000000 +0100
993 +++ src-2.8.92-local/rpc.ypxfrd/ypxfrd_server.c 2003-06-10 16:15:56.000000000 +0200
994 @@ -40,6 +40,7 @@
995 #include "ypxfrd.h"
996 #include "access.h"
997 #include "yp_db.h"
998 +#include "compat.h"
999
1000 static int file = 0;
1001
1002 @@ -97,7 +98,7 @@
1003 {
1004 static struct xfr result;
1005 char buf[MAXPATHLEN];
1006 - struct sockaddr_in *rqhost;
1007 + const struct sockaddr_in *rqhost;
1008 int valid;
1009
1010 if (debug_flag)
1011 diff -ur src-2.8.92/rpc.ypxfrd/ypxfrd_svc.c src-2.8.92-local/rpc.ypxfrd/ypxfrd_svc.c
1012 --- src-2.8.92/rpc.ypxfrd/ypxfrd_svc.c 2003-06-05 17:51:39.000000000 +0200
1013 +++ src-2.8.92-local/rpc.ypxfrd/ypxfrd_svc.c 2003-06-10 16:16:29.000000000 +0200
1014 @@ -23,6 +23,7 @@
1015
1016 #include <stdio.h>
1017 #include <stdlib.h>
1018 +#include <rpc/rpc.h>
1019 #include <rpc/pmap_clnt.h>
1020 #include <string.h>
1021 #include <signal.h>
1022 diff -ur src-2.8.92/yphelper/yphelper.c src-2.8.92-local/yphelper/yphelper.c
1023 --- src-2.8.92/yphelper/yphelper.c 2003-06-05 13:42:08.000000000 +0200
1024 +++ src-2.8.92-local/yphelper/yphelper.c 2003-06-10 18:38:32.000000000 +0200
1025 @@ -21,17 +21,22 @@
1026 #include "config.h"
1027 #endif
1028
1029 +#include <sys/types.h>
1030 #include <grp.h>
1031 #include <pwd.h>
1032 #include <netdb.h>
1033 #include <rpc/types.h>
1034 #include <strings.h>
1035 #include <sys/socket.h>
1036 +#include <sys/param.h>
1037 #include <netinet/in.h>
1038 #include <arpa/inet.h>
1039 #include <unistd.h>
1040 #include <ctype.h>
1041 +#ifdef HAVE_ALLOCA_H
1042 #include <alloca.h>
1043 +#endif /* HAVE_ALLOCA_H */
1044 +#include <stdlib.h>
1045 #if defined(HAVE_GETOPT_H)
1046 #include <getopt.h>
1047 #endif
1048 @@ -314,6 +319,7 @@
1049 (pwd->pw_passwd[0] == 'x' || pwd->pw_passwd[0] == '*'))
1050 {
1051 pass = NULL;
1052 +#ifdef HAVE_GETSPNAM /* shadow password */
1053 spd = fgetspent (s_input);
1054 if (spd != NULL)
1055 {
1056 @@ -332,6 +338,7 @@
1057 }
1058 }
1059 }
1060 +#endif /* HAVE_GETSPNAM */
1061 if (pass == NULL)
1062 pass = pwd->pw_passwd;
1063 }
1064 @@ -349,6 +356,7 @@
1065 exit (0);
1066 }
1067
1068 +#ifdef HAVE_GETSPNAM /* shadow password */
1069 static struct __sgrp *
1070 fgetsgent (FILE *fp)
1071 {
1072 @@ -379,6 +387,7 @@
1073 }
1074 return 0;
1075 }
1076 +#endif /* HAVE_GETSPNAM */
1077
1078 static void
1079 merge_group (char *group, char *gshadow)
1080 @@ -423,6 +432,7 @@
1081 (grp->gr_passwd[0] == 'x' || grp->gr_passwd[0] == '*'))
1082 {
1083 pass = NULL;
1084 +#ifdef HAVE_GETSPNAM /* shadow password */
1085 spd = fgetsgent (s_input);
1086 if (spd != NULL)
1087 {
1088 @@ -441,6 +451,7 @@
1089 }
1090 }
1091 }
1092 +#endif /* HAVE_GETSPNAM */
1093 if (pass == NULL)
1094 pass = grp->gr_passwd;
1095 }
1096 diff -ur src-2.8.92/yppush/yppush.c src-2.8.92-local/yppush/yppush.c
1097 --- src-2.8.92/yppush/yppush.c 2003-06-05 13:42:08.000000000 +0200
1098 +++ src-2.8.92-local/yppush/yppush.c 2003-06-10 20:04:41.000000000 +0200
1099 @@ -29,6 +29,7 @@
1100 #include <time.h>
1101 #include "yp.h"
1102 #include <rpcsvc/ypclnt.h>
1103 +#include <rpc/svc.h>
1104 #include <arpa/inet.h>
1105 #include <sys/param.h>
1106 #include <sys/socket.h>
1107 @@ -73,38 +74,6 @@
1108 static u_int maxchildren = 1;
1109 static u_int children = 0;
1110
1111 -#if HAVE__RPC_DTABLESIZE
1112 -extern int _rpc_dtablesize (void);
1113 -#elif HAVE_GETDTABLESIZE
1114 -
1115 -int
1116 -_rpc_dtablesize ()
1117 -{
1118 - static int size;
1119 -
1120 - if (size == 0)
1121 - size = getdtablesize ();
1122 -
1123 - return size;
1124 -}
1125 -#else
1126 -
1127 -#include <sys/resource.h>
1128 -
1129 -int
1130 -_rpc_dtablesize ()
1131 -{
1132 - static int size = 0;
1133 - struct rlimit rlb;
1134 -
1135 -
1136 - if (size == 0)
1137 - if (getrlimit (RLIMIT_NOFILE, &rlb) >= 0)
1138 - size = rlb.rlim_cur;
1139 -
1140 - return size;
1141 -}
1142 -#endif
1143
1144 static char *
1145 yppush_err_string (enum yppush_status status)
1146 @@ -164,7 +133,7 @@
1147 bool_t
1148 yppushproc_xfrresp_1_svc (yppushresp_xfr *req, void *resp, struct svc_req *rqstp)
1149 {
1150 - struct sockaddr_in *sin;
1151 + const struct sockaddr_in *sin;
1152 char *h;
1153 struct hostent *hp;
1154
1155 diff -ur src-2.8.92/ypserv/server.c src-2.8.92-local/ypserv/server.c
1156 --- src-2.8.92/ypserv/server.c 2003-06-05 14:21:12.000000000 +0200
1157 +++ src-2.8.92-local/ypserv/server.c 2003-06-10 20:05:02.000000000 +0200
1158 @@ -23,13 +23,16 @@
1159 #define _GNU_SOURCE
1160
1161 #include <string.h>
1162 +#include <sys/types.h>
1163 #include <sys/socket.h>
1164 #include <netinet/in.h>
1165 #include <arpa/inet.h>
1166 -#include <sys/types.h>
1167 #include <sys/stat.h>
1168 +#ifdef HAVE_ALLOCA_H
1169 #include <alloca.h>
1170 +#endif /* HAVE_ALLOCA_H */
1171 #include <unistd.h>
1172 +#include <stdlib.h>
1173 #include <dirent.h>
1174 #include <errno.h>
1175 #include <fcntl.h>
1176 @@ -50,7 +53,7 @@
1177 {
1178 if (debug_flag)
1179 {
1180 - struct sockaddr_in *rqhost = svc_getcaller (rqstp->rq_xprt);
1181 + const struct sockaddr_in *rqhost = svc_getcaller (rqstp->rq_xprt);
1182 log_msg ("ypproc_null() [From: %s:%d]",
1183 inet_ntoa (rqhost->sin_addr),
1184 ntohs (rqhost->sin_port));
1185 @@ -69,7 +72,7 @@
1186 {
1187 if (debug_flag)
1188 {
1189 - struct sockaddr_in *rqhost = svc_getcaller (rqstp->rq_xprt);
1190 + const struct sockaddr_in *rqhost = svc_getcaller (rqstp->rq_xprt);
1191 log_msg ("ypproc_domain(\"%s\") [From: %s:%d]",
1192 *argp, inet_ntoa (rqhost->sin_addr),
1193 ntohs (rqhost->sin_port));
1194 @@ -104,7 +107,7 @@
1195 {
1196 if (debug_flag)
1197 {
1198 - struct sockaddr_in *rqhost = svc_getcaller (rqstp->rq_xprt);
1199 + const struct sockaddr_in *rqhost = svc_getcaller (rqstp->rq_xprt);
1200 log_msg ("ypproc_domain_nonack(\"%s\") [From: %s:%d]",
1201 *argp, inet_ntoa (rqhost->sin_addr),
1202 ntohs (rqhost->sin_port));
1203 @@ -144,7 +147,7 @@
1204
1205 if (debug_flag)
1206 {
1207 - struct sockaddr_in *rqhost = svc_getcaller (rqstp->rq_xprt);
1208 + const struct sockaddr_in *rqhost = svc_getcaller (rqstp->rq_xprt);
1209
1210 log_msg ("ypproc_match(): [From: %s:%d]",
1211 inet_ntoa (rqhost->sin_addr), ntohs (rqhost->sin_port));
1212 @@ -232,7 +235,7 @@
1213
1214 if (debug_flag)
1215 {
1216 - struct sockaddr_in *rqhost = svc_getcaller (rqstp->rq_xprt);
1217 + const struct sockaddr_in *rqhost = svc_getcaller (rqstp->rq_xprt);
1218 log_msg ("ypproc_first(): [From: %s:%d]",
1219 inet_ntoa (rqhost->sin_addr), ntohs (rqhost->sin_port));
1220
1221 @@ -327,7 +330,7 @@
1222
1223 if (debug_flag)
1224 {
1225 - struct sockaddr_in *rqhost = svc_getcaller (rqstp->rq_xprt);
1226 + const struct sockaddr_in *rqhost = svc_getcaller (rqstp->rq_xprt);
1227
1228 log_msg ("ypproc_next(): [From: %s:%d]",
1229 inet_ntoa (rqhost->sin_addr), ntohs (rqhost->sin_port));
1230 @@ -424,7 +427,7 @@
1231 struct svc_req *rqstp)
1232 {
1233 DB_FILE dbp;
1234 - struct sockaddr_in *rqhost = svc_getcaller (rqstp->rq_xprt);
1235 + const struct sockaddr_in *rqhost = svc_getcaller (rqstp->rq_xprt);
1236 int valid;
1237
1238 if (debug_flag)
1239 @@ -628,7 +631,7 @@
1240 {
1241 if (debug_flag)
1242 {
1243 - struct sockaddr_in *rqhost = svc_getcaller (rqstp->rq_xprt);
1244 + const struct sockaddr_in *rqhost = svc_getcaller (rqstp->rq_xprt);
1245 log_msg ("ypproc_clear_2_svc() [From: %s:%d]",
1246 inet_ntoa (rqhost->sin_addr), ntohs (rqhost->sin_port));
1247 }
1248 @@ -730,7 +733,7 @@
1249
1250 if (debug_flag)
1251 {
1252 - struct sockaddr_in *rqhost;
1253 + const struct sockaddr_in *rqhost;
1254
1255 rqhost = svc_getcaller (rqstp->rq_xprt);
1256 log_msg ("ypproc_all_2_svc(): [From: %s:%d]",
1257 @@ -901,7 +904,7 @@
1258
1259 if (debug_flag)
1260 {
1261 - struct sockaddr_in *rqhost = svc_getcaller (rqstp->rq_xprt);
1262 + const struct sockaddr_in *rqhost = svc_getcaller (rqstp->rq_xprt);
1263 log_msg ("ypproc_master_2_svc(): [From: %s:%d]",
1264 inet_ntoa (rqhost->sin_addr), ntohs (rqhost->sin_port));
1265
1266 @@ -1008,7 +1011,7 @@
1267
1268 if (debug_flag)
1269 {
1270 - struct sockaddr_in *rqhost;
1271 + const struct sockaddr_in *rqhost;
1272
1273 rqhost = svc_getcaller (rqstp->rq_xprt);
1274
1275 @@ -1132,7 +1135,7 @@
1276
1277 if (debug_flag)
1278 {
1279 - struct sockaddr_in *rqhost = svc_getcaller (rqstp->rq_xprt);
1280 + const struct sockaddr_in *rqhost = svc_getcaller (rqstp->rq_xprt);
1281
1282 log_msg ("ypproc_maplist_2_svc(): [From: %s:%d]",
1283 inet_ntoa (rqhost->sin_addr), ntohs (rqhost->sin_port));
1284 diff -ur src-2.8.92/ypserv/ypserv.c src-2.8.92-local/ypserv/ypserv.c
1285 --- src-2.8.92/ypserv/ypserv.c 2003-06-05 13:42:13.000000000 +0200
1286 +++ src-2.8.92-local/ypserv/ypserv.c 2003-06-10 20:05:16.000000000 +0200
1287 @@ -32,7 +32,6 @@
1288 #if defined(HAVE_GETOPT_H)
1289 #include <getopt.h>
1290 #endif
1291 -#include <poll.h>
1292 #include <sys/file.h>
1293 #include <sys/stat.h>
1294 #include <sys/wait.h>
1295 diff -ur src-2.8.92/ypxfr/ypxfr.c src-2.8.92-local/ypxfr/ypxfr.c
1296 --- src-2.8.92/ypxfr/ypxfr.c 2003-06-05 15:37:26.000000000 +0200
1297 +++ src-2.8.92-local/ypxfr/ypxfr.c 2003-06-10 20:05:31.000000000 +0200
1298 @@ -34,8 +34,12 @@
1299 #include <netinet/in.h>
1300 #include <arpa/inet.h>
1301 #include <ctype.h>
1302 +#ifdef HAVE_ALLOCA_H
1303 #include <alloca.h>
1304 +#endif /* HAVE_ALLOCA_H */
1305 +#include <stdlib.h>
1306 #include <sys/stat.h>
1307 +#include <sys/param.h>
1308 #include "log_msg.h"
1309 #include "yp.h"
1310 #include "ypxfr.h"
1311 @@ -351,7 +355,7 @@
1312 struct sockaddr_in sockaddr, sockaddr_udp;
1313 struct ypresp_order resp_order;
1314 struct ypreq_nokey req_nokey;
1315 - uint32_t masterOrderNum;
1316 + time_t masterOrderNum;
1317 struct hostent *h;
1318 int sock, result;
1319
1320 @@ -451,7 +455,7 @@
1321 /* If we doesn't force the map, look, if the new map is really newer */
1322 if (!force)
1323 {
1324 - uint32_t localOrderNum = 0;
1325 + time_t localOrderNum = 0;
1326 datum inKey, inVal;
1327
1328 #if defined(HAVE_LIBGDBM)
1329 @@ -689,7 +693,7 @@
1330 struct in_addr remote_addr;
1331 unsigned int transid = 0;
1332 unsigned short int remote_port = 0;
1333 - uint32_t program_number = 0;
1334 + unsigned long program_number = 0;
1335 int force = 0;
1336 int noclear = 0;
1337
1338 diff -ur src-2.8.92/ypxfr/ypxfr_xdr.c src-2.8.92-local/ypxfr/ypxfr_xdr.c
1339 --- src-2.8.92/ypxfr/ypxfr_xdr.c 2003-06-05 16:23:02.000000000 +0200
1340 +++ src-2.8.92-local/ypxfr/ypxfr_xdr.c 2003-06-10 18:33:16.000000000 +0200
1341 @@ -39,32 +39,6 @@
1342
1343
1344 bool_t
1345 -xdr_domainname (XDR *xdrs, domainname *objp)
1346 -{
1347 - if (!xdr_string (xdrs, objp, YPMAXDOMAIN))
1348 - return (FALSE);
1349 -
1350 - return (TRUE);
1351 -}
1352 -
1353 -bool_t
1354 -xdr_mapname (XDR *xdrs, mapname *objp)
1355 -{
1356 - if (!xdr_string (xdrs, objp, YPMAXMAP))
1357 - return FALSE;
1358 -
1359 - return TRUE;
1360 -}
1361 -
1362 -bool_t
1363 -xdr_peername (XDR *xdrs, peername *objp)
1364 -{
1365 - if (!xdr_string (xdrs, objp, YPMAXPEER))
1366 - return (FALSE);
1367 - return (TRUE);
1368 -}
1369 -
1370 -bool_t
1371 xdr_keydat (XDR *xdrs, keydat *objp)
1372 {
1373 if (!xdr_bytes (xdrs, (char **) &objp->keydat_val,
1374 @@ -108,16 +82,6 @@
1375 }
1376
1377 bool_t
1378 -xdr_ypresp_master (XDR *xdrs, ypresp_master *objp)
1379 -{
1380 - if (!xdr_ypstat (xdrs, &objp->stat))
1381 - return FALSE;
1382 - if (!xdr_peername (xdrs, &objp->peer))
1383 - return FALSE;
1384 - return TRUE;
1385 -}
1386 -
1387 -bool_t
1388 xdr_ypresp_order (XDR *xdrs, ypresp_order *objp)
1389 {
1390 if (!xdr_ypstat (xdrs, &objp->stat))
1391 @@ -128,16 +92,6 @@
1392 }
1393
1394 bool_t
1395 -xdr_ypbind_binding (XDR *xdrs, ypbind_binding *objp)
1396 -{
1397 - if (!xdr_opaque (xdrs, objp->ypbind_binding_addr, 4))
1398 - return FALSE;
1399 - if (!xdr_opaque (xdrs, objp->ypbind_binding_port, 2))
1400 - return FALSE;
1401 - return TRUE;
1402 -}
1403 -
1404 -bool_t
1405 xdr_ypbind_setdom (XDR *xdrs, ypbind_setdom *objp)
1406 {
1407 if (!xdr_domainname (xdrs, &objp->ypsetdom_domain))
1408 @@ -168,46 +122,6 @@
1409 }
1410
1411 bool_t
1412 -xdr_ypreq_nokey (XDR *xdrs, ypreq_nokey *objp)
1413 -{
1414 - if (!xdr_domainname (xdrs, &objp->domain))
1415 - return FALSE;
1416 -
1417 - if (!xdr_mapname (xdrs, &objp->map))
1418 - return FALSE;
1419 -
1420 - return TRUE;
1421 -}
1422 -
1423 -bool_t
1424 -xdr_ypstat (XDR *xdrs, ypstat *objp)
1425 -{
1426 - if (!xdr_enum (xdrs, (enum_t *) objp))
1427 - return FALSE;
1428 -
1429 - return TRUE;
1430 -}
1431 -
1432 -bool_t
1433 -xdr_ypxfrstat (XDR *xdrs, ypxfrstat *objp)
1434 -{
1435 - if (!xdr_enum (xdrs, (enum_t *) objp))
1436 - return FALSE;
1437 -
1438 - return TRUE;
1439 -}
1440 -
1441 -bool_t
1442 -xdr_ypresp_xfr (XDR * xdrs, ypresp_xfr * objp)
1443 -{
1444 - if (!xdr_u_int (xdrs, &objp->transid))
1445 - return FALSE;
1446 - if (!xdr_ypxfrstat (xdrs, &objp->xfrstat))
1447 - return FALSE;
1448 - return TRUE;
1449 -}
1450 -
1451 -bool_t
1452 ypxfr_xdr_ypresp_all (XDR *xdrs, ypresp_all *objp)
1453 {
1454 int CallAgain = 0;