Author: gs Date: Tue Nov 4 13:44:12 2008 New Revision: 52882 URL: http://svn.opensuse.org/viewcvs/yast?rev=52882&view=rev Log: Show an error popup if writing of rules or settings fails Modified: trunk/audit-laf/package/yast2-audit-laf.changes trunk/audit-laf/src/AuditLaf.ycp Modified: trunk/audit-laf/package/yast2-audit-laf.changes URL: http://svn.opensuse.org/viewcvs/yast/trunk/audit-laf/package/yast2-audit-laf.changes?rev=52882&r1=52881&r2=52882&view=diff ============================================================================== --- trunk/audit-laf/package/yast2-audit-laf.changes (original) +++ trunk/audit-laf/package/yast2-audit-laf.changes Tue Nov 4 13:44:12 2008 @@ -1,4 +1,9 @@ ------------------------------------------------------------------- +Tue Nov 4 13:38:35 CET 2008 - gs@suse.de + +- Show an error popup if writing of rules or settings fails + +------------------------------------------------------------------- Tue Oct 28 11:01:59 CET 2008 - gs@suse.de - Allow to enter any log file name (replace AskForExistingFile Modified: trunk/audit-laf/src/AuditLaf.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/audit-laf/src/AuditLaf.ycp?rev=52882&r1=52881&r2=52882&view=diff ============================================================================== --- trunk/audit-laf/src/AuditLaf.ycp (original) +++ trunk/audit-laf/src/AuditLaf.ycp Tue Nov 4 13:44:12 2008 @@ -324,7 +324,12 @@ */ boolean WriteAuditRules() { boolean success = (boolean)SCR::Write(.target.string, rules_file, RULES ); - // FIXME ??? flush necessary ??? + + if ( !success ) + { + Report::Error( sformat(_("Cannot write rules to %1" ), rules_file) ); + y2error( "Cannot write %1", rules_file ); + } return success; } @@ -472,6 +477,7 @@ */ boolean WriteAuditdSettings() { boolean success = true; + map failed = $[]; if ( ! FileUtils::Exists ( config_file ) ) return false; @@ -480,13 +486,23 @@ foreach (string key, string value, SETTINGS, { // and write each value success = (boolean)SCR::Write(add(.auditd, key), value ); + if ( !success ) + failed = add( failed, key, value ); }); // This is very important // it flushes the cache, and stores the configuration on the disk SCR::Write(.auditd, nil); - y2milestone("%1 has been written: %2", config_file, SETTINGS); - + + if ( failed != $[] ) + { + Report::Error( _("Cannot write /etc/auditd/auditd.conf.") ); + y2error( "Writing %1 to /etc/auditd/auditd.conf FAILED", failed ); + } + else + { + y2milestone("%1 has been written: %2", config_file, SETTINGS); + } return true; } -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org