commit 77b3eed530b60e07334a674abc64e9864c99e903 parent 067eb5082f7fa26e9ddfd0f05cdbc43c06113402 Author: Friedel Schoen <[email protected]> Date: Thu, 29 Dec 2022 00:22:42 +0100 add share and rshare to config.c Diffstat:
M | src/config.c | | | 17 | +++++++++++++++++ |
1 file changed, 17 insertions(+), 0 deletions(-)
diff --git a/src/config.c b/src/config.c @@ -188,6 +188,23 @@ parse_error_t config_parsef(FILE* file, const char* filename) { master = current_section; if (default_s == NULL) default_s = current_section; + } else if (streq(columns[0], "rshare") || streq(columns[0], "share")) { + CHECK_PARAMS_MORE(2); + + for (int i = 1; i < columns_size; i++) { + mount_t* mnt = (current_section != NULL) + ? ¤t_section->mounts[current_section->mount_size++] + : &mounts[mount_size++]; + + mnt->try = false; + mnt->type = NULL; + mnt->source = strdupn(columns[i]); + mnt->target = strdupn(columns[i]); + mnt->options = NULL; + mnt->flags = MS_BIND; + if (columns[0][0] == 'r') // aka. equals rshare + mnt->flags |= MS_REC; + } } else if (streq(columns[0], "color")) { CHECK_ROOT; CHECK_PARAMS_EQUALS(2);