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 / cfg_policykit.scr < prev    next >
Encoding:
Text File  |  2006-11-29  |  1.7 KB  |  66 lines

  1. /**
  2.  * File:
  3.  *   cfg_policykit.scr
  4.  * Summary:
  5.  *   SCR Agent for reading/writing /etc/PolicyKit/privilege.d/*.privilege files
  6.  *   using the ini-agent
  7.  * Access:
  8.  *   read/write
  9.  * Authors:
  10.  *   Ladislav Slezak <lslezak@suse.cz>
  11.  * Example:
  12.  *
  13.  *   Read list of available files
  14.  *   SCR::Dir(.etc.policykit.section)
  15.  *
  16.  *   Read list of sections in a file
  17.  *   SCR::Dir(.etc.policykit.section."/etc/PolicyKit/privilege.d/hal-power-hibernate.privilege")
  18.  *   (["Privilege"])
  19.  *
  20.  *   Read list of options in a section
  21.  *   SCR::Dir(.etc.policykit.value."/etc/PolicyKit/privilege.d/hal-power-hibernate.privilege"."Privilege")
  22.  *   (["RequiredPrivileges", "SufficientPrivileges", "Allow", "Deny", "CanObtain", "CanGrant", "ObtainRequireRoot"])
  23.  *
  24.  *   Read an option
  25.  *   SCR::Read(.etc.policykit.value."/etc/PolicyKit/privilege.d/hal-power-hibernate.privilege"."Privilege"."RequiredPrivileges")
  26.  *   ("desktop-console")
  27.  *
  28.  *
  29.  *   Write an option
  30.  *   SCR::Write(.etc.policykit.value."/etc/PolicyKit/privilege.d/hal-power-hibernate.privilege"."Privilege"."RequiredPrivileges", "")
  31.  *   (true)
  32.  *
  33.  *
  34.  *   Flush the changes
  35.  *   SCR::Write(.etc.policykit, nil)
  36.  *
  37.  *
  38.  *   Fore more information see the INI-agent documentation
  39.  *
  40.  * $Id:$
  41.  */
  42.  
  43. .etc.policykit
  44.  
  45. `ag_ini(
  46.     `IniAgent( ["/etc/PolicyKit/privilege.d/*.privilege"] , $[
  47.     "options" : [ "no_nested_sections", "line_can_continue", "comments_last" ],
  48.     "comments": [
  49.         "^[ \t]*$",        // empty line
  50.         "^[ \t]*#.*$",    // comment char
  51.     ],
  52.     "sections" : [
  53.         $[
  54.         "begin" : [ "^[ \t]*\\[[ \t]*(.*[^ \t])[ \t]*\\][ \t]*", "[%s]" ],
  55.         ]
  56.     ],
  57.     "params" : [
  58.         $[
  59.         "match" : [ "^[ \t]*([^=]*[^ \t=])[ \t]*=[ \t]*(.*[^ \t]|)[ \t]*$" , "%s=%s"],
  60.         ]
  61.     ]
  62.     ]
  63.   )
  64. )
  65.  
  66.