Пример #1
0
static int append_one_mount(BindMount **p, const char *root_directory,
                            const char *path, MountMode mode, bool ignore) {
        char *lpath;
        assert(p);

        lpath = prefix_root(root_directory, path);
        if (!lpath)
                return -ENOMEM;

        set_bind_mount((*p)++, lpath, mode, ignore);
        return 0;
}
Пример #2
0
static int append_mounts(BindMount **p, char **strv, MountMode mode) {
        char **i;

        assert(p);

        STRV_FOREACH(i, strv) {
                bool ignore = false;

                if (IN_SET(mode, INACCESSIBLE, READONLY, READWRITE) && startswith(*i, "-")) {
                        (*i)++;
                        ignore = true;
                }

                if (!path_is_absolute(*i))
                        return -EINVAL;

                set_bind_mount(p, *i, mode, ignore);
                (*p)++;
        }