Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

o Writing is not possible. Show permissions as readonly.

  • Loading branch information...
commit 369a0a7178b48883083886b98c086599a75dbf21 1 parent 0b0bd33
@hzeller authored
Showing with 8 additions and 7 deletions.
  1. +8 −7 folve-main.cc
View
15 folve-main.cc
@@ -74,13 +74,14 @@ static int folve_getattr(const char *path, struct stat *stbuf) {
// If this is a currently open filename, we might be able to output a better
// estimate.
int result = folve_rt.fs->StatByFilename(path, stbuf);
- if (result == 0) return result;
-
- char path_buf[PATH_MAX];
- result = lstat(assemble_orig_path(path_buf, path), stbuf);
- if (result == -1)
- return -errno;
-
+ if (result != 0) {
+ char path_buf[PATH_MAX];
+ result = lstat(assemble_orig_path(path_buf, path), stbuf);
+ if (result == -1)
+ return -errno;
+ }
+ // Whatever write mode was there before: now things are readonly.
+ stbuf->st_mode &= ~(S_IWUSR | S_IWGRP | S_IWOTH);
return 0;
}
Please sign in to comment.
Something went wrong with that request. Please try again.