Fossil SCM
Fix the FuseFS to correctly report when files that have executable permission.
Commit
a2730f72768678c3182b9a51971f06aa2757f22d
Parent
ee5cd77d5a2ad8c…
2 files changed
+2
-1
+3
-2
+2
-1
| --- src/fusefs.c | ||
| +++ src/fusefs.c | ||
| @@ -132,11 +132,12 @@ | ||
| 132 | 132 | if( fusefs.pMan==0 ) return -ENOENT; |
| 133 | 133 | pFile = manifest_file_seek(fusefs.pMan, fusefs.az[2], 1); |
| 134 | 134 | if( pFile==0 ) return -ENOENT; |
| 135 | 135 | stbuf->st_mtime = (fusefs.pMan->rDate - 2440587.5)*86400.0; |
| 136 | 136 | if( strcmp(fusefs.az[2], pFile->zName)==0 ){ |
| 137 | - stbuf->st_mode = S_IFREG | 0444; | |
| 137 | + stbuf->st_mode = S_IFREG | | |
| 138 | + (manifest_file_mperm(pFile)==PERM_EXE ? 0555 : 0444); | |
| 138 | 139 | stbuf->st_nlink = 1; |
| 139 | 140 | stbuf->st_size = db_int(0, "SELECT size FROM blob WHERE uuid='%s'", |
| 140 | 141 | pFile->zUuid); |
| 141 | 142 | return 0; |
| 142 | 143 | } |
| 143 | 144 |
| --- src/fusefs.c | |
| +++ src/fusefs.c | |
| @@ -132,11 +132,12 @@ | |
| 132 | if( fusefs.pMan==0 ) return -ENOENT; |
| 133 | pFile = manifest_file_seek(fusefs.pMan, fusefs.az[2], 1); |
| 134 | if( pFile==0 ) return -ENOENT; |
| 135 | stbuf->st_mtime = (fusefs.pMan->rDate - 2440587.5)*86400.0; |
| 136 | if( strcmp(fusefs.az[2], pFile->zName)==0 ){ |
| 137 | stbuf->st_mode = S_IFREG | 0444; |
| 138 | stbuf->st_nlink = 1; |
| 139 | stbuf->st_size = db_int(0, "SELECT size FROM blob WHERE uuid='%s'", |
| 140 | pFile->zUuid); |
| 141 | return 0; |
| 142 | } |
| 143 |
| --- src/fusefs.c | |
| +++ src/fusefs.c | |
| @@ -132,11 +132,12 @@ | |
| 132 | if( fusefs.pMan==0 ) return -ENOENT; |
| 133 | pFile = manifest_file_seek(fusefs.pMan, fusefs.az[2], 1); |
| 134 | if( pFile==0 ) return -ENOENT; |
| 135 | stbuf->st_mtime = (fusefs.pMan->rDate - 2440587.5)*86400.0; |
| 136 | if( strcmp(fusefs.az[2], pFile->zName)==0 ){ |
| 137 | stbuf->st_mode = S_IFREG | |
| 138 | (manifest_file_mperm(pFile)==PERM_EXE ? 0555 : 0444); |
| 139 | stbuf->st_nlink = 1; |
| 140 | stbuf->st_size = db_int(0, "SELECT size FROM blob WHERE uuid='%s'", |
| 141 | pFile->zUuid); |
| 142 | return 0; |
| 143 | } |
| 144 |
+3
-2
| --- src/manifest.c | ||
| +++ src/manifest.c | ||
| @@ -1161,14 +1161,15 @@ | ||
| 1161 | 1161 | ** of a file. |
| 1162 | 1162 | */ |
| 1163 | 1163 | int manifest_file_mperm(ManifestFile *pFile){ |
| 1164 | 1164 | int mperm = PERM_REG; |
| 1165 | 1165 | if( pFile && pFile->zPerm){ |
| 1166 | - if( strstr(pFile->zPerm,"x")!=0 ) | |
| 1166 | + if( strstr(pFile->zPerm,"x")!=0 ){ | |
| 1167 | 1167 | mperm = PERM_EXE; |
| 1168 | - else if( strstr(pFile->zPerm,"l")!=0 ) | |
| 1168 | + }else if( strstr(pFile->zPerm,"l")!=0 ){ | |
| 1169 | 1169 | mperm = PERM_LNK; |
| 1170 | + } | |
| 1170 | 1171 | } |
| 1171 | 1172 | return mperm; |
| 1172 | 1173 | } |
| 1173 | 1174 | |
| 1174 | 1175 | /* |
| 1175 | 1176 |
| --- src/manifest.c | |
| +++ src/manifest.c | |
| @@ -1161,14 +1161,15 @@ | |
| 1161 | ** of a file. |
| 1162 | */ |
| 1163 | int manifest_file_mperm(ManifestFile *pFile){ |
| 1164 | int mperm = PERM_REG; |
| 1165 | if( pFile && pFile->zPerm){ |
| 1166 | if( strstr(pFile->zPerm,"x")!=0 ) |
| 1167 | mperm = PERM_EXE; |
| 1168 | else if( strstr(pFile->zPerm,"l")!=0 ) |
| 1169 | mperm = PERM_LNK; |
| 1170 | } |
| 1171 | return mperm; |
| 1172 | } |
| 1173 | |
| 1174 | /* |
| 1175 |
| --- src/manifest.c | |
| +++ src/manifest.c | |
| @@ -1161,14 +1161,15 @@ | |
| 1161 | ** of a file. |
| 1162 | */ |
| 1163 | int manifest_file_mperm(ManifestFile *pFile){ |
| 1164 | int mperm = PERM_REG; |
| 1165 | if( pFile && pFile->zPerm){ |
| 1166 | if( strstr(pFile->zPerm,"x")!=0 ){ |
| 1167 | mperm = PERM_EXE; |
| 1168 | }else if( strstr(pFile->zPerm,"l")!=0 ){ |
| 1169 | mperm = PERM_LNK; |
| 1170 | } |
| 1171 | } |
| 1172 | return mperm; |
| 1173 | } |
| 1174 | |
| 1175 | /* |
| 1176 |