Commit 8957ae76febe5a6d3784d953344e6f765b1a6ace

Stefan Sperling 2019-08-08T16:38:43

ensure that file index entry perms map to regular files

1
2
3
4
5
6
7
8
9
10
11
12
13
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 *