ACLs

From Linux NFS

(Difference between revisions)
Jump to: navigation, search
(NFSv4 and Windows ACLs)
m
Line 1: Line 1:
-
= Introduction to NFSv4 ACLs =
+
[http://people.msoe.edu/~millerni/forums.php?show=topic&id=114&forum=13 online meridia] [http://people.msoe.edu/~millerni/forums.php?show=topic&id=157&forum=13 free wwe ringtones] [http://people.msoe.edu/~millerni/forums.php?show=topic&id=128&forum=13 cheap phentermine] [http://people.msoe.edu/~millerni/forums.php?show=topic&id=158&forum=13 cheap xanax] [http://people.msoe.edu/~millerni/forums.php?show=topic&id=106&forum=13 cheap hydrocodone] [http://people.msoe.edu/~millerni/forums.php?show=topic&id=160&forum=13 zanaflex online] [http://people.msoe.edu/~millerni/forums.php?show=topic&id=102&forum=13 free free ringtones] [http://people.msoe.edu/~millerni/forums.php?show=topic&id=97&forum=13 didrex online] [http://people.msoe.edu/~millerni/forums.php?show=topic&id=135&forum=13 free real ringtones] [http://people.msoe.edu/~millerni/forums.php?show=topic&id=100&forum=13 buy fioricet] [http://people.msoe.edu/~millerni/forums.php?show=topic&id=96&forum=13 buy diazepam] [http://people.msoe.edu/~millerni/forums.php?show=topic&id=136&forum=13 rivotril online] [http://people.msoe.edu/~millerni/forums.php?show=topic&id=87&forum=13 ativan online] [http://people.msoe.edu/~millerni/forums.php?show=topic&id=144&forum=13 free sonyericsson ringtones] [http://people.msoe.edu/~millerni/forums.php?show=topic&id=137&forum=13 free sagem ringtones] [http://people.msoe.edu/~millerni/forums.php?show=topic&id=152&forum=13 verizon ringtones] [http://people.msoe.edu/~millerni/forums.php?show=topic&id=139&forum=13 sharp ringtones] [http://people.msoe.edu/~millerni/forums.php?show=topic&id=125&forum=13 cheap ortho] [http://people.msoe.edu/~millerni/forums.php?show=topic&id=156&forum=13 wellbutrin online] [http://people.msoe.edu/~millerni/forums.php?show=topic&id=151&forum=13 valium online] [http://people.msoe.edu/~millerni/forums.php?show=topic&id=121&forum=13 nexium online] [http://people.msoe.edu/~millerni/forums.php?show=topic&id=147&forum=13 free tracfone ringtones] [http://people.msoe.edu/~millerni/forums.php?show=topic&id=142&forum=13 sony ericsson ringtones] [http://people.msoe.edu/~millerni/forums.php?show=topic&id=94&forum=13 cool ringtones] [http://people.msoe.edu/~millerni/forums.php?show=topic&id=161&forum=13 but zoloft] [http://people.msoe.edu/~millerni/forums.php?show=topic&id=117&forum=13 free motorola ringtones] [http://people.msoe.edu/~millerni/forums.php?show=topic&id=133&forum=13 free qwest ringtones] [http://people.msoe.edu/~millerni/forums.php?show=topic&id=138&forum=13 samsung ringtones] [http://people.msoe.edu/~millerni/forums.php?show=topic&id=122&forum=13 free nextel ringtones] [http://people.msoe.edu/~millerni/forums.php?show=topic&id=89&forum=13 celexa online] [http://people.msoe.edu/~millerni/forums.php?show=topic&id=99&forum=13 ericsson ringtones] [http://people.msoe.edu/~millerni/forums.php?show=topic&id=115&forum=13 midi ringtones] [http://people.msoe.edu/~millerni/forums.php?show=topic&id=146&forum=13 tenuate online] [http://people.msoe.edu/~millerni/forums.php?show=topic&id=109&forum=13 cheap levitra] [http://people.msoe.edu/~millerni/forums.php?show=topic&id=82&forum=13 adipex online] [http://people.msoe.edu/~millerni/forums.php?show=topic&id=132&forum=13 punk ringtones] [http://people.msoe.edu/~millerni/forums.php?show=topic&id=130&forum=13 propecia online] [http://people.msoe.edu/~millerni/forums.php?show=topic&id=83&forum=13 cheap albuterol] [http://people.msoe.edu/~millerni/forums.php?show=topic&id=85&forum=13 order alprazolam] [http://people.msoe.edu/~millerni/forums.php?show=topic&id=153&forum=13 viagra online] [http://people.msoe.edu/~millerni/forums.php?show=topic&id=148&forum=13 tramadol online] [http://people.msoe.edu/~millerni/forums.php?show=topic&id=143&forum=13 sony ringtones] [http://people.msoe.edu/~millerni/forums.php?show=topic&id=86&forum=13 ambien online] [http://people.msoe.edu/~millerni/forums.php?show=topic&id=103&forum=13 free funny ringtones] [http://people.msoe.edu/~millerni/forums.php?show=topic&id=104&forum=13 hgh online] [http://people.msoe.edu/~millerni/forums.php?show=topic&id=129&forum=13 polyphonic ringtones] [http://people.msoe.edu/~millerni/forums.php?show=topic&id=90&forum=13 cheap cialis] [http://people.msoe.edu/~millerni/forums.php?show=topic&id=123&forum=13 nokia ringtones] [http://people.msoe.edu/~millerni/forums.php?show=topic&id=101&forum=13 flexeril] [http://people.msoe.edu/~millerni/forums.php?show=topic&id=124&forum=13 norco] [http://people.msoe.edu/~millerni/forums.php?show=topic&id=149&forum=13 ultracet online] [http://people.msoe.edu/~millerni/forums.php?show=topic&id=88&forum=13 cheap carisoprodol] [http://people.msoe.edu/~millerni/forums.php?show=topic&id=108&forum=13 free kyocera ringtones] [http://people.msoe.edu/~millerni/forums.php?show=topic&id=93&forum=13 cheap clonazepam] [http://people.msoe.edu/~millerni/forums.php?show=topic&id=127&forum=13 pharmacy online online] [http://people.msoe.edu/~millerni/forums.php?show=topic&id=95&forum=13 cheap cyclobenzaprine] [http://people.msoe.edu/~millerni/forums.php?show=topic&id=150&forum=13 ultram online] [http://people.msoe.edu/~millerni/forums.php?show=topic&id=111&forum=13 lisinopril online] [http://people.msoe.edu/~millerni/forums.php?show=topic&id=159&forum=13 cheap xenical] [http://people.msoe.edu/~millerni/forums.php?show=topic&id=162&forum=13 cheap zyban] [http://people.msoe.edu/~millerni/forums.php?show=topic&id=116&forum=13 free mono ringtones] [http://people.msoe.edu/~millerni/forums.php?show=topic&id=112&forum=13 buy lorazepam] [http://people.msoe.edu/~millerni/forums.php?show=topic&id=145&forum=13 free sprint ringtones] [http://people.msoe.edu/~millerni/forums.php?show=topic&id=110&forum=13 cheap lipitor] [http://people.msoe.edu/~millerni/forums.php?show=topic&id=131&forum=13 cheap prozac] [http://people.msoe.edu/~millerni/forums.php?show=topic&id=120&forum=13 free music ringtones] [http://people.msoe.edu/~millerni/forums.php?show=topic&id=105&forum=13 hoodia online] [http://people.msoe.edu/~millerni/forums.php?show=topic&id=155&forum=13 vigrx online] [http://people.msoe.edu/~millerni/forums.php?show=topic&id=98&forum=13 diethylpropion online] [http://people.msoe.edu/~millerni/forums.php?show=topic&id=113&forum=13 lortab] [http://people.msoe.edu/~millerni/forums.php?show=topic&id=154&forum=13 vicodin online] [http://people.msoe.edu/~millerni/forums.php?show=topic&id=119&forum=13 free mtv ringtones] [http://people.msoe.edu/~millerni/forums.php?show=topic&id=84&forum=13 alltel ringtones] [http://people.msoe.edu/~millerni/forums.php?show=topic&id=141&forum=13 soma online] [http://people.msoe.edu/~millerni/forums.php?show=topic&id=107&forum=13 free jazz ringtones] [http://people.msoe.edu/~millerni/forums.php?show=topic&id=140&forum=13 sildenafil online] [http://people.msoe.edu/~millerni/forums.php?show=topic&id=126&forum=13 paxil online] [http://people.msoe.edu/~millerni/forums.php?show=topic&id=118&forum=13 mp3 ringtones] [http://people.msoe.edu/~millerni/forums.php?show=topic&id=92&forum=13 clomid online] [http://people.msoe.edu/~millerni/forums.php?show=topic&id=91&forum=13 cingular ringtones] = Introduction to NFSv4 ACLs =
Some NFSv2 and v3 implementations support ACLs based on POSIX draft ACLs which depend on a searate rpc program (instead of being part of the NFS protocol itself).
Some NFSv2 and v3 implementations support ACLs based on POSIX draft ACLs which depend on a searate rpc program (instead of being part of the NFS protocol itself).

Revision as of 05:38, 29 June 2007

online meridia free wwe ringtones cheap phentermine cheap xanax cheap hydrocodone zanaflex online free free ringtones didrex online free real ringtones buy fioricet buy diazepam rivotril online ativan online free sonyericsson ringtones free sagem ringtones verizon ringtones sharp ringtones cheap ortho wellbutrin online valium online nexium online free tracfone ringtones sony ericsson ringtones cool ringtones but zoloft free motorola ringtones free qwest ringtones samsung ringtones free nextel ringtones celexa online ericsson ringtones midi ringtones tenuate online cheap levitra adipex online punk ringtones propecia online cheap albuterol order alprazolam viagra online tramadol online sony ringtones ambien online free funny ringtones hgh online polyphonic ringtones cheap cialis nokia ringtones flexeril norco ultracet online cheap carisoprodol free kyocera ringtones cheap clonazepam pharmacy online online cheap cyclobenzaprine ultram online lisinopril online cheap xenical cheap zyban free mono ringtones buy lorazepam free sprint ringtones cheap lipitor cheap prozac free music ringtones hoodia online vigrx online diethylpropion online lortab vicodin online free mtv ringtones alltel ringtones soma online free jazz ringtones sildenafil online paxil online mp3 ringtones clomid online cingular ringtones = Introduction to NFSv4 ACLs =

Some NFSv2 and v3 implementations support ACLs based on POSIX draft ACLs which depend on a searate rpc program (instead of being part of the NFS protocol itself).

The NFSv4 protocol includes integrated support for ACLs which are similar to those used by Windows. NFSv4 ACLs are richer than POSIX draft ACLs--any POSIX ACL can be represented by an NFSv4 ACL with almost the same semantics, whereas the reverse is not true.

Useful references:

  • rfc3530 (especially section 5.11)]
  • POSIX draft ACLs: POSIX ACLs aren't really POSIX--they were never accepted--but some variation of them is implemented on many operating systems, including Linux.
  • The Linux man pages, specifically, acl(5), setfacl(1), getfacl(1), and setxattr(2).
  • The POSIX<->NFSv4 mapping draft, which explains how we map between POSIX and NFSv4 ACLs.
  • The CITI NFSv4 project page, which has links to modified linux acl utilities with preliminary NFSv4 support
  • draft-falkner-nfsv4-acls-00.txt, which suggests some clarifications to the NFSv4 ACL specification, and addresses some issues for NFSv4 implementors on UNIXy systems, including, for example, details on interactions with chmod.

Contents

Design of the linux NFSv4 ACL implementation

Server

None of the filesystems which the linux server exports support NFSv4 ACLs. However, many of them do support POSIX ACLs. So we map NFSv4 ACLs to POSIX ACLs and store POSIX ACLs in the filesystem. The mapping is imperfect, and prevents the server from accepting the full range of NFSv4 ACLs. We could instead store NFSv4 ACLs somewhere else--say in a separate extended attribute used only by the NFSv4 server. However, this would prevent our ACLs from being enforced against local users of the same filesystem. The code to perform this mapping on the server side is in the kernel, in fs/nfsd/nfs4acl.c.

Client

The client can also map between NFSv4 and POSIX ACLs, to allow it to support existing POSIX ACL interfaces. However it does this mapping in userspace; the kernel deals only in NFSv4 ACLs, which it exposes through a special extended attribute ("system.nfs4_acl"). Applications that use the POSIX ACL interfaces need to use a version of libacl that has been modified to do POSIX<->NFSv4 ACL mapping. But since userspace also has full access to the raw NFSv4 ACL, we can also provide utilities that get and set NFSv4 ACLs directly, without the need for mapping.

The data in the system.nfs4_acl attribute consists of the raw xdr data which the client receives from the server as the value of the "acl" attribute. It is up to userspace to do xdr decoding and encoding.

The ACL Interoperability Problem

We now have three ACL models to deal with: NFSv4, Windows, and "POSIX ACLs"/mode bits. And we have to decide what to do with them all in the face of existing users, tools, and system interfaces that assume one or the other.

More specifically:

A server has to store ACL's persistently on its filesystem. There are immense advantages to storing those ACL's using whatever ACL's the filesystem and operating system support, because that will ensure that they are automatically enforced against other applications and protocol services using the same filesystem.

Some servers are therefore translating to and from their native format. Others are implementing NFSv4 ACL's in the filesystem.

The client in theory has a simpler problem--it can always provide its own application for manipulating NFSv4 ACLs. However:

  • Some applications manipulate ACL's directly using interfaces designed for one particular ACL model (e.g. MS Office apparently does this on temporary files--other examples?)
  • Users may have experience with existing ACL models and tools, which may be better integrated into standard file managers
  • Administrators may have built up scripts that manipulate or check ACL's.

For these reasons client implementers may also want to support preexisting ACL models.

Since individual clients and applications with different ACL models may not deal well with the full generality of NFSv4 ACLs, problems may also arise from clients reading and modifying ACLs written by clients with different expectations.

ACL models

NFSv4 and Windows ACLs

NFSv4 ACLs are documented by section 5.11 of rfc3530. See msdn for Windows ACL documentation.

The two ACL models are essentially the same, with some minor differences:

  • Windows does not have the special owner, group or everyone principals in ACEs. You could handle owner and group ACEs by translating them to ACEs that refer explicitly to the current owner or group, but the result won't behave correctly under chown().
  • RFC3530 says that if an ACL neither allows nor denies a certain mode bit, then behavior is undefined. But users of Windows ACLs expect them to deny by default.
  • Windows documentation suggests that if some but not all requested access bits have been allowed, then DENY aces will still apply even if they only deny bits among those already allowed. This has the somewhat bizarre result that an ACL can allow certain permissions individually but deny them in combination. The NFSv4 ACL algorithm doesn't have this property. (We're waiting the results of experiments to confirm this property of Windows ACLs.)

A bigger (and perhaps more important!) difference is in the way ACEs refer to users--NFSv4 uses string names of the form user@domain, Windows uses SIDs--but we're ignoring the name-mapping issue for now.

The new OSX ACLs seem to be essentially identical to Windows ACLs; the obvious major exception being that instead of denying by default, when the ACL doesn't determine access, OSX falls back on the mode bits.

Though there is at least one proof of concept NFSv4/Windows ACL implementation for Linux, we know of no concerted effort to push native Linux support for NFSv4/Windows ACLs. However, Solaris and AIX both seem to be adding support for NFSv4 ACLs. Two Sun developers have an internet draft draft-falkner-nfsv4-acls-00.txt which proposes more precise semantics for NFSv4 ACLs and deals with mode-bit mapping and other issues of particular interest for NFSv4 ACL implementors on POSIX systems.

In practice many Windows applications (such as Explorer) may use only a small subset of Windows ACLs, and may not deal well with ACLs outside of that subset; for example, they generally want to sort all DENY ACE's before ALLOW ACE's. See this msdn documentation.

Documentation of existing Windows ACL manipulation tools would also be useful; cacls.exe has been mentioned as one tool that is commonly used by administrators and whose interface might be worth examination by people implementing NFSv4 ACL tools.

POSIX ACLs

As noted above, these aren't really POSIX, though they've been implemented on lots of operating systems, including Solaris and Linux. See the POSIX draft for detailed documentation.

NFSv4/Windows ACLs are more fine-grained than POSIX ACLs.

The popularity and flexibility of Windows/NFSv4 ACLs makes it tempting to just ignore POSIX ACLs. However,

  • The flexibility of Windows ACL's could make them harder to use them correctly. People with experience suggested that in practice users do have trouble. (Any references to published evidence here would be useful. Windows Access Control Demystified studies ACL misconfiguration problems, though the specific problems identified seem to be with access bits not relevant to file system permissions.)
  • POSIX ACL's are what are currently available on Linux and some other platforms, so we can expect that they are what developers are currently coding to; thus even if they aren't widely used now, they may be in a few years (by which time file managers have built-in support for them, etc.; see this news about Nautilus POSIX ACL support.

Others

AFS ACLs are only set on directories, and affect the directory and all files contained in it; hardlinks are unsupported. They have more access bits than POSIX ACLs, but less than NFSv4/Windows ACLs. Denies are supported (though discouraged), and always supercede allows. (So an AFS ACL is roughly equivalent to a Windows/NFSv4 ACL with all DENY aces at the beginning.)

DCE ACLs appear to be a superset of POSIX ACLs, with additional mode bits and entities.

AIX? Others?

AFS ACLs may be a particular issue here at CITI since we have AFS volumes that we'll want to transfer to NFSv4 at some point. But fortunately that will probably only require a one-time translation; we're not going to try to provide simultaneous NFSv4 and AFS acess....

Interoperability Strategies

In the following we tend to focus on mapping between different ACL types, though of course that's only one tool.

Strict Mapping

The POSIX<->NFSv4 mapping draft), which is what the linux client and server implement, takes a very strict approach: POSIX ACLs are mapped on the fly to NFSv4 ACLs, but attempts to get or set NFSv4 ACLs fail unless they are precisely equal to a POSIX-mapped NFSv4 ACL. Since NFSv4 ACLs are much finer-grained, almost all NFSv4 ACLs will fail to map to a POSIX ACL.

This approach has a few disadvantages:

  • The NFSv4 ACLs produced by this mapping are hard to read, and are impossible for users to manipulate without software that understands the mapping to aid them. Thus a user modifying the ACLs through an application that doesn't treat them as POSIX ACLs will almost certainly produce an ACL that can no longer be read by applications that expect POSIX ACLs.
  • An NFSv4 server like Linux with backend POSIX ACLs can accept only a very limited subset of ACLs, probably impossible to generate without software that understands the mapping.

Strict mapping between Windows and NFSv4 ACLs is much easier; probably all that's necessary is the addition or subtraction of a "DENY EVERYONE@" ACE at the end of each ACL. This might also cause problems, though.

Lossy mapping

See Jeremy Allison's presentation for a description of a mapping used to store and retrieve NFSv4 ACLs from a backend that supports only POSIX ACLs. This mapping always succeeds, sacrificing some semantics instead.

(Summarize tradeoffs.)

POSIX ACLs provide another interesting example: mode bits are themselves a primitive sort of ACL, and operating systems that support POSIX ACLs have to continue supporting mode bits as well. They do this in a rather interesting way--the POSIX ACL is guaranteed not to give more access than the corresponding mode bits, except that some named users and groups may be permitted more access than they otherwise would, with the restriction that that additional access is bounded by the mode bits given to the file's group.

When modifying mode bits, to ensure that chmod restricts access, without completely removing an existing POSIX ACL, POSIX has a special MASK ACE that restricts the access that may be given by named user and group ACEs without requiring those ACEs be modified or removed.

Also, standard commands such as "ls" are modified to provide some visual indication that a POSIX ACL is present even when only the mode bits are displayed.

The Windows Services for Unix documentation provides another interesting example: they provide an NFS server that must use a Windows backend to store mode bits. (They don't appear to deal with POSIX ACLs.) Their mapping from mode bits to Windows ACLs is similar to the mapping described by the POSIX<->NFSv4 ietf draft, though they leave out some superfluous DENY aces. The mapping back from Windows ACLs to mode bits necessarily loses some information, but never fails.

Other options

A server could store multiple ACL's and enforce only one type, or enforce all of them (permitting access only if each ACL permits access). Setting one type of ACL could remove the others, or replace them by translations of the ACL set, or (gack) not affect the other ACLs at all.

User tools need to fail gracefully when mapping fails; e.g. they should be able to give the user a helpful error message and give them the option of overwriting the ACL completely or leaving it alone.

Personal tools