Package: dash
Version: 0.5.7-1
Severity: serious
Hi!
dash relies, for it's test builtin that faccessat returns useable
values for X_OK when called from the root user. Unfortunately that's not
true on kfreebsd (and seemingly not required by POSIX, see
#640325). Could you please just use the alternate code path on kfreebsd
which appears to work as wanted.
Thanks
Christoph
--- Begin Message ---
Hi!
Petr Salinger <petr.salin...@seznam.cz> writes:
> severity 640325 wishlist
> --
>
>> The following code (extracted from dash's test builtin) is behaving
>> differently between linux and kfreebsd, having a 644 `test' file and
>> running it on linux as root user prints -1 while on kfreebsd it prints
>> 0.
>>
>> -------------------------------------------------------
>> #include <fcntl.h>
>> #include <unistd.h>
>> #include <stdio.h>
>>
>> int main () {
>> printf("%d\n", faccessat(AT_FDCWD, "test", X_OK, AT_EACCESS));
>> }
>> -------------------------------------------------------
>
> While the behaviour is strange, it is still POSIX conforming:
>
> http://pubs.opengroup.org/onlinepubs/9699919799/functions/access.html
>
> If any access permissions are checked, each shall be checked
> individually, as described in XBD File Access Permissions, except that
> where that description refers to execute permission for a process with
> appropriate privileges, an implementation may indicate success for
> X_OK even if execute permission is not granted to any user.
>
> We already wrap access syscall to more intuitive behaviour,
> we should try to do the same also for faccessat.
So relying on this is actually a bug in dash? (and there's probably no
easy way to check how faccessat is behaving right?)
Thanks for your information!
Christoph
--
9FED 5C6C E206 B70A 5857 70CA 9655 22B9 D49A E731
Debian Developer | Lisp Hacker | CaCert Assurer
--- End Message ---
--
9FED 5C6C E206 B70A 5857 70CA 9655 22B9 D49A E731
Debian Developer | Lisp Hacker | CaCert Assurer