merge
This commit is contained in:
commit
60e3d2782b
1 changed files with 3 additions and 1 deletions
|
@ -144,10 +144,12 @@ populate(char *name)
|
||||||
}
|
}
|
||||||
f.mode &= DMDIR | 0777;
|
f.mode &= DMDIR | 0777;
|
||||||
|
|
||||||
/* make file name safe and canonical */
|
/* make file name safe, canonical and free of . and .. */
|
||||||
while (fname[0] == '/') /* don't allow absolute paths */
|
while (fname[0] == '/') /* don't allow absolute paths */
|
||||||
++fname;
|
++fname;
|
||||||
cleanname(fname);
|
cleanname(fname);
|
||||||
|
while (strncmp(fname, "../", 3) == 0)
|
||||||
|
fname += 3;
|
||||||
|
|
||||||
/* reject links */
|
/* reject links */
|
||||||
linkflg = hp->linkflag == LF_SYMLINK1 ||
|
linkflg = hp->linkflag == LF_SYMLINK1 ||
|
||||||
|
|
Loading…
Reference in a new issue