next up previous contents
Next: fork system call Up: Algorithms Previous: Algorithms   Contents

Config file reading algorithm

The file must be run through twice.

  1. Allocate memory for the hash table. The hash function is the lower part of the inode number.
  2. First reading : each time a NODE=... is read :
    1. Allocate a lids_prog_s
    2. Fill fields next, perm and caps with NULL
    3. Fill fields dev and inode with the read values.
    4. Place the structure in the hash tree.
    5. Each time a CAPS=... is read :
      1. Allocate a lids_caps_s
      2. Fill field next with NULL
      3. Fill fields uid, caps, mask, lids, lids_mask with the read values
      4. Make the structure be pointed at by the end of the current caps list.
    6. Each time a PERM=... is read :
      1. Allocate a lids_perm_s
      2. Fill field next with NULL
      3. Fill fields dev, ino, perm with the read values.
      4. Make the structure be pointed at by the end of the current perm list.
  3. Second reading : each time a NODE=... is read :
    1. remind the device and inode numbers
    2. at the first CAPS_INHERIT=..., if it is not NONE, make the last next of the reminded program's caps's list point at the begining of the caps list of the program which is indicated in the CAPS_INHERIT field.

    3. at the first PERM_INHERIT=..., if it is not NONE, make the last next of the reminded program's perm's list point at the begining of the perm list of the program which is indicated in the PERM_INHERIT field.


next up previous contents
Next: fork system call Up: Algorithms Previous: Algorithms   Contents
Biondi Philippe 2000-12-15