Deleted Added
full compact
bootparamd.c (201521) bootparamd.c (229403)
1/*
2
3This code is not copyright, and is placed in the public domain. Feel free to
4use and modify. Please send modifications and/or suggestions + bug fixes to
5
6 Klas Heggemann <klas@nada.kth.se>
7
8*/
9
10#ifndef lint
11static const char rcsid[] =
1/*
2
3This code is not copyright, and is placed in the public domain. Feel free to
4use and modify. Please send modifications and/or suggestions + bug fixes to
5
6 Klas Heggemann <klas@nada.kth.se>
7
8*/
9
10#ifndef lint
11static const char rcsid[] =
12 "$FreeBSD: head/usr.sbin/bootparamd/bootparamd/bootparamd.c 201521 2010-01-04 18:08:16Z ed $";
12 "$FreeBSD: head/usr.sbin/bootparamd/bootparamd/bootparamd.c 229403 2012-01-03 18:51:58Z ed $";
13#endif /* not lint */
14
15#ifdef YP
16#include <rpc/rpc.h>
17#include <rpcsvc/yp_prot.h>
18#include <rpcsvc/ypclnt.h>
19#endif
20#include "bootparam_prot.h"

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

109}
110
111
112bp_getfile_res *
113 bootparamproc_getfile_1_svc(getfile, req)
114bp_getfile_arg *getfile;
115struct svc_req *req;
116{
13#endif /* not lint */
14
15#ifdef YP
16#include <rpc/rpc.h>
17#include <rpcsvc/yp_prot.h>
18#include <rpcsvc/ypclnt.h>
19#endif
20#include "bootparam_prot.h"

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

109}
110
111
112bp_getfile_res *
113 bootparamproc_getfile_1_svc(getfile, req)
114bp_getfile_arg *getfile;
115struct svc_req *req;
116{
117 char *where, *index();
117 char *where;
118 static bp_getfile_res res;
119
120 if (debug)
121 warnx("getfile got question for \"%s\" and file \"%s\"",
122 getfile->client_name, getfile->file_id);
123
124 if (dolog)
125 syslog(LOG_NOTICE,"getfile got question for \"%s\" and file \"%s\"\n",
126 getfile->client_name, getfile->file_id);
127
128 he = NULL;
129 he = gethostbyname(getfile->client_name);
130 if (! he ) goto failed;
131
132 strncpy(askname, he->h_name, sizeof(askname));
133 askname[sizeof(askname)-1] = 0;
134
135 if (getthefile(askname, getfile->file_id,buffer,sizeof(buffer))) {
118 static bp_getfile_res res;
119
120 if (debug)
121 warnx("getfile got question for \"%s\" and file \"%s\"",
122 getfile->client_name, getfile->file_id);
123
124 if (dolog)
125 syslog(LOG_NOTICE,"getfile got question for \"%s\" and file \"%s\"\n",
126 getfile->client_name, getfile->file_id);
127
128 he = NULL;
129 he = gethostbyname(getfile->client_name);
130 if (! he ) goto failed;
131
132 strncpy(askname, he->h_name, sizeof(askname));
133 askname[sizeof(askname)-1] = 0;
134
135 if (getthefile(askname, getfile->file_id,buffer,sizeof(buffer))) {
136 if ( (where = index(buffer,':')) ) {
136 if ( (where = strchr(buffer,':')) ) {
137 /* buffer is re-written to contain the name of the info of file */
138 strncpy(hostname, buffer, where - buffer);
139 hostname[where - buffer] = '\0';
140 where++;
141 strcpy(path, where);
142 he = gethostbyname(hostname);
143 if ( !he ) goto failed;
144 bcopy( he->h_addr, &res.server_address.bp_address_u.ip_addr, 4);

--- 214 unchanged lines hidden ---
137 /* buffer is re-written to contain the name of the info of file */
138 strncpy(hostname, buffer, where - buffer);
139 hostname[where - buffer] = '\0';
140 where++;
141 strcpy(path, where);
142 he = gethostbyname(hostname);
143 if ( !he ) goto failed;
144 bcopy( he->h_addr, &res.server_address.bp_address_u.ip_addr, 4);

--- 214 unchanged lines hidden ---