catalinux / rgfs (public) (License: GPLv3) (since 2020-11-11)
Allows mapping of RocketGit storage area into a local directory
List of commits:
Subject Hash Author Date (UTC)
implemented chown d3862312d2900e96957c0734b5f27d0851d2a19a Catalin(ux) M. BOIE 2020-11-16 18:31:35
Lots of improvements 4953574e14ffba41e05e897fb94771f0ac7bab44 Catalin(ux) M. BOIE 2020-11-15 16:46:04
Allow verbose debug cee91423dda669c580b84451d3b846b3e7ef3038 Catalin(ux) M. BOIE 2020-11-15 12:11:04
Small bug caused by an old way to pack path ad3501ea5b7b112f0760f5aca247275e974edaff Catalin(ux) M. BOIE 2020-11-15 11:59:55
Lots of improvements 9275d4bc7be78518ac7bd2c3aa9cfb946a2969ad Catalin(ux) M. BOIE 2020-11-15 10:40:44
Lots of cleanups 2998ff2dcb74565887986fb7167e65e4fdf6d173 Catalin(ux) M. BOIE 2020-11-14 19:23:09
added utimens b5c24acf3ff86a51a7a49fec1eaf8eb65ae77bbb Catalin(ux) M. BOIE 2020-11-14 16:09:29
Improved debug f9bdf71667d0c77d4fcb4fa6e7792fd2d4c60712 Catalin(ux) M. BOIE 2020-11-13 18:57:48
Allow pushing a name and a repo id 9b48c3ae2a059a1ecd84caf44cea6c551175dd46 Catalin(ux) M. BOIE 2020-11-12 16:14:02
Send also the pkg_repo_id parameter 866c8063866effdabe0aa76fcfb9cc2b3d61b67a Catalin(ux) M. BOIE 2020-11-12 07:54:07
Now we can pass parameters by env 8352d8d09714a3c2af7550ad55517bfa8590a309 Catalin(ux) M. BOIE 2020-11-12 04:48:19
Inistial commit e51779259596117c80f6e7961f4387fdd48f820a Catalin(ux) M. BOIE 2020-11-11 08:18:38
Commit d3862312d2900e96957c0734b5f27d0851d2a19a - implemented chown
Author: Catalin(ux) M. BOIE
Author date (UTC): 2020-11-16 18:31
Committer name: Catalin(ux) M. BOIE
Committer date (UTC): 2020-11-16 18:31
Parent(s): 4953574e14ffba41e05e897fb94771f0ac7bab44
Signing key:
Tree: 66a38f075524a8b9508ed97b9ad065f4e5711830
File Lines added Lines deleted
rgfs.c 47 3
File rgfs.c changed (mode: 100644) (index a34764c..f832806)
... ... static void xlog(char *format, ...)
54 54
55 55 gettimeofday(&tv, NULL); gettimeofday(&tv, NULL);
56 56 len = snprintf(line, sizeof(line), len = snprintf(line, sizeof(line),
57 "%ld.%03ld ", tv.tv_sec, tv.tv_usec);
57 "%ld.%06ld ", tv.tv_sec, tv.tv_usec);
58 58
59 59 va_start(ap, format); va_start(ap, format);
60 60 len2 = vsnprintf(line + len, sizeof(line) - len, format, ap); len2 = vsnprintf(line + len, sizeof(line) - len, format, ap);
 
... ... static int rgfs_recv_hl(const char *op, void *buf, size_t buf_size)
384 384 exit(EXIT_FAILURE); exit(EXIT_FAILURE);
385 385 } }
386 386 r = rgfs_recv(buf + off, buf_size - off); r = rgfs_recv(buf + off, buf_size - off);
387 if (r <= 0)
387 if (r < 0)
388 388 return r; return r;
389 if (r == 0)
390 return off;
389 391
390 392 off += r; off += r;
391 393 if (off >= 4) if (off >= 4)
 
... ... static int rgfs_fuse_link(const char *target, const char *link)
1082 1084 return err; return err;
1083 1085 } }
1084 1086
1087 static int rgfs_fuse_chown(const char *path, uid_t uid, gid_t gid)
1088 {
1089 int err = 0, r, i;
1090 uint16_t path_len, len;
1091 unsigned char buf[4 * 4096], cmd;
1092 uint32_t u32;
1093
1094 xlog("chown: path=%s uid=%u gid=%u\n", path, uid, gid);
1095
1096 path_len = strlen(path);
1097 len = 1 + 2 + 4 + 4 + path_len;
1098 if (len > sizeof(buf)) {
1099 xlog(" buffer too small\n");
1100 return -EIO;
1101 }
1102
1103 i = 0;
1104 buf[i++] = 0x10;
1105 buf[i++] = (len - 1 - 2) >> 8;
1106 buf[i++] = len - 1 - 2;
1107 u32 = htobe32(uid); memcpy(buf + i, &u32, 4); i += 4;
1108 u32 = htobe32(gid); memcpy(buf + i, &u32, 4); i += 4;
1109 memcpy(buf + i, path, path_len); i += path_len;
1110 r = rgfs_send_recv("create", buf, i, buf, sizeof(buf));
1111
1112 i = 4;
1113 if (i < r) {
1114 cmd = buf[i++];
1115 //xlog(" cmd=0x%02hhx\n", cmd);
1116 switch (cmd) {
1117 case 0x00: err = - be32toh(*(uint32_t *) (buf + i)); break;
1118 default: xlog("Unexpected subcode 0x%02hhx!\n", cmd); exit(EXIT_FAILURE);
1119 }
1120 }
1121
1122 if (err < 0)
1123 xlog(" server returned error %d!\n", err);
1124
1125 return 0;
1126 }
1127
1085 1128 static const struct fuse_operations fuse_rgfs = { static const struct fuse_operations fuse_rgfs = {
1086 1129 .getattr = rgfs_fuse_getattr, .getattr = rgfs_fuse_getattr,
1087 1130 .readdir = rgfs_fuse_readdir, .readdir = rgfs_fuse_readdir,
 
... ... static const struct fuse_operations fuse_rgfs = {
1097 1140 .utimens = rgfs_fuse_utimens, .utimens = rgfs_fuse_utimens,
1098 1141 .readlink = rgfs_fuse_readlink, .readlink = rgfs_fuse_readlink,
1099 1142 .symlink = rgfs_fuse_symlink, .symlink = rgfs_fuse_symlink,
1100 .link = rgfs_fuse_link
1143 .link = rgfs_fuse_link,
1144 .chown = rgfs_fuse_chown
1101 1145 }; };
1102 1146
1103 1147 int main(int argc, char *argv[]) int main(int argc, char *argv[])
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 master