Deleted Added
full compact
ypxfrd_server.c (90297) ypxfrd_server.c (95658)
1/*
2 * Copyright (c) 1995, 1996
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

--- 18 unchanged lines hidden (view full) ---

27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 * SUCH DAMAGE.
31 */
32
33#ifndef lint
34static const char rcsid[] =
1/*
2 * Copyright (c) 1995, 1996
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

--- 18 unchanged lines hidden (view full) ---

27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 * SUCH DAMAGE.
31 */
32
33#ifndef lint
34static const char rcsid[] =
35 "$FreeBSD: head/usr.sbin/rpc.ypxfrd/ypxfrd_server.c 90297 2002-02-06 13:30:31Z des $";
35 "$FreeBSD: head/usr.sbin/rpc.ypxfrd/ypxfrd_server.c 95658 2002-04-28 15:18:50Z des $";
36#endif /* not lint */
37
38#include "ypxfrd.h"
39
40#include <stdio.h>
41#include <stdlib.h>
42#include <unistd.h>
43#include <string.h>

--- 54 unchanged lines hidden (view full) ---

98 }
99
100 if (yp_access(argp->xfrmap, (struct svc_req *)rqstp)) {
101 return(&result);
102 }
103
104 snprintf (buf, sizeof(buf), "%s/%s/%s", yp_dir, argp->xfrdomain,
105 argp->xfrmap);
36#endif /* not lint */
37
38#include "ypxfrd.h"
39
40#include <stdio.h>
41#include <stdlib.h>
42#include <unistd.h>
43#include <string.h>

--- 54 unchanged lines hidden (view full) ---

98 }
99
100 if (yp_access(argp->xfrmap, (struct svc_req *)rqstp)) {
101 return(&result);
102 }
103
104 snprintf (buf, sizeof(buf), "%s/%s/%s", yp_dir, argp->xfrdomain,
105 argp->xfrmap);
106 if (access((char *)&buf, R_OK) == -1) {
106 if (access(buf, R_OK) == -1) {
107 result.xfr_u.xfrstat = XFR_ACCESS;
108 return(&result);
109 }
110
111 if (argp->xfr_db_type != XFR_DB_BSD_HASH &&
112 argp->xfr_db_type != XFR_DB_ANY) {
113 result.xfr_u.xfrstat = XFR_DB_TYPE_MISMATCH;
114 return(&result);

--- 12 unchanged lines hidden (view full) ---

127 if (children < MAX_CHILDREN && fork()) {
128 children++;
129 forked = 0;
130 return (NULL);
131 } else {
132 forked++;
133 }
134#endif
107 result.xfr_u.xfrstat = XFR_ACCESS;
108 return(&result);
109 }
110
111 if (argp->xfr_db_type != XFR_DB_BSD_HASH &&
112 argp->xfr_db_type != XFR_DB_ANY) {
113 result.xfr_u.xfrstat = XFR_DB_TYPE_MISMATCH;
114 return(&result);

--- 12 unchanged lines hidden (view full) ---

127 if (children < MAX_CHILDREN && fork()) {
128 children++;
129 forked = 0;
130 return (NULL);
131 } else {
132 forked++;
133 }
134#endif
135 if ((fp = open((char *)&buf, O_RDONLY)) == -1) {
135 if ((fp = open(buf, O_RDONLY)) == -1) {
136 result.xfr_u.xfrstat = XFR_READ_ERR;
137 return(&result);
138 }
139
140 /* Start sending the file. */
141
136 result.xfr_u.xfrstat = XFR_READ_ERR;
137 return(&result);
138 }
139
140 /* Start sending the file. */
141
142 svc_sendreply(rqstp->rq_xprt, xdr_my_xfr, (char *)&result);
142 svc_sendreply(rqstp->rq_xprt, (xdrproc_t)xdr_my_xfr, &result);
143
144 close(fp);
145
146 return (NULL);
147}
143
144 close(fp);
145
146 return (NULL);
147}