Lines Matching defs:namebuff
230 strcpy(daemon->namebuff, "/");
234 daemon->namebuff[0] = 0;
235 strncat(daemon->namebuff, daemon->tftp_prefix, (MAXDNAME-1) - strlen(daemon->namebuff));
237 strncat(daemon->namebuff, "/", (MAXDNAME-1) - strlen(daemon->namebuff));
241 size_t oldlen = strlen(daemon->namebuff);
244 strncat(daemon->namebuff, inet_ntoa(peer.sin_addr), (MAXDNAME-1) - strlen(daemon->namebuff));
245 strncat(daemon->namebuff, "/", (MAXDNAME-1) - strlen(daemon->namebuff));
248 if (stat(daemon->namebuff, &statbuf) == -1 || !S_ISDIR(statbuf.st_mode))
249 daemon->namebuff[oldlen] = 0;
255 if (strstr(filename, daemon->namebuff) == filename)
256 daemon->namebuff[0] = 0;
262 daemon->namebuff[0] = 0;
263 strncat(daemon->namebuff, filename, (MAXDNAME-1) - strlen(daemon->namebuff));
269 len = tftp_err_oops(packet, daemon->namebuff);
282 my_syslog(MS_TFTP | LOG_INFO, _("TFTP sent %s to %s"), daemon->namebuff, inet_ntoa(peer.sin_addr));
290 char *packet = daemon->packet, *namebuff = daemon->namebuff;
298 if (daemon->tftp_prefix && strstr(namebuff, "/../"))
301 if ((fd = open(namebuff, O_RDONLY)) == -1)
305 *len = tftp_err(ERR_FNF, packet, _("file %s not found"), namebuff);
336 strcmp(t->file->filename, namebuff) == 0)
343 if (!(file = whine_malloc(sizeof(struct tftp_file) + strlen(namebuff) + 1)))
354 strcpy(file->filename, namebuff);
359 *len = tftp_err(ERR_PERM, packet, _("cannot access %s: %s"), namebuff);
365 *len = tftp_err_oops(packet, namebuff);