@@ -54,10 +54,11 @@ struct appfs_pathinfo { appfs_pathtype_t type; time_t time; char hostname[256]; + int packaged; unsigned long long inode; union { struct { int childcount; } dir; @@ -744,21 +745,26 @@ char *package_hash; char *sql; int files_count; int fileinfo_ret, retval; + /* Initialize return */ if (children) { *children = NULL; } + /* Verify that this is a valid request */ if (_path == NULL) { return(-ENOENT); } if (_path[0] != '/') { return(-ENOENT); } + + /* Note that this is not a "real" directory from a package */ + pathinfo->packaged = 0; if (_path[1] == '\0') { /* Request for the root directory */ pathinfo->hostname[0] = '\0'; pathinfo->inode = 1; @@ -876,10 +882,11 @@ *path = '\0'; path++; } /* Request for a file in a specific package */ + pathinfo->packaged = 1; APPFS_DEBUG("Requesting information for hostname = %s, package = %s, os = %s, cpuArch = %s, version = %s, path = %s", hostname, packagename, os, cpuArch, version, path ); package_hash = appfs_lookup_package_hash(hostname, packagename, os, cpuArch, version); @@ -995,12 +1002,14 @@ res = -EIO; break; } - if (globalThread.options.writable) { - stbuf->st_mode |= 0222; + if (pathinfo.packaged) { + if (globalThread.options.writable) { + stbuf->st_mode |= 0222; + } } return res; }