~ubuntu-branches/ubuntu/saucy/augeas/saucy-proposed

« back to all changes in this revision

Viewing changes to lenses/sudoers.aug

  • Committer: Package Import Robot
  • Author(s): Nicolas Valcárcel Scerpella
  • Date: 2011-11-10 09:20:03 UTC
  • mfrom: (1.4.2)
  • Revision ID: package-import@ubuntu.com-20111110092003-532kypb6beba5gmk
Tags: 0.9.0-1
* New upstream release
* Added build-arch and build-indep targets to d/rules. (Closes: #648156)
  Thanks to Niels Thykier for the patch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
109
109
let sto_to_spc = store /[^", \t\n\\\\]+|"[^", \t\n\\\\]+"/
110
110
 
111
111
(* Variable: sto_to_spc_no_dquote *)
112
 
let sto_to_spc_no_dquote = store /[^", \t\n\\\\]+/ (* " relax emacs *)
 
112
let sto_to_spc_no_dquote = store /[^",# \t\n\\\\]+/ (* " relax emacs *)
113
113
 
114
114
(* Variable: sto_integer *)
115
115
let sto_integer = store /[0-9]+/
123
123
  let sto_to_eol = store (/([^ \t\n].*[^ \t\n]|[^ \t\n])/ - /include(dir)?.*/) in
124
124
  [ label "#comment" . del /[ \t]*#[ \t]*/ "# " . sto_to_eol . eol ]
125
125
 
 
126
(* View: comment_eol
 
127
Requires a space before the # *)
 
128
let comment_eol = Util.comment_generic /[ \t]+#[ \t]*/ " # "
 
129
 
 
130
(* View: comment_or_eol
 
131
A <comment_eol> or <eol> *)
 
132
let comment_or_eol = comment_eol | (del /([ \t]+#\n|[ \t]*\n)/ "\n")
 
133
 
126
134
(* View: empty
127
135
Map empty lines *)
128
136
let empty   = [ del /[ \t]*#?[ \t]*\n/ "\n" ]
195
203
 *************************************************************************)
196
204
let alias_entry (kw:string) (field:string) (sto:lens)
197
205
    = [ indent . key kw . sep_cont . alias_entry_single field sto
198
 
          . ( sep_col . alias_entry_single field sto )* . eol ]
 
206
          . ( sep_col . alias_entry_single field sto )* . comment_or_eol ]
199
207
 
200
208
(* TODO: go further in user definitions *)
201
209
(* View: user_alias
401
409
 *     > Default_Entry ::= Default_Type Parameter_List
402
410
 *************************************************************************)
403
411
let defaults = [ indent . key "Defaults" . default_type? . sep_cont
404
 
                   . parameter_list . eol ]
 
412
                   . parameter_list . comment_or_eol ]
405
413
 
406
414
 
407
415
 
411
419
 
412
420
(************************************************************************
413
421
 * View: runas_spec
414
 
 *   A runas specification for <spec>, using <alias_list>
 
422
 *   A runas specification for <spec>, using <alias_list> for listing
 
423
 *   users and/or groups used to run a command
415
424
 *
416
425
 *   Definition:
417
 
 *     > Runas_Spec ::= '(' Runas_List ')'
 
426
 *     > Runas_Spec ::= '(' Runas_List ')' |
 
427
 *     >                '(:' Runas_List ')' |
 
428
 *     >                '(' Runas_List ':' Runas_List ')'
418
429
 *************************************************************************)
419
 
let runas_spec = Util.del_str "(" . alias_list "runas_user" sto_to_com
420
 
    . Util.del_str ")" . sep_cont_opt
 
430
let runas_spec_user       = alias_list "runas_user" sto_to_com
 
431
let runas_spec_group      = Util.del_str ":" . indent
 
432
                            . alias_list "runas_group" sto_to_com
 
433
 
 
434
let runas_spec_usergroup  = runas_spec_user . indent . runas_spec_group
 
435
 
 
436
let runas_spec = Util.del_str "("
 
437
                 . (runas_spec_user
 
438
                    | runas_spec_group
 
439
                    | runas_spec_usergroup )
 
440
                 . Util.del_str ")" . sep_cont_opt
421
441
 
422
442
(************************************************************************
423
443
 * View: tag_spec
470
490
let spec = [ label "spec" . indent
471
491
               . alias_list "user" sto_to_com_user . sep_cont
472
492
               . spec_list
473
 
               . ( sep_col . spec_list )* . eol ]
 
493
               . ( sep_col . spec_list )* . comment_or_eol ]
474
494
 
475
495
 
476
496
(************************************************************************
493
513
    . (incl "/usr/local/etc/sudoers")
494
514
    . (incl "/etc/sudoers.d/*")
495
515
    . (incl "/usr/local/etc/sudoers.d/*")
 
516
    . (incl "/opt/csw/etc/sudoers")
 
517
    . (incl "/etc/opt/csw/sudoers")
496
518
    . Util.stdexcl
497
519
 
498
520
let xfm = transform lns filter