1 /* Generated by CIL v. 1.3.5 */
2 /* print_CIL_Input is true */
3
4 #line 214 "/usr/lib/gcc/i486-linux-gnu/4.1.3/include/stddef.h"
5 typedef unsigned int size_t;
6 #line 35 "/usr/include/bits/types.h"
7 typedef unsigned short __u_short;
8 #line 36 "/usr/include/bits/types.h"
9 typedef unsigned int __u_int;
10 #line 37 "/usr/include/bits/types.h"
11 typedef unsigned long __u_long;
12 #line 59 "/usr/include/bits/types.h"
13 typedef long long __quad_t;
14 #line 60 "/usr/include/bits/types.h"
15 typedef unsigned long long __u_quad_t;
16 #line 137 "/usr/include/bits/types.h"
17 typedef __u_quad_t __dev_t;
18 #line 138 "/usr/include/bits/types.h"
19 typedef unsigned int __uid_t;
20 #line 139 "/usr/include/bits/types.h"
21 typedef unsigned int __gid_t;
22 #line 140 "/usr/include/bits/types.h"
23 typedef unsigned long __ino_t;
24 #line 142 "/usr/include/bits/types.h"
25 typedef unsigned int __mode_t;
26 #line 143 "/usr/include/bits/types.h"
27 typedef unsigned int __nlink_t;
28 #line 144 "/usr/include/bits/types.h"
29 typedef long __off_t;
30 #line 145 "/usr/include/bits/types.h"
31 typedef __quad_t __off64_t;
32 #line 146 "/usr/include/bits/types.h"
33 typedef int __pid_t;
34 #line 152 "/usr/include/bits/types.h"
35 typedef long __time_t;
36 #line 167 "/usr/include/bits/types.h"
37 typedef long __blksize_t;
38 #line 172 "/usr/include/bits/types.h"
39 typedef long __blkcnt_t;
40 #line 183 "/usr/include/bits/types.h"
41 typedef int __ssize_t;
42 #line 189 "/usr/include/bits/types.h"
43 typedef char *__caddr_t;
44 #line 195 "/usr/include/bits/types.h"
45 typedef unsigned int __socklen_t;
46 #line 36 "/usr/include/sys/types.h"
47 typedef __u_short u_short;
48 #line 37 "/usr/include/sys/types.h"
49 typedef __u_int u_int;
50 #line 38 "/usr/include/sys/types.h"
51 typedef __u_long u_long;
52 #line 100 "/usr/include/sys/types.h"
53 typedef __pid_t pid_t;
54 #line 110 "/usr/include/sys/types.h"
55 typedef __ssize_t ssize_t;
56 #line 117 "/usr/include/sys/types.h"
57 typedef __caddr_t caddr_t;
58 #line 197 "/usr/include/sys/types.h"
59 typedef int int32_t;
60 #line 29 "/usr/include/bits/sigset.h"
61 struct __anonstruct___sigset_t_2 {
62 unsigned long __val[(int )(1024U / (8U * sizeof(unsigned long )))] ;
63 };
64 #line 29 "/usr/include/bits/sigset.h"
65 typedef struct __anonstruct___sigset_t_2 __sigset_t;
66 #line 38 "/usr/include/sys/select.h"
67 typedef __sigset_t sigset_t;
68 #line 121 "/usr/include/time.h"
69 struct timespec {
70 __time_t tv_sec ;
71 long tv_nsec ;
72 };
73 #line 36 "/usr/include/bits/pthreadtypes.h"
74 typedef unsigned long pthread_t;
75 #line 39 "/usr/include/bits/pthreadtypes.h"
76 union __anonunion_pthread_attr_t_4 {
77 char __size[36] ;
78 long __align ;
79 };
80 #line 39 "/usr/include/bits/pthreadtypes.h"
81 typedef union __anonunion_pthread_attr_t_4 pthread_attr_t;
82 #line 46 "/usr/include/bits/pthreadtypes.h"
83 struct __pthread_internal_slist {
84 struct __pthread_internal_slist *__next ;
85 };
86 #line 46 "/usr/include/bits/pthreadtypes.h"
87 typedef struct __pthread_internal_slist __pthread_slist_t;
88 #line 54 "/usr/include/bits/pthreadtypes.h"
89 union __anonunion____missing_field_name_6 {
90 int __spins ;
91 __pthread_slist_t __list ;
92 };
93 #line 54 "/usr/include/bits/pthreadtypes.h"
94 struct __pthread_mutex_s {
95 int __lock ;
96 unsigned int __count ;
97 int __owner ;
98 int __kind ;
99 unsigned int __nusers ;
100 union __anonunion____missing_field_name_6 __annonCompField1 ;
101 };
102 #line 54 "/usr/include/bits/pthreadtypes.h"
103 union __anonunion_pthread_mutex_t_5 {
104 struct __pthread_mutex_s __data ;
105 char __size[24] ;
106 long __align ;
107 };
108 #line 54 "/usr/include/bits/pthreadtypes.h"
109 typedef union __anonunion_pthread_mutex_t_5 pthread_mutex_t;
110 #line 84 "/usr/include/bits/pthreadtypes.h"
111 struct __anonstruct___data_9 {
112 int __lock ;
113 unsigned int __futex ;
114 unsigned long long __total_seq ;
115 unsigned long long __wakeup_seq ;
116 unsigned long long __woken_seq ;
117 void *__mutex ;
118 unsigned int __nwaiters ;
119 unsigned int __broadcast_seq ;
120 };
121 #line 84 "/usr/include/bits/pthreadtypes.h"
122 union __anonunion_pthread_cond_t_8 {
123 struct __anonstruct___data_9 __data ;
124 char __size[48] ;
125 long long __align ;
126 };
127 #line 84 "/usr/include/bits/pthreadtypes.h"
128 typedef union __anonunion_pthread_cond_t_8 pthread_cond_t;
129 #line 37 "/usr/include/bits/socket.h"
130 typedef __socklen_t socklen_t;
131 #line 29 "/usr/include/bits/sockaddr.h"
132 typedef unsigned short sa_family_t;
133 #line 146 "/usr/include/bits/socket.h"
134 struct sockaddr {
135 sa_family_t sa_family ;
136 char sa_data[14] ;
137 };
138 #line 87 "/usr/include/sys/socket.h"
139 struct sockaddr_in;
140 #line 36 "/usr/include/bits/stat.h"
141 struct stat {
142 __dev_t st_dev ;
143 unsigned short __pad1 ;
144 __ino_t st_ino ;
145 __mode_t st_mode ;
146 __nlink_t st_nlink ;
147 __uid_t st_uid ;
148 __gid_t st_gid ;
149 __dev_t st_rdev ;
150 unsigned short __pad2 ;
151 __off_t st_size ;
152 __blksize_t st_blksize ;
153 __blkcnt_t st_blocks ;
154 struct timespec st_atim ;
155 struct timespec st_mtim ;
156 struct timespec st_ctim ;
157 unsigned long __unused4 ;
158 unsigned long __unused5 ;
159 };
160 #line 23 "/usr/include/bits/dirent.h"
161 struct dirent {
162 __ino_t d_ino ;
163 __off_t d_off ;
164 unsigned short d_reclen ;
165 unsigned char d_type ;
166 char d_name[256] ;
167 };
168 #line 128 "/usr/include/dirent.h"
169 struct __dirstream;
170 #line 128 "/usr/include/dirent.h"
171 typedef struct __dirstream DIR;
172 #line 45 "/usr/include/stdio.h"
173 struct _IO_FILE;
174 #line 49 "/usr/include/stdio.h"
175 typedef struct _IO_FILE FILE;
176 #line 177 "/usr/include/libio.h"
177 typedef void _IO_lock_t;
178 #line 183 "/usr/include/libio.h"
179 struct _IO_marker {
180 struct _IO_marker *_next ;
181 struct _IO_FILE *_sbuf ;
182 int _pos ;
183 };
184 #line 268 "/usr/include/libio.h"
185 struct _IO_FILE {
186 int _flags ;
187 char *_IO_read_ptr ;
188 char *_IO_read_end ;
189 char *_IO_read_base ;
190 char *_IO_write_base ;
191 char *_IO_write_ptr ;
192 char *_IO_write_end ;
193 char *_IO_buf_base ;
194 char *_IO_buf_end ;
195 char *_IO_save_base ;
196 char *_IO_backup_base ;
197 char *_IO_save_end ;
198 struct _IO_marker *_markers ;
199 struct _IO_FILE *_chain ;
200 int _fileno ;
201 int _flags2 ;
202 __off_t _old_offset ;
203 unsigned short _cur_column ;
204 signed char _vtable_offset ;
205 char _shortbuf[1] ;
206 _IO_lock_t *_lock ;
207 __off64_t _offset ;
208 void *__pad1 ;
209 void *__pad2 ;
210 void *__pad3 ;
211 void *__pad4 ;
212 size_t __pad5 ;
213 int _mode ;
214 char _unused2[(int )((15U * sizeof(int ) - 4U * sizeof(void *)) - sizeof(size_t ))] ;
215 };
216 #line 141 "/usr/include/bits/fcntl.h"
217 struct flock {
218 short l_type ;
219 short l_whence ;
220 __off_t l_start ;
221 __off_t l_len ;
222 __pid_t l_pid ;
223 };
224 #line 36 "/usr/include/rpc/types.h"
225 typedef int bool_t;
226 #line 37 "/usr/include/rpc/types.h"
227 typedef int enum_t;
228 #line 39 "/usr/include/rpc/types.h"
229 typedef unsigned long rpcprog_t;
230 #line 40 "/usr/include/rpc/types.h"
231 typedef unsigned long rpcvers_t;
232 #line 41 "/usr/include/rpc/types.h"
233 typedef unsigned long rpcproc_t;
234 #line 42 "/usr/include/rpc/types.h"
235 typedef unsigned long rpcprot_t;
236 #line 50 "/usr/include/stdint.h"
237 typedef unsigned short uint16_t;
238 #line 52 "/usr/include/stdint.h"
239 typedef unsigned int uint32_t;
240 #line 92 "/usr/include/netinet/in.h"
241 typedef uint16_t in_port_t;
242 #line 136 "/usr/include/netinet/in.h"
243 typedef uint32_t in_addr_t;
244 #line 137 "/usr/include/netinet/in.h"
245 struct in_addr {
246 in_addr_t s_addr ;
247 };
248 #line 219 "/usr/include/netinet/in.h"
249 struct sockaddr_in {
250 sa_family_t sin_family ;
251 in_port_t sin_port ;
252 struct in_addr sin_addr ;
253 unsigned char sin_zero[(int )(((sizeof(struct sockaddr ) - sizeof(unsigned short )) - sizeof(in_port_t )) - sizeof(struct in_addr ))] ;
254 };
255 #line 83 "/usr/include/rpc/xdr.h"
256 enum xdr_op {
257 XDR_ENCODE = 0,
258 XDR_DECODE = 1,
259 XDR_FREE = 2
260 } ;
261 #line 111
262 struct XDR;
263 #line 111 "/usr/include/rpc/xdr.h"
264 typedef struct XDR XDR;
265 #line 112 "/usr/include/rpc/xdr.h"
266 struct xdr_ops {
267 bool_t (*x_getlong)(XDR *__xdrs , long *__lp ) ;
268 bool_t (*x_putlong)(XDR *__xdrs , long const *__lp ) ;
269 bool_t (*x_getbytes)(XDR *__xdrs , caddr_t __addr , u_int __len ) ;
270 bool_t (*x_putbytes)(XDR *__xdrs , char const *__addr , u_int __len ) ;
271 u_int (*x_getpostn)(XDR const *__xdrs ) ;
272 bool_t (*x_setpostn)(XDR *__xdrs , u_int __pos ) ;
273 int32_t *(*x_inline)(XDR *__xdrs , u_int __len ) ;
274 void (*x_destroy)(XDR *__xdrs ) ;
275 bool_t (*x_getint32)(XDR *__xdrs , int32_t *__ip ) ;
276 bool_t (*x_putint32)(XDR *__xdrs , int32_t const *__ip ) ;
277 };
278 #line 112 "/usr/include/rpc/xdr.h"
279 struct XDR {
280 enum xdr_op x_op ;
281 struct xdr_ops *x_ops ;
282 caddr_t x_public ;
283 caddr_t x_private ;
284 caddr_t x_base ;
285 u_int x_handy ;
286 };
287 #line 55 "/usr/include/rpc/auth.h"
288 enum auth_stat {
289 AUTH_OK = 0,
290 AUTH_BADCRED = 1,
291 AUTH_REJECTEDCRED = 2,
292 AUTH_BADVERF = 3,
293 AUTH_REJECTEDVERF = 4,
294 AUTH_TOOWEAK = 5,
295 AUTH_INVALIDRESP = 6,
296 AUTH_FAILED = 7
297 } ;
298 #line 85 "/usr/include/rpc/auth.h"
299 struct opaque_auth {
300 enum_t oa_flavor ;
301 caddr_t oa_base ;
302 u_int oa_length ;
303 };
304 #line 58 "/usr/include/rpc/rpc_msg.h"
305 enum msg_type {
306 CALL = 0,
307 REPLY = 1
308 } ;
309 #line 63
310 enum reply_stat {
311 MSG_ACCEPTED = 0,
312 MSG_DENIED = 1
313 } ;
314 #line 68
315 enum accept_stat {
316 SUCCESS = 0,
317 PROG_UNAVAIL = 1,
318 PROG_MISMATCH = 2,
319 PROC_UNAVAIL = 3,
320 GARBAGE_ARGS = 4,
321 SYSTEM_ERR = 5
322 } ;
323 #line 77
324 enum reject_stat {
325 RPC_MISMATCH = 0,
326 AUTH_ERROR = 1
327 } ;
328 #line 91 "/usr/include/rpc/rpc_msg.h"
329 struct __anonstruct_AR_versions_72 {
330 u_long low ;
331 u_long high ;
332 };
333 #line 91 "/usr/include/rpc/rpc_msg.h"
334 struct __anonstruct_AR_results_73 {
335 caddr_t where ;
336 bool_t (*proc)(XDR * , void * , ...) ;
337 };
338 #line 91 "/usr/include/rpc/rpc_msg.h"
339 union __anonunion_ru_71 {
340 struct __anonstruct_AR_versions_72 AR_versions ;
341 struct __anonstruct_AR_results_73 AR_results ;
342 };
343 #line 91 "/usr/include/rpc/rpc_msg.h"
344 struct accepted_reply {
345 struct opaque_auth ar_verf ;
346 enum accept_stat ar_stat ;
347 union __anonunion_ru_71 ru ;
348 };
349 #line 112 "/usr/include/rpc/rpc_msg.h"
350 struct __anonstruct_RJ_versions_75 {
351 u_long low ;
352 u_long high ;
353 };
354 #line 112 "/usr/include/rpc/rpc_msg.h"
355 union __anonunion_ru_74 {
356 struct __anonstruct_RJ_versions_75 RJ_versions ;
357 enum auth_stat RJ_why ;
358 };
359 #line 112 "/usr/include/rpc/rpc_msg.h"
360 struct rejected_reply {
361 enum reject_stat rj_stat ;
362 union __anonunion_ru_74 ru ;
363 };
364 #line 128 "/usr/include/rpc/rpc_msg.h"
365 union __anonunion_ru_76 {
366 struct accepted_reply RP_ar ;
367 struct rejected_reply RP_dr ;
368 };
369 #line 128 "/usr/include/rpc/rpc_msg.h"
370 struct reply_body {
371 enum reply_stat rp_stat ;
372 union __anonunion_ru_76 ru ;
373 };
374 #line 141 "/usr/include/rpc/rpc_msg.h"
375 struct call_body {
376 u_long cb_rpcvers ;
377 u_long cb_prog ;
378 u_long cb_vers ;
379 u_long cb_proc ;
380 struct opaque_auth cb_cred ;
381 struct opaque_auth cb_verf ;
382 };
383 #line 153 "/usr/include/rpc/rpc_msg.h"
384 union __anonunion_ru_77 {
385 struct call_body RM_cmb ;
386 struct reply_body RM_rmb ;
387 };
388 #line 153 "/usr/include/rpc/rpc_msg.h"
389 struct rpc_msg {
390 u_long rm_xid ;
391 enum msg_type rm_direction ;
392 union __anonunion_ru_77 ru ;
393 };
394 #line 66 "/usr/include/rpc/svc.h"
395 enum xprt_stat {
396 XPRT_DIED = 0,
397 XPRT_MOREREQS = 1,
398 XPRT_IDLE = 2
399 } ;
400 #line 75
401 struct SVCXPRT;
402 #line 75 "/usr/include/rpc/svc.h"
403 typedef struct SVCXPRT SVCXPRT;
404 #line 76 "/usr/include/rpc/svc.h"
405 struct xp_ops {
406 bool_t (*xp_recv)(SVCXPRT *__xprt , struct rpc_msg *__msg ) ;
407 enum xprt_stat (*xp_stat)(SVCXPRT *__xprt ) ;
408 bool_t (*xp_getargs)(SVCXPRT *__xprt , bool_t (*__xdr_args)(XDR * , void * , ...) ,
409 caddr_t args_ptr ) ;
410 bool_t (*xp_reply)(SVCXPRT *__xprt , struct rpc_msg *__msg ) ;
411 bool_t (*xp_freeargs)(SVCXPRT *__xprt , bool_t (*__xdr_args)(XDR * , void * , ...) ,
412 caddr_t args_ptr ) ;
413 void (*xp_destroy)(SVCXPRT *__xprt ) ;
414 };
415 #line 76 "/usr/include/rpc/svc.h"
416 struct SVCXPRT {
417 int xp_sock ;
418 u_short xp_port ;
419 struct xp_ops const *xp_ops ;
420 int xp_addrlen ;
421 struct sockaddr_in xp_raddr ;
422 struct opaque_auth xp_verf ;
423 caddr_t xp_p1 ;
424 caddr_t xp_p2 ;
425 char xp_pad[256] ;
426 };
427 #line 149 "/usr/include/rpc/svc.h"
428 struct svc_req {
429 rpcprog_t rq_prog ;
430 rpcvers_t rq_vers ;
431 rpcproc_t rq_proc ;
432 struct opaque_auth rq_cred ;
433 caddr_t rq_clntcred ;
434 SVCXPRT *rq_xprt ;
435 };
436 #line 38 "ypbind.h"
437 typedef char *domainname;
438 #line 45
439 enum ypbind_resptype {
440 YPBIND_SUCC_VAL = 1,
441 YPBIND_FAIL_VAL = 2
442 } ;
443 #line 49 "ypbind.h"
444 typedef enum ypbind_resptype ypbind_resptype;
445 #line 51 "ypbind.h"
446 struct ypbind_binding {
447 char ypbind_binding_addr[4] ;
448 char ypbind_binding_port[2] ;
449 };
450 #line 55 "ypbind.h"
451 typedef struct ypbind_binding ypbind_binding;
452 #line 57 "ypbind.h"
453 union __anonunion_ypbind_resp_u_55 {
454 u_int ypbind_error ;
455 ypbind_binding ypbind_bindinfo ;
456 };
457 #line 57 "ypbind.h"
458 struct ypbind_resp {
459 ypbind_resptype ypbind_status ;
460 union __anonunion_ypbind_resp_u_55 ypbind_resp_u ;
461 };
462 #line 64 "ypbind.h"
463 typedef struct ypbind_resp ypbind_resp;
464 #line 75 "ypbind.h"
465 struct ypbind_oldsetdom {
466 char ypoldsetdom_domain[256] ;
467 ypbind_binding ypoldsetdom_binding ;
468 };
469 #line 79 "ypbind.h"
470 typedef struct ypbind_oldsetdom ypbind_oldsetdom;
471 #line 83 "ypbind.h"
472 struct ypbind_setdom {
473 domainname ypsetdom_domain ;
474 ypbind_binding ypsetdom_binding ;
475 u_int ypsetdom_vers ;
476 };
477 #line 88 "ypbind.h"
478 typedef struct ypbind_setdom ypbind_setdom;
479 #line 26 "ypbind_svc.c"
480 union __anonunion_argument_57 {
481 domainname ypbindproc_olddomain_1_arg ;
482 ypbind_oldsetdom ypbindproc_oldsetdom_1_arg ;
483 };
484 #line 32 "ypbind_svc.c"
485 union __anonunion_result_58 {
486 ypbind_resp ypbindproc_olddomain_1_res ;
487 };
488 #line 91 "ypbind_svc.c"
489 union __anonunion_argument_59 {
490 domainname ypbindproc_domain_2_arg ;
491 ypbind_setdom ypbindproc_setdom_2_arg ;
492 };
493 #line 97 "ypbind_svc.c"
494 union __anonunion_result_60 {
495 ypbind_resp ypbindproc_domain_2_res ;
496 };
497 #line 43 "/usr/lib/gcc/i486-linux-gnu/4.1.3/include/stdarg.h"
498 typedef __builtin_va_list __gnuc_va_list;
499 #line 105 "/usr/lib/gcc/i486-linux-gnu/4.1.3/include/stdarg.h"
500 typedef __gnuc_va_list va_list;
501 #line 154 "/usr/include/bits/types.h"
502 typedef long __suseconds_t;
503 #line 77 "/usr/include/time.h"
504 typedef __time_t time_t;
505 #line 203 "/usr/include/sys/types.h"
506 typedef unsigned int u_int32_t;
507 #line 69 "/usr/include/bits/time.h"
508 struct timeval {
509 __time_t tv_sec ;
510 __suseconds_t tv_usec ;
511 };
512 #line 44 "/usr/include/bits/uio.h"
513 struct iovec {
514 void *iov_base ;
515 size_t iov_len ;
516 };
517 #line 96 "/usr/include/netdb.h"
518 struct hostent {
519 char *h_name ;
520 char **h_aliases ;
521 int h_addrtype ;
522 int h_length ;
523 char **h_addr_list ;
524 };
525 #line 72 "/usr/include/rpc/auth.h"
526 struct __anonstruct_key_46 {
527 u_int32_t high ;
528 u_int32_t low ;
529 };
530 #line 72 "/usr/include/rpc/auth.h"
531 union des_block {
532 struct __anonstruct_key_46 key ;
533 char c[8] ;
534 };
535 #line 94
536 struct AUTH;
537 #line 94 "/usr/include/rpc/auth.h"
538 typedef struct AUTH AUTH;
539 #line 95 "/usr/include/rpc/auth.h"
540 struct auth_ops {
541 void (*ah_nextverf)(AUTH * ) ;
542 int (*ah_marshal)(AUTH * , XDR * ) ;
543 int (*ah_validate)(AUTH * , struct opaque_auth * ) ;
544 int (*ah_refresh)(AUTH * ) ;
545 void (*ah_destroy)(AUTH * ) ;
546 };
547 #line 95 "/usr/include/rpc/auth.h"
548 struct AUTH {
549 struct opaque_auth ah_cred ;
550 struct opaque_auth ah_verf ;
551 union des_block ah_key ;
552 struct auth_ops *ah_ops ;
553 caddr_t ah_private ;
554 };
555 #line 53 "/usr/include/rpc/clnt.h"
556 enum clnt_stat {
557 RPC_SUCCESS = 0,
558 RPC_CANTENCODEARGS = 1,
559 RPC_CANTDECODERES = 2,
560 RPC_CANTSEND = 3,
561 RPC_CANTRECV = 4,
562 RPC_TIMEDOUT = 5,
563 RPC_VERSMISMATCH = 6,
564 RPC_AUTHERROR = 7,
565 RPC_PROGUNAVAIL = 8,
566 RPC_PROGVERSMISMATCH = 9,
567 RPC_PROCUNAVAIL = 10,
568 RPC_CANTDECODEARGS = 11,
569 RPC_SYSTEMERROR = 12,
570 RPC_NOBROADCAST = 21,
571 RPC_UNKNOWNHOST = 13,
572 RPC_UNKNOWNPROTO = 17,
573 RPC_UNKNOWNADDR = 19,
574 RPC_RPCBFAILURE = 14,
575 RPC_PROGNOTREGISTERED = 15,
576 RPC_N2AXLATEFAILURE = 22,
577 RPC_FAILED = 16,
578 RPC_INTR = 18,
579 RPC_TLIERROR = 20,
580 RPC_UDERROR = 23,
581 RPC_INPROGRESS = 24,
582 RPC_STALERACHANDLE = 25
583 } ;
584 #line 106 "/usr/include/rpc/clnt.h"
585 struct __anonstruct_RE_vers_48 {
586 u_long low ;
587 u_long high ;
588 };
589 #line 106 "/usr/include/rpc/clnt.h"
590 struct __anonstruct_RE_lb_49 {
591 long s1 ;
592 long s2 ;
593 };
594 #line 106 "/usr/include/rpc/clnt.h"
595 union __anonunion_ru_47 {
596 int RE_errno ;
597 enum auth_stat RE_why ;
598 struct __anonstruct_RE_vers_48 RE_vers ;
599 struct __anonstruct_RE_lb_49 RE_lb ;
600 };
601 #line 106 "/usr/include/rpc/clnt.h"
602 struct rpc_err {
603 enum clnt_stat re_status ;
604 union __anonunion_ru_47 ru ;
605 };
606 #line 132
607 struct CLIENT;
608 #line 132 "/usr/include/rpc/clnt.h"
609 typedef struct CLIENT CLIENT;
610 #line 133 "/usr/include/rpc/clnt.h"
611 struct clnt_ops {
612 enum clnt_stat (*cl_call)(CLIENT * , u_long , bool_t (*)(XDR * , void * , ...) ,
613 caddr_t , bool_t (*)(XDR * , void * , ...) , caddr_t ,
614 struct timeval ) ;
615 void (*cl_abort)(void) ;
616 void (*cl_geterr)(CLIENT * , struct rpc_err * ) ;
617 bool_t (*cl_freeres)(CLIENT * , bool_t (*)(XDR * , void * , ...) , caddr_t ) ;
618 void (*cl_destroy)(CLIENT * ) ;
619 bool_t (*cl_control)(CLIENT * , int , char * ) ;
620 };
621 #line 133 "/usr/include/rpc/clnt.h"
622 struct CLIENT {
623 AUTH *cl_auth ;
624 struct clnt_ops *cl_ops ;
625 caddr_t cl_private ;
626 };
627 #line 390 "/usr/include/rpc/clnt.h"
628 struct rpc_createerr {
629 enum clnt_stat cf_stat ;
630 struct rpc_err cf_error ;
631 };
632 #line 90 "/usr/include/rpc/pmap_prot.h"
633 struct pmap {
634 unsigned long pm_prog ;
635 unsigned long pm_vers ;
636 unsigned long pm_prot ;
637 unsigned long pm_port ;
638 };
639 #line 27 "pthread_np.h"
640 struct __anonstruct_pthread_rdwr_t_72 {
641 int readers ;
642 int writers ;
643 int wishwrite ;
644 pthread_mutex_t mutex ;
645 pthread_cond_t lock_free ;
646 };
647 #line 27 "pthread_np.h"
648 typedef struct __anonstruct_pthread_rdwr_t_72 pthread_rdwr_t;
649 #line 66 "serv_list.c"
650 struct bound_server {
651 char *host ;
652 sa_family_t family ;
653 struct in_addr addr ;
654 u_short port ;
655 };
656 #line 74 "serv_list.c"
657 struct binding {
658 char domain[257] ;
659 int active ;
660 bool_t use_broadcast ;
661 struct bound_server server[30] ;
662 struct bound_server ypset ;
663 CLIENT *client_handle ;
664 };
665 #line 717 "serv_list.c"
666 struct cu_data {
667 int cu_sock ;
668 bool_t cu_closeit ;
669 struct sockaddr_in cu_raddr ;
670 int cu_rlen ;
671 struct timeval cu_wait ;
672 struct timeval cu_total ;
673 struct rpc_err cu_error ;
674 XDR cu_outxdrs ;
675 u_int cu_xdrpos ;
676 u_int cu_sendsz ;
677 char *cu_outbuf ;
678 u_int cu_recvsz ;
679 char cu_inbuf[1] ;
680 };
681 #line 735 "serv_list.c"
682 struct findserv_req {
683 u_int32_t xid ;
684 u_int server_nr ;
685 struct sockaddr_in sin ;
686 };
687 #line 75 "/usr/include/bits/pthreadtypes.h"
688 union __anonunion_pthread_mutexattr_t_7 {
689 char __size[4] ;
690 long __align ;
691 };
692 #line 75 "/usr/include/bits/pthreadtypes.h"
693 typedef union __anonunion_pthread_mutexattr_t_7 pthread_mutexattr_t;
694 #line 101 "/usr/include/bits/pthreadtypes.h"
695 union __anonunion_pthread_condattr_t_10 {
696 char __size[4] ;
697 long __align ;
698 };
699 #line 101 "/usr/include/bits/pthreadtypes.h"
700 typedef union __anonunion_pthread_condattr_t_10 pthread_condattr_t;
701 #line 1 "ypbind-mt.o"
702 #pragma merger(0,"/tmp/cil-6VCeiQK5.i","-Wall,-g,-O2")
703 #line 100 "/usr/include/sys/socket.h"
704 extern __attribute__((__nothrow__)) int socket(int __domain , int __type , int __protocol ) ;
705 #line 110
706 extern __attribute__((__nothrow__)) int bind(int __fd , struct sockaddr const * __restrict __addr ,
707 socklen_t __len ) ;
708 #line 309 "/usr/include/sys/stat.h"
709 extern __attribute__((__nothrow__)) __mode_t umask(__mode_t __mask ) ;
710 #line 318
711 extern __attribute__((__nothrow__)) int mkdir(char const *__path , __mode_t __mode ) __attribute__((__nonnull__(1))) ;
712 #line 399
713 extern __attribute__((__nothrow__)) int __xstat(int __ver , char const *__filename ,
714 struct stat *__stat_buf ) __attribute__((__nonnull__(2,3))) ;
715
716 #line 450 "/usr/include/sys/stat.h"
717 __inline static int stat__extinline(char const *__path , struct stat *__statbuf )
718 { int tmp ;
719
720 {
721 #line 453
722 tmp = __xstat(3, __path, __statbuf);
723 #line 453
724 return (tmp);
725 }
726 }
727 #line 135 "/usr/include/dirent.h"
728 extern DIR *opendir(char const *__name ) __attribute__((__nonnull__(1))) ;
729 #line 150
730 extern int closedir(DIR *__dirp ) __attribute__((__nonnull__(1))) ;
731 #line 163
732 extern struct dirent *readdir(DIR *__dirp ) __attribute__((__nonnull__(1))) ;
733 #line 146 "/usr/include/stdio.h"
734 extern struct _IO_FILE *stdout ;
735 #line 147
736 extern struct _IO_FILE *stderr ;
737 #line 214
738 extern int fclose(FILE *__stream ) ;
739 #line 249
740 extern FILE *fopen(char const * __restrict __filename , char const * __restrict __modes ) ;
741 #line 331
742 extern int fprintf(FILE * __restrict __stream , char const * __restrict __format
743 , ...) ;
744 #line 337
745 extern int printf(char const * __restrict __format , ...) ;
746 #line 339
747 extern __attribute__((__nothrow__)) int sprintf(char * __restrict __s , char const * __restrict __format
748 , ...) ;
749 #line 361
750 extern __attribute__((__nothrow__)) int ( /* format attribute */ snprintf)(char * __restrict __s ,
751 size_t __maxlen ,
752 char const * __restrict __format
753 , ...) ;
754 #line 411
755 extern __attribute__((__nothrow__)) int sscanf(char const * __restrict __s , char const * __restrict __format
756 , ...) ;
757 #line 570
758 extern __ssize_t __getdelim(char ** __restrict __lineptr , size_t * __restrict __n ,
759 int __delimiter , FILE * __restrict __stream ) ;
760 #line 594
761 extern int fputs(char const * __restrict __s , FILE * __restrict __stream ) ;
762 #line 733
763 extern __attribute__((__nothrow__)) int feof(FILE *__stream ) ;
764 #line 111 "/usr/include/bits/stdio.h"
765 __inline static __ssize_t getline__extinline(char **__lineptr , size_t *__n , FILE *__stream )
766 { __ssize_t tmp ;
767
768 {
769 #line 114
770 tmp = __getdelim((char ** __restrict )__lineptr, (size_t * __restrict )__n, '\n',
771 (FILE * __restrict )__stream);
772 #line 114
773 return (tmp);
774 }
775 }
776 #line 81 "/usr/include/ctype.h"
777 extern unsigned short const **__ctype_b_loc(void) __attribute__((__const__)) ;
778 #line 76 "/usr/include/fcntl.h"
779 extern int fcntl(int __fd , int __cmd , ...) ;
780 #line 85
781 extern int open(char const *__file , int __oflag , ...) __attribute__((__nonnull__(1))) ;
782 #line 43 "/usr/include/bits/errno.h"
783 extern __attribute__((__nothrow__)) int *__errno_location(void) __attribute__((__const__)) ;
784 #line 290 "/usr/include/stdlib.h"
785 extern __attribute__((__nothrow__)) long __strtol_internal(char const * __restrict __nptr ,
786 char ** __restrict __endptr ,
787 int __base , int __group ) __attribute__((__nonnull__(1))) ;
788 #line 332 "/usr/include/stdlib.h"
789 __inline static long strtol__extinline(char const * __restrict __nptr , char ** __restrict __endptr ,
790 int __base )
791 { long tmp ;
792
793 {
794 #line 336
795 tmp = __strtol_internal(__nptr, __endptr, __base, 0);
796 #line 336
797 return (tmp);
798 }
799 }
800 #line 401 "/usr/include/stdlib.h"
801 __inline static int atoi__extinline(char const *__nptr )
802 { int tmp ;
803
804 {
805 #line 404
806 tmp = (int )strtol__extinline((char const * __restrict )__nptr, (char ** __restrict )((char **)((void *)0)),
807 10);
808 #line 404
809 return (tmp);
810 }
811 }
812 #line 603
813 extern __attribute__((__nothrow__)) void free(void *__ptr ) ;
814 #line 646
815 extern __attribute__((__nothrow__, __noreturn__)) void exit(int __status ) ;
816 #line 320 "/usr/include/unistd.h"
817 extern int close(int __fd ) ;
818 #line 333
819 extern ssize_t write(int __fd , void const *__buf , size_t __n ) ;
820 #line 457
821 extern __attribute__((__nothrow__)) int chdir(char const *__path ) __attribute__((__nonnull__(1))) ;
822 #line 490
823 extern __attribute__((__nothrow__)) int dup(int __fd ) ;
824 #line 573
825 extern __attribute__((__nothrow__)) __pid_t getpid(void) ;
826 #line 634
827 extern __attribute__((__nothrow__)) __pid_t setsid(void) ;
828 #line 642
829 extern __attribute__((__nothrow__)) __uid_t getuid(void) ;
830 #line 723
831 extern __attribute__((__nothrow__)) __pid_t fork(void) ;
832 #line 792
833 extern __attribute__((__nothrow__)) int unlink(char const *__name ) __attribute__((__nonnull__(1))) ;
834 #line 943
835 extern __attribute__((__nothrow__)) int getdtablesize(void) ;
836 #line 181 "/usr/include/sys/syslog.h"
837 extern void openlog(char const *__ident , int __option , int __facility ) ;
838 #line 59 "/usr/include/string.h"
839 extern __attribute__((__nothrow__)) void *memset(void *__s , int __c , size_t __n ) __attribute__((__nonnull__(1))) ;
840 #line 102
841 extern __attribute__((__nothrow__)) int strncmp(char const *__s1 , char const *__s2 ,
842 size_t __n ) __attribute__((__pure__,
843 __nonnull__(1,2))) ;
844 #line 194
845 extern __attribute__((__nothrow__)) char *strstr(char const *__haystack , char const *__needle ) __attribute__((__pure__,
846 __nonnull__(1,2))) ;
847 #line 242
848 extern __attribute__((__nothrow__)) size_t strlen(char const *__s ) __attribute__((__pure__,
849 __nonnull__(1))) ;
850 #line 256
851 extern __attribute__((__nothrow__)) char *strerror(int __errnum ) ;
852 #line 216 "/usr/include/signal.h"
853 extern __attribute__((__nothrow__)) int sigemptyset(sigset_t *__set ) __attribute__((__nonnull__(1))) ;
854 #line 222
855 extern __attribute__((__nothrow__)) int sigaddset(sigset_t *__set , int __signo ) __attribute__((__nonnull__(1))) ;
856 #line 271
857 extern int sigwait(sigset_t const * __restrict __set , int * __restrict __sig ) __attribute__((__nonnull__(1,2))) ;
858 #line 31 "/usr/include/bits/sigthread.h"
859 extern __attribute__((__nothrow__)) int pthread_sigmask(int __how , __sigset_t const * __restrict __newmask ,
860 __sigset_t * __restrict __oldmask ) ;
861 #line 125 "/usr/include/locale.h"
862 extern __attribute__((__nothrow__)) char *setlocale(int __category , char const *__locale ) ;
863 #line 52 "/usr/include/libintl.h"
864 extern __attribute__((__nothrow__)) char *dcgettext(char const *__domainname ,
865 char const *__msgid , int __category ) __attribute__((__format_arg__(2))) ;
866 #line 83
867 extern __attribute__((__nothrow__)) char *textdomain(char const *__domainname ) ;
868 #line 87
869 extern __attribute__((__nothrow__)) char *bindtextdomain(char const *__domainname ,
870 char const *__dirname ) ;
871 #line 173 "/usr/include/rpc/svc.h"
872 extern __attribute__((__nothrow__)) bool_t svc_register(SVCXPRT *__xprt , rpcprog_t __prog ,
873 rpcvers_t __vers , void (*__dispatch)(struct svc_req * ,
874 SVCXPRT * ) ,
875 rpcprot_t __protocol ) ;
876 #line 277
877 extern __attribute__((__nothrow__)) void svc_run(void) ;
878 #line 296
879 extern __attribute__((__nothrow__)) SVCXPRT *svcudp_create(int __sock ) ;
880 #line 303
881 extern __attribute__((__nothrow__)) SVCXPRT *svctcp_create(int __sock , u_int __sendsize ,
882 u_int __recvsize ) ;
883 #line 64 "/usr/include/rpcsvc/ypclnt.h"
884 extern __attribute__((__nothrow__)) int yp_get_default_domain(char ** ) ;
885 #line 74 "/usr/include/rpc/pmap_clnt.h"
886 extern __attribute__((__nothrow__)) bool_t pmap_unset(u_long __program , u_long __vers ) ;
887 #line 222 "/usr/include/pthread.h"
888 extern __attribute__((__nothrow__)) int pthread_create(pthread_t * __restrict __newthread ,
889 pthread_attr_t const * __restrict __attr ,
890 void *(*__start_routine)(void * ) ,
891 void * __restrict __arg ) __attribute__((__nonnull__(1,3))) ;
892 #line 729
893 extern __attribute__((__nothrow__)) int pthread_mutex_lock(pthread_mutex_t *__mutex ) __attribute__((__nonnull__(1))) ;
894 #line 740
895 extern __attribute__((__nothrow__)) int pthread_mutex_unlock(pthread_mutex_t *__mutex ) __attribute__((__nonnull__(1))) ;
896 #line 936
897 extern __attribute__((__nothrow__)) int pthread_cond_broadcast(pthread_cond_t *__cond ) __attribute__((__nonnull__(1))) ;
898 #line 944
899 extern int pthread_cond_wait(pthread_cond_t * __restrict __cond , pthread_mutex_t * __restrict __mutex ) __attribute__((__nonnull__(1,2))) ;
900 #line 47 "/usr/include/nss.h"
901 extern __attribute__((__nothrow__)) int __nss_configure_lookup(char const *__dbname ,
902 char const *__string ) ;
903 #line 36 "ypbind.h"
904 int ypset ;
905 #line 6 "log_msg.h"
906 int debug_flag ;
907 #line 8
908 void log_msg(int type , char const *fmt , ...) ;
909 #line 6 "local.h"
910 int broken_server ;
911 #line 7
912 int port ;
913 #line 8
914 int ping_interval ;
915 #line 11
916 void clear_server(void) ;
917 #line 12
918 int add_server(char const *domain___0 , char const *host , int check_syntax ) ;
919 #line 18
920 void *test_bindings(void *param __attribute__((__unused__)) ) ;
921 #line 21
922 void do_binding(void) ;
923 #line 23
924 void ypbindprog_1(struct svc_req *rqstp , SVCXPRT *transp ) ;
925 #line 24
926 void ypbindprog_2(struct svc_req *rqstp , SVCXPRT *transp ) ;
927 #line 69 "ypbind-mt.c"
928 char *domain = (char *)((void *)0);
929 #line 70 "ypbind-mt.c"
930 char const *configfile = "/etc/yp.conf";
931 #line 71 "ypbind-mt.c"
932 int ypset = 0;
933 #line 72 "ypbind-mt.c"
934 int use_broadcast = 0;
935 #line 73 "ypbind-mt.c"
936 int broken_server = 0;
937 #line 74 "ypbind-mt.c"
938 int ping_interval = 20;
939 #line 75 "ypbind-mt.c"
940 int local_only = 0;
941 #line 76 "ypbind-mt.c"
942 int port = -1;
943 #line 77 "ypbind-mt.c"
944 static int lock_fd ;
945 #line 78 "ypbind-mt.c"
946 static int pid_is_written = 0;
947 #line 79 "ypbind-mt.c"
948 static union __anonunion_pthread_mutex_t_5 mutex_pid = {{0, 0U, 0, 0, 0U, {0}}};
949 #line 80 "ypbind-mt.c"
950 static union __anonunion_pthread_cond_t_8 cond_pid = {{0, 0U, 0ULL, 0ULL, 0ULL, (void *)0, 0U, 0U}};
951 #line 82 "ypbind-mt.c"
952 static void unlink_bindingdir(void)
953 { DIR *dird ;
954 char path[4096] ;
955 struct dirent *dirp ;
956 size_t __s1_len ;
957 size_t __s2_len ;
958 int tmp___4 ;
959 int tmp___7 ;
960 int tmp___8 ;
961 size_t __s1_len___0 ;
962 size_t __s2_len___0 ;
963 int tmp___14 ;
964 int tmp___17 ;
965 int tmp___18 ;
966
967 {
968 #line 90
969 dird = opendir("/var/yp/binding");
970 #line 90
971 if ((unsigned int )dird != (unsigned int )((void *)0)) {
972 #line 92
973 while (1) {
974 #line 92
975 dirp = readdir(dird);
976 #line 92
977 if (! ((unsigned int )dirp != (unsigned int )((void *)0))) {
978 #line 92
979 break;
980 }
981 #line 93
982 if (0) {
983 #line 93
984 __s1_len = strlen((char const *)(dirp->d_name));
985 #line 93
986 __s2_len = strlen(".");
987 #line 93
988 if (! ((unsigned int )((void const *)(dirp->d_name + 1)) - (unsigned int )((void const *)(dirp->d_name)) == 1U)) {
989 goto _L___0;
990 } else {
991 #line 93
992 if (__s1_len >= 4U) {
993 _L___0: /* CIL Label */
994 #line 93
995 if (! ((unsigned int )((void const *)("." + 1)) - (unsigned int )((void const *)".") == 1U)) {
996 #line 93
997 tmp___8 = 1;
998 } else {
999 #line 93
1000 if (__s2_len >= 4U) {
1001 #line 93
1002 tmp___8 = 1;
1003 } else {
1004 #line 93
1005 tmp___8 = 0;
1006 }
1007 }
1008 } else {
1009 #line 93
1010 tmp___8 = 0;
1011 }
1012 }
1013 #line 93
1014 if (tmp___8) {
1015 #line 93
1016 tmp___4 = __builtin_strcmp((char const *)(dirp->d_name), ".");
1017 } else {
1018 #line 93
1019 tmp___7 = __builtin_strcmp((char const *)(dirp->d_name), ".");
1020 #line 93
1021 tmp___4 = tmp___7;
1022 }
1023 } else {
1024 #line 93
1025 tmp___7 = __builtin_strcmp((char const *)(dirp->d_name), ".");
1026 #line 93
1027 tmp___4 = tmp___7;
1028 }
1029 #line 94
1030 if (tmp___4) {
1031 #line 94
1032 if (0) {
1033 #line 94
1034 __s1_len___0 = strlen((char const *)(dirp->d_name));
1035 #line 94
1036 __s2_len___0 = strlen("..");
1037 #line 94
1038 if (! ((unsigned int )((void const *)(dirp->d_name + 1)) - (unsigned int )((void const *)(dirp->d_name)) == 1U)) {
1039 goto _L___2;
1040 } else {
1041 #line 94
1042 if (__s1_len___0 >= 4U) {
1043 _L___2: /* CIL Label */
1044 #line 94
1045 if (! ((unsigned int )((void const *)(".." + 1)) - (unsigned int )((void const *)"..") == 1U)) {
1046 #line 94
1047 tmp___18 = 1;
1048 } else {
1049 #line 94
1050 if (__s2_len___0 >= 4U) {
1051 #line 94
1052 tmp___18 = 1;
1053 } else {
1054 #line 94
1055 tmp___18 = 0;
1056 }
1057 }
1058 } else {
1059 #line 94
1060 tmp___18 = 0;
1061 }
1062 }
1063 #line 94
1064 if (tmp___18) {
1065 #line 94
1066 tmp___14 = __builtin_strcmp((char const *)(dirp->d_name), "..");
1067 } else {
1068 #line 94
1069 tmp___17 = __builtin_strcmp((char const *)(dirp->d_name), "..");
1070 #line 94
1071 tmp___14 = tmp___17;
1072 }
1073 } else {
1074 #line 94
1075 tmp___17 = __builtin_strcmp((char const *)(dirp->d_name), "..");
1076 #line 94
1077 tmp___14 = tmp___17;
1078 }
1079 #line 94
1080 if (tmp___14) {
1081 #line 96
1082 snprintf((char * __restrict )(path), 4096U, (char const * __restrict )"%s/%s",
1083 "/var/yp/binding", dirp->d_name);
1084 #line 97
1085 unlink((char const *)(path));
1086 }
1087 }
1088 }
1089 #line 99
1090 closedir(dird);
1091 }
1092 #line 101
1093 return;
1094 }
1095 }
1096 #line 104 "ypbind-mt.c"
1097 static int load_config(int check_syntax )
1098 { FILE *fp ;
1099 char *buf ;
1100 size_t buflen ;
1101 int have_entries ;
1102 int bad_entries ;
1103 char tmpserver[81] ;
1104 char tmpdomain[257] ;
1105 int count ;
1106 char *tmp ;
1107 char *cp ;
1108 ssize_t n ;
1109 ssize_t tmp___0 ;
1110 char *tmp___2 ;
1111 unsigned short const **tmp___3 ;
1112 size_t tmp___4 ;
1113 size_t tmp___5 ;
1114 char *tmp___6 ;
1115 char *tmp___7 ;
1116 char *tmp___8 ;
1117 int tmp___9 ;
1118 char *tmp___10 ;
1119 char *tmp___11 ;
1120 int tmp___12 ;
1121 char *tmp___13 ;
1122 char *tmp___14 ;
1123 int tmp___15 ;
1124 char *tmp___16 ;
1125 int tmp___17 ;
1126 int tmp___31 ;
1127 size_t __s1_len___0 ;
1128 size_t __s2_len___0 ;
1129 int tmp___37 ;
1130 int tmp___40 ;
1131 int tmp___41 ;
1132 unsigned short const **tmp___44 ;
1133 int tmp___58 ;
1134 size_t __s1_len___2 ;
1135 size_t __s2_len___2 ;
1136 int tmp___64 ;
1137 int tmp___67 ;
1138 int tmp___68 ;
1139 unsigned short const **tmp___71 ;
1140 int tmp___85 ;
1141 size_t __s1_len___4 ;
1142 size_t __s2_len___4 ;
1143 int tmp___91 ;
1144 int tmp___94 ;
1145 int tmp___95 ;
1146 unsigned short const **tmp___98 ;
1147 char *tmp___99 ;
1148 char *tmp___100 ;
1149 int tmp___101 ;
1150 char *tmp___102 ;
1151 char *tmp___103 ;
1152 char *tmp___104 ;
1153
1154 {
1155 #line 108
1156 buf = (char *)((void *)0);
1157 #line 109
1158 buflen = (size_t )0;
1159 #line 110
1160 have_entries = 0;
1161 #line 111
1162 bad_entries = 0;
1163 #line 113
1164 fp = fopen((char const * __restrict )configfile, (char const * __restrict )"r");
1165 #line 114
1166 if ((unsigned int )((void *)0) == (unsigned int )fp) {
1167 #line 115
1168 return (1);
1169 }
1170 #line 117
1171 if (debug_flag) {
1172 #line 118
1173 log_msg(7, "parsing config file");
1174 }
1175 #line 120
1176 while (1) {
1177 #line 120
1178 tmp___101 = feof(fp);
1179 #line 120
1180 if (tmp___101) {
1181 #line 120
1182 break;
1183 }
1184 #line 126
1185 tmp___0 = getline__extinline(& buf, & buflen, fp);
1186 #line 126
1187 n = tmp___0;
1188 #line 144
1189 cp = buf;
1190 #line 146
1191 if (n < 1) {
1192 #line 147
1193 break;
1194 }
1195 #line 149
1196 tmp___2 = __builtin_strchr(cp, (char )'#');
1197 #line 149
1198 tmp = tmp___2;
1199 #line 150
1200 if (tmp) {
1201 #line 151
1202 (*tmp) = (char )'\000';
1203 }
1204 #line 152
1205 while (1) {
1206 #line 152
1207 tmp___3 = __ctype_b_loc();
1208 #line 152
1209 if (! ((int const )(*((*tmp___3) + (int )(*cp))) & 8192)) {
1210 #line 152
1211 break;
1212 }
1213 #line 153
1214 cp ++;
1215 }
1216 #line 154
1217 if ((int )(*cp) == 0) {
1218 #line 155
1219 continue;
1220 }
1221 #line 157
1222 tmp___5 = strlen((char const *)cp);
1223 #line 157
1224 if ((int )(*(cp + (tmp___5 - 1U))) == 10) {
1225 #line 158
1226 tmp___4 = strlen((char const *)cp);
1227 #line 158
1228 (*(cp + (tmp___4 - 1U))) = (char )'\000';
1229 }
1230 #line 160
1231 if (debug_flag) {
1232 #line 161
1233 tmp___6 = dcgettext((char const *)((void *)0), "Trying entry:", 5);
1234 #line 161
1235 log_msg(7, "%s %s", tmp___6, cp);
1236 }
1237 #line 163
1238 if (check_syntax) {
1239 #line 164
1240 tmp___7 = dcgettext((char const *)((void *)0), "Trying entry:", 5);
1241 #line 164
1242 printf((char const * __restrict )"%s %s\n", tmp___7, cp);
1243 }
1244 #line 166
1245 if (0) {
1246 #line 166
1247 if (0) {
1248 #line 166
1249 __s1_len___4 = strlen((char const *)cp);
1250 #line 166
1251 __s2_len___4 = strlen("domain");
1252 #line 166
1253 if (! ((unsigned int )((void const *)(cp + 1)) - (unsigned int )((void const *)cp) == 1U)) {
1254 goto _L___12;
1255 } else {
1256 #line 166
1257 if (__s1_len___4 >= 4U) {
1258 _L___12: /* CIL Label */
1259 #line 166
1260 if (! ((unsigned int )((void const *)("domain" + 1)) - (unsigned int )((void const *)"domain") == 1U)) {
1261 #line 166
1262 tmp___95 = 1;
1263 } else {
1264 #line 166
1265 if (__s2_len___4 >= 4U) {
1266 #line 166
1267 tmp___95 = 1;
1268 } else {
1269 #line 166
1270 tmp___95 = 0;
1271 }
1272 }
1273 } else {
1274 #line 166
1275 tmp___95 = 0;
1276 }
1277 }
1278 #line 166
1279 if (tmp___95) {
1280 #line 166
1281 tmp___91 = __builtin_strcmp((char const *)cp, "domain");
1282 } else {
1283 #line 166
1284 tmp___94 = __builtin_strcmp((char const *)cp, "domain");
1285 #line 166
1286 tmp___91 = tmp___94;
1287 }
1288 } else {
1289 #line 166
1290 tmp___94 = __builtin_strcmp((char const *)cp, "domain");
1291 #line 166
1292 tmp___91 = tmp___94;
1293 }
1294 #line 166
1295 tmp___85 = tmp___91;
1296 } else {
1297 #line 166
1298 tmp___85 = strncmp((char const *)cp, "domain", 6U);
1299 }
1300 #line 166
1301 if (tmp___85 == 0) {
1302 #line 166
1303 tmp___98 = __ctype_b_loc();
1304 #line 166
1305 if ((int const )(*((*tmp___98) + (int )(*(cp + 6)))) & 8192) {
1306 #line 176
1307 tmp___10 = strstr((char const *)cp, "server");
1308 #line 176
1309 if ((unsigned int )tmp___10 != (unsigned int )((void *)0)) {
1310 #line 178
1311 count = sscanf((char const * __restrict )cp, (char const * __restrict )"domain %64s server %80s",
1312 tmpdomain, tmpserver);
1313 #line 180
1314 if (count == 2) {
1315 #line 182
1316 if (debug_flag) {
1317 #line 183
1318 tmp___8 = dcgettext((char const *)((void *)0), "parsed domain \'%s\' server \'%s\'",
1319 5);
1320 #line 183
1321 log_msg(7, (char const *)tmp___8, tmpdomain, tmpserver);
1322 }
1323 #line 185
1324 tmp___9 = add_server((char const *)(tmpdomain), (char const *)(tmpserver),
1325 check_syntax);
1326 #line 185
1327 if (tmp___9) {
1328 #line 186
1329 have_entries ++;
1330 } else {
1331 #line 188
1332 bad_entries ++;
1333 }
1334 #line 190
1335 continue;
1336 }
1337 }
1338 #line 193
1339 tmp___13 = strstr((char const *)cp, "broadcast");
1340 #line 193
1341 if ((unsigned int )tmp___13 != (unsigned int )((void *)0)) {
1342 #line 195
1343 count = sscanf((char const * __restrict )cp, (char const * __restrict )"domain %s broadcast",
1344 tmpdomain);
1345 #line 196
1346 if (count == 1) {
1347 #line 198
1348 if (debug_flag) {
1349 #line 199
1350 tmp___11 = dcgettext((char const *)((void *)0), "parsed domain \'%s\' broadcast",
1351 5);
1352 #line 199
1353 log_msg(7, (char const *)tmp___11, tmpdomain);
1354 }
1355 #line 201
1356 tmp___12 = add_server((char const *)(tmpdomain), (char const *)((void *)0),
1357 check_syntax);
1358 #line 201
1359 if (tmp___12) {
1360 #line 202
1361 have_entries ++;
1362 } else {
1363 #line 204
1364 bad_entries ++;
1365 }
1366 #line 206
1367 continue;
1368 }
1369 }
1370 } else {
1371 goto _L___13;
1372 }
1373 } else {
1374 _L___13: /* CIL Label */
1375 #line 232
1376 if (0) {
1377 #line 232
1378 if (0) {
1379 #line 232
1380 __s1_len___2 = strlen((char const *)cp);
1381 #line 232
1382 __s2_len___2 = strlen("ypserver");
1383 #line 232
1384 if (! ((unsigned int )((void const *)(cp + 1)) - (unsigned int )((void const *)cp) == 1U)) {
1385 goto _L___7;
1386 } else {
1387 #line 232
1388 if (__s1_len___2 >= 4U) {
1389 _L___7: /* CIL Label */
1390 #line 232
1391 if (! ((unsigned int )((void const *)("ypserver" + 1)) - (unsigned int )((void const *)"ypserver") == 1U)) {
1392 #line 232
1393 tmp___68 = 1;
1394 } else {
1395 #line 232
1396 if (__s2_len___2 >= 4U) {
1397 #line 232
1398 tmp___68 = 1;
1399 } else {
1400 #line 232
1401 tmp___68 = 0;
1402 }
1403 }
1404 } else {
1405 #line 232
1406 tmp___68 = 0;
1407 }
1408 }
1409 #line 232
1410 if (tmp___68) {
1411 #line 232
1412 tmp___64 = __builtin_strcmp((char const *)cp, "ypserver");
1413 } else {
1414 #line 232
1415 tmp___67 = __builtin_strcmp((char const *)cp, "ypserver");
1416 #line 232
1417 tmp___64 = tmp___67;
1418 }
1419 } else {
1420 #line 232
1421 tmp___67 = __builtin_strcmp((char const *)cp, "ypserver");
1422 #line 232
1423 tmp___64 = tmp___67;
1424 }
1425 #line 232
1426 tmp___58 = tmp___64;
1427 } else {
1428 #line 232
1429 tmp___58 = strncmp((char const *)cp, "ypserver", 8U);
1430 }
1431 #line 232
1432 if (tmp___58 == 0) {
1433 #line 232
1434 tmp___71 = __ctype_b_loc();
1435 #line 232
1436 if ((int const )(*((*tmp___71) + (int )(*(cp + 8)))) & 8192) {
1437 #line 237
1438 count = sscanf((char const * __restrict )cp, (char const * __restrict )"ypserver %80s",
1439 tmpserver);
1440 #line 238
1441 if (count == 1) {
1442 #line 240
1443 if (debug_flag) {
1444 #line 241
1445 tmp___14 = dcgettext((char const *)((void *)0), "parsed ypserver %s",
1446 5);
1447 #line 241
1448 log_msg(7, (char const *)tmp___14, tmpserver);
1449 }
1450 #line 242
1451 tmp___15 = add_server((char const *)domain, (char const *)(tmpserver),
1452 check_syntax);
1453 #line 242
1454 if (tmp___15) {
1455 #line 243
1456 have_entries ++;
1457 } else {
1458 #line 245
1459 bad_entries ++;
1460 }
1461 #line 246
1462 continue;
1463 }
1464 } else {
1465 goto _L___8;
1466 }
1467 } else {
1468 _L___8: /* CIL Label */
1469 #line 249
1470 if (0) {
1471 #line 249
1472 if (0) {
1473 #line 249
1474 __s1_len___0 = strlen((char const *)cp);
1475 #line 249
1476 __s2_len___0 = strlen("broadcast");
1477 #line 249
1478 if (! ((unsigned int )((void const *)(cp + 1)) - (unsigned int )((void const *)cp) == 1U)) {
1479 goto _L___2;
1480 } else {
1481 #line 249
1482 if (__s1_len___0 >= 4U) {
1483 _L___2: /* CIL Label */
1484 #line 249
1485 if (! ((unsigned int )((void const *)("broadcast" + 1)) - (unsigned int )((void const *)"broadcast") == 1U)) {
1486 #line 249
1487 tmp___41 = 1;
1488 } else {
1489 #line 249
1490 if (__s2_len___0 >= 4U) {
1491 #line 249
1492 tmp___41 = 1;
1493 } else {
1494 #line 249
1495 tmp___41 = 0;
1496 }
1497 }
1498 } else {
1499 #line 249
1500 tmp___41 = 0;
1501 }
1502 }
1503 #line 249
1504 if (tmp___41) {
1505 #line 249
1506 tmp___37 = __builtin_strcmp((char const *)cp, "broadcast");
1507 } else {
1508 #line 249
1509 tmp___40 = __builtin_strcmp((char const *)cp, "broadcast");
1510 #line 249
1511 tmp___37 = tmp___40;
1512 }
1513 } else {
1514 #line 249
1515 tmp___40 = __builtin_strcmp((char const *)cp, "broadcast");
1516 #line 249
1517 tmp___37 = tmp___40;
1518 }
1519 #line 249
1520 tmp___31 = tmp___37;
1521 } else {
1522 #line 249
1523 tmp___31 = strncmp((char const *)cp, "broadcast", 9U);
1524 }
1525 #line 249
1526 if (tmp___31 == 0) {
1527 #line 249
1528 tmp___44 = __ctype_b_loc();
1529 #line 249
1530 if ((int const )(*((*tmp___44) + (int )(*(cp + 9)))) & 8192) {
1531 goto _L___3;
1532 } else {
1533 #line 249
1534 if ((int )(*(cp + 9)) == 0) {
1535 _L___3: /* CIL Label */
1536 #line 255
1537 if (debug_flag) {
1538 #line 256
1539 tmp___16 = dcgettext((char const *)((void *)0), "parsed broadcast",
1540 5);
1541 #line 256
1542 log_msg(7, (char const *)tmp___16);
1543 }
1544 #line 257
1545 tmp___17 = add_server((char const *)domain, (char const *)((void *)0),
1546 check_syntax);
1547 #line 257
1548 if (tmp___17) {
1549 #line 258
1550 have_entries ++;
1551 } else {
1552 #line 260
1553 bad_entries ++;
1554 }
1555 #line 261
1556 continue;
1557 }
1558 }
1559 }
1560 }
1561 }
1562 #line 263
1563 if (check_syntax) {
1564 #line 265
1565 tmp___99 = dcgettext((char const *)((void *)0), "Entry \"%s\" is not valid!\n",
1566 5);
1567 #line 265
1568 fprintf((FILE * __restrict )stderr, (char const * __restrict )tmp___99,
1569 cp);
1570 #line 266
1571 bad_entries ++;
1572 } else {
1573 #line 269
1574 tmp___100 = dcgettext((char const *)((void *)0), "Entry \"%s\" is not valid, ignore it!",
1575 5);
1576 #line 269
1577 log_msg(3, (char const *)tmp___100, cp);
1578 }
1579 }
1580 #line 271
1581 fclose(fp);
1582 #line 273
1583 if (buf) {
1584 #line 274
1585 free((void *)buf);
1586 }
1587 #line 276
1588 if (check_syntax) {
1589 #line 278
1590 if (bad_entries) {
1591 #line 280
1592 tmp___102 = dcgettext((char const *)((void *)0), "Bad entries found.\n", 5);
1593 #line 280
1594 fprintf((FILE * __restrict )stderr, (char const * __restrict )tmp___102);
1595 #line 281
1596 return (1);
1597 }
1598 #line 283
1599 if (! have_entries) {
1600 #line 285
1601 tmp___103 = dcgettext((char const *)((void *)0), "No entry found.\n", 5);
1602 #line 285
1603 fprintf((FILE * __restrict )stderr, (char const * __restrict )tmp___103);
1604 #line 286
1605 return (1);
1606 }
1607 }
1608 #line 290
1609 if (! have_entries) {
1610 #line 292
1611 if (debug_flag) {
1612 #line 293
1613 tmp___104 = dcgettext((char const *)((void *)0), "No entry found.", 5);
1614 #line 293
1615 log_msg(7, (char const *)tmp___104);
1616 }
1617 #line 294
1618 return (1);
1619 }
1620 #line 297
1621 return (0);
1622 }
1623 }
1624 #line 301 "ypbind-mt.c"
1625 static void create_pidfile(void)
1626 { struct flock lock ;
1627 int left ;
1628 int written ;
1629 pid_t pid ;
1630 char pbuf[10] ;
1631 char *ptr ;
1632 int flags ;
1633 char *tmp ;
1634 int tmp___0 ;
1635 int *tmp___1 ;
1636 char *tmp___2 ;
1637 char *tmp___3 ;
1638 int *tmp___4 ;
1639 int tmp___5 ;
1640 char *tmp___6 ;
1641 char *tmp___7 ;
1642 int tmp___8 ;
1643 __pid_t tmp___9 ;
1644
1645 {
1646 #line 310
1647 lock_fd = open("/var/run/ypbind.pid", 66, 420);
1648 #line 312
1649 if (lock_fd < 0) {
1650 #line 313
1651 tmp = dcgettext((char const *)((void *)0), "cannot create pidfile %s", 5);
1652 #line 313
1653 log_msg(3, (char const *)tmp, "/var/run/ypbind.pid");
1654 }
1655 #line 316
1656 flags = fcntl(lock_fd, 1, 0);
1657 #line 317
1658 if (flags == -1) {
1659 #line 320
1660 close(lock_fd);
1661 #line 321
1662 return;
1663 }
1664 #line 323
1665 flags |= 1;
1666 #line 324
1667 tmp___0 = fcntl(lock_fd, 2, flags);
1668 #line 324
1669 if (tmp___0 < 0) {
1670 #line 327
1671 close(lock_fd);
1672 #line 328
1673 return;
1674 }
1675 #line 331
1676 lock.l_type = (short)1;
1677 #line 332
1678 lock.l_start = 0L;
1679 #line 333
1680 lock.l_whence = (short)0;
1681 #line 334
1682 lock.l_len = 0L;
1683 #line 337
1684 tmp___5 = fcntl(lock_fd, 5, & lock);
1685 #line 337
1686 if (tmp___5 < 0) {
1687 #line 339
1688 tmp___4 = __errno_location();
1689 #line 339
1690 if ((*tmp___4) != 37) {
1691 #line 341
1692 tmp___1 = __errno_location();
1693 #line 341
1694 tmp___2 = strerror((*tmp___1));
1695 #line 341
1696 tmp___3 = dcgettext((char const *)((void *)0), "fcntl error: %s", 5);
1697 #line 341
1698 log_msg(3, (char const *)tmp___3, tmp___2);
1699 }
1700 #line 344
1701 pid = 0;
1702 } else {
1703 #line 346
1704 if ((int )lock.l_type == 2) {
1705 #line 347
1706 pid = 0;
1707 } else {
1708 #line 349
1709 pid = lock.l_pid;
1710 }
1711 }
1712 #line 351
1713 if (pid != 0) {
1714 #line 353
1715 tmp___6 = dcgettext((char const *)((void *)0), "ypbind-mt already running (pid %d) - exiting",
1716 5);
1717 #line 353
1718 log_msg(3, (char const *)tmp___6, pid);
1719 #line 355
1720 exit(1);
1721 }
1722 #line 359
1723 lock.l_type = (short)1;
1724 #line 360
1725 lock.l_start = 0L;
1726 #line 361
1727 lock.l_whence = (short)0;
1728 #line 362
1729 lock.l_len = 0L;
1730 #line 363
1731 tmp___8 = fcntl(lock_fd, 6, & lock);
1732 #line 363
1733 if (tmp___8 != 0) {
1734 #line 364
1735 tmp___7 = dcgettext((char const *)((void *)0), "cannot lock pidfile", 5);
1736 #line 364
1737 log_msg(3, (char const *)tmp___7);
1738 }
1739 #line 365
1740 tmp___9 = getpid();
1741 #line 365
1742 sprintf((char * __restrict )(pbuf), (char const * __restrict )"%ld\n", (long )tmp___9);
1743 #line 366
1744 left = (int )strlen((char const *)(pbuf));
1745 #line 367
1746 ptr = pbuf;
1747 #line 368
1748 while (left > 0) {
1749 #line 370
1750 written = write(lock_fd, (void const *)ptr, (unsigned int )left);
1751 #line 370
1752 if (written <= 0) {
1753 #line 371
1754 return;
1755 }
1756 #line 372
1757 left -= written;
1758 #line 373
1759 ptr += written;
1760 }
1761 #line 378
1762 return;
1763 }
1764 }
1765 #line 382 "ypbind-mt.c"
1766 static void *sig_handler(void *v_param __attribute__((__unused__)) )
1767 { struct flock lock ;
1768 sigset_t sigs_to_catch ;
1769 int caught ;
1770 int ret ;
1771 int tmp ;
1772 char *tmp___0 ;
1773 char *tmp___1 ;
1774 char *tmp___2 ;
1775 char *tmp___3 ;
1776 int tmp___4 ;
1777 char *tmp___5 ;
1778 char *tmp___6 ;
1779
1780 {
1781 #line 392
1782 create_pidfile();
1783 #line 397
1784 pthread_mutex_lock(& mutex_pid);
1785 #line 398
1786 pid_is_written = 1;
1787 #line 399
1788 pthread_cond_broadcast(& cond_pid);
1789 #line 400
1790 pthread_mutex_unlock(& mutex_pid);
1791 #line 402
1792 sigemptyset(& sigs_to_catch);
1793 #line 403
1794 sigaddset(& sigs_to_catch, 17);
1795 #line 404
1796 sigaddset(& sigs_to_catch, 15);
1797 #line 405
1798 sigaddset(& sigs_to_catch, 2);
1799 #line 406
1800 sigaddset(& sigs_to_catch, 3);
1801 #line 407
1802 sigaddset(& sigs_to_catch, 11);
1803 #line 408
1804 sigaddset(& sigs_to_catch, 1);
1805 #line 410
1806 while (1) {
1807 #line 412
1808 tmp = sigwait((sigset_t const * __restrict )(& sigs_to_catch), (int * __restrict )(& caught));
1809 #line 412
1810 ret = tmp;
1811 #line 413
1812 if (ret != 0) {
1813 #line 415
1814 if (ret != 4) {
1815 #line 416
1816 tmp___0 = dcgettext((char const *)((void *)0), "sigwait failed: ret=%d.",
1817 5);
1818 #line 416
1819 log_msg(3, (char const *)tmp___0, ret);
1820 }
1821 #line 417
1822 continue;
1823 }
1824 #line 419
1825 switch (caught) {
1826 case 17:
1827 #line 422
1828 tmp___1 = dcgettext((char const *)((void *)0), "SIGCHLD arrived, what should I do ?",
1829 5);
1830 #line 422
1831 log_msg(3, (char const *)tmp___1);
1832 #line 423
1833 break;
1834 case 15:
1835 case 2:
1836 case 3:
1837 case 11:
1838 #line 429
1839 if (debug_flag) {
1840 #line 430
1841 tmp___2 = dcgettext((char const *)((void *)0), "Signal (%d) for quitting program arrived.",
1842 5);
1843 #line 430
1844 log_msg(7, (char const *)tmp___2, caught);
1845 }
1846 #line 432
1847 pmap_unset(100007UL, 2UL);
1848 #line 433
1849 pmap_unset(100007UL, 1UL);
1850 #line 435
1851 lock.l_type = (short)2;
1852 #line 436
1853 lock.l_start = 0L;
1854 #line 437
1855 lock.l_whence = (short)0;
1856 #line 438
1857 lock.l_len = 0L;
1858 #line 439
1859 tmp___4 = fcntl(lock_fd, 6, & lock);
1860 #line 439
1861 if (tmp___4 != 0) {
1862 #line 440
1863 tmp___3 = dcgettext((char const *)((void *)0), "cannot unlock pidfile", 5);
1864 #line 440
1865 log_msg(3, (char const *)tmp___3);
1866 }
1867 #line 441
1868 close(lock_fd);
1869 #line 442
1870 unlink("/var/run/ypbind.pid");
1871 #line 443
1872 unlink_bindingdir();
1873 #line 444
1874 exit(0);
1875 #line 445
1876 break;
1877 case 1:
1878 #line 448
1879 if (debug_flag) {
1880 #line 449
1881 tmp___5 = dcgettext((char const *)((void *)0), "SIGHUP arrived, reloading config file.",
1882 5);
1883 #line 449
1884 log_msg(7, (char const *)tmp___5);
1885 }
1886 #line 450
1887 clear_server();
1888 #line 452
1889 if (use_broadcast) {
1890 #line 453
1891 add_server((char const *)domain, (char const *)((void *)0), 0);
1892 } else {
1893 #line 455
1894 load_config(0);
1895 }
1896 #line 457
1897 if (ping_interval < 1) {
1898 #line 458
1899 do_binding();
1900 }
1901 #line 459
1902 break;
1903 default:
1904 #line 461
1905 tmp___6 = dcgettext((char const *)((void *)0), "Unknown signal: %d", 5);
1906 #line 461
1907 log_msg(3, (char const *)tmp___6, caught);
1908 #line 462
1909 break;
1910 }
1911 }
1912 }
1913 }
1914 #line 467 "ypbind-mt.c"
1915 static void usage(void)
1916 { char *tmp ;
1917 char *tmp___0 ;
1918 char *tmp___1 ;
1919 char *tmp___2 ;
1920
1921 {
1922 #line 470
1923 tmp = dcgettext((char const *)((void *)0), "Usage:\n", 5);
1924 #line 470
1925 fputs((char const * __restrict )tmp, (FILE * __restrict )stderr);
1926 #line 471
1927 tmp___0 = dcgettext((char const *)((void *)0), "\typbind [-broadcast | -ypset | -ypsetme] [-p port] [-f configfile]\n\t [-no-ping] [-broken-server] [-local-only] [-i ping-interval] [-debug]\n",
1928 5);
1929 #line 471
1930 fputs((char const * __restrict )tmp___0, (FILE * __restrict )stderr);
1931 #line 472
1932 tmp___1 = dcgettext((char const *)((void *)0), "\typbind -c [-f configfile]\n",
1933 5);
1934 #line 472
1935 fputs((char const * __restrict )tmp___1, (FILE * __restrict )stderr);
1936 #line 473
1937 tmp___2 = dcgettext((char const *)((void *)0), "\typbind --version\n", 5);
1938 #line 473
1939 fputs((char const * __restrict )tmp___2, (FILE * __restrict )stderr);
1940 #line 474
1941 exit(1);
1942 }
1943 }
1944 #line 477 "ypbind-mt.c"
1945 int main(int argc , char **argv )
1946 { SVCXPRT *transp ;
1947 int sock ;
1948 int result ;
1949 int i ;
1950 sigset_t sigs_to_block ;
1951 struct sockaddr_in socket_address ;
1952 pthread_t sig_thread ;
1953 pthread_t ping_thread ;
1954 struct stat st ;
1955 int configcheck_only ;
1956 size_t __s1_len ;
1957 size_t __s2_len ;
1958 int tmp___4 ;
1959 int tmp___7 ;
1960 int tmp___8 ;
1961 size_t __s1_len___0 ;
1962 size_t __s2_len___0 ;
1963 int tmp___14 ;
1964 int tmp___17 ;
1965 int tmp___18 ;
1966 size_t __s1_len___1 ;
1967 size_t __s2_len___1 ;
1968 int tmp___24 ;
1969 int tmp___27 ;
1970 int tmp___28 ;
1971 size_t __s1_len___2 ;
1972 size_t __s2_len___2 ;
1973 int tmp___34 ;
1974 int tmp___37 ;
1975 int tmp___38 ;
1976 size_t __s1_len___3 ;
1977 size_t __s2_len___3 ;
1978 int tmp___44 ;
1979 int tmp___47 ;
1980 int tmp___48 ;
1981 size_t __s1_len___4 ;
1982 size_t __s2_len___4 ;
1983 int tmp___54 ;
1984 int tmp___57 ;
1985 int tmp___58 ;
1986 size_t __s1_len___5 ;
1987 size_t __s2_len___5 ;
1988 int tmp___64 ;
1989 int tmp___67 ;
1990 int tmp___68 ;
1991 size_t __s1_len___6 ;
1992 size_t __s2_len___6 ;
1993 int tmp___74 ;
1994 int tmp___77 ;
1995 int tmp___78 ;
1996 size_t __s1_len___7 ;
1997 size_t __s2_len___7 ;
1998 int tmp___84 ;
1999 int tmp___87 ;
2000 int tmp___88 ;
2001 size_t __s1_len___8 ;
2002 size_t __s2_len___8 ;
2003 int tmp___94 ;
2004 int tmp___97 ;
2005 int tmp___98 ;
2006 size_t __s1_len___9 ;
2007 size_t __s2_len___9 ;
2008 int tmp___104 ;
2009 int tmp___107 ;
2010 int tmp___108 ;
2011 size_t __s1_len___10 ;
2012 size_t __s2_len___10 ;
2013 int tmp___114 ;
2014 int tmp___117 ;
2015 int tmp___118 ;
2016 size_t __s1_len___11 ;
2017 size_t __s2_len___11 ;
2018 int tmp___124 ;
2019 int tmp___127 ;
2020 int tmp___128 ;
2021 size_t __s1_len___12 ;
2022 size_t __s2_len___12 ;
2023 int tmp___134 ;
2024 int tmp___137 ;
2025 int tmp___138 ;
2026 size_t __s1_len___13 ;
2027 size_t __s2_len___13 ;
2028 int tmp___144 ;
2029 int tmp___147 ;
2030 int tmp___148 ;
2031 size_t __s1_len___14 ;
2032 size_t __s2_len___14 ;
2033 int tmp___154 ;
2034 int tmp___157 ;
2035 int tmp___158 ;
2036 size_t __s1_len___15 ;
2037 size_t __s2_len___15 ;
2038 int tmp___164 ;
2039 int tmp___167 ;
2040 int tmp___168 ;
2041 size_t __s1_len___16 ;
2042 size_t __s2_len___16 ;
2043 int tmp___174 ;
2044 int tmp___177 ;
2045 int tmp___178 ;
2046 char *tmp___179 ;
2047 char *tmp___180 ;
2048 int tmp___181 ;
2049 size_t __s1_len___17 ;
2050 size_t __s2_len___17 ;
2051 int tmp___187 ;
2052 int tmp___190 ;
2053 int tmp___191 ;
2054 char *tmp___192 ;
2055 char *tmp___193 ;
2056 int tmp___194 ;
2057 char *tmp___195 ;
2058 __uid_t tmp___196 ;
2059 int *tmp___197 ;
2060 char *tmp___198 ;
2061 char *tmp___199 ;
2062 int tmp___200 ;
2063 int tmp___201 ;
2064 int *tmp___202 ;
2065 char *tmp___203 ;
2066 char *tmp___204 ;
2067 int tmp___205 ;
2068 int tmp___206 ;
2069 int *tmp___207 ;
2070 char *tmp___208 ;
2071 char *tmp___209 ;
2072 int tmp___210 ;
2073 char *tmp___211 ;
2074 char *tmp___212 ;
2075 char *tmp___213 ;
2076 int tmp___214 ;
2077 int j ;
2078 int *tmp___215 ;
2079 char *tmp___216 ;
2080 int *tmp___217 ;
2081 char *tmp___218 ;
2082 __pid_t tmp___219 ;
2083 int *tmp___220 ;
2084 char *tmp___221 ;
2085 int tmp___222 ;
2086 int *tmp___223 ;
2087 char *tmp___224 ;
2088 int tmp___225 ;
2089 int *tmp___226 ;
2090 char *tmp___227 ;
2091 char *tmp___228 ;
2092 register unsigned int __v ;
2093 register unsigned int __x ;
2094 register unsigned int __v___0 ;
2095 register unsigned int __x___0 ;
2096 register unsigned short __v___1 ;
2097 register unsigned short __x___1 ;
2098 int *tmp___229 ;
2099 char *tmp___230 ;
2100 char *tmp___231 ;
2101 char *tmp___232 ;
2102 char *tmp___233 ;
2103 bool_t tmp___234 ;
2104 char *tmp___235 ;
2105 bool_t tmp___236 ;
2106 int *tmp___237 ;
2107 char *tmp___238 ;
2108 char *tmp___239 ;
2109 register unsigned int __v___2 ;
2110 register unsigned int __x___2 ;
2111 register unsigned int __v___3 ;
2112 register unsigned int __x___3 ;
2113 register unsigned short __v___4 ;
2114 register unsigned short __x___4 ;
2115 int *tmp___240 ;
2116 char *tmp___241 ;
2117 char *tmp___242 ;
2118 char *tmp___243 ;
2119 char *tmp___244 ;
2120 bool_t tmp___245 ;
2121 char *tmp___246 ;
2122 bool_t tmp___247 ;
2123 char *tmp___248 ;
2124
2125 {
2126 #line 486
2127 configcheck_only = 0;
2128 #line 488
2129 setlocale(5, "");
2130 #line 489
2131 setlocale(0, "");
2132 #line 490
2133 bindtextdomain("ypbind-mt", "/usr/share/locale");
2134 #line 491
2135 textdomain("ypbind-mt");
2136 #line 494
2137 i = 1;
2138 #line 494
2139 while (i < argc) {
2140 #line 496
2141 if (0) {
2142 #line 496
2143 __s1_len___16 = strlen("--version");
2144 #line 496
2145 __s2_len___16 = strlen((char const *)(*(argv + i)));
2146 #line 496
2147 if (! ((unsigned int )((void const *)("--version" + 1)) - (unsigned int )((void const *)"--version") == 1U)) {
2148 goto _L___35;
2149 } else {
2150 #line 496
2151 if (__s1_len___16 >= 4U) {
2152 _L___35: /* CIL Label */
2153 #line 496
2154 if (! ((unsigned int )((void const *)((*(argv + i)) + 1)) - (unsigned int )((void const *)(*(argv + i))) == 1U)) {
2155 #line 496
2156 tmp___178 = 1;
2157 } else {
2158 #line 496
2159 if (__s2_len___16 >= 4U) {
2160 #line 496
2161 tmp___178 = 1;
2162 } else {
2163 #line 496
2164 tmp___178 = 0;
2165 }
2166 }
2167 } else {
2168 #line 496
2169 tmp___178 = 0;
2170 }
2171 }
2172 #line 496
2173 if (tmp___178) {
2174 #line 496
2175 tmp___174 = __builtin_strcmp("--version", (char const *)(*(argv + i)));
2176 } else {
2177 #line 496
2178 tmp___177 = __builtin_strcmp("--version", (char const *)(*(argv + i)));
2179 #line 496
2180 tmp___174 = tmp___177;
2181 }
2182 } else {
2183 #line 496
2184 tmp___177 = __builtin_strcmp("--version", (char const *)(*(argv + i)));
2185 #line 496
2186 tmp___174 = tmp___177;
2187 }
2188 #line 496
2189 if (tmp___174 == 0) {
2190 #line 498
2191 fprintf((FILE * __restrict )stderr, (char const * __restrict )"ypbind (%s) %s\n",
2192 "ypbind-mt", "1.19.1");
2193 #line 499
2194 exit(1);
2195 } else {
2196 #line 501
2197 if (0) {
2198 #line 501
2199 __s1_len___15 = strlen("-ypset");
2200 #line 501
2201 __s2_len___15 = strlen((char const *)(*(argv + i)));
2202 #line 501
2203 if (! ((unsigned int )((void const *)("-ypset" + 1)) - (unsigned int )((void const *)"-ypset") == 1U)) {
2204 goto _L___33;
2205 } else {
2206 #line 501
2207 if (__s1_len___15 >= 4U) {
2208 _L___33: /* CIL Label */
2209 #line 501
2210 if (! ((unsigned int )((void const *)((*(argv + i)) + 1)) - (unsigned int )((void const *)(*(argv + i))) == 1U)) {
2211 #line 501
2212 tmp___168 = 1;
2213 } else {
2214 #line 501
2215 if (__s2_len___15 >= 4U) {
2216 #line 501
2217 tmp___168 = 1;
2218 } else {
2219 #line 501
2220 tmp___168 = 0;
2221 }
2222 }
2223 } else {
2224 #line 501
2225 tmp___168 = 0;
2226 }
2227 }
2228 #line 501
2229 if (tmp___168) {
2230 #line 501
2231 tmp___164 = __builtin_strcmp("-ypset", (char const *)(*(argv + i)));
2232 } else {
2233 #line 501
2234 tmp___167 = __builtin_strcmp("-ypset", (char const *)(*(argv + i)));
2235 #line 501
2236 tmp___164 = tmp___167;
2237 }
2238 } else {
2239 #line 501
2240 tmp___167 = __builtin_strcmp("-ypset", (char const *)(*(argv + i)));
2241 #line 501
2242 tmp___164 = tmp___167;
2243 }
2244 #line 501
2245 if (tmp___164 == 0) {
2246 #line 502
2247 ypset = 1;
2248 } else {
2249 #line 503
2250 if (0) {
2251 #line 503
2252 __s1_len___14 = strlen("-ypsetme");
2253 #line 503
2254 __s2_len___14 = strlen((char const *)(*(argv + i)));
2255 #line 503
2256 if (! ((unsigned int )((void const *)("-ypsetme" + 1)) - (unsigned int )((void const *)"-ypsetme") == 1U)) {
2257 goto _L___31;
2258 } else {
2259 #line 503
2260 if (__s1_len___14 >= 4U) {
2261 _L___31: /* CIL Label */
2262 #line 503
2263 if (! ((unsigned int )((void const *)((*(argv + i)) + 1)) - (unsigned int )((void const *)(*(argv + i))) == 1U)) {
2264 #line 503
2265 tmp___158 = 1;
2266 } else {
2267 #line 503
2268 if (__s2_len___14 >= 4U) {
2269 #line 503
2270 tmp___158 = 1;
2271 } else {
2272 #line 503
2273 tmp___158 = 0;
2274 }
2275 }
2276 } else {
2277 #line 503
2278 tmp___158 = 0;
2279 }
2280 }
2281 #line 503
2282 if (tmp___158) {
2283 #line 503
2284 tmp___154 = __builtin_strcmp("-ypsetme", (char const *)(*(argv + i)));
2285 } else {
2286 #line 503
2287 tmp___157 = __builtin_strcmp("-ypsetme", (char const *)(*(argv + i)));
2288 #line 503
2289 tmp___154 = tmp___157;
2290 }
2291 } else {
2292 #line 503
2293 tmp___157 = __builtin_strcmp("-ypsetme", (char const *)(*(argv + i)));
2294 #line 503
2295 tmp___154 = tmp___157;
2296 }
2297 #line 503
2298 if (tmp___154 == 0) {
2299 #line 504
2300 ypset = 2;
2301 } else {
2302 #line 505
2303 if (0) {
2304 #line 505
2305 __s1_len___12 = strlen("-d");
2306 #line 505
2307 __s2_len___12 = strlen((char const *)(*(argv + i)));
2308 #line 505
2309 if (! ((unsigned int )((void const *)("-d" + 1)) - (unsigned int )((void const *)"-d") == 1U)) {
2310 goto _L___27;
2311 } else {
2312 #line 505
2313 if (__s1_len___12 >= 4U) {
2314 _L___27: /* CIL Label */
2315 #line 505
2316 if (! ((unsigned int )((void const *)((*(argv + i)) + 1)) - (unsigned int )((void const *)(*(argv + i))) == 1U)) {
2317 #line 505
2318 tmp___138 = 1;
2319 } else {
2320 #line 505
2321 if (__s2_len___12 >= 4U) {
2322 #line 505
2323 tmp___138 = 1;
2324 } else {
2325 #line 505
2326 tmp___138 = 0;
2327 }
2328 }
2329 } else {
2330 #line 505
2331 tmp___138 = 0;
2332 }
2333 }
2334 #line 505
2335 if (tmp___138) {
2336 #line 505
2337 tmp___134 = __builtin_strcmp("-d", (char const *)(*(argv + i)));
2338 } else {
2339 #line 505
2340 tmp___137 = __builtin_strcmp("-d", (char const *)(*(argv + i)));
2341 #line 505
2342 tmp___134 = tmp___137;
2343 }
2344 } else {
2345 #line 505
2346 tmp___137 = __builtin_strcmp("-d", (char const *)(*(argv + i)));
2347 #line 505
2348 tmp___134 = tmp___137;
2349 }
2350 #line 506
2351 if (tmp___134 == 0) {
2352 #line 507
2353 debug_flag = 1;
2354 } else {
2355 #line 506
2356 if (0) {
2357 #line 506
2358 __s1_len___13 = strlen("-debug");
2359 #line 506
2360 __s2_len___13 = strlen((char const *)(*(argv + i)));
2361 #line 506
2362 if (! ((unsigned int )((void const *)("-debug" + 1)) - (unsigned int )((void const *)"-debug") == 1U)) {
2363 goto _L___29;
2364 } else {
2365 #line 506
2366 if (__s1_len___13 >= 4U) {
2367 _L___29: /* CIL Label */
2368 #line 506
2369 if (! ((unsigned int )((void const *)((*(argv + i)) + 1)) - (unsigned int )((void const *)(*(argv + i))) == 1U)) {
2370 #line 506
2371 tmp___148 = 1;
2372 } else {
2373 #line 506
2374 if (__s2_len___13 >= 4U) {
2375 #line 506
2376 tmp___148 = 1;
2377 } else {
2378 #line 506
2379 tmp___148 = 0;
2380 }
2381 }
2382 } else {
2383 #line 506
2384 tmp___148 = 0;
2385 }
2386 }
2387 #line 506
2388 if (tmp___148) {
2389 #line 506
2390 tmp___144 = __builtin_strcmp("-debug", (char const *)(*(argv + i)));
2391 } else {
2392 #line 506
2393 tmp___147 = __builtin_strcmp("-debug", (char const *)(*(argv + i)));
2394 #line 506
2395 tmp___144 = tmp___147;
2396 }
2397 } else {
2398 #line 506
2399 tmp___147 = __builtin_strcmp("-debug", (char const *)(*(argv + i)));
2400 #line 506
2401 tmp___144 = tmp___147;
2402 }
2403 #line 506
2404 if (tmp___144 == 0) {
2405 #line 507
2406 debug_flag = 1;
2407 } else {
2408 #line 508
2409 if (0) {
2410 #line 508
2411 __s1_len___10 = strlen("-broken-server");
2412 #line 508
2413 __s2_len___10 = strlen((char const *)(*(argv + i)));
2414 #line 508
2415 if (! ((unsigned int )((void const *)("-broken-server" + 1)) - (unsigned int )((void const *)"-broken-server") == 1U)) {
2416 goto _L___23;
2417 } else {
2418 #line 508
2419 if (__s1_len___10 >= 4U) {
2420 _L___23: /* CIL Label */
2421 #line 508
2422 if (! ((unsigned int )((void const *)((*(argv + i)) + 1)) - (unsigned int )((void const *)(*(argv + i))) == 1U)) {
2423 #line 508
2424 tmp___118 = 1;
2425 } else {
2426 #line 508
2427 if (__s2_len___10 >= 4U) {
2428 #line 508
2429 tmp___118 = 1;
2430 } else {
2431 #line 508
2432 tmp___118 = 0;
2433 }
2434 }
2435 } else {
2436 #line 508
2437 tmp___118 = 0;
2438 }
2439 }
2440 #line 508
2441 if (tmp___118) {
2442 #line 508
2443 tmp___114 = __builtin_strcmp("-broken-server", (char const *)(*(argv + i)));
2444 } else {
2445 #line 508
2446 tmp___117 = __builtin_strcmp("-broken-server", (char const *)(*(argv + i)));
2447 #line 508
2448 tmp___114 = tmp___117;
2449 }
2450 } else {
2451 #line 508
2452 tmp___117 = __builtin_strcmp("-broken-server", (char const *)(*(argv + i)));
2453 #line 508
2454 tmp___114 = tmp___117;
2455 }
2456 #line 509
2457 if (tmp___114 == 0) {
2458 #line 510
2459 broken_server = 1;
2460 } else {
2461 #line 509
2462 if (0) {
2463 #line 509
2464 __s1_len___11 = strlen("-broken_server");
2465 #line 509
2466 __s2_len___11 = strlen((char const *)(*(argv + i)));
2467 #line 509
2468 if (! ((unsigned int )((void const *)("-broken_server" + 1)) - (unsigned int )((void const *)"-broken_server") == 1U)) {
2469 goto _L___25;
2470 } else {
2471 #line 509
2472 if (__s1_len___11 >= 4U) {
2473 _L___25: /* CIL Label */
2474 #line 509
2475 if (! ((unsigned int )((void const *)((*(argv + i)) + 1)) - (unsigned int )((void const *)(*(argv + i))) == 1U)) {
2476 #line 509
2477 tmp___128 = 1;
2478 } else {
2479 #line 509
2480 if (__s2_len___11 >= 4U) {
2481 #line 509
2482 tmp___128 = 1;
2483 } else {
2484 #line 509
2485 tmp___128 = 0;
2486 }
2487 }
2488 } else {
2489 #line 509
2490 tmp___128 = 0;
2491 }
2492 }
2493 #line 509
2494 if (tmp___128) {
2495 #line 509
2496 tmp___124 = __builtin_strcmp("-broken_server", (char const *)(*(argv + i)));
2497 } else {
2498 #line 509
2499 tmp___127 = __builtin_strcmp("-broken_server", (char const *)(*(argv + i)));
2500 #line 509
2501 tmp___124 = tmp___127;
2502 }
2503 } else {
2504 #line 509
2505 tmp___127 = __builtin_strcmp("-broken_server", (char const *)(*(argv + i)));
2506 #line 509
2507 tmp___124 = tmp___127;
2508 }
2509 #line 509
2510 if (tmp___124 == 0) {
2511 #line 510
2512 broken_server = 1;
2513 } else {
2514 #line 511
2515 if (0) {
2516 #line 511
2517 __s1_len___8 = strlen("-no-ping");
2518 #line 511
2519 __s2_len___8 = strlen((char const *)(*(argv + i)));
2520 #line 511
2521 if (! ((unsigned int )((void const *)("-no-ping" + 1)) - (unsigned int )((void const *)"-no-ping") == 1U)) {
2522 goto _L___19;
2523 } else {
2524 #line 511
2525 if (__s1_len___8 >= 4U) {
2526 _L___19: /* CIL Label */
2527 #line 511
2528 if (! ((unsigned int )((void const *)((*(argv + i)) + 1)) - (unsigned int )((void const *)(*(argv + i))) == 1U)) {
2529 #line 511
2530 tmp___98 = 1;
2531 } else {
2532 #line 511
2533 if (__s2_len___8 >= 4U) {
2534 #line 511
2535 tmp___98 = 1;
2536 } else {
2537 #line 511
2538 tmp___98 = 0;
2539 }
2540 }
2541 } else {
2542 #line 511
2543 tmp___98 = 0;
2544 }
2545 }
2546 #line 511
2547 if (tmp___98) {
2548 #line 511
2549 tmp___94 = __builtin_strcmp("-no-ping", (char const *)(*(argv + i)));
2550 } else {
2551 #line 511
2552 tmp___97 = __builtin_strcmp("-no-ping", (char const *)(*(argv + i)));
2553 #line 511
2554 tmp___94 = tmp___97;
2555 }
2556 } else {
2557 #line 511
2558 tmp___97 = __builtin_strcmp("-no-ping", (char const *)(*(argv + i)));
2559 #line 511
2560 tmp___94 = tmp___97;
2561 }
2562 #line 512
2563 if (tmp___94 == 0) {
2564 #line 513
2565 ping_interval = 0;
2566 } else {
2567 #line 512
2568 if (0) {
2569 #line 512
2570 __s1_len___9 = strlen("-no_ping");
2571 #line 512
2572 __s2_len___9 = strlen((char const *)(*(argv + i)));
2573 #line 512
2574 if (! ((unsigned int )((void const *)("-no_ping" + 1)) - (unsigned int )((void const *)"-no_ping") == 1U)) {
2575 goto _L___21;
2576 } else {
2577 #line 512
2578 if (__s1_len___9 >= 4U) {
2579 _L___21: /* CIL Label */
2580 #line 512
2581 if (! ((unsigned int )((void const *)((*(argv + i)) + 1)) - (unsigned int )((void const *)(*(argv + i))) == 1U)) {
2582 #line 512
2583 tmp___108 = 1;
2584 } else {
2585 #line 512
2586 if (__s2_len___9 >= 4U) {
2587 #line 512
2588 tmp___108 = 1;
2589 } else {
2590 #line 512
2591 tmp___108 = 0;
2592 }
2593 }
2594 } else {
2595 #line 512
2596 tmp___108 = 0;
2597 }
2598 }
2599 #line 512
2600 if (tmp___108) {
2601 #line 512
2602 tmp___104 = __builtin_strcmp("-no_ping", (char const *)(*(argv + i)));
2603 } else {
2604 #line 512
2605 tmp___107 = __builtin_strcmp("-no_ping", (char const *)(*(argv + i)));
2606 #line 512
2607 tmp___104 = tmp___107;
2608 }
2609 } else {
2610 #line 512
2611 tmp___107 = __builtin_strcmp("-no_ping", (char const *)(*(argv + i)));
2612 #line 512
2613 tmp___104 = tmp___107;
2614 }
2615 #line 512
2616 if (tmp___104 == 0) {
2617 #line 513
2618 ping_interval = 0;
2619 } else {
2620 #line 514
2621 if (0) {
2622 #line 514
2623 __s1_len___7 = strlen("-broadcast");
2624 #line 514
2625 __s2_len___7 = strlen((char const *)(*(argv + i)));
2626 #line 514
2627 if (! ((unsigned int )((void const *)("-broadcast" + 1)) - (unsigned int )((void const *)"-broadcast") == 1U)) {
2628 goto _L___17;
2629 } else {
2630 #line 514
2631 if (__s1_len___7 >= 4U) {
2632 _L___17: /* CIL Label */
2633 #line 514
2634 if (! ((unsigned int )((void const *)((*(argv + i)) + 1)) - (unsigned int )((void const *)(*(argv + i))) == 1U)) {
2635 #line 514
2636 tmp___88 = 1;
2637 } else {
2638 #line 514
2639 if (__s2_len___7 >= 4U) {
2640 #line 514
2641 tmp___88 = 1;
2642 } else {
2643 #line 514
2644 tmp___88 = 0;
2645 }
2646 }
2647 } else {
2648 #line 514
2649 tmp___88 = 0;
2650 }
2651 }
2652 #line 514
2653 if (tmp___88) {
2654 #line 514
2655 tmp___84 = __builtin_strcmp("-broadcast", (char const *)(*(argv + i)));
2656 } else {
2657 #line 514
2658 tmp___87 = __builtin_strcmp("-broadcast", (char const *)(*(argv + i)));
2659 #line 514
2660 tmp___84 = tmp___87;
2661 }
2662 } else {
2663 #line 514
2664 tmp___87 = __builtin_strcmp("-broadcast", (char const *)(*(argv + i)));
2665 #line 514
2666 tmp___84 = tmp___87;
2667 }
2668 #line 514
2669 if (tmp___84 == 0) {
2670 #line 515
2671 use_broadcast = 1;
2672 } else {
2673 #line 516
2674 if (0) {
2675 #line 516
2676 __s1_len___5 = strlen("-local-only");
2677 #line 516
2678 __s2_len___5 = strlen((char const *)(*(argv + i)));
2679 #line 516
2680 if (! ((unsigned int )((void const *)("-local-only" + 1)) - (unsigned int )((void const *)"-local-only") == 1U)) {
2681 goto _L___13;
2682 } else {
2683 #line 516
2684 if (__s1_len___5 >= 4U) {
2685 _L___13: /* CIL Label */
2686 #line 516
2687 if (! ((unsigned int )((void const *)((*(argv + i)) + 1)) - (unsigned int )((void const *)(*(argv + i))) == 1U)) {
2688 #line 516
2689 tmp___68 = 1;
2690 } else {
2691 #line 516
2692 if (__s2_len___5 >= 4U) {
2693 #line 516
2694 tmp___68 = 1;
2695 } else {
2696 #line 516
2697 tmp___68 = 0;
2698 }
2699 }
2700 } else {
2701 #line 516
2702 tmp___68 = 0;
2703 }
2704 }
2705 #line 516
2706 if (tmp___68) {
2707 #line 516
2708 tmp___64 = __builtin_strcmp("-local-only", (char const *)(*(argv + i)));
2709 } else {
2710 #line 516
2711 tmp___67 = __builtin_strcmp("-local-only", (char const *)(*(argv + i)));
2712 #line 516
2713 tmp___64 = tmp___67;
2714 }
2715 } else {
2716 #line 516
2717 tmp___67 = __builtin_strcmp("-local-only", (char const *)(*(argv + i)));
2718 #line 516
2719 tmp___64 = tmp___67;
2720 }
2721 #line 517
2722 if (tmp___64 == 0) {
2723 #line 518
2724 local_only = 1;
2725 } else {
2726 #line 517
2727 if (0) {
2728 #line 517
2729 __s1_len___6 = strlen("-local_only");
2730 #line 517
2731 __s2_len___6 = strlen((char const *)(*(argv + i)));
2732 #line 517
2733 if (! ((unsigned int )((void const *)("-local_only" + 1)) - (unsigned int )((void const *)"-local_only") == 1U)) {
2734 goto _L___15;
2735 } else {
2736 #line 517
2737 if (__s1_len___6 >= 4U) {
2738 _L___15: /* CIL Label */
2739 #line 517
2740 if (! ((unsigned int )((void const *)((*(argv + i)) + 1)) - (unsigned int )((void const *)(*(argv + i))) == 1U)) {
2741 #line 517
2742 tmp___78 = 1;
2743 } else {
2744 #line 517
2745 if (__s2_len___6 >= 4U) {
2746 #line 517
2747 tmp___78 = 1;
2748 } else {
2749 #line 517
2750 tmp___78 = 0;
2751 }
2752 }
2753 } else {
2754 #line 517
2755 tmp___78 = 0;
2756 }
2757 }
2758 #line 517
2759 if (tmp___78) {
2760 #line 517
2761 tmp___74 = __builtin_strcmp("-local_only", (char const *)(*(argv + i)));
2762 } else {
2763 #line 517
2764 tmp___77 = __builtin_strcmp("-local_only", (char const *)(*(argv + i)));
2765 #line 517
2766 tmp___74 = tmp___77;
2767 }
2768 } else {
2769 #line 517
2770 tmp___77 = __builtin_strcmp("-local_only", (char const *)(*(argv + i)));
2771 #line 517
2772 tmp___74 = tmp___77;
2773 }
2774 #line 517
2775 if (tmp___74 == 0) {
2776 #line 518
2777 local_only = 1;
2778 } else {
2779 #line 519
2780 if (0) {
2781 #line 519
2782 __s1_len___4 = strlen("-f");
2783 #line 519
2784 __s2_len___4 = strlen((char const *)(*(argv + i)));
2785 #line 519
2786 if (! ((unsigned int )((void const *)("-f" + 1)) - (unsigned int )((void const *)"-f") == 1U)) {
2787 goto _L___11;
2788 } else {
2789 #line 519
2790 if (__s1_len___4 >= 4U) {
2791 _L___11: /* CIL Label */
2792 #line 519
2793 if (! ((unsigned int )((void const *)((*(argv + i)) + 1)) - (unsigned int )((void const *)(*(argv + i))) == 1U)) {
2794 #line 519
2795 tmp___58 = 1;
2796 } else {
2797 #line 519
2798 if (__s2_len___4 >= 4U) {
2799 #line 519
2800 tmp___58 = 1;
2801 } else {
2802 #line 519
2803 tmp___58 = 0;
2804 }
2805 }
2806 } else {
2807 #line 519
2808 tmp___58 = 0;
2809 }
2810 }
2811 #line 519
2812 if (tmp___58) {
2813 #line 519
2814 tmp___54 = __builtin_strcmp("-f", (char const *)(*(argv + i)));
2815 } else {
2816 #line 519
2817 tmp___57 = __builtin_strcmp("-f", (char const *)(*(argv + i)));
2818 #line 519
2819 tmp___54 = tmp___57;
2820 }
2821 } else {
2822 #line 519
2823 tmp___57 = __builtin_strcmp("-f", (char const *)(*(argv + i)));
2824 #line 519
2825 tmp___54 = tmp___57;
2826 }
2827 #line 519
2828 if (tmp___54 == 0) {
2829 #line 521
2830 if (i + 1 == argc) {
2831 #line 522
2832 usage();
2833 } else {
2834 #line 521
2835 if ((int )(*((*(argv + (i + 1))) + 0)) == 45) {
2836 #line 522
2837 usage();
2838 }
2839 }
2840 #line 523
2841 i ++;
2842 #line 524
2843 configfile = (char const *)(*(argv + i));
2844 } else {
2845 #line 526
2846 if (0) {
2847 #line 526
2848 __s1_len___3 = strlen("-p");
2849 #line 526
2850 __s2_len___3 = strlen((char const *)(*(argv + i)));
2851 #line 526
2852 if (! ((unsigned int )((void const *)("-p" + 1)) - (unsigned int )((void const *)"-p") == 1U)) {
2853 goto _L___9;
2854 } else {
2855 #line 526
2856 if (__s1_len___3 >= 4U) {
2857 _L___9: /* CIL Label */
2858 #line 526
2859 if (! ((unsigned int )((void const *)((*(argv + i)) + 1)) - (unsigned int )((void const *)(*(argv + i))) == 1U)) {
2860 #line 526
2861 tmp___48 = 1;
2862 } else {
2863 #line 526
2864 if (__s2_len___3 >= 4U) {
2865 #line 526
2866 tmp___48 = 1;
2867 } else {
2868 #line 526
2869 tmp___48 = 0;
2870 }
2871 }
2872 } else {
2873 #line 526
2874 tmp___48 = 0;
2875 }
2876 }
2877 #line 526
2878 if (tmp___48) {
2879 #line 526
2880 tmp___44 = __builtin_strcmp("-p", (char const *)(*(argv + i)));
2881 } else {
2882 #line 526
2883 tmp___47 = __builtin_strcmp("-p", (char const *)(*(argv + i)));
2884 #line 526
2885 tmp___44 = tmp___47;
2886 }
2887 } else {
2888 #line 526
2889 tmp___47 = __builtin_strcmp("-p", (char const *)(*(argv + i)));
2890 #line 526
2891 tmp___44 = tmp___47;
2892 }
2893 #line 526
2894 if (tmp___44 == 0) {
2895 #line 528
2896 if (i + 1 == argc) {
2897 #line 529
2898 usage();
2899 } else {
2900 #line 528
2901 if ((int )(*((*(argv + (i + 1))) + 0)) == 45) {
2902 #line 529
2903 usage();
2904 }
2905 }
2906 #line 530
2907 i ++;
2908 #line 531
2909 port = atoi__extinline((char const *)(*(argv + i)));
2910 } else {
2911 #line 533
2912 if (0) {
2913 #line 533
2914 __s1_len___0 = strlen("-ping-interval");
2915 #line 533
2916 __s2_len___0 = strlen((char const *)(*(argv + i)));
2917 #line 533
2918 if (! ((unsigned int )((void const *)("-ping-interval" + 1)) - (unsigned int )((void const *)"-ping-interval") == 1U)) {
2919 goto _L___2;
2920 } else {
2921 #line 533
2922 if (__s1_len___0 >= 4U) {
2923 _L___2: /* CIL Label */
2924 #line 533
2925 if (! ((unsigned int )((void const *)((*(argv + i)) + 1)) - (unsigned int )((void const *)(*(argv + i))) == 1U)) {
2926 #line 533
2927 tmp___18 = 1;
2928 } else {
2929 #line 533
2930 if (__s2_len___0 >= 4U) {
2931 #line 533
2932 tmp___18 = 1;
2933 } else {
2934 #line 533
2935 tmp___18 = 0;
2936 }
2937 }
2938 } else {
2939 #line 533
2940 tmp___18 = 0;
2941 }
2942 }
2943 #line 533
2944 if (tmp___18) {
2945 #line 533
2946 tmp___14 = __builtin_strcmp("-ping-interval",
2947 (char const *)(*(argv + i)));
2948 } else {
2949 #line 533
2950 tmp___17 = __builtin_strcmp("-ping-interval",
2951 (char const *)(*(argv + i)));
2952 #line 533
2953 tmp___14 = tmp___17;
2954 }
2955 } else {
2956 #line 533
2957 tmp___17 = __builtin_strcmp("-ping-interval", (char const *)(*(argv + i)));
2958 #line 533
2959 tmp___14 = tmp___17;
2960 }
2961 #line 535
2962 if (tmp___14 == 0) {
2963 goto _L___7;
2964 } else {
2965 #line 534
2966 if (0) {
2967 #line 534
2968 __s1_len___1 = strlen("-ping-interval");
2969 #line 534
2970 __s2_len___1 = strlen((char const *)(*(argv + i)));
2971 #line 534
2972 if (! ((unsigned int )((void const *)("-ping-interval" + 1)) - (unsigned int )((void const *)"-ping-interval") == 1U)) {
2973 goto _L___4;
2974 } else {
2975 #line 534
2976 if (__s1_len___1 >= 4U) {
2977 _L___4: /* CIL Label */
2978 #line 534
2979 if (! ((unsigned int )((void const *)((*(argv + i)) + 1)) - (unsigned int )((void const *)(*(argv + i))) == 1U)) {
2980 #line 534
2981 tmp___28 = 1;
2982 } else {
2983 #line 534
2984 if (__s2_len___1 >= 4U) {
2985 #line 534
2986 tmp___28 = 1;
2987 } else {
2988 #line 534
2989 tmp___28 = 0;
2990 }
2991 }
2992 } else {
2993 #line 534
2994 tmp___28 = 0;
2995 }
2996 }
2997 #line 534
2998 if (tmp___28) {
2999 #line 534
3000 tmp___24 = __builtin_strcmp("-ping-interval",
3001 (char const *)(*(argv + i)));
3002 } else {
3003 #line 534
3004 tmp___27 = __builtin_strcmp("-ping-interval",
3005 (char const *)(*(argv + i)));
3006 #line 534
3007 tmp___24 = tmp___27;
3008 }
3009 } else {
3010 #line 534
3011 tmp___27 = __builtin_strcmp("-ping-interval",
3012 (char const *)(*(argv + i)));
3013 #line 534
3014 tmp___24 = tmp___27;
3015 }
3016 #line 535
3017 if (tmp___24 == 0) {
3018 goto _L___7;
3019 } else {
3020 #line 535
3021 if (0) {
3022 #line 535
3023 __s1_len___2 = strlen("-i");
3024 #line 535
3025 __s2_len___2 = strlen((char const *)(*(argv + i)));
3026 #line 535
3027 if (! ((unsigned int )((void const *)("-i" + 1)) - (unsigned int )((void const *)"-i") == 1U)) {
3028 goto _L___6;
3029 } else {
3030 #line 535
3031 if (__s1_len___2 >= 4U) {
3032 _L___6: /* CIL Label */
3033 #line 535
3034 if (! ((unsigned int )((void const *)((*(argv + i)) + 1)) - (unsigned int )((void const *)(*(argv + i))) == 1U)) {
3035 #line 535
3036 tmp___38 = 1;
3037 } else {
3038 #line 535
3039 if (__s2_len___2 >= 4U) {
3040 #line 535
3041 tmp___38 = 1;
3042 } else {
3043 #line 535
3044 tmp___38 = 0;
3045 }
3046 }
3047 } else {
3048 #line 535
3049 tmp___38 = 0;
3050 }
3051 }
3052 #line 535
3053 if (tmp___38) {
3054 #line 535
3055 tmp___34 = __builtin_strcmp("-i", (char const *)(*(argv + i)));
3056 } else {
3057 #line 535
3058 tmp___37 = __builtin_strcmp("-i", (char const *)(*(argv + i)));
3059 #line 535
3060 tmp___34 = tmp___37;
3061 }
3062 } else {
3063 #line 535
3064 tmp___37 = __builtin_strcmp("-i", (char const *)(*(argv + i)));
3065 #line 535
3066 tmp___34 = tmp___37;
3067 }
3068 #line 535
3069 if (tmp___34 == 0) {
3070 _L___7: /* CIL Label */
3071 #line 537
3072 if (i + 1 == argc) {
3073 #line 538
3074 usage();
3075 } else {
3076 #line 537
3077 if ((int )(*((*(argv + (i + 1))) + 0)) == 45) {
3078 #line 538
3079 usage();
3080 }
3081 }
3082 #line 539
3083 i ++;
3084 #line 540
3085 ping_interval = atoi__extinline((char const *)(*(argv + i)));
3086 } else {
3087 #line 542
3088 if (0) {
3089 #line 542
3090 __s1_len = strlen("-c");
3091 #line 542
3092 __s2_len = strlen((char const *)(*(argv + i)));
3093 #line 542
3094 if (! ((unsigned int )((void const *)("-c" + 1)) - (unsigned int )((void const *)"-c") == 1U)) {
3095 goto _L___0;
3096 } else {
3097 #line 542
3098 if (__s1_len >= 4U) {
3099 _L___0: /* CIL Label */
3100 #line 542
3101 if (! ((unsigned int )((void const *)((*(argv + i)) + 1)) - (unsigned int )((void const *)(*(argv + i))) == 1U)) {
3102 #line 542
3103 tmp___8 = 1;
3104 } else {
3105 #line 542
3106 if (__s2_len >= 4U) {
3107 #line 542
3108 tmp___8 = 1;
3109 } else {
3110 #line 542
3111 tmp___8 = 0;
3112 }
3113 }
3114 } else {
3115 #line 542
3116 tmp___8 = 0;
3117 }
3118 }
3119 #line 542
3120 if (tmp___8) {
3121 #line 542
3122 tmp___4 = __builtin_strcmp("-c", (char const *)(*(argv + i)));
3123 } else {
3124 #line 542
3125 tmp___7 = __builtin_strcmp("-c", (char const *)(*(argv + i)));
3126 #line 542
3127 tmp___4 = tmp___7;
3128 }
3129 } else {
3130 #line 542
3131 tmp___7 = __builtin_strcmp("-c", (char const *)(*(argv + i)));
3132 #line 542
3133 tmp___4 = tmp___7;
3134 }
3135 #line 542
3136 if (tmp___4 == 0) {
3137 #line 543
3138 configcheck_only = 1;
3139 } else {
3140 #line 545
3141 usage();
3142 }
3143 }
3144 }
3145 }
3146 }
3147 }
3148 }
3149 }
3150 }
3151 }
3152 }
3153 }
3154 }
3155 }
3156 }
3157 }
3158 }
3159 }
3160 #line 494
3161 i ++;
3162 }
3163 #line 548
3164 tmp___181 = yp_get_default_domain(& domain);
3165 #line 549
3166 if (tmp___181) {
3167 goto _L___38;
3168 } else {
3169 #line 549
3170 if ((unsigned int )domain == (unsigned int )((void *)0)) {
3171 goto _L___38;
3172 } else {
3173 #line 549
3174 if ((int )(*(domain + 0)) == 0) {
3175 goto _L___38;
3176 } else {
3177 #line 549
3178 if (0) {
3179 #line 549
3180 __s1_len___17 = strlen((char const *)domain);
3181 #line 549
3182 __s2_len___17 = strlen("(none)");
3183 #line 549
3184 if (! ((unsigned int )((void const *)(domain + 1)) - (unsigned int )((void const *)domain) == 1U)) {
3185 goto _L___37;
3186 } else {
3187 #line 549
3188 if (__s1_len___17 >= 4U) {
3189 _L___37: /* CIL Label */
3190 #line 549
3191 if (! ((unsigned int )((void const *)("(none)" + 1)) - (unsigned int )((void const *)"(none)") == 1U)) {
3192 #line 549
3193 tmp___191 = 1;
3194 } else {
3195 #line 549
3196 if (__s2_len___17 >= 4U) {
3197 #line 549
3198 tmp___191 = 1;
3199 } else {
3200 #line 549
3201 tmp___191 = 0;
3202 }
3203 }
3204 } else {
3205 #line 549
3206 tmp___191 = 0;
3207 }
3208 }
3209 #line 549
3210 if (tmp___191) {
3211 #line 549
3212 tmp___187 = __builtin_strcmp((char const *)domain, "(none)");
3213 } else {
3214 #line 549
3215 tmp___190 = __builtin_strcmp((char const *)domain, "(none)");
3216 #line 549
3217 tmp___187 = tmp___190;
3218 }
3219 } else {
3220 #line 549
3221 tmp___190 = __builtin_strcmp((char const *)domain, "(none)");
3222 #line 549
3223 tmp___187 = tmp___190;
3224 }
3225 #line 549
3226 if (tmp___187 == 0) {
3227 _L___38: /* CIL Label */
3228 #line 551
3229 if (configcheck_only) {
3230 #line 553
3231 tmp___179 = dcgettext((char const *)((void *)0), "ERROR: domainname not set.\n",
3232 5);
3233 #line 553
3234 fputs((char const * __restrict )tmp___179, (FILE * __restrict )stderr);
3235 #line 554
3236 domain = (char *)"(none)";
3237 } else {
3238 #line 558
3239 tmp___180 = dcgettext((char const *)((void *)0), "domainname not set - aborting.\n",
3240 5);
3241 #line 558
3242 fputs((char const * __restrict )tmp___180, (FILE * __restrict )stderr);
3243 #line 559
3244 exit(1);
3245 }
3246 }
3247 }
3248 }
3249 }
3250 #line 563
3251 if (configcheck_only) {
3252 #line 565
3253 tmp___194 = load_config(1);
3254 #line 565
3255 if (tmp___194 != 0) {
3256 #line 567
3257 tmp___192 = dcgettext((char const *)((void *)0), "Config file %s is not ok.\n",
3258 5);
3259 #line 567
3260 fprintf((FILE * __restrict )stderr, (char const * __restrict )tmp___192,
3261 configfile);
3262 #line 568
3263 exit(1);
3264 } else {
3265 #line 572
3266 tmp___193 = dcgettext((char const *)((void *)0), "Config file %s is ok.\n",
3267 5);
3268 #line 572
3269 fprintf((FILE * __restrict )stdout, (char const * __restrict )tmp___193,
3270 configfile);
3271 #line 573
3272 exit(0);
3273 }
3274 }
3275 #line 577
3276 tmp___196 = getuid();
3277 #line 577
3278 if (tmp___196 != 0U) {
3279 #line 579
3280 tmp___195 = dcgettext((char const *)((void *)0), "ypbind must be run as root\n",
3281 5);
3282 #line 579
3283 fputs((char const * __restrict )tmp___195, (FILE * __restrict )stderr);
3284 #line 580
3285 exit(1);
3286 }
3287 #line 583
3288 tmp___201 = stat__extinline("/var/yp", & st);
3289 #line 583
3290 if (tmp___201 == -1) {
3291 #line 584
3292 tmp___200 = mkdir("/var/yp", 493U);
3293 #line 584
3294 if (tmp___200 < 0) {
3295 #line 587
3296 tmp___197 = __errno_location();
3297 #line 587
3298 tmp___198 = strerror((*tmp___197));
3299 #line 587
3300 tmp___199 = dcgettext((char const *)((void *)0), "Could not create %s: %s\n",
3301 5);
3302 #line 587
3303 fprintf((FILE * __restrict )stderr, (char const * __restrict )tmp___199,
3304 "/var/yp", tmp___198);
3305 #line 589
3306 exit(1);
3307 }
3308 }
3309 #line 592
3310 tmp___206 = stat__extinline("/var/yp/binding", & st);
3311 #line 592
3312 if (tmp___206 == -1) {
3313 #line 593
3314 tmp___205 = mkdir("/var/yp/binding", 493U);
3315 #line 593
3316 if (tmp___205 < 0) {
3317 #line 596
3318 tmp___202 = __errno_location();
3319 #line 596
3320 tmp___203 = strerror((*tmp___202));
3321 #line 596
3322 tmp___204 = dcgettext((char const *)((void *)0), "Could not create %s: %s\n",
3323 5);
3324 #line 596
3325 fprintf((FILE * __restrict )stderr, (char const * __restrict )tmp___204,
3326 "/var/yp/binding", tmp___203);
3327 #line 598
3328 exit(1);
3329 }
3330 }
3331 #line 601
3332 tmp___210 = chdir("/var/yp/binding");
3333 #line 601
3334 if (tmp___210 < 0) {
3335 #line 603
3336 tmp___207 = __errno_location();
3337 #line 603
3338 tmp___208 = strerror((*tmp___207));
3339 #line 603
3340 tmp___209 = dcgettext((char const *)((void *)0), "Could not change to directory %s: %s\n",
3341 5);
3342 #line 603
3343 fprintf((FILE * __restrict )stderr, (char const * __restrict )tmp___209, "/var/yp/binding",
3344 tmp___208);
3345 #line 605
3346 exit(1);
3347 }
3348 #line 608
3349 if (! use_broadcast) {
3350 #line 610
3351 tmp___214 = load_config(0);
3352 #line 610
3353 if (tmp___214 != 0) {
3354 #line 612
3355 tmp___211 = dcgettext((char const *)((void *)0), "No NIS server and no -broadcast option specified.\n",
3356 5);
3357 #line 612
3358 fputs((char const * __restrict )tmp___211, (FILE * __restrict )stderr);
3359 #line 613
3360 tmp___212 = dcgettext((char const *)((void *)0), "Add a NIS server to the %s configuration file,\n",
3361 5);
3362 #line 613
3363 fprintf((FILE * __restrict )stderr, (char const * __restrict )tmp___212,
3364 configfile);
3365 #line 616
3366 tmp___213 = dcgettext((char const *)((void *)0), "or start ypbind with the -broadcast option.\n",
3367 5);
3368 #line 616
3369 fputs((char const * __restrict )tmp___213, (FILE * __restrict )stderr);
3370 #line 617
3371 exit(1);
3372 }
3373 } else {
3374 #line 621
3375 add_server((char const *)domain, (char const *)((void *)0), 0);
3376 }
3377 #line 623
3378 unlink_bindingdir();
3379 #line 625
3380 openlog("ypbind", 1, 24);
3381 #line 627
3382 if (debug_flag) {
3383 #line 629
3384 log_msg(7, "[Welcome to ypbind-mt, version %s]\n", "1.19.1");
3385 #line 630
3386 log_msg(7, "ping interval is %d seconds\n", ping_interval);
3387 } else {
3388 #line 636
3389 j = fork();
3390 #line 636
3391 if (j > 0) {
3392 #line 637
3393 exit(0);
3394 }
3395 #line 639
3396 if (j < 0) {
3397 #line 641
3398 tmp___215 = __errno_location();
3399 #line 641
3400 tmp___216 = strerror((*tmp___215));
3401 #line 641
3402 log_msg(3, "Cannot fork: %s\n", tmp___216);
3403 #line 642
3404 exit(-1);
3405 }
3406 #line 645
3407 tmp___219 = setsid();
3408 #line 645
3409 if (tmp___219 == -1) {
3410 #line 647
3411 tmp___217 = __errno_location();
3412 #line 647
3413 tmp___218 = strerror((*tmp___217));
3414 #line 647
3415 log_msg(3, "Cannot setsid: %s\n", tmp___218);
3416 #line 648
3417 exit(-1);
3418 }
3419 #line 651
3420 j = fork();
3421 #line 651
3422 if (j > 0) {
3423 #line 652
3424 exit(0);
3425 }
3426 #line 654
3427 if (j < 0) {
3428 #line 656
3429 tmp___220 = __errno_location();
3430 #line 656
3431 tmp___221 = strerror((*tmp___220));
3432 #line 656
3433 log_msg(3, "Cannot fork: %s\n", tmp___221);
3434 #line 657
3435 exit(-1);
3436 }
3437 #line 660
3438 j = 0;
3439 #line 660
3440 while (1) {
3441 #line 660
3442 tmp___222 = getdtablesize();
3443 #line 660
3444 if (! (j < tmp___222)) {
3445 #line 660
3446 break;
3447 }
3448 #line 661
3449 close(j);
3450 #line 660
3451 j ++;
3452 }
3453 #line 662
3454 tmp___223 = __errno_location();
3455 #line 662
3456 (*tmp___223) = 0;
3457 #line 664
3458 umask(0U);
3459 #line 665
3460 j = open("/dev/null", 2);
3461 #line 666
3462 dup(j);
3463 #line 667
3464 dup(j);
3465 }
3466 #line 672
3467 __nss_configure_lookup("hosts", "files dns");
3468 #line 675
3469 sigemptyset(& sigs_to_block);
3470 #line 676
3471 sigaddset(& sigs_to_block, 17);
3472 #line 677
3473 sigaddset(& sigs_to_block, 15);
3474 #line 678
3475 sigaddset(& sigs_to_block, 2);
3476 #line 679
3477 sigaddset(& sigs_to_block, 3);
3478 #line 680
3479 sigaddset(& sigs_to_block, 11);
3480 #line 681
3481 sigaddset(& sigs_to_block, 1);
3482 #line 682
3483 tmp___225 = pthread_sigmask(0, (__sigset_t const * __restrict )(& sigs_to_block),
3484 (__sigset_t * __restrict )((void *)0));
3485 #line 682
3486 if (tmp___225 != 0) {
3487 #line 684
3488 tmp___224 = dcgettext((char const *)((void *)0), "Could not block signals.",
3489 5);
3490 #line 684
3491 log_msg(3, (char const *)tmp___224);
3492 #line 685
3493 exit(1);
3494 }
3495 #line 688
3496 pthread_create((pthread_t * __restrict )(& sig_thread), (pthread_attr_t const * __restrict )((void *)0),
3497 & sig_handler, (void * __restrict )((void *)0));
3498 #line 691
3499 pthread_mutex_lock(& mutex_pid);
3500 #line 692
3501 while (pid_is_written < 1) {
3502 #line 694
3503 pthread_cond_wait((pthread_cond_t * __restrict )(& cond_pid), (pthread_mutex_t * __restrict )(& mutex_pid));
3504 }
3505 #line 696
3506 pthread_mutex_unlock(& mutex_pid);
3507 #line 698
3508 pmap_unset(100007UL, 1UL);
3509 #line 699
3510 pmap_unset(100007UL, 2UL);
3511 #line 701
3512 if (port >= 0) {
3513 goto _L___39;
3514 } else {
3515 #line 701
3516 if (local_only) {
3517 _L___39: /* CIL Label */
3518 #line 703
3519 sock = socket(2, 2, 0);
3520 #line 704
3521 if (sock < 0) {
3522 #line 706
3523 tmp___226 = __errno_location();
3524 #line 706
3525 tmp___227 = strerror((*tmp___226));
3526 #line 706
3527 tmp___228 = dcgettext((char const *)((void *)0), "Cannot create UDP: %s",
3528 5);
3529 #line 706
3530 log_msg(3, (char const *)tmp___228, tmp___227);
3531 #line 707
3532 exit(1);
3533 }
3534 #line 710
3535 memset((void *)((char *)(& socket_address)), 0, sizeof(socket_address));
3536 #line 711
3537 socket_address.sin_family = (unsigned short)2;
3538 #line 712
3539 if (local_only) {
3540 #line 713
3541 __x = 2130706433U;
3542 #line 713
3543 __asm__ ("bswap %0": "=r" (__v): "0" (__x));
3544 #line 713
3545 socket_address.sin_addr.s_addr = __v;
3546 } else {
3547 #line 715
3548 __x___0 = 0U;
3549 #line 715
3550 __asm__ ("bswap %0": "=r" (__v___0): "0" (__x___0));
3551 #line 715
3552 socket_address.sin_addr.s_addr = __v___0;
3553 }
3554 #line 717
3555 if (port >= 0) {
3556 #line 718
3557 __x___1 = (unsigned short )port;
3558 #line 718
3559 __asm__ ("rorw $8, %w0": "=r" (__v___1): "0" (__x___1): "cc");
3560 #line 718
3561 socket_address.sin_port = __v___1;
3562 }
3563 #line 720
3564 result = bind(sock, (struct sockaddr const * __restrict )((struct sockaddr *)(& socket_address)),
3565 sizeof(socket_address));
3566 #line 722
3567 if (result < 0) {
3568 #line 724
3569 tmp___229 = __errno_location();
3570 #line 724
3571 tmp___230 = strerror((*tmp___229));
3572 #line 724
3573 tmp___231 = dcgettext((char const *)((void *)0), "Cannot bind UDP: %s",
3574 5);
3575 #line 724
3576 log_msg(3, (char const *)tmp___231, tmp___230);
3577 #line 725
3578 exit(1);
3579 }
3580 } else {
3581 #line 729
3582 sock = -1;
3583 }
3584 }
3585 #line 731
3586 transp = svcudp_create(sock);
3587 #line 732
3588 if ((unsigned int )transp == (unsigned int )((void *)0)) {
3589 #line 734
3590 tmp___232 = dcgettext((char const *)((void *)0), "Cannot create udp service.",
3591 5);
3592 #line 734
3593 log_msg(3, (char const *)tmp___232);
3594 #line 735
3595 exit(1);
3596 }
3597 #line 738
3598 tmp___234 = svc_register(transp, 100007UL, 2UL, & ypbindprog_2, 17UL);
3599 #line 738
3600 if (! tmp___234) {
3601 #line 741
3602 tmp___233 = dcgettext((char const *)((void *)0), "Unable to register (YPBINDPROG, YPBINDVERS, udp).",
3603 5);
3604 #line 741
3605 log_msg(3, (char const *)tmp___233);
3606 #line 743
3607 exit(1);
3608 }
3609 #line 746
3610 tmp___236 = svc_register(transp, 100007UL, 1UL, & ypbindprog_1, 17UL);
3611 #line 746
3612 if (! tmp___236) {
3613 #line 749
3614 tmp___235 = dcgettext((char const *)((void *)0), "Unable to register (YPBINDPROG, YPBINDOLDVERS, udp).",
3615 5);
3616 #line 749
3617 log_msg(3, (char const *)tmp___235);
3618 #line 751
3619 exit(1);
3620 }
3621 #line 754
3622 if (port >= 0) {
3623 goto _L___40;
3624 } else {
3625 #line 754
3626 if (local_only) {
3627 _L___40: /* CIL Label */
3628 #line 756
3629 sock = socket(2, 1, 0);
3630 #line 757
3631 if (sock < 0) {
3632 #line 759
3633 tmp___237 = __errno_location();
3634 #line 759
3635 tmp___238 = strerror((*tmp___237));
3636 #line 759
3637 tmp___239 = dcgettext((char const *)((void *)0), "Cannot create TCP: %s",
3638 5);
3639 #line 759
3640 log_msg(3, (char const *)tmp___239, tmp___238);
3641 #line 760
3642 exit(1);
3643 }
3644 #line 763
3645 memset((void *)(& socket_address), 0, sizeof(socket_address));
3646 #line 764
3647 socket_address.sin_family = (unsigned short)2;
3648 #line 765
3649 if (local_only) {
3650 #line 766
3651 __x___2 = 2130706433U;
3652 #line 766
3653 __asm__ ("bswap %0": "=r" (__v___2): "0" (__x___2));
3654 #line 766
3655 socket_address.sin_addr.s_addr = __v___2;
3656 } else {
3657 #line 768
3658 __x___3 = 0U;
3659 #line 768
3660 __asm__ ("bswap %0": "=r" (__v___3): "0" (__x___3));
3661 #line 768
3662 socket_address.sin_addr.s_addr = __v___3;
3663 }
3664 #line 770
3665 if (port >= 0) {
3666 #line 771
3667 __x___4 = (unsigned short )port;
3668 #line 771
3669 __asm__ ("rorw $8, %w0": "=r" (__v___4): "0" (__x___4): "cc");
3670 #line 771
3671 socket_address.sin_port = __v___4;
3672 }
3673 #line 773
3674 result = bind(sock, (struct sockaddr const * __restrict )((struct sockaddr *)(& socket_address)),
3675 sizeof(socket_address));
3676 #line 775
3677 if (result < 0) {
3678 #line 777
3679 tmp___240 = __errno_location();
3680 #line 777
3681 tmp___241 = strerror((*tmp___240));
3682 #line 777
3683 tmp___242 = dcgettext((char const *)((void *)0), "Cannot bind TCP: %s",
3684 5);
3685 #line 777
3686 log_msg(3, (char const *)tmp___242, tmp___241);
3687 #line 778
3688 exit(1);
3689 }
3690 } else {
3691 #line 782
3692 sock = -1;
3693 }
3694 }
3695 #line 784
3696 transp = svctcp_create(sock, 0U, 0U);
3697 #line 785
3698 if ((unsigned int )transp == (unsigned int )((void *)0)) {
3699 #line 787
3700 tmp___243 = dcgettext((char const *)((void *)0), "Cannot create tcp service.\n",
3701 5);
3702 #line 787
3703 log_msg(3, (char const *)tmp___243);
3704 #line 788
3705 exit(1);
3706 }
3707 #line 791
3708 tmp___245 = svc_register(transp, 100007UL, 2UL, & ypbindprog_2, 6UL);
3709 #line 791
3710 if (! tmp___245) {
3711 #line 794
3712 tmp___244 = dcgettext((char const *)((void *)0), "Unable to register (YPBINDPROG, YPBINDVERS, tcp).",
3713 5);
3714 #line 794
3715 log_msg(3, (char const *)tmp___244);
3716 #line 795
3717 exit(1);
3718 }
3719 #line 798
3720 tmp___247 = svc_register(transp, 100007UL, 1UL, & ypbindprog_1, 6UL);
3721 #line 798
3722 if (! tmp___247) {
3723 #line 801
3724 tmp___246 = dcgettext((char const *)((void *)0), "Unable to register (YPBINDPROG, YPBINDOLDVERS, tcp).",
3725 5);
3726 #line 801
3727 log_msg(3, (char const *)tmp___246);
3728 #line 803
3729 exit(1);
3730 }
3731 #line 806
3732 pthread_create((pthread_t * __restrict )(& ping_thread), (pthread_attr_t const * __restrict )((void *)0),
3733 & test_bindings, (void * __restrict )((void *)0));
3734 #line 808
3735 svc_run();
3736 #line 809
3737 tmp___248 = dcgettext((char const *)((void *)0), "svc_run returned.", 5);
3738 #line 809
3739 log_msg(3, (char const *)tmp___248);
3740 #line 810
3741 unlink("/var/run/ypbind.pid");
3742 #line 811
3743 exit(1);
3744 }
3745 }
3746 #line 1 "ypbind_xdr.o"
3747 #pragma merger(0,"/tmp/cil-qTzP9RAw.i","-Wall,-g,-O2")
3748 #line 291 "/usr/include/rpc/xdr.h"
3749 extern __attribute__((__nothrow__)) bool_t xdr_u_int(XDR *__xdrs , u_int *__up ) ;
3750 #line 309
3751 extern __attribute__((__nothrow__)) bool_t xdr_enum(XDR *__xdrs , enum_t *__ep ) ;
3752 #line 315
3753 extern __attribute__((__nothrow__)) bool_t xdr_opaque(XDR *__xdrs , caddr_t __cp ,
3754 u_int __cnt ) ;
3755 #line 316
3756 extern __attribute__((__nothrow__)) bool_t xdr_string(XDR *__xdrs , char **__cpp ,
3757 u_int __maxsize ) ;
3758 #line 320
3759 extern __attribute__((__nothrow__)) bool_t xdr_char(XDR *__xdrs , char *__cp ) ;
3760 #line 322
3761 extern __attribute__((__nothrow__)) bool_t xdr_vector(XDR *__xdrs , char *__basep ,
3762 u_int __nelem , u_int __elemsize ,
3763 bool_t (*__xdr_elem)(XDR * ,
3764 void *
3765 , ...) ) ;
3766 #line 118 "ypbind.h"
3767 bool_t ypbind_xdr_domainname(XDR *xdrs , domainname *objp ) ;
3768 #line 119
3769 bool_t ypbind_xdr_resptype(XDR *xdrs , ypbind_resptype *objp ) ;
3770 #line 120
3771 bool_t ypbind_xdr_binding(XDR *xdrs , ypbind_binding *objp ) ;
3772 #line 121
3773 bool_t ypbind_xdr_resp(XDR *xdrs , ypbind_resp *objp ) ;
3774 #line 122
3775 bool_t ypbind_xdr_oldsetdom(XDR *xdrs , ypbind_oldsetdom *objp ) ;
3776 #line 123
3777 bool_t ypbind_xdr_setdom(XDR *xdrs , ypbind_setdom *objp ) ;
3778 #line 4 "ypbind_xdr.c"
3779 bool_t ypbind_xdr_domainname(XDR *xdrs , domainname *objp )
3780 { bool_t tmp ;
3781
3782 {
3783 #line 7
3784 tmp = xdr_string(xdrs, objp, 256U);
3785 #line 7
3786 if (! tmp) {
3787 #line 8
3788 return (0);
3789 }
3790 #line 9
3791 return (1);
3792 }
3793 }
3794 #line 12 "ypbind_xdr.c"
3795 bool_t ypbind_xdr_resptype(XDR *xdrs , ypbind_resptype *objp )
3796 { bool_t tmp ;
3797
3798 {
3799 #line 15
3800 tmp = xdr_enum(xdrs, (enum_t *)objp);
3801 #line 15
3802 if (! tmp) {
3803 #line 16
3804 return (0);
3805 }
3806 #line 17
3807 return (1);
3808 }
3809 }
3810 #line 20 "ypbind_xdr.c"
3811 bool_t ypbind_xdr_binding(XDR *xdrs , ypbind_binding *objp )
3812 { bool_t tmp ;
3813 bool_t tmp___0 ;
3814
3815 {
3816 #line 23
3817 tmp = xdr_opaque(xdrs, objp->ypbind_binding_addr, 4U);
3818 #line 23
3819 if (! tmp) {
3820 #line 24
3821 return (0);
3822 }
3823 #line 25
3824 tmp___0 = xdr_opaque(xdrs, objp->ypbind_binding_port, 2U);
3825 #line 25
3826 if (! tmp___0) {
3827 #line 26
3828 return (0);
3829 }
3830 #line 27
3831 return (1);
3832 }
3833 }
3834 #line 30 "ypbind_xdr.c"
3835 bool_t ypbind_xdr_resp(XDR *xdrs , ypbind_resp *objp )
3836 { bool_t tmp ;
3837 bool_t tmp___0 ;
3838 bool_t tmp___1 ;
3839
3840 {
3841 #line 33
3842 tmp = ypbind_xdr_resptype(xdrs, & objp->ypbind_status);
3843 #line 33
3844 if (! tmp) {
3845 #line 34
3846 return (0);
3847 }
3848 #line 35
3849 switch ((int )objp->ypbind_status) {
3850 case 2:
3851 #line 38
3852 tmp___0 = xdr_u_int(xdrs, & objp->ypbind_resp_u.ypbind_error);
3853 #line 38
3854 if (! tmp___0) {
3855 #line 39
3856 return (0);
3857 }
3858 #line 40
3859 break;
3860 case 1:
3861 #line 42
3862 tmp___1 = ypbind_xdr_binding(xdrs, & objp->ypbind_resp_u.ypbind_bindinfo);
3863 #line 42
3864 if (! tmp___1) {
3865 #line 43
3866 return (0);
3867 }
3868 #line 44
3869 break;
3870 default: ;
3871 #line 46
3872 return (0);
3873 }
3874 #line 48
3875 return (1);
3876 }
3877 }
3878 #line 51 "ypbind_xdr.c"
3879 bool_t ypbind_xdr_oldsetdom(XDR *xdrs , ypbind_oldsetdom *objp )
3880 { bool_t tmp ;
3881 bool_t tmp___0 ;
3882
3883 {
3884 #line 54
3885 tmp = xdr_vector(xdrs, objp->ypoldsetdom_domain, 256U, sizeof(char ), (bool_t (*)(XDR * ,
3886 void *
3887 , ...))(& xdr_char));
3888 #line 54
3889 if (! tmp) {
3890 #line 56
3891 return (0);
3892 }
3893 #line 57
3894 tmp___0 = ypbind_xdr_binding(xdrs, & objp->ypoldsetdom_binding);
3895 #line 57
3896 if (! tmp___0) {
3897 #line 58
3898 return (0);
3899 }
3900 #line 59
3901 return (1);
3902 }
3903 }
3904 #line 62 "ypbind_xdr.c"
3905 bool_t ypbind_xdr_setdom(XDR *xdrs , ypbind_setdom *objp )
3906 { bool_t tmp ;
3907 bool_t tmp___0 ;
3908 bool_t tmp___1 ;
3909
3910 {
3911 #line 65
3912 tmp = ypbind_xdr_domainname(xdrs, & objp->ypsetdom_domain);
3913 #line 65
3914 if (! tmp) {
3915 #line 66
3916 return (0);
3917 }
3918 #line 67
3919 tmp___0 = ypbind_xdr_binding(xdrs, & objp->ypsetdom_binding);
3920 #line 67
3921 if (! tmp___0) {
3922 #line 68
3923 return (0);
3924 }
3925 #line 69
3926 tmp___1 = xdr_u_int(xdrs, & objp->ypsetdom_vers);
3927 #line 69
3928 if (! tmp___1) {
3929 #line 70
3930 return (0);
3931 }
3932 #line 71
3933 return (1);
3934 }
3935 }
3936 #line 1 "ypbind_svc.o"
3937 #pragma merger(0,"/tmp/cil-c4GTiXrf.i","-Wall,-g,-O2")
3938 #line 287 "/usr/include/rpc/xdr.h"
3939 extern __attribute__((__nothrow__)) bool_t xdr_void(void) ;
3940 #line 229 "/usr/include/rpc/svc.h"
3941 extern __attribute__((__nothrow__)) bool_t svc_sendreply(SVCXPRT *xprt , bool_t (*__xdr_results)(XDR * ,
3942 void *
3943 , ...) ,
3944 caddr_t __xdr_location ) ;
3945 #line 232
3946 extern __attribute__((__nothrow__)) void svcerr_decode(SVCXPRT *__xprt ) ;
3947 #line 236
3948 extern __attribute__((__nothrow__)) void svcerr_noproc(SVCXPRT *__xprt ) ;
3949 #line 245
3950 extern __attribute__((__nothrow__)) void svcerr_systemerr(SVCXPRT *__xprt ) ;
3951 #line 100 "ypbind.h"
3952 bool_t ypbindproc_oldnull_1_svc(void *argp __attribute__((__unused__)) , void *result ,
3953 struct svc_req *rqstp __attribute__((__unused__)) ) ;
3954 #line 102
3955 bool_t ypbindproc_olddomain_1_svc(domainname *argp , ypbind_resp *result , struct svc_req *rqstp ) ;
3956 #line 104
3957 bool_t ypbindproc_oldsetdom_1_svc(ypbind_oldsetdom *argp , void *result , struct svc_req *rqstp ) ;
3958 #line 105
3959 int ypbindprog_1_freeresult(SVCXPRT *transp __attribute__((__unused__)) , bool_t (*xdr_result)(XDR * ,
3960 void *
3961 , ...) ,
3962 caddr_t result ) ;
3963 #line 109
3964 bool_t ypbindproc_null_2_svc(void *argp __attribute__((__unused__)) , void *result ,
3965 struct svc_req *rqstp __attribute__((__unused__)) ) ;
3966 #line 111
3967 bool_t ypbindproc_domain_2_svc(domainname *argp , ypbind_resp *result , struct svc_req *rqstp ) ;
3968 #line 113
3969 bool_t ypbindproc_setdom_2_svc(ypbind_setdom *argp , void *result , struct svc_req *rqstp ) ;
3970 #line 114
3971 int ypbindprog_2_freeresult(SVCXPRT *transp __attribute__((__unused__)) , bool_t (*xdr_result)(XDR * ,
3972 void *
3973 , ...) ,
3974 caddr_t result ) ;
3975 #line 23 "ypbind_svc.c"
3976 void ypbindprog_1(struct svc_req *rqstp , SVCXPRT *transp )
3977 { union __anonunion_argument_57 argument ;
3978 union __anonunion_result_58 result ;
3979 bool_t retval ;
3980 bool_t (*xdr_argument)(XDR * , void * , ...) ;
3981 bool_t (*xdr_result)(XDR * , void * , ...) ;
3982 bool_t (*local)(char * , void * , struct svc_req * ) ;
3983 bool_t tmp ;
3984 bool_t tmp___0 ;
3985 bool_t tmp___1 ;
3986 char *tmp___2 ;
3987 bool_t tmp___3 ;
3988 char *tmp___4 ;
3989 int tmp___5 ;
3990
3991 {
3992 #line 41
3993 switch ((int )rqstp->rq_proc) {
3994 case 0:
3995 #line 44
3996 xdr_argument = (bool_t (*)(XDR * , void * , ...))(& xdr_void);
3997 #line 45
3998 xdr_result = (bool_t (*)(XDR * , void * , ...))(& xdr_void);
3999 #line 46
4000 local = (bool_t (*)(char * , void * , struct svc_req * ))(& ypbindproc_oldnull_1_svc);
4001 #line 48
4002 break;
4003 case 1:
4004 #line 51
4005 xdr_argument = (bool_t (*)(XDR * , void * , ...))(& ypbind_xdr_domainname);
4006 #line 52
4007 xdr_result = (bool_t (*)(XDR * , void * , ...))(& ypbind_xdr_resp);
4008 #line 53
4009 local = (bool_t (*)(char * , void * , struct svc_req * ))(& ypbindproc_olddomain_1_svc);
4010 #line 55
4011 break;
4012 case 2:
4013 #line 58
4014 xdr_argument = (bool_t (*)(XDR * , void * , ...))(& ypbind_xdr_oldsetdom);
4015 #line 59
4016 xdr_result = (bool_t (*)(XDR * , void * , ...))(& xdr_void);
4017 #line 60
4018 local = (bool_t (*)(char * , void * , struct svc_req * ))(& ypbindproc_oldsetdom_1_svc);
4019 #line 62
4020 break;
4021 default:
4022 #line 65
4023 svcerr_noproc(transp);
4024 #line 66
4025 return;
4026 }
4027 #line 68
4028 memset((void *)((char *)(& argument)), 0, sizeof(argument));
4029 #line 69
4030 tmp = ((*((transp->xp_ops)->xp_getargs)))(transp, xdr_argument, (char *)(& argument));
4031 #line 69
4032 if (! tmp) {
4033 #line 71
4034 svcerr_decode(transp);
4035 #line 72
4036 return;
4037 }
4038 #line 74
4039 tmp___0 = ((*local))((char *)(& argument), (void *)(& result), rqstp);
4040 #line 74
4041 retval = tmp___0;
4042 #line 75
4043 if (retval > 0) {
4044 #line 75
4045 tmp___1 = svc_sendreply(transp, xdr_result, (char *)(& result));
4046 #line 75
4047 if (! tmp___1) {
4048 #line 77
4049 svcerr_systemerr(transp);
4050 }
4051 }
4052 #line 79
4053 tmp___3 = ((*((transp->xp_ops)->xp_freeargs)))(transp, xdr_argument, (char *)(& argument));
4054 #line 79
4055 if (! tmp___3) {
4056 #line 80
4057 tmp___2 = dcgettext((char const *)((void *)0), "unable to free arguments", 5);
4058 #line 80
4059 log_msg(3, (char const *)tmp___2);
4060 }
4061 #line 82
4062 tmp___5 = ypbindprog_1_freeresult(transp, xdr_result, (char *)(& result));
4063 #line 82
4064 if (! tmp___5) {
4065 #line 83
4066 tmp___4 = dcgettext((char const *)((void *)0), "unable to free results", 5);
4067 #line 83
4068 log_msg(3, (char const *)tmp___4);
4069 }
4070 #line 85
4071 return;
4072 }
4073 }
4074 #line 88 "ypbind_svc.c"
4075 void ypbindprog_2(struct svc_req *rqstp , SVCXPRT *transp )
4076 { union __anonunion_argument_59 argument ;
4077 union __anonunion_result_60 result ;
4078 bool_t retval ;
4079 bool_t (*xdr_argument)(XDR * , void * , ...) ;
4080 bool_t (*xdr_result)(XDR * , void * , ...) ;
4081 bool_t (*local)(char * , void * , struct svc_req * ) ;
4082 bool_t tmp ;
4083 bool_t tmp___0 ;
4084 bool_t tmp___1 ;
4085 char *tmp___2 ;
4086 bool_t tmp___3 ;
4087 char *tmp___4 ;
4088 int tmp___5 ;
4089
4090 {
4091 #line 106
4092 switch ((int )rqstp->rq_proc) {
4093 case 0:
4094 #line 109
4095 xdr_argument = (bool_t (*)(XDR * , void * , ...))(& xdr_void);
4096 #line 110
4097 xdr_result = (bool_t (*)(XDR * , void * , ...))(& xdr_void);
4098 #line 111
4099 local = (bool_t (*)(char * , void * , struct svc_req * ))(& ypbindproc_null_2_svc);
4100 #line 113
4101 break;
4102 case 1:
4103 #line 116
4104 xdr_argument = (bool_t (*)(XDR * , void * , ...))(& ypbind_xdr_domainname);
4105 #line 117
4106 xdr_result = (bool_t (*)(XDR * , void * , ...))(& ypbind_xdr_resp);
4107 #line 118
4108 local = (bool_t (*)(char * , void * , struct svc_req * ))(& ypbindproc_domain_2_svc);
4109 #line 120
4110 break;
4111 case 2:
4112 #line 123
4113 xdr_argument = (bool_t (*)(XDR * , void * , ...))(& ypbind_xdr_setdom);
4114 #line 124
4115 xdr_result = (bool_t (*)(XDR * , void * , ...))(& xdr_void);
4116 #line 125
4117 local = (bool_t (*)(char * , void * , struct svc_req * ))(& ypbindproc_setdom_2_svc);
4118 #line 127
4119 break;
4120 default:
4121 #line 130
4122 svcerr_noproc(transp);
4123 #line 131
4124 return;
4125 }
4126 #line 133
4127 memset((void *)((char *)(& argument)), 0, sizeof(argument));
4128 #line 134
4129 tmp = ((*((transp->xp_ops)->xp_getargs)))(transp, xdr_argument, (char *)(& argument));
4130 #line 134
4131 if (! tmp) {
4132 #line 136
4133 svcerr_decode(transp);
4134 #line 137
4135 return;
4136 }
4137 #line 139
4138 tmp___0 = ((*local))((char *)(& argument), (void *)(& result), rqstp);
4139 #line 139
4140 retval = tmp___0;
4141 #line 140
4142 if (retval > 0) {
4143 #line 140
4144 tmp___1 = svc_sendreply(transp, xdr_result, (char *)(& result));
4145 #line 140
4146 if (! tmp___1) {
4147 #line 142
4148 svcerr_systemerr(transp);
4149 }
4150 }
4151 #line 144
4152 tmp___3 = ((*((transp->xp_ops)->xp_freeargs)))(transp, xdr_argument, (char *)(& argument));
4153 #line 144
4154 if (! tmp___3) {
4155 #line 145
4156 tmp___2 = dcgettext((char const *)((void *)0), "unable to free arguments", 5);
4157 #line 145
4158 log_msg(3, (char const *)tmp___2);
4159 }
4160 #line 147
4161 tmp___5 = ypbindprog_2_freeresult(transp, xdr_result, (char *)(& result));
4162 #line 147
4163 if (! tmp___5) {
4164 #line 148
4165 tmp___4 = dcgettext((char const *)((void *)0), "unable to free results", 5);
4166 #line 148
4167 log_msg(3, (char const *)tmp___4);
4168 }
4169 #line 150
4170 return;
4171 }
4172 }
4173 #line 1 "ypbind_server.o"
4174 #pragma merger(0,"/tmp/cil-IqD537Ar.i","-Wall,-g,-O2")
4175 #line 54 "/usr/include/arpa/inet.h"
4176 extern __attribute__((__nothrow__)) char *inet_ntoa(struct in_addr __in ) ;
4177 #line 375 "/usr/include/rpc/xdr.h"
4178 extern __attribute__((__nothrow__)) void xdr_free(bool_t (*__proc)(XDR * , void *
4179 , ...) , char *__objp ) ;
4180 #line 10 "local.h"
4181 void find_domain(char const *domain___0 , ypbind_resp *result ) ;
4182 #line 14
4183 void change_binding(char const *domain___0 , ypbind_binding *binding ) ;
4184 #line 19
4185 int test_bindings_once(int lastcheck , char const *req_domain ) ;
4186 #line 41 "ypbind_server.c"
4187 bool_t ypbindproc_oldnull_1_svc(void *argp __attribute__((__unused__)) , void *result ,
4188 struct svc_req *rqstp __attribute__((__unused__)) )
4189 {
4190
4191 {
4192 #line 45
4193 memset(result, 0, sizeof(char *));
4194 #line 46
4195 return (1);
4196 }
4197 }
4198 #line 49 "ypbind_server.c"
4199 bool_t ypbindproc_null_2_svc(void *argp __attribute__((__unused__)) , void *result ,
4200 struct svc_req *rqstp __attribute__((__unused__)) )
4201 {
4202
4203 {
4204 #line 53
4205 memset(result, 0, sizeof(char *));
4206 #line 54
4207 return (1);
4208 }
4209 }
4210 #line 57 "ypbind_server.c"
4211 static bool_t ypbindproc_domain(char *domain___0 , ypbind_resp *result , struct svc_req *rqstp __attribute__((__unused__)) )
4212 { char *tmp ;
4213 char *tmp___1 ;
4214 char *tmp___2 ;
4215 char *tmp___3 ;
4216
4217 {
4218 #line 61
4219 memset((void *)result, 0, sizeof(ypbind_resp ));
4220 #line 62
4221 result->ypbind_status = 2;
4222 #line 63
4223 result->ypbind_resp_u.ypbind_error = 2U;
4224 #line 65
4225 tmp___1 = __builtin_strchr(domain___0, (char )'/');
4226 #line 65
4227 if (tmp___1) {
4228 #line 67
4229 tmp = dcgettext((char const *)((void *)0), "Domain name \'%s\' has embedded slash -- rejecting.",
4230 5);
4231 #line 67
4232 log_msg(3, (char const *)tmp, domain___0);
4233 #line 69
4234 return (1);
4235 }
4236 #line 72
4237 test_bindings_once(1, (char const *)domain___0);
4238 #line 73
4239 find_domain((char const *)domain___0, result);
4240 #line 75
4241 if (debug_flag) {
4242 #line 77
4243 if ((int )result->ypbind_status == 2) {
4244 #line 78
4245 tmp___2 = dcgettext((char const *)((void *)0), "Status: YPBIND_FAIL_VAL",
4246 5);
4247 #line 78
4248 log_msg(7, (char const *)tmp___2);
4249 } else {
4250 #line 80
4251 tmp___3 = dcgettext((char const *)((void *)0), "Status: YPBIND_SUCC_VAL",
4252 5);
4253 #line 80
4254 log_msg(7, (char const *)tmp___3);
4255 }
4256 }
4257 #line 82
4258 return (1);
4259 }
4260 }
4261 #line 85 "ypbind_server.c"
4262 bool_t ypbindproc_olddomain_1_svc(domainname *argp , ypbind_resp *result , struct svc_req *rqstp )
4263 { bool_t tmp ;
4264
4265 {
4266 #line 89
4267 if (debug_flag) {
4268 #line 90
4269 log_msg(7, "ypbindproc_olddomain_1_svc (%s)", (*argp));
4270 }
4271 #line 92
4272 tmp = ypbindproc_domain((*argp), result, rqstp);
4273 #line 92
4274 return (tmp);
4275 }
4276 }
4277 #line 95 "ypbind_server.c"
4278 bool_t ypbindproc_domain_2_svc(domainname *argp , ypbind_resp *result , struct svc_req *rqstp )
4279 { bool_t tmp ;
4280
4281 {
4282 #line 99
4283 if (debug_flag) {
4284 #line 100
4285 log_msg(7, "ypbindproc_domain_2_svc (%s)", (*argp));
4286 }
4287 #line 102
4288 tmp = ypbindproc_domain((*argp), result, rqstp);
4289 #line 102
4290 return (tmp);
4291 }
4292 }
4293 #line 105 "ypbind_server.c"
4294 static bool_t ypbindproc_setdom(char const *domain___0 , ypbind_binding *binding ,
4295 struct sockaddr_in *fromhost )
4296 { char *tmp ;
4297 char *tmp___1 ;
4298 char *tmp___2 ;
4299 char *tmp___3 ;
4300 register unsigned int __v ;
4301 register unsigned int __x ;
4302 char *tmp___4 ;
4303 char *tmp___5 ;
4304 register unsigned short __v___0 ;
4305 register unsigned short __x___0 ;
4306
4307 {
4308 #line 109
4309 tmp___1 = __builtin_strchr((char *)domain___0, (char )'/');
4310 #line 109
4311 if (tmp___1) {
4312 #line 111
4313 tmp = dcgettext((char const *)((void *)0), "Domain name \'%s\' has embedded slash -- rejecting.",
4314 5);
4315 #line 111
4316 log_msg(3, (char const *)tmp, domain___0);
4317 #line 113
4318 return (1);
4319 }
4320 #line 116
4321 switch (ypset) {
4322 case 2:
4323 #line 119
4324 __x = 2130706433U;
4325 #line 119
4326 __asm__ ("bswap %0": "=r" (__v): "0" (__x));
4327 #line 119
4328 if (fromhost->sin_addr.s_addr != __v) {
4329 #line 121
4330 if (debug_flag) {
4331 #line 122
4332 tmp___2 = inet_ntoa(fromhost->sin_addr);
4333 #line 122
4334 tmp___3 = dcgettext((char const *)((void *)0), "User from \'%s\' try\'s to change the binding.",
4335 5);
4336 #line 122
4337 log_msg(7, (char const *)tmp___3, tmp___2);
4338 }
4339 #line 125
4340 return (1);
4341 }
4342 #line 127
4343 break;
4344 case 1:
4345 #line 129
4346 break;
4347 case 0:
4348 default:
4349 #line 132
4350 tmp___4 = dcgettext((char const *)((void *)0), "Changing the binding is not allowed.",
4351 5);
4352 #line 132
4353 log_msg(3, (char const *)tmp___4);
4354 #line 133
4355 return (1);
4356 }
4357 #line 135
4358 __x___0 = fromhost->sin_port;
4359 #line 135
4360 __asm__ ("rorw $8, %w0": "=r" (__v___0): "0" (__x___0): "cc");
4361 #line 135
4362 if ((int )__v___0 >= 1024) {
4363 #line 137
4364 tmp___5 = dcgettext((char const *)((void *)0), "SETDOM request doesn\'t come from reserved port.",
4365 5);
4366 #line 137
4367 log_msg(3, (char const *)tmp___5);
4368 #line 138
4369 return (1);
4370 }
4371 #line 141
4372 change_binding(domain___0, binding);
4373 #line 143
4374 return (1);
4375 }
4376 }
4377 #line 146 "ypbind_server.c"
4378 bool_t ypbindproc_oldsetdom_1_svc(ypbind_oldsetdom *argp , void *result , struct svc_req *rqstp )
4379 { bool_t tmp ;
4380
4381 {
4382 #line 150
4383 if (debug_flag) {
4384 #line 151
4385 log_msg(7, "ypbindproc_oldsetdom_1_svc (%s)", argp->ypoldsetdom_domain);
4386 }
4387 #line 154
4388 memset(result, 0, sizeof(char *));
4389 #line 156
4390 tmp = ypbindproc_setdom((char const *)(argp->ypoldsetdom_domain), & argp->ypoldsetdom_binding,
4391 & (rqstp->rq_xprt)->xp_raddr);
4392 #line 156
4393 return (tmp);
4394 }
4395 }
4396 #line 161 "ypbind_server.c"
4397 bool_t ypbindproc_setdom_2_svc(ypbind_setdom *argp , void *result , struct svc_req *rqstp )
4398 { bool_t tmp ;
4399
4400 {
4401 #line 165
4402 if (debug_flag) {
4403 #line 166
4404 log_msg(7, "ypbindproc_setdom_2_svc (%s)", argp->ypsetdom_domain);
4405 }
4406 #line 169
4407 memset(result, 0, sizeof(char *));
4408 #line 171
4409 tmp = ypbindproc_setdom((char const *)argp->ypsetdom_domain, & argp->ypsetdom_binding,
4410 & (rqstp->rq_xprt)->xp_raddr);
4411 #line 171
4412 return (tmp);
4413 }
4414 }
4415 #line 176 "ypbind_server.c"
4416 int ypbindprog_1_freeresult(SVCXPRT *transp __attribute__((__unused__)) , bool_t (*xdr_result)(XDR * ,
4417 void *
4418 , ...) ,
4419 caddr_t result )
4420 {
4421
4422 {
4423 #line 180
4424 xdr_free(xdr_result, result);
4425 #line 182
4426 return (1);
4427 }
4428 }
4429 #line 185 "ypbind_server.c"
4430 int ypbindprog_2_freeresult(SVCXPRT *transp __attribute__((__unused__)) , bool_t (*xdr_result)(XDR * ,
4431 void *
4432 , ...) ,
4433 caddr_t result )
4434 {
4435
4436 {
4437 #line 189
4438 xdr_free(xdr_result, result);
4439 #line 191
4440 return (1);
4441 }
4442 }
4443 #line 1 "log_msg.o"
4444 #pragma merger(0,"/tmp/cil-gqDJgxro.i","-Wall,-g,-O2")
4445 #line 346 "/usr/include/stdio.h"
4446 extern int vfprintf(FILE * __restrict __s , char const * __restrict __format ,
4447 __gnuc_va_list __arg ) ;
4448 #line 487
4449 extern int fputc(int __c , FILE *__stream ) ;
4450 #line 200 "/usr/include/sys/syslog.h"
4451 extern void ( /* format attribute */ vsyslog)(int __pri , char const *__fmt , __gnuc_va_list __ap ) ;
4452 #line 1011 "/usr/include/unistd.h"
4453 extern __attribute__((__nothrow__)) long syscall(long __sysno , ...) ;
4454 #line 33 "log_msg.c"
4455 pid_t gettid(void)
4456 { pid_t tmp ;
4457
4458 {
4459 #line 36
4460 tmp = (pid_t )syscall(224L);
4461 #line 36
4462 return (tmp);
4463 }
4464 }
4465 #line 46 "log_msg.c"
4466 int debug_flag = 0;
4467 #line 48 "log_msg.c"
4468 void log_msg(int type , char const *fmt , ...)
4469 { va_list ap ;
4470 pid_t tmp ;
4471
4472 {
4473 #line 56
4474 __builtin_va_start(ap, fmt);
4475 #line 58
4476 if (debug_flag) {
4477 #line 60
4478 tmp = gettid();
4479 #line 60
4480 fprintf((FILE * __restrict )stderr, (char const * __restrict )"%d: ", tmp);
4481 #line 61
4482 vfprintf((FILE * __restrict )stderr, (char const * __restrict )fmt, ap);
4483 #line 62
4484 fputc('\n', stderr);
4485 } else {
4486 #line 70
4487 vsyslog(type, fmt, ap);
4488 }
4489 #line 74
4490 __builtin_va_end(ap);
4491 #line 75
4492 return;
4493 }
4494 }
4495 #line 1 "serv_list.o"
4496 #pragma merger(0,"/tmp/cil-XubJ6WST.i","-Wall,-g,-O2")
4497 #line 50 "/usr/include/sys/uio.h"
4498 extern ssize_t writev(int __fd , struct iovec const *__iovec , int __count ) ;
4499 #line 61 "/usr/include/netdb.h"
4500 extern __attribute__((__nothrow__)) int *__h_errno_location(void) __attribute__((__const__)) ;
4501 #line 166
4502 extern int gethostbyaddr_r(void const * __restrict __addr , __socklen_t __len ,
4503 int __type , struct hostent * __restrict __result_buf ,
4504 char * __restrict __buf , size_t __buflen , struct hostent ** __restrict __result ,
4505 int * __restrict __h_errnop ) ;
4506 #line 173
4507 extern int gethostbyname_r(char const * __restrict __name , struct hostent * __restrict __result_buf ,
4508 char * __restrict __buf , size_t __buflen , struct hostent ** __restrict __result ,
4509 int * __restrict __h_errnop ) ;
4510 #line 405 "/usr/include/unistd.h"
4511 extern unsigned int sleep(unsigned int __seconds ) ;
4512 #line 589 "/usr/include/stdlib.h"
4513 extern __attribute__((__nothrow__)) void *malloc(size_t __size ) __attribute__((__malloc__)) ;
4514 #line 591
4515 extern __attribute__((__nothrow__)) void *calloc(size_t __nmemb , size_t __size ) __attribute__((__malloc__)) ;
4516 #line 600
4517 extern __attribute__((__nothrow__)) void *realloc(void *__ptr , size_t __size ) __attribute__((__warn_unused_result__,
4518 __malloc__)) ;
4519 #line 628
4520 extern __attribute__((__nothrow__, __noreturn__)) void abort(void) ;
4521 #line 38 "/usr/include/string.h"
4522 extern __attribute__((__nothrow__)) void *memcpy(void * __restrict __dest , void const * __restrict __src ,
4523 size_t __n ) __attribute__((__nonnull__(1,2))) ;
4524 #line 84
4525 extern __attribute__((__nothrow__)) char *strcpy(char * __restrict __dest , char const * __restrict __src ) __attribute__((__nonnull__(1,2))) ;
4526 #line 1304 "/usr/include/bits/string2.h"
4527 extern __attribute__((__nothrow__)) char *__strdup(char const *__string ) __attribute__((__malloc__)) ;
4528 #line 289 "/usr/include/rpc/xdr.h"
4529 extern __attribute__((__nothrow__)) bool_t xdr_u_short(XDR *__xdrs , u_short *__usp ) ;
4530 #line 308
4531 extern __attribute__((__nothrow__)) bool_t xdr_bool(XDR *__xdrs , bool_t *__bp ) ;
4532 #line 163 "/usr/include/rpc/auth.h"
4533 extern AUTH *authunix_create_default(void) ;
4534 #line 335 "/usr/include/rpc/clnt.h"
4535 extern __attribute__((__nothrow__)) CLIENT *clntudp_create(struct sockaddr_in *__raddr ,
4536 u_long __program , u_long __version ,
4537 struct timeval __wait_resend ,
4538 int *__sockp ) ;
4539 #line 338
4540 extern __attribute__((__nothrow__)) CLIENT *clntudp_bufcreate(struct sockaddr_in *__raddr ,
4541 u_long __program ,
4542 u_long __version ,
4543 struct timeval __wait_resend ,
4544 int *__sockp , u_int __sendsz ,
4545 u_int __recvsz ) ;
4546 #line 395
4547 extern struct rpc_createerr rpc_createerr ;
4548 #line 402
4549 extern __attribute__((__nothrow__)) char *clnt_sperrno(enum clnt_stat __num ) ;
4550 #line 85 "/usr/include/rpc/pmap_clnt.h"
4551 extern __attribute__((__nothrow__)) enum clnt_stat clnt_broadcast(u_long __prog ,
4552 u_long __vers ,
4553 u_long __proc ,
4554 bool_t (*__xargs)(XDR * ,
4555 void *
4556 , ...) ,
4557 caddr_t __argsp ,
4558 bool_t (*__xresults)(XDR * ,
4559 void *
4560 , ...) ,
4561 caddr_t __resultsp ,
4562 bool_t (*__eachresult)(caddr_t resp ,
4563 struct sockaddr_in *raddr ) ) ;
4564 #line 97 "/usr/include/rpc/pmap_prot.h"
4565 extern __attribute__((__nothrow__)) bool_t xdr_pmap(XDR *__xdrs , struct pmap *__regs ) ;
4566 #line 42 "/usr/include/sys/ioctl.h"
4567 extern __attribute__((__nothrow__)) int ioctl(int __fd , unsigned long __request
4568 , ...) ;
4569 #line 187 "/usr/include/time.h"
4570 extern __attribute__((__nothrow__)) time_t time(time_t *__timer ) ;
4571 #line 231 "/usr/include/pthread.h"
4572 extern __attribute__((__noreturn__)) void pthread_exit(void *__retval ) ;
4573 #line 725
4574 extern __attribute__((__nothrow__)) int pthread_mutex_trylock(pthread_mutex_t *__mutex ) __attribute__((__nonnull__(1))) ;
4575 #line 39 "pthread_np.h"
4576 int pthread_rdwr_rlock_np(pthread_rdwr_t *rdwrp ) ;
4577 #line 40
4578 int pthread_rdwr_wlock_np(pthread_rdwr_t *rdwrp ) ;
4579 #line 41
4580 int pthread_rdwr_runlock_np(pthread_rdwr_t *rdwrp ) ;
4581 #line 42
4582 int pthread_rdwr_wunlock_np(pthread_rdwr_t *rdwrp ) ;
4583 #line 84 "serv_list.c"
4584 static struct binding *domainlist = (struct binding *)((void *)0);
4585 #line 85 "serv_list.c"
4586 static int max_domains = 0;
4587 #line 86 "serv_list.c"
4588 static struct __anonstruct_pthread_rdwr_t_72 domainlock = {0, 0, 0, {{0, 0U, 0, 0, 0U, {0}}}, {{0, 0U, 0ULL, 0ULL, 0ULL, (void *)0, 0U, 0U}}};
4589 #line 87 "serv_list.c"
4590 static union __anonunion_pthread_mutex_t_5 search_lock = {{0, 0U, 0, 0, 0U, {0}}};
4591 #line 89
4592 static void do_broadcast(struct binding *list ) ;
4593 #line 90
4594 static int ping_all(struct binding *list ) ;
4595 #line 92 "serv_list.c"
4596 static void remove_bindingfile(char const *domain___0 )
4597 { size_t tmp ;
4598 size_t tmp___0 ;
4599 char *path ;
4600 unsigned int __lengthofpath ;
4601
4602 {
4603 #line 95
4604 tmp = strlen("/var/yp/binding");
4605 #line 95
4606 tmp___0 = strlen(domain___0);
4607 #line 95
4608 __lengthofpath = (tmp + tmp___0) + 10U;
4609 #line 95
4610 path = (char *)__builtin_alloca(sizeof((*path)) * __lengthofpath);
4611 #line 97
4612 sprintf((char * __restrict )path, (char const * __restrict )"%s/%s.1", "/var/yp/binding",
4613 domain___0);
4614 #line 98
4615 unlink((char const *)path);
4616 #line 99
4617 sprintf((char * __restrict )path, (char const * __restrict )"%s/%s.2", "/var/yp/binding",
4618 domain___0);
4619 #line 100
4620 unlink((char const *)path);
4621 #line 101
4622 return;
4623 }
4624 }
4625 #line 105 "serv_list.c"
4626 static void update_bindingfile(struct binding *entry )
4627 { unsigned short sport ;
4628 struct iovec iov[2] ;
4629 struct ypbind_resp ybres ;
4630 char path1[4097] ;
4631 char path2[4097] ;
4632 int fd ;
4633 int len ;
4634 int *tmp ;
4635 char *tmp___0 ;
4636 ssize_t tmp___1 ;
4637 int *tmp___2 ;
4638 char *tmp___3 ;
4639 int *tmp___4 ;
4640 char *tmp___5 ;
4641 ssize_t tmp___6 ;
4642 int *tmp___7 ;
4643 char *tmp___8 ;
4644
4645 {
4646 #line 109
4647 sport = (unsigned short )port;
4648 #line 115
4649 sprintf((char * __restrict )(path1), (char const * __restrict )"%s/%s.1", "/var/yp/binding",
4650 entry->domain);
4651 #line 116
4652 sprintf((char * __restrict )(path2), (char const * __restrict )"%s/%s.2", "/var/yp/binding",
4653 entry->domain);
4654 #line 118
4655 iov[0].iov_base = (void *)((char *)(& sport));
4656 #line 119
4657 iov[0].iov_len = sizeof(sport);
4658 #line 120
4659 iov[1].iov_base = (void *)((char *)(& ybres));
4660 #line 121
4661 iov[1].iov_len = sizeof(ybres);
4662 #line 123
4663 memset((void *)(& ybres), 0, sizeof(ybres));
4664 #line 124
4665 ybres.ypbind_status = 1;
4666 #line 125
4667 if (entry->active >= 0) {
4668 #line 127
4669 memcpy((void * __restrict )(& ybres.ypbind_resp_u.ypbind_bindinfo.ypbind_binding_addr),
4670 (void const * __restrict )(& entry->server[entry->active].addr), sizeof(struct in_addr ));
4671 #line 129
4672 memcpy((void * __restrict )(& ybres.ypbind_resp_u.ypbind_bindinfo.ypbind_binding_port),
4673 (void const * __restrict )(& entry->server[entry->active].port), sizeof(unsigned short ));
4674 } else {
4675 #line 132
4676 if (entry->active == -2) {
4677 #line 134
4678 memcpy((void * __restrict )(& ybres.ypbind_resp_u.ypbind_bindinfo.ypbind_binding_addr),
4679 (void const * __restrict )(& entry->ypset.addr), sizeof(struct in_addr ));
4680 #line 136
4681 memcpy((void * __restrict )(& ybres.ypbind_resp_u.ypbind_bindinfo.ypbind_binding_port),
4682 (void const * __restrict )(& entry->ypset.port), sizeof(unsigned short ));
4683 } else {
4684 #line 143
4685 unlink((char const *)(path1));
4686 #line 144
4687 unlink((char const *)(path2));
4688 #line 145
4689 log_msg(3, "INTERNAL ERROR: update_bindingfile called without valid data!");
4690 #line 146
4691 return;
4692 }
4693 }
4694 #line 149
4695 len = (int )(iov[0].iov_len + iov[1].iov_len);
4696 #line 151
4697 fd = open((char const *)(path1), 578, 420);
4698 #line 151
4699 if (fd != -1) {
4700 #line 153
4701 tmp___1 = writev(fd, (struct iovec const *)(iov), 2);
4702 #line 153
4703 if (tmp___1 != len) {
4704 #line 155
4705 tmp = __errno_location();
4706 #line 155
4707 tmp___0 = strerror((*tmp));
4708 #line 155
4709 log_msg(3, "writev (%s): %s", path1, tmp___0);
4710 #line 156
4711 unlink((char const *)(path1));
4712 }
4713 #line 158
4714 close(fd);
4715 } else {
4716 #line 161
4717 tmp___2 = __errno_location();
4718 #line 161
4719 tmp___3 = strerror((*tmp___2));
4720 #line 161
4721 log_msg(3, "open(%s): %s", path1, tmp___3);
4722 }
4723 #line 163
4724 fd = open((char const *)(path2), 578, 420);
4725 #line 163
4726 if (fd != -1) {
4727 #line 165
4728 tmp___6 = writev(fd, (struct iovec const *)(iov), 2);
4729 #line 165
4730 if (tmp___6 != len) {
4731 #line 167
4732 tmp___4 = __errno_location();
4733 #line 167
4734 tmp___5 = strerror((*tmp___4));
4735 #line 167
4736 log_msg(3, "writev (%s): %s", path2, tmp___5);
4737 #line 168
4738 unlink((char const *)(path2));
4739 }
4740 #line 170
4741 close(fd);
4742 } else {
4743 #line 173
4744 tmp___7 = __errno_location();
4745 #line 173
4746 tmp___8 = strerror((*tmp___7));
4747 #line 173
4748 log_msg(3, "open(%s): %s", path2, tmp___8);
4749 }
4750 #line 174
4751 return;
4752 }
4753 }
4754 #line 177 "serv_list.c"
4755 void change_binding(char const *domain___0 , ypbind_binding *binding )
4756 { int i ;
4757 struct sockaddr_in addr ;
4758 struct timeval timeout___0 ;
4759 int sock ;
4760 size_t __s1_len ;
4761 size_t __s2_len ;
4762 int tmp___4 ;
4763 int tmp___7 ;
4764 int tmp___8 ;
4765
4766 {
4767 #line 182
4768 pthread_rdwr_rlock_np(& domainlock);
4769 #line 184
4770 i = 0;
4771 #line 184
4772 while (i < max_domains) {
4773 #line 186
4774 if (0) {
4775 #line 186
4776 __s1_len = strlen((char const *)((domainlist + i)->domain));
4777 #line 186
4778 __s2_len = strlen(domain___0);
4779 #line 186
4780 if (! ((unsigned int )((void const *)((domainlist + i)->domain + 1)) - (unsigned int )((void const *)((domainlist + i)->domain)) == 1U)) {
4781 goto _L___0;
4782 } else {
4783 #line 186
4784 if (__s1_len >= 4U) {
4785 _L___0: /* CIL Label */
4786 #line 186
4787 if (! ((unsigned int )((void const *)(domain___0 + 1)) - (unsigned int )((void const *)domain___0) == 1U)) {
4788 #line 186
4789 tmp___8 = 1;
4790 } else {
4791 #line 186
4792 if (__s2_len >= 4U) {
4793 #line 186
4794 tmp___8 = 1;
4795 } else {
4796 #line 186
4797 tmp___8 = 0;
4798 }
4799 }
4800 } else {
4801 #line 186
4802 tmp___8 = 0;
4803 }
4804 }
4805 #line 186
4806 if (tmp___8) {
4807 #line 186
4808 tmp___4 = __builtin_strcmp((char const *)((domainlist + i)->domain), domain___0);
4809 } else {
4810 #line 186
4811 tmp___7 = __builtin_strcmp((char const *)((domainlist + i)->domain), domain___0);
4812 #line 186
4813 tmp___4 = tmp___7;
4814 }
4815 } else {
4816 #line 186
4817 tmp___7 = __builtin_strcmp((char const *)((domainlist + i)->domain), domain___0);
4818 #line 186
4819 tmp___4 = tmp___7;
4820 }
4821 #line 186
4822 if (tmp___4 == 0) {
4823 #line 192
4824 pthread_rdwr_runlock_np(& domainlock);
4825 #line 193
4826 pthread_rdwr_wlock_np(& domainlock);
4827 #line 195
4828 if ((unsigned int )(domainlist + i)->client_handle != (unsigned int )((void *)0)) {
4829 #line 196
4830 ((*((((domainlist + i)->client_handle)->cl_ops)->cl_destroy)))((domainlist + i)->client_handle);
4831 }
4832 #line 198
4833 (domainlist + i)->active = -2;
4834 #line 199
4835 memcpy((void * __restrict )(& (domainlist + i)->ypset.addr), (void const * __restrict )(& binding->ypbind_binding_addr),
4836 sizeof(struct in_addr ));
4837 #line 202
4838 memcpy((void * __restrict )(& (domainlist + i)->ypset.port), (void const * __restrict )(& binding->ypbind_binding_port),
4839 sizeof(unsigned short ));
4840 #line 205
4841 (domainlist + i)->ypset.family = (unsigned short)2;
4842 #line 207
4843 sock = -1;
4844 #line 208
4845 timeout___0.tv_sec = 1L;
4846 #line 209
4847 timeout___0.tv_usec = 0L;
4848 #line 210
4849 memset((void *)(& addr), 0, sizeof(struct sockaddr_in ));
4850 #line 211
4851 memcpy((void * __restrict )(& addr.sin_addr), (void const * __restrict )(& (domainlist + i)->ypset.addr),
4852 sizeof(struct in_addr ));
4853 #line 213
4854 memcpy((void * __restrict )(& addr.sin_port), (void const * __restrict )(& (domainlist + i)->ypset.port),
4855 sizeof(unsigned short ));
4856 #line 215
4857 addr.sin_family = (domainlist + i)->ypset.family;
4858 #line 217
4859 (domainlist + i)->client_handle = clntudp_create(& addr, 100004UL, 2UL, timeout___0,
4860 & sock);
4861 #line 217
4862 if ((unsigned int )(domainlist + i)->client_handle == (unsigned int )((void *)0)) {
4863 #line 220
4864 (domainlist + i)->active = -1;
4865 #line 221
4866 remove_bindingfile(domain___0);
4867 }
4868 #line 223
4869 pthread_rdwr_wunlock_np(& domainlock);
4870 #line 224
4871 pthread_rdwr_rlock_np(& domainlock);
4872 #line 225
4873 update_bindingfile(domainlist + i);
4874 #line 226
4875 pthread_rdwr_runlock_np(& domainlock);
4876 #line 228
4877 return;
4878 }
4879 #line 184
4880 i ++;
4881 }
4882 #line 232
4883 pthread_rdwr_runlock_np(& domainlock);
4884 #line 233
4885 return;
4886 }
4887 }
4888 #line 236 "serv_list.c"
4889 void find_domain(char const *domain___0 , ypbind_resp *result )
4890 { int i ;
4891 int count ;
4892 size_t __s1_len ;
4893 size_t __s2_len ;
4894 int tmp___4 ;
4895 int tmp___7 ;
4896 int tmp___8 ;
4897 register unsigned short __v ;
4898 register unsigned short __x ;
4899 char *tmp___9 ;
4900 register unsigned short __v___0 ;
4901 register unsigned short __x___0 ;
4902 char *tmp___10 ;
4903 int tmp___11 ;
4904 int tmp___12 ;
4905
4906 {
4907 #line 239
4908 count = 0;
4909 #line 241
4910 if ((unsigned int )domainlist == (unsigned int )((void *)0)) {
4911 #line 242
4912 return;
4913 }
4914 #line 244
4915 pthread_rdwr_rlock_np(& domainlock);
4916 #line 246
4917 i = 0;
4918 #line 246
4919 while (i < max_domains) {
4920 #line 247
4921 if (0) {
4922 #line 247
4923 __s1_len = strlen((char const *)((domainlist + i)->domain));
4924 #line 247
4925 __s2_len = strlen(domain___0);
4926 #line 247
4927 if (! ((unsigned int )((void const *)((domainlist + i)->domain + 1)) - (unsigned int )((void const *)((domainlist + i)->domain)) == 1U)) {
4928 goto _L___0;
4929 } else {
4930 #line 247
4931 if (__s1_len >= 4U) {
4932 _L___0: /* CIL Label */
4933 #line 247
4934 if (! ((unsigned int )((void const *)(domain___0 + 1)) - (unsigned int )((void const *)domain___0) == 1U)) {
4935 #line 247
4936 tmp___8 = 1;
4937 } else {
4938 #line 247
4939 if (__s2_len >= 4U) {
4940 #line 247
4941 tmp___8 = 1;
4942 } else {
4943 #line 247
4944 tmp___8 = 0;
4945 }
4946 }
4947 } else {
4948 #line 247
4949 tmp___8 = 0;
4950 }
4951 }
4952 #line 247
4953 if (tmp___8) {
4954 #line 247
4955 tmp___4 = __builtin_strcmp((char const *)((domainlist + i)->domain), domain___0);
4956 } else {
4957 #line 247
4958 tmp___7 = __builtin_strcmp((char const *)((domainlist + i)->domain), domain___0);
4959 #line 247
4960 tmp___4 = tmp___7;
4961 }
4962 } else {
4963 #line 247
4964 tmp___7 = __builtin_strcmp((char const *)((domainlist + i)->domain), domain___0);
4965 #line 247
4966 tmp___4 = tmp___7;
4967 }
4968 #line 247
4969 if (tmp___4 == 0) {
4970 #line 248
4971 break;
4972 }
4973 #line 246
4974 i ++;
4975 }
4976 #line 250
4977 if (i >= max_domains) {
4978 #line 252
4979 pthread_rdwr_runlock_np(& domainlock);
4980 #line 253
4981 return;
4982 }
4983 again:
4984 #line 257
4985 count ++;
4986 #line 258
4987 if ((domainlist + i)->active >= 0) {
4988 #line 260
4989 result->ypbind_status = 1;
4990 #line 261
4991 memcpy((void * __restrict )(& result->ypbind_resp_u.ypbind_bindinfo.ypbind_binding_addr),
4992 (void const * __restrict )(& (domainlist + i)->server[(domainlist + i)->active].addr),
4993 sizeof(struct in_addr ));
4994 #line 264
4995 memcpy((void * __restrict )(& result->ypbind_resp_u.ypbind_bindinfo.ypbind_binding_port),
4996 (void const * __restrict )(& (domainlist + i)->server[(domainlist + i)->active].port),
4997 sizeof(unsigned short ));
4998 #line 267
4999 if (debug_flag) {
5000 #line 270
5001 __x = (domainlist + i)->server[(domainlist + i)->active].port;
5002 #line 270
5003 __asm__ ("rorw $8, %w0": "=r" (__v): "0" (__x): "cc");
5004 #line 270
5005 tmp___9 = inet_ntoa((domainlist + i)->server[(domainlist + i)->active].addr);
5006 #line 270
5007 log_msg(7, "YPBINDPROC_DOMAIN: server \'%s\', port %d", tmp___9, __v);
5008 }
5009 } else {
5010 #line 272
5011 if ((domainlist + i)->active == -2) {
5012 #line 274
5013 result->ypbind_status = -1;
5014 #line 275
5015 memcpy((void * __restrict )(& result->ypbind_resp_u.ypbind_bindinfo.ypbind_binding_addr),
5016 (void const * __restrict )(& (domainlist + i)->ypset.addr), sizeof(struct in_addr ));
5017 #line 277
5018 memcpy((void * __restrict )(& result->ypbind_resp_u.ypbind_bindinfo.ypbind_binding_port),
5019 (void const * __restrict )(& (domainlist + i)->ypset.port), sizeof(unsigned short ));
5020 #line 280
5021 if (debug_flag) {
5022 #line 284
5023 __x___0 = (domainlist + i)->ypset.port;
5024 #line 284
5025 __asm__ ("rorw $8, %w0": "=r" (__v___0): "0" (__x___0): "cc");
5026 #line 284
5027 tmp___10 = inet_ntoa((domainlist + i)->ypset.addr);
5028 #line 284
5029 log_msg(7, "YPBINDPROC_DOMAIN: server \'%s\', port %d", tmp___10, __v___0);
5030 }
5031 } else {
5032 #line 290
5033 pthread_rdwr_runlock_np(& domainlock);
5034 #line 292
5035 if (count > 2) {
5036 #line 293
5037 return;
5038 }
5039 #line 295
5040 tmp___12 = pthread_mutex_trylock(& search_lock);
5041 #line 295
5042 if (tmp___12 == 0) {
5043 #line 297
5044 if (debug_flag) {
5045 #line 298
5046 log_msg(7, "trylock = success");
5047 }
5048 #line 299
5049 tmp___11 = ping_all(domainlist + i);
5050 #line 299
5051 if (! tmp___11) {
5052 #line 299
5053 if ((domainlist + i)->use_broadcast) {
5054 #line 301
5055 do_broadcast(domainlist + i);
5056 }
5057 }
5058 } else {
5059 #line 305
5060 if (debug_flag) {
5061 #line 306
5062 log_msg(7, "trylock = failed");
5063 }
5064 #line 309
5065 pthread_mutex_lock(& search_lock);
5066 }
5067 #line 311
5068 pthread_mutex_unlock(& search_lock);
5069 #line 313
5070 pthread_rdwr_rlock_np(& domainlock);
5071 goto again;
5072 }
5073 }
5074 #line 317
5075 pthread_rdwr_runlock_np(& domainlock);
5076 #line 319
5077 return;
5078 }
5079 }
5080 #line 322 "serv_list.c"
5081 void clear_server(void)
5082 { int i ;
5083 int j ;
5084
5085 {
5086 #line 327
5087 pthread_rdwr_wlock_np(& domainlock);
5088 #line 329
5089 if ((unsigned int )domainlist != (unsigned int )((void *)0)) {
5090 #line 331
5091 i = 0;
5092 #line 331
5093 while (i < max_domains) {
5094 #line 333
5095 j = 0;
5096 #line 333
5097 while (j < 30) {
5098 #line 335
5099 if ((unsigned int )(domainlist + i)->server[j].host != (unsigned int )((void *)0)) {
5100 #line 336
5101 free((void *)(domainlist + i)->server[j].host);
5102 }
5103 #line 333
5104 j ++;
5105 }
5106 #line 338
5107 if ((unsigned int )(domainlist + i)->ypset.host != (unsigned int )((void *)0)) {
5108 #line 339
5109 free((void *)(domainlist + i)->ypset.host);
5110 }
5111 #line 340
5112 if ((unsigned int )(domainlist + i)->client_handle != (unsigned int )((void *)0)) {
5113 #line 341
5114 ((*((((domainlist + i)->client_handle)->cl_ops)->cl_destroy)))((domainlist + i)->client_handle);
5115 }
5116 #line 331
5117 i ++;
5118 }
5119 #line 343
5120 free((void *)domainlist);
5121 }
5122 #line 345
5123 domainlist = (struct binding *)((void *)0);
5124 #line 346
5125 max_domains = 0;
5126 #line 348
5127 pthread_rdwr_wunlock_np(& domainlock);
5128 #line 349
5129 return;
5130 }
5131 }
5132 #line 351 "serv_list.c"
5133 static int get_entry(char const *domain___0 , struct binding **entry )
5134 { int i ;
5135 size_t __s1_len ;
5136 size_t __s2_len ;
5137 int tmp___4 ;
5138 int tmp___7 ;
5139 int tmp___8 ;
5140 char *tmp___9 ;
5141
5142 {
5143 #line 356
5144 (*entry) = (struct binding *)((void *)0);
5145 #line 358
5146 i = 0;
5147 #line 358
5148 while (i < max_domains) {
5149 #line 360
5150 if (0) {
5151 #line 360
5152 __s1_len = strlen((char const *)((domainlist + i)->domain));
5153 #line 360
5154 __s2_len = strlen(domain___0);
5155 #line 360
5156 if (! ((unsigned int )((void const *)((domainlist + i)->domain + 1)) - (unsigned int )((void const *)((domainlist + i)->domain)) == 1U)) {
5157 goto _L___0;
5158 } else {
5159 #line 360
5160 if (__s1_len >= 4U) {
5161 _L___0: /* CIL Label */
5162 #line 360
5163 if (! ((unsigned int )((void const *)(domain___0 + 1)) - (unsigned int )((void const *)domain___0) == 1U)) {
5164 #line 360
5165 tmp___8 = 1;
5166 } else {
5167 #line 360
5168 if (__s2_len >= 4U) {
5169 #line 360
5170 tmp___8 = 1;
5171 } else {
5172 #line 360
5173 tmp___8 = 0;
5174 }
5175 }
5176 } else {
5177 #line 360
5178 tmp___8 = 0;
5179 }
5180 }
5181 #line 360
5182 if (tmp___8) {
5183 #line 360
5184 tmp___4 = __builtin_strcmp((char const *)((domainlist + i)->domain), domain___0);
5185 } else {
5186 #line 360
5187 tmp___7 = __builtin_strcmp((char const *)((domainlist + i)->domain), domain___0);
5188 #line 360
5189 tmp___4 = tmp___7;
5190 }
5191 } else {
5192 #line 360
5193 tmp___7 = __builtin_strcmp((char const *)((domainlist + i)->domain), domain___0);
5194 #line 360
5195 tmp___4 = tmp___7;
5196 }
5197 #line 360
5198 if (tmp___4 == 0) {
5199 #line 361
5200 (*entry) = domainlist + i;
5201 }
5202 #line 358
5203 i ++;
5204 }
5205 #line 364
5206 if (! (*entry)) {
5207 #line 366
5208 max_domains ++;
5209 #line 367
5210 domainlist = (struct binding *)realloc((void *)domainlist, (unsigned int )max_domains * sizeof(struct binding ));
5211 #line 368
5212 if ((unsigned int )domainlist == (unsigned int )((void *)0)) {
5213 #line 370
5214 tmp___9 = dcgettext((char const *)((void *)0), "Not enough memory !", 5);
5215 #line 370
5216 log_msg(3, (char const *)tmp___9);
5217 #line 371
5218 exit(1);
5219 }
5220 #line 373
5221 strcpy((char * __restrict )((domainlist + (max_domains - 1))->domain), (char const * __restrict )domain___0);
5222 #line 374
5223 (domainlist + (max_domains - 1))->ypset.host = (char *)((void *)0);
5224 #line 375
5225 (domainlist + (max_domains - 1))->active = -1;
5226 #line 376
5227 (domainlist + (max_domains - 1))->use_broadcast = 0;
5228 #line 377
5229 memset((void *)((domainlist + (max_domains - 1))->server), 0, 30U * sizeof(struct bound_server ));
5230 #line 379
5231 (*entry) = domainlist + (max_domains - 1);
5232 }
5233 #line 382
5234 return (0);
5235 }
5236 }
5237 #line 385 "serv_list.c"
5238 int add_server(char const *domain___0 , char const *host , int check_syntax )
5239 { struct binding *entry ;
5240 int active ;
5241 int res ;
5242 char *tmp ;
5243 char *tmp___0 ;
5244 struct hostent *hent ;
5245 struct hostent hostbuf ;
5246 size_t hstbuflen ;
5247 char *hsttmpbuf ;
5248 int herr ;
5249 int error ;
5250 char *tmp___1 ;
5251 char *tmp___2 ;
5252 int *tmp___3 ;
5253 int *tmp___4 ;
5254 char *tmp___5 ;
5255 char *tmp___6 ;
5256 char *tmp___7 ;
5257 char *tmp___8 ;
5258 char *tmp___9 ;
5259 char *tmp___10 ;
5260 char *tmp___11 ;
5261 char *tmp___12 ;
5262 char *tmp___13 ;
5263 char *tmp___14 ;
5264 char *tmp___24 ;
5265
5266 {
5267 #line 390
5268 res = 0;
5269 #line 392
5270 if ((unsigned int )domain___0 == (unsigned int )((void *)0)) {
5271 #line 394
5272 tmp = dcgettext((char const *)((void *)0), "internal error: add_server called with NULL domain.",
5273 5);
5274 #line 394
5275 log_msg(3, (char const *)tmp);
5276 #line 396
5277 abort();
5278 }
5279 #line 399
5280 pthread_rdwr_wlock_np(& domainlock);
5281 #line 401
5282 get_entry(domain___0, & entry);
5283 #line 403
5284 if ((unsigned int )host == (unsigned int )((void *)0)) {
5285 #line 405
5286 entry->use_broadcast = 1;
5287 #line 406
5288 res = 1;
5289 #line 408
5290 if (debug_flag) {
5291 #line 409
5292 tmp___0 = dcgettext((char const *)((void *)0), "add_server() domain: %s, broadcast",
5293 5);
5294 #line 409
5295 log_msg(7, (char const *)tmp___0, domain___0);
5296 }
5297 } else {
5298 #line 425
5299 active = 0;
5300 #line 425
5301 while (active < 30) {
5302 #line 426
5303 if ((unsigned int )entry->server[active].host == (unsigned int )((void *)0)) {
5304 #line 427
5305 break;
5306 }
5307 #line 425
5308 active ++;
5309 }
5310 #line 430
5311 if ((unsigned int )entry->server[active].host != (unsigned int )((void *)0)) {
5312 #line 432
5313 if (debug_flag) {
5314 #line 433
5315 tmp___1 = dcgettext((char const *)((void *)0), "add_server() domain: %s, host: %s, NO SLOT FREE!",
5316 5);
5317 #line 433
5318 log_msg(7, (char const *)tmp___1, domain___0, host);
5319 }
5320 goto exit;
5321 }
5322 #line 439
5323 if (debug_flag) {
5324 #line 440
5325 tmp___2 = dcgettext((char const *)((void *)0), "add_server() domain: %s, host: %s, slot: %d",
5326 5);
5327 #line 440
5328 log_msg(7, (char const *)tmp___2, domain___0, host, active);
5329 }
5330 #line 445
5331 hstbuflen = 1024U;
5332 #line 446
5333 hsttmpbuf = (char *)__builtin_alloca(hstbuflen);
5334 #line 447
5335 while (1) {
5336 #line 447
5337 error = gethostbyname_r((char const * __restrict )host, (struct hostent * __restrict )(& hostbuf),
5338 (char * __restrict )hsttmpbuf, hstbuflen, (struct hostent ** __restrict )(& hent),
5339 (int * __restrict )(& herr));
5340 #line 447
5341 if (! (error != 0)) {
5342 #line 447
5343 break;
5344 }
5345 #line 449
5346 if (herr == -1) {
5347 #line 453
5348 hstbuflen *= 2U;
5349 #line 454
5350 hsttmpbuf = (char *)__builtin_alloca(hstbuflen);
5351 } else {
5352 #line 449
5353 if (error == -1) {
5354 #line 449
5355 tmp___3 = __errno_location();
5356 #line 449
5357 if ((*tmp___3) == 34) {
5358 #line 453
5359 hstbuflen *= 2U;
5360 #line 454
5361 hsttmpbuf = (char *)__builtin_alloca(hstbuflen);
5362 } else {
5363 goto _L;
5364 }
5365 } else {
5366 _L: /* CIL Label */
5367 #line 449
5368 if (error == 34) {
5369 #line 453
5370 hstbuflen *= 2U;
5371 #line 454
5372 hsttmpbuf = (char *)__builtin_alloca(hstbuflen);
5373 } else {
5374 #line 457
5375 break;
5376 }
5377 }
5378 }
5379 }
5380 #line 465
5381 if (! hent) {
5382 #line 467
5383 tmp___4 = __h_errno_location();
5384 #line 467
5385 switch ((*tmp___4)) {
5386 case 1:
5387 #line 470
5388 if (check_syntax) {
5389 #line 471
5390 tmp___5 = dcgettext((char const *)((void *)0), "Unknown host:", 5);
5391 #line 471
5392 fprintf((FILE * __restrict )stderr, (char const * __restrict )"%s %s\n",
5393 tmp___5, host);
5394 } else {
5395 #line 473
5396 tmp___6 = dcgettext((char const *)((void *)0), "Unknown host:", 5);
5397 #line 473
5398 log_msg(3, "%s %s", tmp___6, host);
5399 }
5400 #line 474
5401 break;
5402 case 2:
5403 #line 476
5404 if (check_syntax) {
5405 #line 477
5406 tmp___7 = dcgettext((char const *)((void *)0), "Host name lookup failure",
5407 5);
5408 #line 477
5409 fprintf((FILE * __restrict )stderr, (char const * __restrict )"%s\n",
5410 tmp___7);
5411 } else {
5412 #line 479
5413 tmp___8 = dcgettext((char const *)((void *)0), "Host name lookup failure",
5414 5);
5415 #line 479
5416 log_msg(3, (char const *)tmp___8);
5417 }
5418 #line 480
5419 break;
5420 case 4:
5421 #line 482
5422 if (check_syntax) {
5423 #line 483
5424 tmp___9 = dcgettext((char const *)((void *)0), "No address associated with name:",
5425 5);
5426 #line 483
5427 fprintf((FILE * __restrict )stderr, (char const * __restrict )"%s %s\n",
5428 tmp___9, host);
5429 } else {
5430 #line 486
5431 tmp___10 = dcgettext((char const *)((void *)0), "No address associated with name:",
5432 5);
5433 #line 486
5434 log_msg(3, "%s %s", tmp___10, host);
5435 }
5436 #line 488
5437 break;
5438 case 3:
5439 #line 490
5440 if (check_syntax) {
5441 #line 491
5442 tmp___11 = dcgettext((char const *)((void *)0), "Unknown server error",
5443 5);
5444 #line 491
5445 fprintf((FILE * __restrict )stderr, (char const * __restrict )"%s\n",
5446 tmp___11);
5447 } else {
5448 #line 493
5449 tmp___12 = dcgettext((char const *)((void *)0), "Unknown server error",
5450 5);
5451 #line 493
5452 log_msg(3, (char const *)tmp___12);
5453 }
5454 #line 494
5455 break;
5456 default: ;
5457 #line 496
5458 if (check_syntax) {
5459 #line 497
5460 tmp___13 = dcgettext((char const *)((void *)0), "gethostbyname: Unknown error",
5461 5);
5462 #line 497
5463 fprintf((FILE * __restrict )stderr, (char const * __restrict )"%s\n",
5464 tmp___13);
5465 } else {
5466 #line 499
5467 tmp___14 = dcgettext((char const *)((void *)0), "gethostbyname: Unknown error",
5468 5);
5469 #line 499
5470 log_msg(3, (char const *)tmp___14);
5471 }
5472 #line 500
5473 break;
5474 }
5475 goto exit;
5476 }
5477 #line 504
5478 if ((unsigned int )(*(hent->h_addr_list + 0)) == (unsigned int )((void *)0)) {
5479 goto exit;
5480 }
5481 #line 507
5482 tmp___24 = __strdup(host);
5483 #line 507
5484 entry->server[active].host = tmp___24;
5485 #line 508
5486 entry->server[active].family = (unsigned short )hent->h_addrtype;
5487 #line 512
5488 memcpy((void * __restrict )(& entry->server[active].addr), (void const * __restrict )(*(hent->h_addr_list + 0)),
5489 (unsigned int )hent->h_length);
5490 #line 514
5491 res = 1;
5492 }
5493 exit:
5494 #line 518
5495 pthread_rdwr_wunlock_np(& domainlock);
5496 #line 519
5497 return (res);
5498 }
5499 }
5500 #line 522 "serv_list.c"
5501 static struct binding *in_use = (struct binding *)((void *)0);
5502 #line 524 "serv_list.c"
5503 static bool_t eachresult(bool_t *out , struct sockaddr_in *addr )
5504 { struct timeval timeout___0 ;
5505 int sock ;
5506 struct hostent hostbuf ;
5507 struct hostent *host ;
5508 size_t hstbuflen ;
5509 char *hsttmpbuf ;
5510 int herr ;
5511 int error ;
5512 int *tmp ;
5513 char *tmp___0 ;
5514 char *tmp___1 ;
5515 char *tmp___2 ;
5516 register unsigned short __v ;
5517 register unsigned short __x ;
5518 char *tmp___3 ;
5519 char *tmp___4 ;
5520 register unsigned short __v___0 ;
5521 register unsigned short __x___0 ;
5522
5523 {
5524 #line 530
5525 if ((*out)) {
5526 #line 532
5527 if (debug_flag) {
5528 #line 541
5529 hstbuflen = 1024U;
5530 #line 542
5531 hsttmpbuf = (char *)__builtin_alloca(hstbuflen);
5532 #line 543
5533 while (1) {
5534 #line 543
5535 error = gethostbyaddr_r((void const * __restrict )((char *)(& addr->sin_addr.s_addr)),
5536 sizeof(addr->sin_addr.s_addr), 2, (struct hostent * __restrict )(& hostbuf),
5537 (char * __restrict )hsttmpbuf, hstbuflen, (struct hostent ** __restrict )(& host),
5538 (int * __restrict )(& herr));
5539 #line 543
5540 if (! (error < 0)) {
5541 #line 543
5542 break;
5543 }
5544 #line 547
5545 if (herr == -1) {
5546 #line 551
5547 hstbuflen *= 2U;
5548 #line 552
5549 hsttmpbuf = (char *)__builtin_alloca(hstbuflen);
5550 } else {
5551 #line 547
5552 if (error == -1) {
5553 #line 547
5554 tmp = __errno_location();
5555 #line 547
5556 if ((*tmp) == 34) {
5557 #line 551
5558 hstbuflen *= 2U;
5559 #line 552
5560 hsttmpbuf = (char *)__builtin_alloca(hstbuflen);
5561 } else {
5562 goto _L;
5563 }
5564 } else {
5565 _L: /* CIL Label */
5566 #line 547
5567 if (error == 34) {
5568 #line 551
5569 hstbuflen *= 2U;
5570 #line 552
5571 hsttmpbuf = (char *)__builtin_alloca(hstbuflen);
5572 } else {
5573 #line 555
5574 break;
5575 }
5576 }
5577 }
5578 }
5579 #line 570
5580 if ((unsigned int )host != (unsigned int )((void *)0)) {
5581 #line 571
5582 tmp___0 = dcgettext((char const *)((void *)0), "Answer for domain \'%s\' from server \'%s\'",
5583 5);
5584 #line 571
5585 log_msg(7, (char const *)tmp___0, in_use->domain, host->h_name);
5586 } else {
5587 #line 574
5588 tmp___1 = inet_ntoa(addr->sin_addr);
5589 #line 574
5590 tmp___2 = dcgettext((char const *)((void *)0), "Answer for domain \'%s\' from unknown server \'%s\'",
5591 5);
5592 #line 574
5593 log_msg(7, (char const *)tmp___2, in_use->domain, tmp___1);
5594 }
5595 }
5596 #line 579
5597 if (! broken_server) {
5598 #line 579
5599 __x___0 = addr->sin_port;
5600 #line 579
5601 __asm__ ("rorw $8, %w0": "=r" (__v___0): "0" (__x___0): "cc");
5602 #line 579
5603 if ((int )__v___0 >= 1024) {
5604 #line 584
5605 __x = addr->sin_port;
5606 #line 584
5607 __asm__ ("rorw $8, %w0": "=r" (__v): "0" (__x): "cc");
5608 #line 584
5609 tmp___3 = inet_ntoa(addr->sin_addr);
5610 #line 584
5611 tmp___4 = dcgettext((char const *)((void *)0), "Answer for domain \'%s\' from \'%s\' on illegal port %d.",
5612 5);
5613 #line 584
5614 log_msg(3, (char const *)tmp___4, in_use->domain, tmp___3, __v);
5615 #line 585
5616 return (0);
5617 }
5618 }
5619 #line 588
5620 memcpy((void * __restrict )(& in_use->server[0].addr), (void const * __restrict )(& addr->sin_addr),
5621 sizeof(struct in_addr ));
5622 #line 590
5623 memcpy((void * __restrict )(& in_use->server[0].port), (void const * __restrict )(& addr->sin_port),
5624 sizeof(unsigned short ));
5625 #line 593
5626 sock = -1;
5627 #line 594
5628 timeout___0.tv_sec = 1L;
5629 #line 595
5630 timeout___0.tv_usec = 0L;
5631 #line 596
5632 pthread_mutex_lock(& search_lock);
5633 in_use->client_handle = clntudp_create(addr, 100004UL, 2UL, timeout___0, & sock);
5634 #line 599
5635 if ((unsigned int )in_use->client_handle == (unsigned int )((void *)0)) {
5636 #line 600
5637 pthread_mutex_unlock(& search_lock);
5638 return (0);
5639 }
5640 #line 602
5641 in_use->active = 0;
5642 #line 604
5643 pthread_mutex_unlock(& search_lock);
5644 return (1);
5645 } else {
5646 #line 608
5647 return (0);
5648 }
5649 }
5650 }
5651 #line 612 "serv_list.c"
5652 static void do_broadcast(struct binding *list )
5653 { char *domain___0 ;
5654 bool_t out ;
5655 enum clnt_stat status ;
5656 char const *__old ;
5657 size_t __len ;
5658 size_t tmp ;
5659 char *__new ;
5660 char *tmp___0 ;
5661 char *tmp___2 ;
5662 char *tmp___3 ;
5663 char *tmp___4 ;
5664
5665 {
5666 #line 622
5667 pthread_rdwr_rlock_np(& domainlock);
5668 #line 623
5669 __old = (char const *)(list->domain);
5670 #line 623
5671 tmp = strlen(__old);
5672 #line 623
5673 __len = tmp + 1U;
5674 #line 623
5675 tmp___0 = (char *)__builtin_alloca(__len);
5676 #line 623
5677 __new = tmp___0;
5678 #line 623
5679 domain___0 = (char *)memcpy((void * __restrict )__new, (void const * __restrict )__old,
5680 __len);
5681 #line 624
5682 pthread_rdwr_runlock_np(& domainlock);
5683 #line 626
5684 if (debug_flag) {
5685 #line 627
5686 tmp___2 = dcgettext((char const *)((void *)0), "do_broadcast() for domain \'%s\' is called",
5687 5);
5688 #line 627
5689 log_msg(7, (char const *)tmp___2, domain___0);
5690 }
5691 #line 632
5692 pthread_rdwr_wlock_np(& domainlock);
5693 #line 633
5694 list->active = -1;
5695 #line 634
5696 pthread_rdwr_wunlock_np(& domainlock);
5697 #line 641
5698 pthread_rdwr_rlock_np(& domainlock);
5699 #line 643
5700 in_use = list;
5701 #line 645
5702 status = clnt_broadcast(100004UL, 2UL, 2UL, (bool_t (*)(XDR * , void * , ...))(& ypbind_xdr_domainname),
5703 (char *)((void *)(& domain___0)), (bool_t (*)(XDR * , void *
5704 , ...))(& xdr_bool),
5705 (char *)((void *)(& out)), (bool_t (*)(caddr_t resp , struct sockaddr_in *raddr ))(& eachresult));
5706 #line 651
5707 if ((int )status != 0) {
5708 #line 653
5709 remove_bindingfile((char const *)domain___0);
5710 #line 654
5711 tmp___3 = clnt_sperrno(status);
5712 #line 654
5713 log_msg(3, "broadcast: %s.", tmp___3);
5714 } else {
5715 #line 657
5716 update_bindingfile(list);
5717 }
5718 #line 659
5719 pthread_rdwr_runlock_np(& domainlock);
5720 #line 661
5721 if (debug_flag) {
5722 #line 662
5723 tmp___4 = dcgettext((char const *)((void *)0), "leave do_broadcast() for domain \'%s\'",
5724 5);
5725 #line 662
5726 log_msg(7, (char const *)tmp___4, domain___0);
5727 }
5728 #line 664
5729 return;
5730 }
5731 }
5732 #line 668 "serv_list.c"
5733 static struct timeval timeout = {(__time_t )1, (__suseconds_t )0};
5734 #line 669 "serv_list.c"
5735 static struct timeval tottimeout = {(__time_t )1, (__suseconds_t )0};
5736 #line 676 "serv_list.c"
5737 static u_short __pmap_getport(struct sockaddr_in *address , u_long program , u_long version ,
5738 u_int protocol )
5739 { u_short rport ;
5740 int sock ;
5741 CLIENT *client ;
5742 struct pmap parms ;
5743 register unsigned short __v ;
5744 register unsigned short __x ;
5745 enum clnt_stat tmp ;
5746
5747 {
5748 #line 680
5749 rport = (u_short )0;
5750 #line 681
5751 sock = -1;
5752 #line 685
5753 __x = (unsigned short)111;
5754 #line 685
5755 __asm__ ("rorw $8, %w0": "=r" (__v): "0" (__x): "cc");
5756 #line 685
5757 address->sin_port = __v;
5758 #line 687
5759 client = clntudp_bufcreate(address, 100000UL, 2UL, timeout, & sock, 400U, 400U);
5760 #line 690
5761 if ((unsigned int )client != (unsigned int )((CLIENT *)((void *)0))) {
5762 #line 692
5763 parms.pm_prog = program;
5764 #line 693
5765 parms.pm_vers = version;
5766 #line 694
5767 parms.pm_prot = (unsigned long )protocol;
5768 #line 695
5769 parms.pm_port = 0UL;
5770 #line 696
5771 tmp = ((*((client->cl_ops)->cl_call)))(client, 3UL, (bool_t (*)(XDR * , void *
5772 , ...))(& xdr_pmap),
5773 (char *)(& parms), (bool_t (*)(XDR * ,
5774 void *
5775 , ...))(& xdr_u_short),
5776 (char *)(& rport), tottimeout);
5777 #line 696
5778 if ((int )tmp != 0) {
5779 #line 700
5780 rpc_createerr.cf_stat = 14;
5781 #line 701
5782 ((*((client->cl_ops)->cl_geterr)))(client, & rpc_createerr.cf_error);
5783 } else {
5784 #line 703
5785 if ((int )rport == 0) {
5786 #line 705
5787 rpc_createerr.cf_stat = 15;
5788 }
5789 }
5790 #line 707
5791 ((*((client->cl_ops)->cl_destroy)))(client);
5792 }
5793 #line 709
5794 if (sock != -1) {
5795 #line 710
5796 close(sock);
5797 }
5798 #line 711
5799 address->sin_port = (unsigned short)0;
5800 #line 712
5801 return (rport);
5802 }
5803 }
5804 #line 744 "serv_list.c"
5805 static int ping_all(struct binding *list )
5806 { struct timeval TIMEOUT50 ;
5807 struct timeval TIMEOUT00 ;
5808 CLIENT *clnt ;
5809 struct findserv_req **pings ;
5810 struct sockaddr_in s_in ;
5811 struct sockaddr_in *any ;
5812 int found ;
5813 u_int32_t xid_seed ;
5814 u_int32_t xid_lookup ;
5815 int sock ;
5816 int dontblock ;
5817 bool_t clnt_res ;
5818 u_long i ;
5819 u_long pings_count ;
5820 struct cu_data *cu ;
5821 char *domain___0 ;
5822 time_t tmp ;
5823 __pid_t tmp___0 ;
5824 char *tmp___1 ;
5825 register unsigned short __v ;
5826 register unsigned short __x ;
5827 unsigned short tmp___2 ;
5828 register unsigned short __v___0 ;
5829 register unsigned short __x___0 ;
5830 char *tmp___3 ;
5831 register unsigned short __v___1 ;
5832 register unsigned short __x___1 ;
5833 char *tmp___4 ;
5834 char *tmp___5 ;
5835 char *tmp___6 ;
5836
5837 {
5838 #line 747
5839 TIMEOUT50.tv_sec = (__time_t )5;
5840 #line 747
5841 TIMEOUT50.tv_usec = (__suseconds_t )0;
5842 #line 748
5843 TIMEOUT00.tv_sec = (__time_t )0;
5844 #line 748
5845 TIMEOUT00.tv_usec = (__suseconds_t )0;
5846 #line 751
5847 any = (struct sockaddr_in *)((void *)0);
5848 #line 752
5849 found = -1;
5850 #line 754
5851 dontblock = 1;
5852 #line 756
5853 pings_count = (u_long )0;
5854 #line 758
5855 domain___0 = list->domain;
5856 #line 760
5857 if ((unsigned int )list->server[0].host == (unsigned int )((void *)0)) {
5858 #line 761
5859 return (0);
5860 }
5861 #line 763
5862 pthread_rdwr_wlock_np(& domainlock);
5863 #line 764
5864 list->active = -1;
5865 #line 765
5866 pthread_rdwr_wunlock_np(& domainlock);
5867 #line 767
5868 pings = (struct findserv_req **)malloc(sizeof(struct findserv_req *) * 30U);
5869 #line 768
5870 if ((unsigned int )pings == (unsigned int )((void *)0)) {
5871 #line 769
5872 return (0);
5873 }
5874 #line 770
5875 tmp = time((time_t *)((void *)0));
5876 #line 770
5877 tmp___0 = getpid();
5878 #line 770
5879 xid_seed = (unsigned int )(tmp ^ (long )tmp___0);
5880 #line 772
5881 i = 0UL;
5882 #line 772
5883 while (1) {
5884 #line 772
5885 if (i < 30UL) {
5886 #line 772
5887 if (! list->server[i].host) {
5888 #line 772
5889 break;
5890 }
5891 } else {
5892 #line 772
5893 break;
5894 }
5895 #line 774
5896 if (debug_flag) {
5897 #line 775
5898 tmp___1 = dcgettext((char const *)((void *)0), "ping host \'%s\', domain \'%s\'",
5899 5);
5900 #line 775
5901 log_msg(7, (char const *)tmp___1, list->server[i].host, list->domain);
5902 }
5903 #line 778
5904 memset((void *)(& s_in), 0, sizeof(struct sockaddr_in ));
5905 #line 779
5906 memcpy((void * __restrict )(& s_in.sin_addr), (void const * __restrict )(& list->server[i].addr),
5907 sizeof(struct in_addr ));
5908 #line 781
5909 s_in.sin_family = list->server[i].family;
5910 #line 783
5911 tmp___2 = __pmap_getport(& s_in, 100004UL, 2UL, 17U);
5912 #line 783
5913 __x = tmp___2;
5914 #line 783
5915 __asm__ ("rorw $8, %w0": "=r" (__v): "0" (__x): "cc");
5916 #line 783
5917 s_in.sin_port = __v;
5918 #line 784
5919 if (! broken_server) {
5920 #line 784
5921 __x___1 = s_in.sin_port;
5922 #line 784
5923 __asm__ ("rorw $8, %w0": "=r" (__v___1): "0" (__x___1): "cc");
5924 #line 784
5925 if ((int )__v___1 >= 1024) {
5926 #line 789
5927 __x___0 = s_in.sin_port;
5928 #line 789
5929 __asm__ ("rorw $8, %w0": "=r" (__v___0): "0" (__x___0): "cc");
5930 #line 789
5931 tmp___3 = dcgettext((char const *)((void *)0), "Answer for domain \'%s\' from \'%s\' on illegal port %d.",
5932 5);
5933 #line 789
5934 log_msg(3, (char const *)tmp___3, list->domain, list->server[i].host, __v___0);
5935 goto __Cont;
5936 }
5937 }
5938 #line 792
5939 list->server[i].port = s_in.sin_port;
5940 #line 793
5941 if ((int )s_in.sin_port == 0) {
5942 #line 795
5943 if (debug_flag) {
5944 #line 796
5945 tmp___4 = dcgettext((char const *)((void *)0), "host \'%s\' doesn\'t answer.",
5946 5);
5947 #line 796
5948 log_msg(7, (char const *)tmp___4, list->server[i].host);
5949 }
5950 goto __Cont;
5951 }
5952 #line 801
5953 (*(pings + pings_count)) = (struct findserv_req *)calloc(1U, sizeof(struct findserv_req ));
5954 #line 802
5955 memcpy((void * __restrict )(& ((*(pings + pings_count)))->sin), (void const * __restrict )(& s_in),
5956 sizeof(struct sockaddr_in ));
5957 #line 803
5958 any = & ((*(pings + pings_count)))->sin;
5959 #line 804
5960 ((*(pings + pings_count)))->xid = xid_seed;
5961 #line 805
5962 ((*(pings + pings_count)))->server_nr = (unsigned int )i;
5963 #line 806
5964 xid_seed ++;
5965 #line 807
5966 pings_count ++;
5967 __Cont: /* CIL Label */
5968 #line 772
5969 i ++;
5970 }
5971 #line 811
5972 if (pings_count == 0UL) {
5973 #line 813
5974 free((void *)pings);
5975 #line 814
5976 return (0);
5977 }
5978 #line 818
5979 sock = socket(2, 2, 17);
5980 #line 819
5981 clnt = clntudp_create(any, 100004UL, 2UL, TIMEOUT50, & sock);
5982 #line 820
5983 if ((unsigned int )clnt == (unsigned int )((void *)0)) {
5984 #line 822
5985 close(sock);
5986 #line 823
5987 i = 0UL;
5988 #line 823
5989 while (i < pings_count) {
5990 #line 824
5991 free((void *)(*(pings + i)));
5992 #line 823
5993 i ++;
5994 }
5995 #line 825
5996 free((void *)pings);
5997 #line 826
5998 return (0);
5999 }
6000 #line 828
6001 clnt->cl_auth = authunix_create_default();
6002 #line 829
6003 cu = (struct cu_data *)clnt->cl_private;
6004 #line 830
6005 ((*((clnt->cl_ops)->cl_control)))(clnt, 1, (char *)(& TIMEOUT00));
6006 #line 831
6007 ioctl(sock, 21537UL, & dontblock);
6008 #line 834
6009 i = 0UL;
6010 #line 834
6011 while (i < pings_count) {
6012 #line 837
6013 (*((u_int32_t *)cu->cu_outbuf)) = ((*(pings + i)))->xid - 1U;
6014 #line 838
6015 memcpy((void * __restrict )(& cu->cu_raddr), (void const * __restrict )(& ((*(pings + i)))->sin),
6016 sizeof(struct sockaddr_in ));
6017 #line 839
6018 memset((void *)(& clnt_res), 0, sizeof(clnt_res));
6019 #line 841
6020 ((*((clnt->cl_ops)->cl_call)))(clnt, 2UL, (bool_t (*)(XDR * , void * , ...))(& ypbind_xdr_domainname),
6021 (char *)(& domain___0), (bool_t (*)(XDR * , void *
6022 , ...))(& xdr_bool),
6023 (char *)(& clnt_res), TIMEOUT00);
6024 #line 834
6025 i ++;
6026 }
6027 #line 847
6028 memset((void *)((char *)(& clnt_res)), 0, sizeof(clnt_res));
6029 #line 848
6030 ((*((clnt->cl_ops)->cl_call)))(clnt, 2UL, (bool_t (*)(XDR * , void * , ...))((void *)0),
6031 (char *)((void *)0), (bool_t (*)(XDR * , void *
6032 , ...))(& xdr_bool),
6033 (char *)(& clnt_res), TIMEOUT00);
6034 #line 851
6035 xid_lookup = (*((u_int32_t *)(cu->cu_inbuf)));
6036 #line 852
6037 close(sock);
6038 #line 853
6039 i = 0UL;
6040 #line 853
6041 while (i < pings_count) {
6042 #line 855
6043 if (((*(pings + i)))->xid == xid_lookup) {
6044 #line 857
6045 pthread_rdwr_wlock_np(& domainlock);
6046 #line 859
6047 sock = -1;
6048 #line 860
6049 list->client_handle = clntudp_create(& ((*(pings + i)))->sin, 100004UL, 2UL,
6050 TIMEOUT50, & sock);
6051 #line 863
6052 if ((unsigned int )list->client_handle == (unsigned int )((void *)0)) {
6053 #line 866
6054 tmp___5 = dcgettext((char const *)((void *)0), "Server \'%s\' for domain \'%s\' answer to ping but failed to bind",
6055 5);
6056 #line 866
6057 log_msg(7, (char const *)tmp___5, list->server[list->active].host, domain___0);
6058 } else {
6059 #line 872
6060 list->active = (int )((*(pings + i)))->server_nr;
6061 #line 873
6062 pthread_rdwr_wunlock_np(& domainlock);
6063 #line 874
6064 pthread_rdwr_rlock_np(& domainlock);
6065 #line 875
6066 update_bindingfile(list);
6067 #line 876
6068 pthread_rdwr_runlock_np(& domainlock);
6069 #line 877
6070 if (debug_flag) {
6071 #line 878
6072 tmp___6 = dcgettext((char const *)((void *)0), "Answer for domain \'%s\' from server \'%s\'",
6073 5);
6074 #line 878
6075 log_msg(7, (char const *)tmp___6, domain___0, list->server[list->active].host);
6076 }
6077 #line 881
6078 found = 1;
6079 }
6080 }
6081 #line 853
6082 i ++;
6083 }
6084 #line 886
6085 ((*(((clnt->cl_auth)->ah_ops)->ah_destroy)))(clnt->cl_auth);
6086 #line 887
6087 ((*((clnt->cl_ops)->cl_destroy)))(clnt);
6088 #line 889
6089 i = 0UL;
6090 #line 889
6091 while (i < pings_count) {
6092 #line 890
6093 free((void *)(*(pings + i)));
6094 #line 889
6095 i ++;
6096 }
6097 #line 891
6098 free((void *)pings);
6099 #line 893
6100 if (! found) {
6101 #line 894
6102 remove_bindingfile((char const *)(list->domain));
6103 }
6104 #line 896
6105 return (found);
6106 }
6107 }
6108 #line 996 "serv_list.c"
6109 void do_binding(void)
6110 { int i ;
6111 int tmp ;
6112
6113 {
6114 #line 1001
6115 pthread_mutex_lock(& search_lock);
6116 #line 1002
6117 i = 0;
6118 #line 1002
6119 while (i < max_domains) {
6120 #line 1004
6121 tmp = ping_all(domainlist + i);
6122 #line 1004
6123 if (! tmp) {
6124 #line 1004
6125 if ((domainlist + i)->use_broadcast) {
6126 #line 1005
6127 do_broadcast(domainlist + i);
6128 }
6129 }
6130 #line 1002
6131 i ++;
6132 }
6133 #line 1007
6134 pthread_mutex_unlock(& search_lock);
6135 #line 1008
6136 return;
6137 }
6138 }
6139 #line 1016 "serv_list.c"
6140 static int success = 0;
6141 #line 1013 "serv_list.c"
6142 void *test_bindings(void *param __attribute__((__unused__)) )
6143 { int lastcheck ;
6144
6145 {
6146 #line 1017
6147 lastcheck = 0;
6148 #line 1019
6149 do_binding();
6150 #line 1021
6151 if (ping_interval < 1) {
6152 #line 1022
6153 pthread_exit((void *)(& success));
6154 }
6155 #line 1024
6156 while (1) {
6157 #line 1026
6158 sleep((unsigned int )ping_interval);
6159 #line 1030
6160 if (ping_interval < 1) {
6161 #line 1031
6162 pthread_exit((void *)(& success));
6163 }
6164 #line 1033
6165 lastcheck += ping_interval;
6166 #line 1034
6167 if (lastcheck >= 900) {
6168 #line 1035
6169 lastcheck = 0;
6170 }
6171 #line 1037
6172 lastcheck = test_bindings_once(lastcheck, (char const *)((void *)0));
6173 }
6174 }
6175 }
6176 #line 1042 "serv_list.c"
6177 int test_bindings_once(int lastcheck , char const *req_domain )
6178 { int i ;
6179 char *tmp ;
6180 char *tmp___0 ;
6181 char *domain___0 ;
6182 bool_t out ;
6183 enum clnt_stat status ;
6184 char *tmp___1 ;
6185 size_t __s1_len ;
6186 size_t __s2_len ;
6187 int tmp___7 ;
6188 int tmp___10 ;
6189 int tmp___11 ;
6190 struct timeval time_out ;
6191 char *tmp___12 ;
6192 char *tmp___13 ;
6193 char *tmp___14 ;
6194 char *tmp___15 ;
6195 int tmp___16 ;
6196 int tmp___17 ;
6197
6198 {
6199 #line 1050
6200 pthread_rdwr_wlock_np(& domainlock);
6201 #line 1052
6202 if (debug_flag) {
6203 #line 1054
6204 if (lastcheck) {
6205 #line 1055
6206 tmp = dcgettext((char const *)((void *)0), "Pinging all active server.", 5);
6207 #line 1055
6208 log_msg(7, (char const *)tmp);
6209 } else {
6210 #line 1057
6211 tmp___0 = dcgettext((char const *)((void *)0), "Check new for fastest server.",
6212 5);
6213 #line 1057
6214 log_msg(7, (char const *)tmp___0);
6215 }
6216 }
6217 #line 1060
6218 i = 0;
6219 #line 1060
6220 while (i < max_domains) {
6221 #line 1062
6222 domain___0 = (domainlist + i)->domain;
6223 #line 1063
6224 out = 1;
6225 #line 1064
6226 status = 0;
6227 #line 1066
6228 if (req_domain) {
6229 #line 1066
6230 if (0) {
6231 #line 1066
6232 __s1_len = strlen((char const *)domain___0);
6233 #line 1066
6234 __s2_len = strlen(req_domain);
6235 #line 1066
6236 if (! ((unsigned int )((void const *)(domain___0 + 1)) - (unsigned int )((void const *)domain___0) == 1U)) {
6237 goto _L___0;
6238 } else {
6239 #line 1066
6240 if (__s1_len >= 4U) {
6241 _L___0: /* CIL Label */
6242 #line 1066
6243 if (! ((unsigned int )((void const *)(req_domain + 1)) - (unsigned int )((void const *)req_domain) == 1U)) {
6244 #line 1066
6245 tmp___11 = 1;
6246 } else {
6247 #line 1066
6248 if (__s2_len >= 4U) {
6249 #line 1066
6250 tmp___11 = 1;
6251 } else {
6252 #line 1066
6253 tmp___11 = 0;
6254 }
6255 }
6256 } else {
6257 #line 1066
6258 tmp___11 = 0;
6259 }
6260 }
6261 #line 1066
6262 if (tmp___11) {
6263 #line 1066
6264 tmp___7 = __builtin_strcmp((char const *)domain___0, req_domain);
6265 } else {
6266 #line 1066
6267 tmp___10 = __builtin_strcmp((char const *)domain___0, req_domain);
6268 #line 1066
6269 tmp___7 = tmp___10;
6270 }
6271 } else {
6272 #line 1066
6273 tmp___10 = __builtin_strcmp((char const *)domain___0, req_domain);
6274 #line 1066
6275 tmp___7 = tmp___10;
6276 }
6277 #line 1066
6278 if (tmp___7 != 0) {
6279 #line 1068
6280 if (debug_flag) {
6281 #line 1069
6282 tmp___1 = dcgettext((char const *)((void *)0), "Requested domain %s, found %s, ignored.",
6283 5);
6284 #line 1069
6285 log_msg(7, (char const *)tmp___1, req_domain, domain___0);
6286 }
6287 goto __Cont;
6288 }
6289 }
6290 #line 1075
6291 if ((unsigned int )(domainlist + i)->client_handle == (unsigned int )((void *)0)) {
6292 #line 1075
6293 if ((domainlist + i)->active != -1) {
6294 #line 1077
6295 log_msg(3, "ALERT: active=%d, but client_handle is NULL!", (domainlist + i)->active);
6296 #line 1079
6297 (domainlist + i)->active = -1;
6298 }
6299 }
6300 #line 1082
6301 if ((domainlist + i)->active != -1) {
6302 #line 1086
6303 if (lastcheck != 0) {
6304 #line 1091
6305 time_out.tv_sec = 3L;
6306 #line 1092
6307 time_out.tv_usec = 0L;
6308 #line 1093
6309 status = ((*((((domainlist + i)->client_handle)->cl_ops)->cl_call)))((domainlist + i)->client_handle,
6310 1UL,
6311 (bool_t (*)(XDR * ,
6312 void *
6313 , ...))(& ypbind_xdr_domainname),
6314 (char *)(& domain___0),
6315 (bool_t (*)(XDR * ,
6316 void *
6317 , ...))(& xdr_bool),
6318 (char *)(& out),
6319 time_out);
6320 }
6321 #line 1103
6322 if (lastcheck == 0) {
6323 #line 1103
6324 if ((domainlist + i)->active != -2) {
6325 goto _L___1;
6326 } else {
6327 goto _L___2;
6328 }
6329 } else {
6330 _L___2: /* CIL Label */
6331 #line 1103
6332 if ((int )status != 0) {
6333 goto _L___1;
6334 } else {
6335 #line 1103
6336 if (out != 1) {
6337 _L___1: /* CIL Label */
6338 #line 1108
6339 if (debug_flag) {
6340 #line 1108
6341 if (lastcheck != 0) {
6342 #line 1112
6343 if ((domainlist + i)->use_broadcast) {
6344 #line 1113
6345 tmp___12 = dcgettext((char const *)((void *)0), "Server for domain \'%s\' doesn\'t answer.",
6346 5);
6347 #line 1113
6348 log_msg(7, (char const *)tmp___12, domain___0);
6349 } else {
6350 #line 1118
6351 if ((domainlist + i)->active == -2) {
6352 #line 1119
6353 tmp___13 = inet_ntoa((domainlist + i)->ypset.addr);
6354 #line 1119
6355 tmp___14 = dcgettext((char const *)((void *)0), "Server \'%s\' for domain \'%s\' doesn\'t answer.",
6356 5);
6357 #line 1119
6358 log_msg(7, (char const *)tmp___14, tmp___13, domain___0);
6359 } else {
6360 #line 1124
6361 tmp___15 = dcgettext((char const *)((void *)0), "Server \'%s\' for domain \'%s\' doesn\'t answer.",
6362 5);
6363 #line 1124
6364 log_msg(7, (char const *)tmp___15, (domainlist + i)->server[(domainlist + i)->active].host,
6365 domain___0);
6366 }
6367 }
6368 }
6369 }
6370 #line 1133
6371 if ((unsigned int )(domainlist + i)->client_handle == (unsigned int )((void *)0)) {
6372 #line 1135
6373 log_msg(3, "ALERT: client_handle=NULL, active=%d, lastcheck=%d, domain=%s",
6374 (domainlist + i)->active, lastcheck, domain___0);
6375 } else {
6376 #line 1139
6377 ((*((((domainlist + i)->client_handle)->cl_ops)->cl_destroy)))((domainlist + i)->client_handle);
6378 }
6379 #line 1140
6380 (domainlist + i)->client_handle = (CLIENT *)((void *)0);
6381 #line 1141
6382 if ((domainlist + i)->active == -2) {
6383 #line 1145
6384 if ((unsigned int )(domainlist + i)->ypset.host != (unsigned int )((void *)0)) {
6385 #line 1146
6386 free((void *)(domainlist + i)->ypset.host);
6387 }
6388 #line 1147
6389 (domainlist + i)->ypset.host = (char *)((void *)0);
6390 }
6391 #line 1149
6392 (domainlist + i)->active = -1;
6393 #line 1150
6394 lastcheck = 0;
6395 #line 1154
6396 pthread_rdwr_wunlock_np(& domainlock);
6397 #line 1155
6398 pthread_mutex_lock(& search_lock);
6399 #line 1156
6400 tmp___16 = ping_all(domainlist + i);
6401 #line 1156
6402 if (! tmp___16) {
6403 #line 1156
6404 if ((domainlist + i)->use_broadcast) {
6405 #line 1158
6406 do_broadcast(domainlist + i);
6407 }
6408 }
6409 #line 1159
6410 pthread_mutex_unlock(& search_lock);
6411 #line 1160
6412 pthread_rdwr_wlock_np(& domainlock);
6413 }
6414 }
6415 }
6416 } else {
6417 #line 1167
6418 pthread_rdwr_wunlock_np(& domainlock);
6419 #line 1168
6420 pthread_mutex_lock(& search_lock);
6421 #line 1169
6422 tmp___17 = ping_all(domainlist + i);
6423 #line 1169
6424 if (! tmp___17) {
6425 #line 1169
6426 if ((domainlist + i)->use_broadcast) {
6427 #line 1170
6428 do_broadcast(domainlist + i);
6429 }
6430 }
6431 #line 1171
6432 pthread_mutex_unlock(& search_lock);
6433 #line 1172
6434 pthread_rdwr_wlock_np(& domainlock);
6435 }
6436 __Cont: /* CIL Label */
6437 #line 1060
6438 i ++;
6439 }
6440 #line 1176
6441 pthread_rdwr_wunlock_np(& domainlock);
6442 #line 1178
6443 return (lastcheck);
6444 }
6445 }
6446 #line 1 "pthread_np.o"
6447 #pragma merger(0,"/tmp/cil-KRVFXT38.i","-Wall,-g,-O2")
6448 #line 716 "/usr/include/pthread.h"
6449 extern __attribute__((__nothrow__)) int pthread_mutex_init(pthread_mutex_t *__mutex ,
6450 pthread_mutexattr_t const *__mutexattr ) __attribute__((__nonnull__(1))) ;
6451 #line 923
6452 extern __attribute__((__nothrow__)) int pthread_cond_init(pthread_cond_t * __restrict __cond ,
6453 pthread_condattr_t const * __restrict __cond_attr ) __attribute__((__nonnull__(1))) ;
6454 #line 932
6455 extern __attribute__((__nothrow__)) int pthread_cond_signal(pthread_cond_t *__cond ) __attribute__((__nonnull__(1))) ;
6456 #line 38 "./pthread_np.h"
6457 int pthread_rdwr_init_np(pthread_rdwr_t *rdwrp ) ;
6458 #line 24 "pthread_np.c"
6459 int pthread_rdwr_init_np(pthread_rdwr_t *rdwrp )
6460 {
6461
6462 {
6463 #line 27
6464 rdwrp->readers = 0;
6465 #line 28
6466 rdwrp->writers = 0;
6467 #line 29
6468 rdwrp->wishwrite = 0;
6469 #line 30
6470 pthread_mutex_init(& rdwrp->mutex, (pthread_mutexattr_t const *)((void *)0));
6471 #line 31
6472 pthread_cond_init((pthread_cond_t * __restrict )(& rdwrp->lock_free), (pthread_condattr_t const * __restrict )((void *)0));
6473 #line 32
6474 return (0);
6475 }
6476 }
6477 #line 35 "pthread_np.c"
6478 int pthread_rdwr_rlock_np(pthread_rdwr_t *rdwrp )
6479 {
6480
6481 {
6482 #line 38
6483 pthread_mutex_lock(& rdwrp->mutex);
6484 #line 40
6485 while (1) {
6486 #line 40
6487 if (! rdwrp->writers) {
6488 #line 40
6489 if (! rdwrp->wishwrite) {
6490 #line 40
6491 break;
6492 }
6493 }
6494 #line 41
6495 pthread_cond_wait((pthread_cond_t * __restrict )(& rdwrp->lock_free), (pthread_mutex_t * __restrict )(& rdwrp->mutex));
6496 }
6497 #line 43
6498 rdwrp->readers ++;
6499 #line 44
6500 pthread_mutex_unlock(& rdwrp->mutex);
6501 #line 45
6502 return (0);
6503 }
6504 }
6505 #line 48 "pthread_np.c"
6506 int pthread_rdwr_wlock_np(pthread_rdwr_t *rdwrp )
6507 {
6508
6509 {
6510 #line 51
6511 pthread_mutex_lock(& rdwrp->mutex);
6512 #line 52
6513 rdwrp->wishwrite ++;
6514 #line 53
6515 while (1) {
6516 #line 53
6517 if (! rdwrp->writers) {
6518 #line 53
6519 if (! rdwrp->readers) {
6520 #line 53
6521 break;
6522 }
6523 }
6524 #line 54
6525 pthread_cond_wait((pthread_cond_t * __restrict )(& rdwrp->lock_free), (pthread_mutex_t * __restrict )(& rdwrp->mutex));
6526 }
6527 #line 55
6528 rdwrp->writers ++;
6529 #line 56
6530 rdwrp->wishwrite --;
6531 #line 57
6532 pthread_mutex_unlock(& rdwrp->mutex);
6533 #line 58
6534 return (0);
6535 }
6536 }
6537 #line 61 "pthread_np.c"
6538 int pthread_rdwr_runlock_np(pthread_rdwr_t *rdwrp )
6539 { int status ;
6540
6541 {
6542 #line 66
6543 pthread_mutex_lock(& rdwrp->mutex);
6544 #line 67
6545 if (rdwrp->readers == 0) {
6546 #line 69
6547 status = -1;
6548 } else {
6549 #line 73
6550 rdwrp->readers --;
6551 #line 74
6552 if (rdwrp->readers == 0) {
6553 #line 75
6554 pthread_cond_signal(& rdwrp->lock_free);
6555 }
6556 #line 76
6557 status = 0;
6558 }
6559 #line 78
6560 pthread_mutex_unlock(& rdwrp->mutex);
6561 #line 79
6562 return (status);
6563 }
6564 }
6565 #line 82 "pthread_np.c"
6566 int pthread_rdwr_wunlock_np(pthread_rdwr_t *rdwrp )
6567 { int status ;
6568
6569 {
6570 #line 87
6571 pthread_mutex_lock(& rdwrp->mutex);
6572 #line 88
6573 if (rdwrp->writers == 0) {
6574 #line 90
6575 status = -1;
6576 } else {
6577 #line 94
6578 rdwrp->writers = 0;
6579 #line 95
6580 pthread_cond_broadcast(& rdwrp->lock_free);
6581 #line 96
6582 status = 0;
6583 }
6584 #line 98
6585 pthread_mutex_unlock(& rdwrp->mutex);
6586 #line 99
6587 return (status);
6588 }
6589 }
6590 #line 1 "ypbind_slp.o"
6591 #pragma merger(0,"/tmp/cil-WCpVn6U1.i","-Wall,-g,-O2")
syntax highlighted by Code2HTML, v. 0.9.1