This is ~miro/src/bin/fs2iff. It contains the source for fs2iff(1), a program
that probes a unix file system subtree, and generates an IFF file for that
subtree such that the semantic relationships between users and files/dirs on
the file system are identical to those in the instance picture (according to
the semantics R for the instance language).

   gen.[ch]		module for producing entries in the output
   perm.[ch]		module for manipulating access permissions
   search.[ch]		module for searching the file system subtree
   top.[ch]		top-level control file
   user.[ch]		module for keeping track of system user/group info
   vote.[ch]		module for taking votes on permissions in a directory

The high-level operation of this program is described as follows. The TOP
module first calls Gen_UserRoleBoxes() to generate all SUBJECT boxes. This
routine has the side-effect of storing the sysnames of these boxes in a hash
table so they may be looked up when arrows are generated. The TOP module then
calls Search_TopLevelPath() to search the indicated subtree of the file
system.

The search traverses the directory tree using a DFS. Computations are made
during both the downward and upward traversals. During the downward traversal,
the "cd-permission" of each directory is computed as the "cd-permission" of
its parent ANDed with the "x" bits of the directory. At the leaves of the
search (i.e., at the files), a "read", "write", and "exec" permission is
computed using the "r", "w", and "x" bits, and the current "cd-permission" of
that file's parent directory. During the upward traversal, the permissions for
a directory are computed as a function of its own "cd-permission" and from the
permissions of all its entries. Once the permissions for the directory have
been computed, arrows are generated each of its entries corresponding to the
*differences* between the parent directory permissions and the entry
permissions.

Currently, voting is not fully implemented. Preliminary tests showed that it
led to the production of ambiguous instance pictures. This problem should be
solved, as it will lead to instance pictures with far fewer arrows.
