On 8/22/21 1:43 PM, Ammar Faizi wrote: > On Sun, Aug 22, 2021 at 7:08 PM Pavel Begunkov <asml.silence@xxxxxxxxx> wrote: >> - if (chroot(tmpdir)) { >> + r = chroot(tmpdir); >> + if (r) { >> + if (r == -EPERM) { >> + fprintf(stderr, "chroot not allowed, skip\n"); >> + return 0; >> + } > > Hey, it's the userspace API. > > chroot, on success, zero is returned. On error, -1 is returned, and errno is > set appropriately. That was extremely silly indeed, thanks Ammar. Curiously, it didn't fail because EPERM == 1 > Did you mean if (errno == EPERM)? > Should #include <errno.h> as well. > Sorry for the duplicate, forgot to switch to plain text. > --- > Ammar Faizi > -- Pavel Begunkov