[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [PATCH] issue #532 read-only admin area

From: Philip Martin <philip_at_codematters.co.uk>
Date: 2002-01-29 02:18:55 CET

Branko ÄŒibej <brane@xbc.nu> writes:

> Philip Martin wrote:
>
> > So what I don't understand is why
> >Win32 cannot simply do the right thing 'under the hood' of
> >apr_file_perms_set. This is documented to return APR_INCOMPLETE and
> >APR_ENOTIMPL if the platform cannot fully comply. It gets 3 sets of
> >read/write/execute flags, Win32 could ignore or extrapolate from those
> >as required. If it needs to set an ACL as well as a permission can
> >apr_file_perms_set not do that? What exactly is the Win32 readonly and
> >executable interface? Can someone with Win32 knowledge contribute?
> >Why is more than apr_file_perms_set required?
> >
> Because the semantics are different. On Win32, setting the read-only
> bit is a completely different operation than removing all write access
> bits from the file's ACL.

Stop thinking in terms of bits. All I want is "read-only" or
"no-write-permission" for the user. I don't care whether it sets bits
or tweaks an ACL.

I want to make a file readonly, I call apr_file_set_readonly(...), it
does some "magic" on Win32. Why can it not do that same stuff when I
call apr_file_perms_set(~APR_UWRITE)? Then I don't need two
interfaces to "read-only", and I can discard apr_file_set_readonly.

> For one thing, the FAT file system doesn't
> support ACLs, but does have a read-only bit.

But this is an argument for only one interface, isn't it? On FAT it
doesn't do ACL stuff, on NTFS it does. Again, it's not visisble
outside apr_file_perms_set and apr_file_perms_get (or apr_stat or
whatever its called).

>
> Besides, there are other attributes (hidden, archive, system) that
> don't even have a Unix equivalent (and setting them on Unix would be a
> no-op); OTOH, there's no such thing as an "executable" attribute on
> Win32.

So we add APR_HIDDEN to apr_file_perms_set and the Unix
implementation returns APR_ENOTIMPL or APR_EINCOMPLETE. No problem,
its still just apr_file_perms_set.

>
>
> Permissions and attributes really are different.

Well, can you propose an interface? I'm stuck, I can't see it, "it's
different" is not enough.

>
> (BTW, there are a lot of Unix filesystems that support ACLs, but APR
> doesn't know anything about them ...)

-- 
Philip
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Oct 21 14:37:00 2006

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.