Only list world readable files.

This commit is contained in:
Solderpunk 2019-11-21 23:03:39 +02:00
parent 23a6284cc4
commit 0de58e031a
1 changed files with 4 additions and 0 deletions

View File

@ -156,6 +156,10 @@ func generateDirectoryListing(path string) string {
}
listing = "# Directory listing\n\n"
for _, file := range files {
// Only list world readable files
if uint64(file.Mode().Perm())&0444 != 0444 {
continue
}
listing += fmt.Sprintf("=> %s %s\n", file.Name(), file.Name())
}
return listing