File TODO changed (mode: 100644) (index b2e0c07..6b8c543) |
8 |
8 |
[ ] On debian, I can switch to fuse3, not clear if this is true on Fedora. |
[ ] On debian, I can switch to fuse3, not clear if this is true on Fedora. |
9 |
9 |
Seems on Fedora is version 2.9.9. :( |
Seems on Fedora is version 2.9.9. :( |
10 |
10 |
Seems it is available. |
Seems it is available. |
11 |
|
[ ] |
|
|
11 |
|
[ ] Implement xattr, else rocketgit gives errors: |
|
12 |
|
flistxattr(4, NULL, 0) = 17 |
|
13 |
|
flistxattr(4, "security.selinux\0", 17) = 17 |
|
14 |
|
fgetxattr(4, "system.posix_acl_access", 0x7ffef2176040, 132) = -1 ENODATA (No data available) |
|
15 |
|
newfstatat(4, "", {st_mode=S_IFREG|0644, st_size=9907, ...}, AT_EMPTY_PATH) = 0 |
|
16 |
|
fsetxattr(5, "system.posix_acl_access", "\2\0\0\0\1\0\6\0\377\377\377\377\4\0\4\0\377\377\377\377 \0\4\0\377\377\377\377", 28, 0) = -1 EPERM (Operation not permitted) |
|
17 |
|
fsetxattr(5, "system.posix_acl_access", "\2\0\0\0\1\0\6\0\377\377\377\377\4\0\4\0\377\377\377\377 \0\4\0\377\377\377\377", 28, 0) = -1 EPERM (Operation not permitted) |
|
18 |
|
fchmod(5, 0100644) = 0 |
|
19 |
|
write(1, "'/mnt/build2/rpms/1/os/wh_build-user-98c6467b/wh_build-user-98c6467b+wh_build-0.1-1.x86_64.rpm' -> '/mnt/build2/rgfs/1/2/fedora/37/x86_64/os/+pending/wh_build-user-98c6467b/wh_build-use |
|
20 |
|
write(2, "cp: ", 4) = 4 |
|
21 |
|
write(2, "preserving permissions for \342\200\230/mnt/build2/rgfs/1/2/fedora/37/x86_64/os/+pending/wh_build-user-98c6467b/wh_build-user-98c6467b+wh_build-0.1-1.x86_64.rpm\342\200\231", 154) = 154 |
|
22 |
|
write(2, ": Operation not permitted", 25) = 25 |
|
23 |
|
[ ] |
File rgfs.c changed (mode: 100644) (index 4043a50..12d9874) |
... |
... |
static int rgfs_fuse_chmod(const char *path, mode_t mode) |
1213 |
1213 |
return err; |
return err; |
1214 |
1214 |
} |
} |
1215 |
1215 |
|
|
|
1216 |
|
static int rgfs_fuse_getxattr(const char *path, const char *attr_name, |
|
1217 |
|
char *value, size_t value_size) |
|
1218 |
|
{ |
|
1219 |
|
int r, i, err = 0; |
|
1220 |
|
unsigned char buf[4 * 4096], cmd; |
|
1221 |
|
uint16_t len; |
|
1222 |
|
|
|
1223 |
|
xlog("getxattr: path=[%s] attr=[%s]\n", path, attr_name); |
|
1224 |
|
|
|
1225 |
|
uint16_t path_len = strlen(path); |
|
1226 |
|
uint16_t attr_name_len = strlen(attr_name); |
|
1227 |
|
len = 1 + 2 + path_len + 2 + attr_name_len; |
|
1228 |
|
if (len > sizeof(buf)) { |
|
1229 |
|
xlog(" buffer too small\n"); |
|
1230 |
|
return -EIO; |
|
1231 |
|
} |
|
1232 |
|
|
|
1233 |
|
i = 0; |
|
1234 |
|
buf[i++] = 0x13; |
|
1235 |
|
buf[i++] = path_len >> 8; |
|
1236 |
|
buf[i++] = path_len; |
|
1237 |
|
buf[i++] = attr_name_len >> 8; |
|
1238 |
|
buf[i++] = attr_name_len; |
|
1239 |
|
memcpy(buf + i, path, path_len); i += path_len; |
|
1240 |
|
memcpy(buf + i, attr_name, attr_name_len); i += attr_name_len; |
|
1241 |
|
r = rgfs_send_recv("getxattr", buf, i, buf, sizeof(buf)); |
|
1242 |
|
|
|
1243 |
|
i = 4; |
|
1244 |
|
while (i < r) { |
|
1245 |
|
cmd = buf[i++]; |
|
1246 |
|
//xlog(" cmd=0x%02hhx\n", cmd); |
|
1247 |
|
switch (cmd) { |
|
1248 |
|
case 0x00: err = - be32toh(*(uint32_t *) (buf + i)); i += 4; break; |
|
1249 |
|
case 0x01: |
|
1250 |
|
uint16_t u16 = be16toh(*(uint16_t *) (buf + i)); i += 2; |
|
1251 |
|
if (u16 > sizeof(path) - 1) { |
|
1252 |
|
xlog("attr value len bigger than buf!\n"); |
|
1253 |
|
i += u16; |
|
1254 |
|
break; |
|
1255 |
|
} |
|
1256 |
|
if (u16 < value_size) |
|
1257 |
|
value_size = u16; |
|
1258 |
|
memcpy(value, buf + i, value_size); i += u16; |
|
1259 |
|
value[value_size] = '\0'; |
|
1260 |
|
err = value_size; |
|
1261 |
|
break; |
|
1262 |
|
default: xlog("Unexpected subcode 0x%02hhx!\n", cmd); exit(EXIT_FAILURE); |
|
1263 |
|
} |
|
1264 |
|
} |
|
1265 |
|
|
|
1266 |
|
if (err < 0) |
|
1267 |
|
xlog(" server returned error %d!\n", err); |
|
1268 |
|
|
|
1269 |
|
return err; |
|
1270 |
|
} |
|
1271 |
|
|
1216 |
1272 |
static const struct fuse_operations fuse_rgfs = { |
static const struct fuse_operations fuse_rgfs = { |
1217 |
1273 |
.getattr = rgfs_fuse_getattr, |
.getattr = rgfs_fuse_getattr, |
1218 |
1274 |
.readdir = rgfs_fuse_readdir, |
.readdir = rgfs_fuse_readdir, |
|
... |
... |
static const struct fuse_operations fuse_rgfs = { |
1230 |
1286 |
.symlink = rgfs_fuse_symlink, |
.symlink = rgfs_fuse_symlink, |
1231 |
1287 |
.link = rgfs_fuse_link, |
.link = rgfs_fuse_link, |
1232 |
1288 |
.chown = rgfs_fuse_chown, |
.chown = rgfs_fuse_chown, |
1233 |
|
.chmod = rgfs_fuse_chmod |
|
|
1289 |
|
.chmod = rgfs_fuse_chmod, |
|
1290 |
|
.getxattr = rgfs_fuse_getxattr |
1234 |
1291 |
}; |
}; |
1235 |
1292 |
|
|
1236 |
1293 |
int main(int argc, char *argv[]) |
int main(int argc, char *argv[]) |