ensure that file index entry perms map to regular files
diff --git a/lib/fileindex.c b/lib/fileindex.c
index 2e2def1..c4026c7 100644
--- a/lib/fileindex.c
+++ b/lib/fileindex.c
@@ -61,7 +61,7 @@ mode_t
got_fileindex_perms_to_st(struct got_fileindex_entry *ie)
{
mode_t perms = (ie->mode >> GOT_FILEIDX_MODE_PERMS_SHIFT);
- return (perms & (S_IRWXU | S_IRWXG | S_IRWXO));
+ return (S_IFREG | (perms & (S_IRWXU | S_IRWXG | S_IRWXO)));
}
const struct got_error *