Re: [PATCH liburing] tests; skip non-root sendmsg_fs_cve

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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



[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux