Mailinglist Archive: yast-commit (953 mails)

< Previous Next >
[yast-commit] r49791 - in /trunk/auditd/src: Auditd.ycp complex.ycp wizards.ycp
  • From: gs@xxxxxxxxxxxxxxxx
  • Date: Wed, 06 Aug 2008 16:14:27 -0000
  • Message-id: <20080806161428.143A22A006@xxxxxxxxxxxxxxxx>
Author: gs
Date: Wed Aug 6 18:14:27 2008
New Revision: 49791

URL: http://svn.opensuse.org/viewcvs/yast?rev=49791&view=rev
Log:
add a workflow step "check" to be able to check rules

Modified:
trunk/auditd/src/Auditd.ycp
trunk/auditd/src/complex.ycp
trunk/auditd/src/wizards.ycp

Modified: trunk/auditd/src/Auditd.ycp
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/auditd/src/Auditd.ycp?rev=49791&r1=49790&r2=49791&view=diff
==============================================================================
--- trunk/auditd/src/Auditd.ycp (original)
+++ trunk/auditd/src/Auditd.ycp Wed Aug 6 18:14:27 2008
@@ -74,6 +74,16 @@
*/
boolean write_only = false;

+boolean rules_locked = false;
+
+global void SetRulesLocked( boolean value ) {
+ rules_locked = value;
+}
+
+global boolean RulesLocked() {
+ return rules_locked;
+}
+
/**
* Return rules file path
*/

Modified: trunk/auditd/src/complex.ycp
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/auditd/src/complex.ycp?rev=49791&r1=49790&r2=49791&view=diff
==============================================================================
--- trunk/auditd/src/complex.ycp (original)
+++ trunk/auditd/src/complex.ycp Wed Aug 6 18:14:27 2008
@@ -286,12 +286,36 @@

void StoreRulesDialog( string id, map event) {
string rules = (string)UI::QueryWidget( `id("rules"), `Value );
-
+
Auditd::SetRules( rules );

y2debug( "RULES: %1", rules );
y2milestone( "Store rules dialog" );
}

+symbol CheckSettings() {
+ symbol ret = `next;
+
+ Auditd::SetRulesLocked( false );
+
+ string rules = (string)UI::QueryWidget( `id("rules"), `Value );
+ list <string> rules_list = splitstring( rules, "\n");
+
+ foreach ( string rule, rules_list, {
+ if ( regexpmatch( rule, "^[ /t]*-e[ /t]*2" ) )
+ {
+ boolean yes = Popup::YesNo( _("Lock is set in audit.rules (-e 2).\n
+Are you sure that you want to lock the rules until next boot?\n
+If you want to change the rules, press 'No' to go back to rules editor.") );
+ if ( yes )
+ ret = `next;
+ else
+ ret = `back;
+ Auditd::SetRulesLocked( true );
+ }
+ } );
+ return ret;
+}
+
/* EOF */
}

Modified: trunk/auditd/src/wizards.ycp
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/auditd/src/wizards.ycp?rev=49791&r1=49790&r2=49791&view=diff
==============================================================================
--- trunk/auditd/src/wizards.ycp (original)
+++ trunk/auditd/src/wizards.ycp Wed Aug 6 18:14:27 2008
@@ -102,12 +102,19 @@
],
];

+ string ini_tab = "";
+
+ if ( Auditd::RulesLocked() )
+ ini_tab = "auditd_rules";
+ else
+ ini_tab = "logfile_settings";
+
map <string, any> wd = $[
"tab" : CWMTab::CreateWidget ($[
"tab_order" : ["logfile_settings", "dispatcher",
"diskspace_settings", "auditd_rules"],
"tabs" : tabs,
"widget_descr" : widgets,
- "initial_tab" : "logfile_settings",
+ "initial_tab" : ini_tab,
])
];

@@ -140,6 +147,7 @@
map aliases = $[
"read" : [ ``( ReadDialog() ), true ],
"main" : ``( MainSequence() ),
+ "check" : ``( CheckSettings() ),
"write" : [ ``( WriteDialog() ), true ]
];

@@ -151,7 +159,11 @@
],
"main" : $[
`abort : `abort,
- `next : "write"
+ `next : "check"
+ ],
+ "check" : $[
+ `abort: `abort,
+ `next: "write"
],
"write" : $[
`abort : `abort,

--
To unsubscribe, e-mail: yast-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: yast-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages