Commit 58134aab authored by Gabriel Krisman Bertazi's avatar Gabriel Krisman Bertazi
Browse files

lib: Forbid viewing rootfs as a CI_MOUNTPOINT

Viewing the entire rootfs as a CI mountpoint is a recipe for disaster.
Prevent it from happening.
Signed-off-by: default avatarGabriel Krisman Bertazi <>
parent 955ec434
......@@ -114,6 +114,8 @@ static FILE *try_load_file()
static int validate_mountpoint(const char *path)
if (!strcmp(path, "/"))
return -1;
return 0;
......@@ -158,8 +160,11 @@ int load_mount_points()
path[len-1] = '\0';
if (validate_mountpoint(path))
if (validate_mountpoint(path) < 0) {
fprintf(stderr, "Warning: libcasefold: Can't configure "
"%s as a CI mountpoint. Ignoring.\n", path);
if (insert_mountpoint(path))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment