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

Reply via email to