yp_server.c (13375) | yp_server.c (13800) |
---|---|
1/* 2 * Copyright (c) 1995 3 * Bill Paul <wpaul@ctr.columbia.edu>. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 31 unchanged lines hidden (view full) --- 40#include <errno.h> 41#include <sys/types.h> 42#include <sys/socket.h> 43#include <netinet/in.h> 44#include <arpa/inet.h> 45#include <rpc/rpc.h> 46 47#ifndef lint | 1/* 2 * Copyright (c) 1995 3 * Bill Paul <wpaul@ctr.columbia.edu>. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 31 unchanged lines hidden (view full) --- 40#include <errno.h> 41#include <sys/types.h> 42#include <sys/socket.h> 43#include <netinet/in.h> 44#include <arpa/inet.h> 45#include <rpc/rpc.h> 46 47#ifndef lint |
48static char rcsid[] = "$Id: yp_server.c,v 1.2 1995/12/23 21:35:35 wpaul Exp $"; | 48static char rcsid[] = "$Id: yp_server.c,v 1.3 1996/01/10 16:07:39 wpaul Exp $"; |
49#endif /* not lint */ 50 51int forked = 0; 52int children = 0; 53DB *spec_dbp = NULL; /* Special global DB handle for ypproc_all. */ 54 55void * 56ypproc_null_2_svc(void *argp, struct svc_req *rqstp) --- 560 unchanged lines hidden (view full) --- 617 struct ypmaplist *yp_maplist = NULL; 618 DIR *dird; 619 struct dirent *dirp; 620 struct stat statbuf; 621 622 snprintf(yp_mapdir, sizeof(yp_mapdir), "%s/%s", yp_dir, domain); 623 624 if ((dird = opendir(yp_mapdir)) == NULL) { | 49#endif /* not lint */ 50 51int forked = 0; 52int children = 0; 53DB *spec_dbp = NULL; /* Special global DB handle for ypproc_all. */ 54 55void * 56ypproc_null_2_svc(void *argp, struct svc_req *rqstp) --- 560 unchanged lines hidden (view full) --- 617 struct ypmaplist *yp_maplist = NULL; 618 DIR *dird; 619 struct dirent *dirp; 620 struct stat statbuf; 621 622 snprintf(yp_mapdir, sizeof(yp_mapdir), "%s/%s", yp_dir, domain); 623 624 if ((dird = opendir(yp_mapdir)) == NULL) { |
625 yp_error("opendir(%s) failed: %s", strerror(errno)); | 625 yp_error("opendir(%s) failed: %s", yp_mapdir, strerror(errno)); |
626 return(NULL); 627 } 628 629 while ((dirp = readdir(dird)) != NULL) { 630 if (strcmp(dirp->d_name, ".") && strcmp(dirp->d_name, "..")) { 631 snprintf(yp_mapname, sizeof(yp_mapname), "%s/%s",yp_mapdir,dirp->d_name); 632 if (stat(yp_mapname, &statbuf) < 0 || !S_ISREG(statbuf.st_mode)) 633 continue; --- 64 unchanged lines hidden --- | 626 return(NULL); 627 } 628 629 while ((dirp = readdir(dird)) != NULL) { 630 if (strcmp(dirp->d_name, ".") && strcmp(dirp->d_name, "..")) { 631 snprintf(yp_mapname, sizeof(yp_mapname), "%s/%s",yp_mapdir,dirp->d_name); 632 if (stat(yp_mapname, &statbuf) < 0 || !S_ISREG(statbuf.st_mode)) 633 continue; --- 64 unchanged lines hidden --- |