Exercise 2: Access control lists

Introduction

For this exercise you have to extend the MINIX file system with access control lists. These allow you to specify access permissions on a per user (principal) basis, rather than the current owner-group-other protection method. ACLs generally provide better security because they allow finer grained access control. For example, consider the /etc/passwd file with the following ACL:
    ast: ---
    jim: r--
    kjb: rw-
    lvd: rw-
    *: r--
Note: there was a mistake in earlier versions of this exercise: our examples as displayed on these web-pages did not include a space between the colon and the rwx bits. As you can see above, this space IS required - implementations lacking this space will be rejected on the basis of 'layout errors'.

For the ACL permissions we use the normal MINIX file permissions, i.e. r for read, w for write, and x for execute. The ACL listed above specify that the user ast has no rights and has therefore no access to the file. The user jim can read it, while kjb and lvd have the ability to modify the file. Everybody else can only read the file. A special default permission is used when the user id doesn't match any in the list. This is depicted by the special user name ``*''.

The super user has the same special privileges for filesystem objects with an ACL as in the normal protection scheme. The privileges are an extension of the normal rules, and are summarized as follows:

Assignment and hints

Relevant information can be found in the OS book in sections: 5.6-7. Check at least the index for the following references:

Testing

The following are some suggested tests. Your code should pass these tests to get a grade at all.

With these four tests you can see if the file system denies or grants access to files and directories according to the specified ACLs.

These tests focus on the interaction between user program and file system.

An interoperability test, checks for hidden assumptions in the implementation.

It is probably not enough to use only your user program to test the exercise. You should probably also write separate testing tools to test your code.

Manual pages

acl(1)
manage access control lists for file system objects
acl(2)
get or set a file's access control lists

Bits and pieces

sys/acl.h
Header file with ACL definitions
extra/acl.c
Source file implements with the acl() system call stub.
fsck
New fsck that knows about ACLs