Den tis 2 jan. 2024 kl 14:20 skrev Joe Orton <jor...@redhat.com>:

> On Tue, Jan 02, 2024 at 02:00:00PM +0100, Daniel Sahlberg wrote:
> > My idea was to incrementally improve the code but maybe a better way
> > is to switch to access() completely. access() seems to be widely
> > available but I will have to read up on the setuid properties to make
> > sure we don't change how things has worked in the past.
> >
> > Background: Subversion has the ability to say a file "needs locking", if
> a
> > particular user/working copy doesn't hold the "lock" the file should be
> > read-only (and inversely if the user holds the lock the file should be
> > writeable). We check for W access using the code above and then update
> the
> > permissions accordingly.
>
> Makes sense. Yeah, I would recommend switching to using access(,W_OK) or
> access(,X_OK) on Unix, I'm not aware of any portability concerns with
> that.
>
> Regards, Joe
>
>
Thanks Joe! We ended up changing to access().

Kind regards,
Daniel

Reply via email to