Fossil SCM

Fix the FuseFS to correctly report when files that have executable permission.

drh 2014-06-14 02:48 UTC fusefs
Commit a2730f72768678c3182b9a51971f06aa2757f22d
2 files changed +2 -1 +3 -2
+2 -1
--- src/fusefs.c
+++ src/fusefs.c
@@ -132,11 +132,12 @@
132132
if( fusefs.pMan==0 ) return -ENOENT;
133133
pFile = manifest_file_seek(fusefs.pMan, fusefs.az[2], 1);
134134
if( pFile==0 ) return -ENOENT;
135135
stbuf->st_mtime = (fusefs.pMan->rDate - 2440587.5)*86400.0;
136136
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);
138139
stbuf->st_nlink = 1;
139140
stbuf->st_size = db_int(0, "SELECT size FROM blob WHERE uuid='%s'",
140141
pFile->zUuid);
141142
return 0;
142143
}
143144
--- 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 @@
11611161
** of a file.
11621162
*/
11631163
int manifest_file_mperm(ManifestFile *pFile){
11641164
int mperm = PERM_REG;
11651165
if( pFile && pFile->zPerm){
1166
- if( strstr(pFile->zPerm,"x")!=0 )
1166
+ if( strstr(pFile->zPerm,"x")!=0 ){
11671167
mperm = PERM_EXE;
1168
- else if( strstr(pFile->zPerm,"l")!=0 )
1168
+ }else if( strstr(pFile->zPerm,"l")!=0 ){
11691169
mperm = PERM_LNK;
1170
+ }
11701171
}
11711172
return mperm;
11721173
}
11731174
11741175
/*
11751176
--- 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

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button