13.07.2015 Views

An Operating Systems Vade Mecum

An Operating Systems Vade Mecum

An Operating Systems Vade Mecum

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Access methods 205directory is /a/b (directory 3). To successfully open d (file 5, through indirect file 6),the subject must have appropriate access rights for directory 3, file 6, directories 1, 2, and4, and finally file 5. We know how to interpret access rights for ordinary files (like 5)and directories (like 1, 2, 3, and 4). How do we interpret the access rights on indirect file6? We could ignore them completely and trust the other restrictions to create adequatesecurity. Or we might treat file 6 as an ordinary file. To open it for reading, we wouldrequire Read privilege on both indirect file 6 and file 5 (as well as Execute privilege ondirectories 1, 2, 3, and 4). To open file 6 for writing, we would require Write privilegeon both 6 and 5 (and Execute privilege on directories 1, 2, 3, and 4)This latter approach becomes awkward if we allow indirect files to point to directories,in which case we want to treat the permissions on the indirect file as directory permissions.For example, to open f/e (file 5 through indirect file 7) for writing, wewould require Execute privilege on indirect file 7 and directories 1, 2, 3, and 4 and Writeprivilege on file 5. Sometimes the privileges on indirect files are taken as ordinary-fileprivileges, and sometimes they are taken as directory privileges. Perhaps it is simpler,after all, to ignore them. BSD4.2 Unix takes this approach. It also understands theChangePrivileges call to apply not to the indirect file it is called on but rather to the filethat the indirect file refers to.3 ACCESS METHODSProcesses read and write files. Specifying which part of the file is to be read or writteninto depends on the access method for that file. The access method dictates both whichlocation in the file and how much data at that location are to be accessed. The accessmethod might be specified at the following times:When the operating system is designed. In this case, all files use the same accessmethod.When the file is created. In this case, every time the file is opened, the same accessmethod will be used.When the file is opened. Several processes can have the same file open and accessit differently.Let us look at some of the more popular access methods.3.1 Sequential accessMany applications require only sequential access, in which the entire file is read or writtenfrom the beginning to the end. Each operation implicitly advances a pointer that indicateswhere the next operation should take place. We call this pointer the read/writemark. Occasionally, separate read and write marks are kept for the same open file. (<strong>An</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!