X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fprocd.git;a=blobdiff_plain;f=jail%2Ffs.c;h=c4cdcc93d6cdfb5c2329468e6929ca12a3cbe81c;hp=7b7b82002402ad90edb838a6b12368d42c35b55a;hb=0cf8b0576a66ca28aeec98e19dc9c1cbf4324894;hpb=9211278a18daad763bac3f06afd97dfd5e03aa2c diff --git a/jail/fs.c b/jail/fs.c index 7b7b820..c4cdcc9 100644 --- a/jail/fs.c +++ b/jail/fs.c @@ -86,7 +86,7 @@ static int add_script_interp(const char *path, const char *map, int size) start++; } if (start >= size) { - ERROR("bad script interp (%s)", path); + ERROR("bad script interp (%s)\n", path); return -1; } int stop = start + 1; @@ -94,7 +94,7 @@ static int add_script_interp(const char *path, const char *map, int size) stop++; } if (stop >= size || (stop-start) > PATH_MAX) { - ERROR("bad script interp (%s)", path); + ERROR("bad script interp (%s)\n", path); return -1; } char buf[PATH_MAX]; @@ -116,7 +116,7 @@ int add_path_and_deps(const char *path, int readonly, int error, int lib) if (path[0] == '/') { if (avl_find(&mounts, path)) return 0; - fd = open(path, O_RDONLY); + fd = open(path, O_RDONLY|O_CLOEXEC); if (fd == -1) return error; add_mount(path, readonly, error);