Slashdot Mirror


FreeBSD Access Control Lists

BSD Forums writes "The Unix permissions model has worked for decades due to its flexible simplicity. It's not the only approach, though. FreeBSD 5.0 supports Access Control Lists, which allow for more flexible permissions. Daniel Harris explains what ACLs can make easier."

108 comments

  1. Now correct me if I'm wrong... by Ataru · · Score: 3, Interesting

    But Windows NT has had ACLs for some time now.
    A lot of people have derided the concept.
    But as far as I can see, they are a complete superset of the Un*x system.
    It's pretty hard to argue that it's not as good.
    Discuss.

    1. Re:Now correct me if I'm wrong... by nathanh · · Score: 5, Insightful
      But Windows NT has had ACLs for some time now. A lot of people have derided the concept. But as far as I can see, they are a complete superset of the Un*x system. It's pretty hard to argue that it's not as good.

      Other operating systems, including UNIX, have had ACLs before Windows NT even existed and the concept was derided then as well. This is not a "Un*x vs Windows" argument. Please don't turn it into one.

      The typical arguments against ACLs are:

      • ACLs add complexity to the filesystem code; making the filesystem slower, buggier, harder to write and more difficult to prove.
      • ACLs add an administrative overhead to the system. In a nutshell, ACLs can get messy very quickly. Very hard to debug certain problems.
      • ACLs can remove rights from accounts that actually need them. Typical problem is removing read-rights from the backup account.
      • ACLs require more complex userspace tools. This makes userspace tools bloated, potentially buggier and harder to use.

      The trick, as with all computing, is to weigh the benefits vs the costs. Sometimes you need ACLs and then it makes sense to introduce the extra complexity. Other times it makes no sense at all, so you dispense with them. For example, there's not much value in ACLs for an embedded UNIX with a single user (eg, a PDA). There's definitely a lot of value for ACLs with a multiuser UNIX or a UNIX fileserver. You need to decide when it makes sense to have ACLs and when to use UNIX ugo, not make blanket statements about one being better than the other.

    2. Re:Now correct me if I'm wrong... by Ataru · · Score: 1

      But it is only necessary to say,
      "So why can't everyone do whatever the hell they want to any file they come across?"
      Over to you.

    3. Re:Now correct me if I'm wrong... by Przepla · · Score: 4, Informative
      Typical problem is removing read-rights from the backup account.
      Well in FreeBSD that is not a problem, since operator account was designed to do backups. This user has a read-only right to any filesystem. You have to use root account to set no-dump flag however.
      --
      When in doubt, go to the library. - Ron Weasley in Harry Potter and the Chamber of Secrets
    4. Re:Now correct me if I'm wrong... by nathanh · · Score: 1

      You didn't understand anything I said.

    5. Re:Now correct me if I'm wrong... by scrytch · · Score: 3, Insightful

      > But Windows NT has had ACLs for some time now.

      True, and they have features that POSIX ACL's don't, such as more granular access rights and categories like OWNER/CREATOR.

      It also has this other charming feature: when you use the GUI, it sorts the ACL by name. And when you have global allow or deny privs on particular credentials, but specific other credentials that override them, they may work when you set them, then mysteriously not once you simply view them in the GUI, because the list has been reordered, and the first one wins. This sort of thing drives NT admins nuts. And there's no sign of it being fixed.

      --
      I've finally had it: until slashdot gets article moderation, I am not coming back.
    6. Re:Now correct me if I'm wrong... by evilviper · · Score: 1
      But Windows NT has had ACLs for some time now.

      And Windows permissions are the single biggest pain in the ass of any permission system ever created.

      Want to add a new user to this folder and all sub-folders? Well TOO DAMN BAD! You almost always need to add the user to every single sub-folder manually. Of course, there are situations where the permission will filter down, but they are rare, and in that case, you haven't been using ACL's benefits, so you might as well have been using unix permissions. By god, I really don't know how MCSEs manage (actually I do, and the answer is that they don't, hence 99.999% of all Windows systems being very insecure).
      --
      Slashdot gets worse every day... Pipedot: News for nerds, without the corporate slant
  2. Management cost vs. flexibility by Amit+J.+Patel · · Score: 4, Insightful

    Flexible systems solve more of the initial problem but tend to be harder to manage. (Pick your favorite example: Linux vs. Mac, C++ vs. Java, Civilization vs. Quake, ...) What I worried about back when I used ACLs was that roles can change over time. Yes, I have some directory that Bob should have access to. Two months from now, Alice joins Bob's group and takes over his duties, so she needs access. Can Bob grant that access? Now what happens when Bob transfers to a different group? Who's going to go around checking all files accessible by Bob to determine which of them were accessible by him because he's working on some particular project and which were accessible because he's a good buddy of mine? What if you forget to do this?

    Keep it simple. If not for yourself, for your children, and your children's children.

    -- Amit (overgeneralizing)
    1. Re:Management cost vs. flexibility by Paul+Jakma · · Score: 4, Interesting

      Well, the answer is to assign the permission to a group, not to Bob directly. But, drat, then you are back to using groups. :)

      The prime problem which ACLs solve or rather work-around, is that users:

      - have no way to specify their own collection of users (they have to ask the admin to create a group)

      AND

      - a user can not chgrp a file to any group of which they are not a member (security)

      ACLs provide normal users a means to assign permissions to files by arbitrary users, and (iirc) arbitrary groups. But they are, as you point out, a management nightmare - while being a feature very few people actually need.

      --
      I use Friend/Foe + mod-point modifiers as a karma/reputation system.
    2. Re:Management cost vs. flexibility by Ataru · · Score: 1

      Roles can change over time, that is true.
      Under Un*x as far as I can see you have this "group" attribute that means that if you are a member of any group authorised to fuck with the file, you can fuck with the file.
      I'm sorry, this might have worked back in the day, when everyone was a beardy hacker, but nowadays it is asking for a bum-raping.
      ACLs, being a superset of the almost nothingness of Group Permissions, do have the disadvantage of being slightly more complicated. But then, the simpler system is obviously inadequate. That is a word that looks mis-spelled even if it isn't. Anyway, argue with that, muthafucka. Bo selecter.

  3. Re:Why *BSD died by Ataru · · Score: 0, Offtopic

    Fact me 'til I fart.
    Bitch.

  4. Re:Why *BSD died by Anonymous Coward · · Score: 0

    Why in the hell would anybody still reply to a *BSD is dying troll?

  5. Re:Why *BSD died by Anonymous Coward · · Score: 0

    Why the hell would anyone touch your feces infested cock?

  6. Re:Why *BSD died by Anonymous Coward · · Score: 0

    Ooh, Anonymous Coward, you're so brave. I've always wanted to be like you.

  7. Re:How dead is BSD? by Anonymous Coward · · Score: 0

    Do you feel better now? Have you considered how sad your life is? Give some thought to what mistakes you've made to bring you to this point. I wish you the best.

  8. ACL's rock. by craig2787 · · Score: 4, Interesting

    I had a directory that I wanted 777 for all but user www. The solution was simple with ACL's; it eliminated the need for adding a new group for one measly dir.

    Go ACL's!

    1. Re:ACL's rock. by aminorex · · Score: 2, Funny

      You don't need ACLs in the OS for that.
      You need an ACL veneer over user/group
      permissions that dynamically allocates a
      new group as required in order to fulfill
      the constraints you specify.

      ACLs are one honking big bird to swallow
      in order to take care of the fly you
      swallowed earlier. I don't know why you
      swallowed the fly.

      --
      -I like my women like I like my tea: green-
    2. Re:ACL's rock. by craig2787 · · Score: 1

      I completely do not understand your post. I'm not even going to paste fragments to clarify, because I'd be pasting the whole thing. ACLs are cool beans, ok? Just leave it be, you'll be alright.

  9. printable version by Anonymous Coward · · Score: 0

    thanks for linking to the printable version, saves me a click!

  10. Default permissions by Col.+Klink+(retired) · · Score: 3, Interesting

    It's not like FreeBSD is the first to have ACLs. Solaris and Linux both support them as well.

    One thing I like under Solaris ACLs is you can set a "default" permission. I always have my default umask set to 027, but I do some collaborative work in some shared directories and it's nice to be able to force any files created in that directory to be writeable by the group. ACLs on Solaris completely ignore the umask.

    Under Linux, however, the ACLs work with the umask. I can set default permissions for a directory to be group read-only and files created by someone with a 007 umask will be set to read-only, but I can't do the opposite.

    I believe Linux is doing the POSIXly correct thing, but I don't find it very useful.

    --

    -- Don't Tase me, bro!

    1. Re:Default permissions by Anonymous Coward · · Score: 0

      I believe Linux is doing the POSIXly correct thing, but I don't find it very useful.

      Considering ACLs are built-into FreeBSD 5.X, and the Linux thing is a 'work in progress patch', it is not suprising the Linux ACL isn't useful.

    2. Re:Default permissions by Anonymous Coward · · Score: 0

      You got your umask set to 027? Do you know what that means? luser!

    3. Re:Default permissions by someonehasmyname · · Score: 2, Informative

      I use that umask also. It means that files he creates are automatically chmodded to 640 and directories are automatically chmodded to 750.

      "man umask" will tell you that you need to subtract the desired permissions from 777 to get the appropriate umask value.

      You use numbers and not "chmod a+rw", right?

      --
      Common sense is not so common.
    4. Re:Default permissions by Nothinman · · Score: 1

      Are you using ACLs on XFS or another filesystem? I believe the XFS ACL implementation does support a default ACL, atleast in 2.4. With all the integration in 2.6 I'm not sure if that option survived.

    5. Re:Default permissions by Col.+Klink+(retired) · · Score: 2, Informative
      I'm using ACLs under ext3. It supports "default" ACLs, just not the same way Solaris does. Actually, the Solaris 2.6 man page for setfacl says:
      If a file is created in a directory that contains default ACL entries, the newly created file will have permissions generated according to the intersection of umask(1), the default ACL entries, and the permissions requested at creation time.
      However, the setfacl man page under Solaris 9 say:
      The umask(1) will not be applied if the directory contains default ACL entries.
      Despite the fact the 2.6 and 9 have opposite descriptions of their behavior, both 2.6 and 9 behave as described in the Sol 9 man page. Linux behaves as the Sol 2.6 man page describes.
      --

      -- Don't Tase me, bro!

  11. Re:BSD problems by Anonymous Coward · · Score: 0

    I dunno, the trolls aren't as creative, but the OS is pretty solid.

  12. Re:BSD problems by Anonymous Coward · · Score: 0

    The drives probably running in PIO4, if you're too stupid to RTFM you probably should check the man pages, etc. Or switch to an equally crappy Linux distro such as Roothat.

    *BSD is for the enterprise, not some stupid Linux fuckhead that runs it on their desktop and complains about it being slow becasue its not configured properley.

  13. Oh suck my salty nuts.. by Anonymous Coward · · Score: 0

    I bet you owning a fucking mac as well.

    Bloody *BSD users - mindless zealots.

    1. Re:Oh suck my salty nuts.. by Anonymous Coward · · Score: 0

      Oh suck my salty nuts..

      Bathe more often.

      It will reduce your offensive BO.

  14. Slashdot ACLs ? by noselasd · · Score: 3, Funny

    Isn't it time Slashdot make use of ACL's to prevent the "*BSD is dying trolls" ?

    1. Re:Slashdot ACLs ? by Anonymous Coward · · Score: 0

      The Failure of *BSD
      "
      Of course we can all agree that BSD is a failure, but why did BSD fail Once you get past the fact that BSD is fragmented between a myriad of incompatible kernels, there is the historical record of failure and of failed operating systems. BSD experienced moderate success about 15 years ago in academic circles. Since then it has been in steady decline. We all know BSD keeps losing market share but why Is it the problematic personalities of many of the key players Or is it larger than their troubled personalities
      The record is clear on one thing no operating system has ever come back from the grave. Efforts to resuscitate BSD are one step away from spiritualists wishing to communicate with the dead. As the situation grows more desperate for the adherents of this doomed OS, the sorrow takes hold. An unremitting gloom hangs like a death shroud over a once hopeful BSD community. The hope is gone; a mournful nostalgia has settled in. Now is the end time for BSD.

  15. Netware ACLs were best ever by swb · · Score: 3, Informative

    Netware ACLs were the best and simplest to work with. I still miss them. For those with no Netware experience, directories had the following attributes:

    Read, Write, Create, Erase, Modify, File scan (see directory contents), Access control (ability to change attributes for these properties for yourself or others), and Supervisory which enabled turning any of these bits on or off regardless of their status.

    IIRC, RF was the default permission. Subdirectories always inhereited the permissions of their parents, although the above permissions could be selectively blocked from inheritance.

    My favorite feature (which if 2K had would make life lots easier), was directory traversal rights were automatic. If I as a user have RWCEMF rights to directory BAR located in directory tree /usr/local/foobar/foo/bar but am explicitely excluded from rights to foobar/ and foo/, I can still get to my directory and only see just the directories I need to navigate the file system.

    Systems without traversal rights like this require some pretty convoluted logic to make them work, like home folders in Win2k. You need to make HOME readable to everyone so it can be mounted and people can find their home directories, but each user home directory needs inheritance blocked and specific user rights assigned. In Netware rights, you just grant the user rights to their directory, admin rights to HOME, and inheritance and directory traversal make it work.

    I hope BSDs ACLs include automatic minimal traversal rights and inheritance.

    1. Re:Netware ACLs were best ever by __past__ · · Score: 2, Interesting

      As far as I can see, the ACLs in FreeBSD/UFS2 (following the POSIX.1e proposal) just know the traditional read-write-execute/search permissions, only with more fine-grained possibilities to assign these rights to users and groups. However, the FreeBSD implementation seems to be flexible enough to support additional flags - in fact, the acl(3) manpage explicitly mentions nonportable functions for Netware style ACLs (and some others, like NTFS). I have no idea how to actually use that, however.

    2. Re:Netware ACLs were best ever by swb · · Score: 1

      More fine-grained rights are nice, but they're probably not necessary, since you can pretty easily roll Netware's WCEM into unix W.

      What really makes the magic IMHO is inheritance and dynamic traversal rights (on-demand X right). You can make a sensible rights policy with RWX, but without traversal you end up doing some crazy stuff to make it work.

  16. Old news... by BrokenHalo · · Score: 2, Informative

    I have no idea about Windows NT, but "real" operating systems of yore such as Honeywell's ancient GCOS (usually referred to as God's Chosen Operating System) back in the late 70s and early 80s, PRIME's PRIMOS (1980s) and Data General's AOS/VS (1980s) and AOS/VS2 (early 1990s) all had effective implementations of ACLs. Nothing new here.

  17. Unix needs ACL's by big-magic · · Score: 4, Insightful

    Let's face it. We've all known that the classical Unix security model (uid/gid) was not fine-grained enough for modern usage. But the problem has always been that the alternatives were complicated. That is the standard argument against ACL's. The reality is that this is a messy problem that doesn't have any elegant solutions. If there was a simple solution, someone would have found it by now. So, the best thing to do is to implement the current solution (ACL's) and make it work as smoothly as possible.

    I'm definitely not a Microsoft fan. But one quality of Microsoft that I admire is that they are not afraid to move forward in situations where there are no clean solutions. By contrast, the Unix community often gets bogged down in such situation and is unable to make progress for long periods of time. I realize this is somewhat unfair, since Microsoft developers get paid to do this grunt work. But if Linux/*BSD wants to compete directly with Microsft (as many advocates claim), it must do the same.

    1. Re:Unix needs ACL's by Anonymous Coward · · Score: 1, Insightful

      I'm definitely not a Microsoft fan.

      And you don't need to be one to know that ACL's have a VMS history long before Microsoft added them.

    2. Re:Unix needs ACL's by big-magic · · Score: 1

      I wasn't implying that Microsoft created the idea. ACL's are not the only situation where Micrsoft has forged ahead when there is no simple solution (while the Unix developers are left behind arguing about the "right" solution). As a matter of fact, there is probably lot of things the Unix community could learn by taking a second look at the details of VMS, OS/360, and other "old" technology. In particular, I've always thought we had a lot more to learn from the mainframe world.

    3. Re:Unix needs ACL's by guacamole · · Score: 1

      _UNIX_ has had ACLs for a decade now (Solaris, HPUX, AIX, IRIX, etc). It's only the open source unix offshots like Linux or *BSD are getting them too only now.

    4. Re:Unix needs ACL's by I_am_the_man · · Score: 1

      "ACL's are not the only situation where Micrsoft has forged ahead..."

      If you consider what MS has for their ACL's as "forged ahead" then you are mistaken. There is nothing intuative or easy about Microsoft's maze of file permissions and layers of confusion.

  18. Re:Why *BSD died by Anonymous Coward · · Score: 0

    Hoping to effect change?

    (If this was a VA Reseach/VA Linux/whatever they are now is dead post, the adminstration on /. would stop it)

  19. Sad by Quill_28 · · Score: 1

    Good Lord, there are more -1 posts on this article, than 0-5 posts.

    So many losers so few BSD's articles.

    1. Re:Sad by The+Munger · · Score: 0, Troll

      You'd be a sore loser too if your operating system was dying ;-)

      --
      Refuse to make a statement in your sig!
  20. Keys to Powerful Living by Anonymous Coward · · Score: 0
    Then Jesus told them, "I assure you, if you have faith and don't doubt, you can do things like this and much more. You can even say to this mountain, 'May God lift you up and throw you into the sea,' and it will happen. If you believe, you will receive whatever you ask for in prayer" (Matthew 21:21).
  21. ACL's . .Good and Bad by nurb432 · · Score: 3, Interesting

    95% of the time they just increase overhead for the admins, but for that 5% that you really NEED them for, they are a godsend...

    --
    ---- Booth was a patriot ----
    1. Re:ACL's . .Good and Bad by Anonymous Coward · · Score: 0
      I really don't want to start a holy war here, but what is the deal with you BSD fanatics? I've been sitting here at my freelance gig in front of a BSD box (a PIII 800 w/512 Megs of RAM) for about 20 minutes now while it attempts to copy a 17 Meg file from one folder on the hard drive to another folder. 20 minutes. At home, on my Pentium Pro 200 running NT 4, which by all standards should be a lot slower than this BSD box, the same operation would take about 2 minutes. If that.

      In addition, during this file transfer, Netscape will not work. And everything else has ground to a halt. Even Emacs Lite is straining to keep up as I type this.

      I won't bore you with the laundry list of other problems that I've encountered while working on various BSD machines, but suffice it to say there have been many, not the least of which is I've never seen a BSD box that has run faster than its Windows counterpart, despite the BSD machine's faster chip architecture. My 486/66 with 8 megs of ram runs faster than this 800 mhz machine at times. From a productivity standpoint, I don't get how people can claim that BSD is a "superior" machine.

      BSD addicts, flame me if you'd like, but I'd rather hear some intelligent reasons why anyone would choose to use a BSD over other faster, cheaper, more stable systems.

    2. Re:ACL's . .Good and Bad by I_am_the_man · · Score: 1

      Can you say Troll?

  22. OT: moderation correction by nutznboltz · · Score: 1

    oops, I mouse-o'ed while moderating. This post exists only to cancel that moderation.

  23. Access control lists no, mandatory security yes by Anonymous Coward · · Score: 0
    Access control lists are a primitive in search of a security policy. You don't want users, or even sysadmins, manipulating them directly. You want some defined security policy that they enforce, with tools that insure that all the access control lists are consistent with the security policy.

    Mandatory security is the way to go. NSA Secure Linux and LOMAC are the best known steps in that direction. LOMAC, from Network Associates, was a big step in the right direction. NA did that for Linux, made it open source, but stopped development a while back, possibly because Microsoft got nervous about improved Linux security. (Microsoft is known to have lobbied heavily against NSA Secure Linux.)

    The problem with mandatory security is that it really works. You then have to go and fix all the tools that cross security boundaries and shouldn't.

    The key project here would be to take NSA Secure Linux or LOMAC and make a mail server, a DNS server, and Apache work within the restrictions. That would be very, very useful.

  24. *BSD is dying by Anonymous Coward · · Score: 0
    Fact: *BSD is dying

    It is common knowledge that *BSD is dying, that ever hapless *BSD is mired in an irrecoverable and mortifying tangle of fatal trouble. It is perhaps anybody's guess as to which *BSD is the worst off of an admittedly suffering *BSD community. The numbers continue to decline for *BSD but FreeBSD may be hurting the most. Look at the numbers. The loss of user base for FreeBSD continues in a head spinning downward spiral.

    OpenBSD leader Theo states that there are 7000 users of OpenBSD. How many users of BSD are there? Let's see. The number of OpenBSD versus NetBSD posts on Usenet is roughly in ratio of 5 to 1. Therefore there are about 7000/5 = 1400 NetBSD users. BSD/OS posts on Usenet are about half of the volume of NetBSD posts. Therefore there are about 700 users of BSD/OS. A recent article put FreeBSD at about 80 percent of the *BSD market. Therefore there are (7000+1400+700)*4 = 36400 FreeBSD users. This is consistent with the number of FreeBSD Usenet posts.

    Due to the troubles of Walnut Creek, abysmal sales and so on, FreeBSD went out of business and was taken over by BSDI who sell another troubled OS. Now BSDI is also dead, its corpse turned over to yet another charnel house.

    All major marketing surveys show that *BSD has steadily declined in market share. *BSD is extremely sick and its long term survival prospects are very dim. If *BSD is to survive at all it will only be among hobbyist dilettante dabblers. In truth, for all practical purposes *BSD is already dead. It is a dead man walking.

    Fact: *BSD is dying

  25. Reducing redundancy when explaining ACLs by SlashCrunchPop · · Score: 1

    I was using ACLs long before I began using FreeBSD and I've reduced my explanation of ACLs to the uninitiated to the following dialogue:

    Mike: "My mama didn't raise no fool!"
    Bob: "So who raised you, then?"

    Show me a shorter explanation of ACLs and I will post a troll about Linux. Oh, wait, this was it.

  26. Fact: FreeBSD is dying by Anonymous Coward · · Score: 0
    Heads up! Repeat:
    Fact: FreeBSD is dying
  27. B - S - D - E - A - D by Anonymous Coward · · Score: 0

    Subject says it all.