catalinux / rgfs (public) (License: GPLv3) (since 2020-11-11) (hash sha1)
Allows mapping of RocketGit storage area into a local directory
List of commits:
Subject Hash Author Date (UTC)
Implemented getxattr d6af17c272a32934ea9e3b158d8377eeef820bff Catalin(ux) M. BOIE 2023-06-04 09:02:22
Avoid double close of a fd thanks to -fanalyzer 4e04977ac4908edd9d52bd12500de03a58a91633 Catalin(ux) M. BOIE 2023-04-23 06:59:45
Cosmetic 4ec874c481fd2872f387efb13a52cdf2bcdb374f Catalin(ux) M. BOIE 2022-10-25 12:39:01
Cosmetic 4c235f5658721afbbd5bc1bd1e36929ac4ac8ea4 Catalin(ux) M. BOIE 2022-10-21 16:54:31
Released version 0.2 dc38467f694ee1d44c8eee48c1478e79097e1dec Catalin(ux) M. BOIE 2022-06-09 05:20:42
Cosmetic feb437708c6af9578176971f1a81ab3c8e9e561e Catalin(ux) M. BOIE 2022-01-24 19:59:44
Cosmetic d987cb7229ef9db41441607609699568416a8cee Catalin(ux) M. BOIE 2022-01-24 11:55:48
Deal with partial writes 5db8d961f1e732b0c96b57126f3528649a543b13 Catalin(ux) M. BOIE 2022-01-24 09:25:06
Really fix write size overflow 7433a431f7e8da44ef8e98fa9011e8a44cd8de08 Catalin(ux) M. BOIE 2022-01-24 07:52:05
Added first step of specifying protocol 608380dcd49803c6aaf45561a19b2a19529031a2 Catalin(ux) M. BOIE 2022-01-24 07:51:45
If the write buffer is not enough, limit the size aa62b3515b8ff95f45f63ea4a0a848d9d49d41b2 Catalin(ux) M. BOIE 2022-01-23 19:48:11
More preparations for ebian package 93fc386ff8a32954b2559a76b1bc44ab9ac50b6a Catalin(ux) M. BOIE 2021-12-04 12:44:28
duilder update c7ab77a1da4bac86bbb3decc375e084e2eee994f Catalin(ux) M. BOIE 2021-11-17 16:46:56
.spec file is not genrated anymore because the dep extract phase 8d7838b9d611d53677513c61a1f8e7a31cd94040 Catalin(ux) M. BOIE 2021-11-17 16:35:36
Avoid an overflow 896593e3ec385d03b0f368688407f00881604a95 Catalin(ux) M. BOIE 2021-10-24 10:35:57
Stupid mistake: sizeof(pointer) 0ad966a0968bd2d762950860b4a66db28fc7ee06 Catalin(ux) M. BOIE 2021-10-24 10:18:47
More debugging 68246f79bd9a96fadfbef0d9cd4e884e04ee4f86 Catalin(ux) M. BOIE 2021-10-24 09:40:12
Seems that fuse cannot return any value on read, so adapt to dyn alloc memory 787716468c47f979da048d266a6e0acb569345ab Catalin(ux) M. BOIE 2021-10-24 09:01:56
More debugging 44259f8be40bc2aa8220ed1f76d51e3f54ea5595 Catalin(ux) M. BOIE 2021-10-24 08:30:33
spec: replaced usrbindir with bindir c34fbb313f831714894e528a483db700cdac4e5b Catalin(ux) M. BOIE 2021-10-21 16:38:26
Commit d6af17c272a32934ea9e3b158d8377eeef820bff - Implemented getxattr
Author: Catalin(ux) M. BOIE
Author date (UTC): 2023-06-04 09:02
Committer name: Catalin(ux) M. BOIE
Committer date (UTC): 2023-06-04 09:02
Parent(s): 4e04977ac4908edd9d52bd12500de03a58a91633
Signing key:
Tree: 8c73ac008f48e8cf5d3f5d34cf9abe9ea8ac13d5
File Lines added Lines deleted
TODO 13 1
rgfs.c 58 1
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[])
Date/time (UTC) Type Misc Labels
2023-06-04 10:02 build fedora-38-x86_64 worker/r1 builder/color=fff worker_elap/3544s wait_time/0s date/2023-06-04 time/09:02
Hints:
Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://rocketgit.com/user/catalinux/rgfs

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@ssh.rocketgit.com/user/catalinux/rgfs

Clone this repository using git:
git clone git://git.rocketgit.com/user/catalinux/rgfs

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a merge request:
... clone the repository ...
... make some changes and some commits ...
git push origin main