Re: [PATCH v2] shell: allow overriding built-in commands

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

 



On Sun, Mar 23, 2025 at 8:05 AM Ayman Bagabas <ayman.bagabas@xxxxxxxxx> wrote:
> Shouldn't we also check [access()] for both F_OK?

Any success for R_OK, W_OK, or X_OK implies F_OK.

I'm not a fan of access() calls in general for multiple reasons
(they get suggested for security tests in setuid programs, but
you race from "access seems OK" to "actually try to access"
against anyone who modifies the name-to-underlying-entity
binding, so in general the "right" test is "do the operation
with the appropriate permissions in place, then see if it
actually worked", which is atomic). But in this particular case
it's probably not that important (we seem to make a lot of
assumptions about security, or perhaps lack of its importance,
in git-shell).

Chris





[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux