home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / boot / i386 / root / usr / share / YaST2 / scrconf / etc_passwd.scr < prev    next >
Encoding:
Text File  |  2006-11-29  |  1.5 KB  |  74 lines

  1. /**
  2.  * File:
  3.  *   etc_passwd.scr
  4.  * Summary:
  5.  *   SCR Agent for reading /etc/passwd
  6.  * Access:
  7.  *   read-only
  8.  * Authors:
  9.  *   Unknown <yast2-hacker@suse.de>
  10.  * See:
  11.  *   anyagent
  12.  *   libscr
  13.  *   man passwd(5)
  14.  * Example:
  15.  *   Read(.etc.passwd)
  16.  *   ([$["fullname":"root", "gid":0, "home":"/root", "password":"x",
  17.  *       "shell":"/bin/bash", "uid":0, "username":"root"], 
  18.  *     $["fullname":"bin", "gid":1, "home":"/bin", "password":"x",
  19.  *       "shell":"/bin/bash", "uid":1, "username":"bin"],
  20.  *     $["fullname":"daemon", "gid":2,"home":"/sbin", "password":"x",
  21.  *     ... 
  22.  *   ])
  23.  * 
  24.  * $Id: etc_passwd.scr 13018 2003-12-11 12:52:53Z jhumpol $
  25.  *
  26.  * Returns a <b>list of maps</b>. Each map (list-entry) corresponds 
  27.  * with one user. 
  28.  * Keys for the maps are: "username", "password", "uid", "gid", "fullname", "home" and "shell". 
  29.  */
  30. .etc.passwd
  31.  
  32. `ag_anyagent(
  33.   `Description (
  34.       (`File("/etc/passwd")),    // real filename
  35.       "#",            // Comment
  36.       true,
  37.       (`List (
  38.     `Or (
  39.       `Tuple (
  40.       `username (`String("+")),
  41.       ":",
  42.       `password (`String ("")),
  43.       ":",
  44.       `uid (`String ("")),
  45.       ":",
  46.       `gid (`String ("")),
  47.       ":",
  48.       `fullname (`String ("")),
  49.       ":",
  50.       `home (`String ("")),
  51.       ":",
  52.       `shell (`String (""))
  53.     ),
  54.  
  55.     `Tuple (
  56.       `username (`String ("^:")),
  57.       ":",
  58.       `password (`Or (`String ("^:"), "")),
  59.       ":",
  60.       `uid (`Number ()),
  61.       ":",
  62.       `gid (`Number ()),
  63.       ":",
  64.       `fullname (`Or (`String ("^:"), "")),
  65.       ":",
  66.       `home (`String ("^:")),
  67.       ":",
  68.       `shell (`String ("^\n"))
  69.     )),
  70.     "\n"
  71.       ))
  72.     )
  73. )
  74.