Test 4 - File Systems and Security

CS 438, Operating Systems Concepts


  1. Passwords can be used to implement authentication, but they also can be used to implement authorization. Explain how, and explain the principle difference between the ways passwords are used to implement authentication and authorization.


    Private-key encryption uses a secret key to encrypt and decrypt information. By assigning keys to services, it becomes possible to authorize an agent's access to a service by giving the service's key to the agent. The agent can then present the key to the service as proof that it is allowed to access the service.

    Most answers agreed that encryption could be used to implement authentication, but explanations of how it can be done were less common.


  2. You are implementing a file system that uses a FAT-style directory and contiguous allocation. Describe how you would optimize the FAT (if at all) to take advantage of contiguous allocation.


    The FAT can be optimized by essentially changing the data structure. Under non-contiguous disk-block allocation, the FAT is a cross between a bit map, keeping track of the free list, and a linked list keeping track of the sequence of blocks allocated to each file. With contiguous allocation, the linked list is out of a job, as only the first block and size (or last block) need to be kept for each file, and the FAT essentially turns into a bit map (the details are a bit more messy, but details weren't required).

    Most answers to this question were correct.


  3. Would you expect it to be easier to implement inserting writes in a file system with contiguous allocation or with block allocation? Explain your answer.


    Block allocation minimizes the data shifting to only the extra blocks needed to hold the new data, plus possibly the old blocks on either side of the new blocks. Contiguous allocation may require data shifting that ripples throughout the file.

    Most answers to this question were correct.


  4. Suppose you take a file system that implements file pointers and create a variant file system that doesn't have file pointers. What file-related system calls would have to change in your variant to adjust for the lack of file pointers? Explain how the system calls would change.


    The file pointer is the location within the file where reads and writes take place. Without a file pointer, reads and writes will have to indicate explicitly the locations within the file where I-O will take place, which is most easily done by adding a file-location parameter to read() and write(). Any lseek()-like system calls that manipulate the file pointer can be deleted,

    Most of the answers to this question were wrong, because they confused the concept of a file pointer with the type FILE * (which we never covered in class or in the text); the part about system calls in the question should have been the tip-off that the first version of file pointer was what was meant.



This page last modified on 15 December 2003.