From f7f5223b43aff240cc973dd169ceb6c038785870 Mon Sep 17 00:00:00 2001 From: Sumit Bose Date: Thu, 18 Sep 2008 23:49:14 +0200 Subject: restructuring for UI and validation --- sudoers/sudoers.rng | 486 ++++++++++++++++++++++++++++++++++++++++++++++++++-- sudoers/sudoers2xml | 20 ++- 2 files changed, 479 insertions(+), 27 deletions(-) diff --git a/sudoers/sudoers.rng b/sudoers/sudoers.rng index 6787df7..7686f1c 100644 --- a/sudoers/sudoers.rng +++ b/sudoers/sudoers.rng @@ -1,22 +1,474 @@ + xmlns:a="http://freeipa.org/xml/rng/ns/annotations/1.0" + xmlns:ui="http://freeipa.org/xml/rng/ns/ui/1.0"> Sudo configuration (/etc/sudoers) - - + + + + + + user + posixGroup + netgroup + + - + + + + + + + + + + on + off + + + + + + on + off + + + + + + on + off + + + + + + on + off + + + + + + on + off + + + + + + + + + on + off + + + + + + on + off + + + + + + on + off + + + + + + on + off + + + + + + on + off + + + + + + on + off + + + + + + on + off + + + + + + on + off + + + + + + on + off + + + + + + on + off + + + + + + on + off + + + + + + on + off + + + + + + on + off + + + + + + on + off + + + + + + on + off + + + + + + on + off + + + + + + on + off + + + + + + on + off + + + + + + on + off + + + + + + on + off + + + + + + on + off + + + + + + on + off + + + + + + on + off + + + + + + on + off + + + + + + on + off + + + + + + + + 1 + 65535 + + + + + + + + 0 + 65535 + + + + + + 0 + 65535 + + + + + + -1 + 65535 + + + + + + (0[0-7]{3}) + + + + + + + + + + + + + + + + + + + + /.* + + + + + + + + + + + + + + [A-Za-z0-9_-]{1,16} + + + + + + + emerg + alert + crit + err + warning + notice + info + debug + + + + + + emerg + alert + crit + err + warning + notice + info + debug + + + + + + /.* + + + + + + [A-Za-z0-9_-]{1,16} + + + + + + + + + + + + + + + + + + always + never + once + + + + + + (/.*|built-in) + + + + + + + all + always + any + never + + + + + + (/.*|off) + + + + + + + + + + + + + + auth + authpriv + daemon + user + local0 + local1 + local2 + local3 + local4 + local5 + local6 + local7 + off + + + + + + all + always + any + never + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - @@ -44,21 +496,19 @@ - + + [A-Za-z0-9_-]{1,16} + + - + + + - - - - - - - diff --git a/sudoers/sudoers2xml b/sudoers/sudoers2xml index 4ce9b18..75bb6c9 100755 --- a/sudoers/sudoers2xml +++ b/sudoers/sudoers2xml @@ -37,7 +37,7 @@ $user_group_attributename{'user'}='uids'; my $did_defaults=0; print ''."\n"; -print ''."\n"; +print ''."\n"; # parse sudoers one line at a time while (<>){ @@ -85,13 +85,14 @@ while (<>){ ##print "cn: defaults\n"; ##print "description: Default sudoOption's go here\n"; ##print "sudoOption: $_\n" foreach @options; - print '\n