View | Details | Raw Unified | Return to bug 100914 | Differences between
and this patch

Collapse All | Expand All

(-)libexec/tftpd/tftpd.c (-4 / +16 lines)
Lines 588-603 validate_access(char **filep, int mode) Link Here
588
				dirp->name, filename);
588
				dirp->name, filename);
589
			if (stat(pathname, &stbuf) == 0 &&
589
			if (stat(pathname, &stbuf) == 0 &&
590
			    (stbuf.st_mode & S_IFMT) == S_IFREG) {
590
			    (stbuf.st_mode & S_IFMT) == S_IFREG) {
591
				if ((stbuf.st_mode & S_IROTH) != 0) {
591
				if (mode == RRQ) {
592
					break;
592
					if ((stbuf.st_mode & S_IROTH) != 0) {
593
						break;
594
					}
595
				} else {
596
					if ((stbuf.st_mode & S_IWOTH) != 0) {
597
						break;
598
					}
593
				}
599
				}
594
				err = EACCESS;
600
				err = EACCESS;
595
			}
601
			}
596
		}
602
		}
597
		if (dirp->name != NULL)
603
		if (dirp->name != NULL)
598
			*filep = filename = pathname;
604
			*filep = filename = pathname;
599
		else if (mode == RRQ)
605
		else {
600
			return (err);
606
			if (mode == RRQ) {
607
				return (err);
608
			} else {
609
				if (!create_new)
610
					return (err);
611
			}
612
		}
601
	}
613
	}
602
	if (options[OPT_TSIZE].o_request) {
614
	if (options[OPT_TSIZE].o_request) {
603
		if (mode == RRQ) 
615
		if (mode == RRQ) 

Return to bug 100914