Mailinglist Archive: yast-commit (883 mails)

< Previous Next >
[yast-commit] r57970 - in /trunk/audit-laf/src: audit-laf.ycp cmdline.ycp
  • From: gs@xxxxxxxxxxxxxxxx
  • Date: Thu, 09 Jul 2009 10:55:02 -0000
  • Message-id: <E1MOrHK-0005v1-AB@xxxxxxxxxxxxxxxx>
Author: gs
Date: Thu Jul 9 12:55:01 2009
New Revision: 57970

URL: http://svn.opensuse.org/viewcvs/yast?rev=57970&view=rev
Log:
use type 'enum' for values

Modified:
trunk/audit-laf/src/audit-laf.ycp
trunk/audit-laf/src/cmdline.ycp

Modified: trunk/audit-laf/src/audit-laf.ycp
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/audit-laf/src/audit-laf.ycp?rev=57970&r1=57969&r2=57970&view=diff
==============================================================================
--- trunk/audit-laf/src/audit-laf.ycp (original)
+++ trunk/audit-laf/src/audit-laf.ycp Thu Jul 9 12:55:01 2009
@@ -69,63 +69,66 @@
// translators: command line help text for
set action
"help" : _("Set the specified option"),
//"options" : ["non_strict"],
- // help text for additional parameter name
//"non_strict_help": _("Use keywords and
values specified in 'man auditd.conf'")
]
],
"options" : $[
"logfile" :$[
- // translators: command line help text for
show logfile option
+ // translators: command line help text for
'show logfile'
"help" : _("Show log file settings")
],
"diskspace" :$[
- // translators: command line help text for
show disk space option
+ // translators: command line help text for
'show diskspace'
"help" : _("Show disk space settings")
],
+ "disp" :$[
+ // translators: command line help text for
'show dispatcher'
+ "help" : _("Show dispatcher settings")
+ ],
+
"log_file" :$[
- // translators: command line help text for
log_file option
- "help" : _("Name of the log file (full
path name)"),
- "type" : "string"
- ],
+ // translators: command line help text for
log_file option
+ "help" : _("Name of the log file (full
path name)"),
+ "type" : "string"
+ ],
"log_format":$[
// translators: command line help text for
log_format option
- // (do NOT translate: RAW, NOLOG)
- "help" : _("Log format (RAW, NOLOG)"),
- "type" : "string"
+ "help" : _("Log format"),
+ "type" : "enum",
+ "typespec" : ["RAW", "NOLOG"]
],
"flush" :$[
- // translators: command line help text for
flush option
- // (do NOT translate: INCREMENTAL, NONE,
DATA, SYNC)
- "help" : _("How to write data to disk
(INCREMENTAL, NONE, DATA, SYNC)"),
- "type" : "string"
- ],
+ // translators: command line help text for
flush option
+ "help" : _("How to write data to
disk"),
+ "type" : "enum",
+ "typespec" : ["INCREMENTAL", "NONE",
"DATA", "SYNC"]
+ ],
"freq" :$[
// translators: command line help text for
frequency option
- // (do NOT translate: INCREMENTAL, NONE,
DATA, SYNC)
"help" : _("How many records to write
before a flush to disk is issued"),
- "type" : "string"
+ "type" : "integer"
],
"max_log_file":$[
// translators: command line help text for
max_log_file option
"help" : _("Maximal size (in MByte) of
the log file"),
- "type" : "string"
+ "type" : "integer"
],
"max_log_file_action":$[
// translators: command line help
text for max_log_file_action option
- // (do NOT translate: IGNORE,
SYSLOG, SUSPEND, ROTATE, KEEP_LOGS)
- "help" : _("Action if
max_log_file is reached (IGNORE, SYSLOG, SUSPEND, ROTATE, KEEP_LOGS)"),
- "type" : "string"
+ "help" : _("Action if
max_log_file is reached"),
+ "type" : "enum",
+ "typespec" : ["IGNORE", "SYSLOG",
"SUSPEND", "ROTATE", "KEEP_LOG"]
],
"num_logs" :$[
// translators: command line help text for
num_logs option
"help" : _("Number of log files to
keep"),
- "type" : "string"
+ "type" : "integer"
],
"name_format":$[
// translators: command line help text for
name_format option
- // (do NOT translate: NONE, HOSTNAME, FQD,
USER)
- "help" : _("Computer name format
(NONE, HOSTNAME, FQD, USER)"),
- "type" : "string"
+ "help" : _("Computer name format"),
+ "type" : "enum",
+ "typespec" : [ "NONE", "HOSTNAME", "FQD",
"USER" ]
],
"name" :$[
// translators: command line help text for
name_format option
@@ -135,24 +138,35 @@

"space_left":$[
// translators: command line help text for
space_left option
- "help" : _("Space left on log
partition (in MByte) starts to run low"),
- "type" : "string"
+ "help" : _("Space left on log
partition (in MByte) when system starts to run low"),
+ "type" : "integer"
],
"space_left_action":$[
// translators: command line help
text for space_left_action option
- // (do NOT translate: IGNORE, SYSLOG,
SUSPEND, SINGLE, HALT, EXEC, EMAIL)
- "help" : _("Action if
space_left is reached (IGNORE, SYSLOG, SUSPEND, SINGLE, HALT, EXEC <full path
to script>, EMAIL)"),
+ "help" : _("Action if
space_left is reached"),
+ "type" : "enum",
+ "typespec" : [ "IGNORE", "SYSLOG",
"SUSPEND", "SINGLE", "HALT", "EMAIL" ]
+ ],
+ "space_left_script":$[
+ // translators: command line help
text for space_left_script option
+ "help" : _("Script to execute
(full path name) if space_left is reached"),
"type" : "string"
],
"admin_space_left":$[
// translators: command line help text
for admin_space_left
- "help" : _("Disk space to on log
partition (in MByte) is running low"),
- "type" : "string"
+ "help" : _("Space left on log
partition (in MByte) when system is running low"),
+ "type" : "integer"
],
"admin_space_left_action":$[
// command line help text for
admin_space_left_action option
- // (do NOT translate: IGNORE,
SYSLOG, SUSPEND, SINGLE, HALT, EXEC, EMAIL)
- "help" : _("Action if
admin_space_left is reached (IGNORE, SYSLOG, SUSPEND, SINGLE, HALT, EXEC <full
path to script>, EMAIL)"),
+ "help" : _("Action if
admin_space_left is reached"),
+ "type" : "enum",
+ "typespec" : [ "IGNORE",
"SYSLOG", "SUSPEND", "SINGLE", "HALT", "EMAIL" ]
+
+ ],
+ "admin_space_left_script":$[
+ // translators: command line
help text for admin_space_left_script option
+ "help" : _("Script to execute
(full path name) if admin_space_left is reached"),
"type" : "string"
],
"action_mail_acct":$[
@@ -162,20 +176,45 @@
],
"disk_full_action":$[
// command line help text for
disk_full_action option
- "help" : _("Action to perform if disk
is full (IGNORE, SYSLOG, SUSPEND, SINGLE, HALT, EXEC <full path to script>)"),
- "type" : "string"
+ "help" : _("Action to perform
if disk is full"),
+ "type" : "enum",
+ "typespec" : ["IGNORE", "SYSLOG",
"SUSPEND", "SINGLE", "HALT"]
],
+ "disk_full_script" :$[
+ // translators: command line help
text for admin_space_left_script option
+ "help" : _("Script to execute
(full path name) if disk is full"),
+ "type" : "string"
+ ],
"disk_error_action":$[
// command line help text for
disk_error_action option
- "help" : _("Action to perform
on disk error (IGNORE, SYSLOG, SUSPEND, SINGLE, HALT, EXEC <full path to
script>)"),
- "type" : "string"
- ]
+ "help" : _("Action to perform
on disk error"),
+ "type" : "enum",
+ "typespec" : ["IGNORE", "SYSLOG",
"SUSPEND", "SINGLE", "HALT"]
+ ],
+ "disk_error_script" :$[
+ // translators: command line help
text for script on disk error option
+ "help" : _("Script to execute
(full path name) on disk error"),
+ "type" : "string"
+ ],
+ "disp_qos" :$[
+ // command line help text for
communication control option
+ "help" : _("How to communicate
between dispatcher and the audit daemon"),
+ "type" : "enum",
+ "typespec" : ["lossy", "lossless"]
+ ],
+ "dispatcher" :$[
+ // command line help text for
dispatcher option
+ "help" : _("Dispatcher program
(full path name)"),
+ "type" : "string"
+ ]
],
"mappings": $[
- "show" : [ "logfile", "diskspace" ],
+ "show" : [ "logfile", "diskspace", "disp" ],
"set" : [ "log_file", "log_format", "flush", "freq",
"max_log_file", "max_log_file_action",
- "num_logs", "name_format", "name",
"space_left", "space_left_action","admin_space_left",
- "admin_space_left_action", "action_mail_acct",
"disk_full_action", "disk_error_action" ]
+ "num_logs", "name_format", "name",
"space_left", "space_left_action", "space_left_script",
+ "admin_space_left", "admin_space_left_action",
"admin_space_left_script", "action_mail_acct",
+ "disk_full_action", "disk_full_script",
"disk_error_action", "disk_error_script",
+ "disp_qos", "dispatcher"]
]
];

@@ -194,7 +233,7 @@

if(propose) ret = AuditLafAutoSequence();
else ret = CommandLine::Run(cmdline_description);
-y2debug("ret=%1", ret);
+y2milestone("Return value=%1", ret);

/* Finish */
y2milestone("yast2-audit-laf module finished");

Modified: trunk/audit-laf/src/cmdline.ycp
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/audit-laf/src/cmdline.ycp?rev=57970&r1=57969&r2=57970&view=diff
==============================================================================
--- trunk/audit-laf/src/cmdline.ycp (original)
+++ trunk/audit-laf/src/cmdline.ycp Thu Jul 9 12:55:01 2009
@@ -33,6 +33,9 @@
"disk_full_action",
"disk_error_action"
];
+list <string> dispatcher_settings = ["disp_qos",
+ "dispatcher"
+ ];

define string GetLogfileSettings() {

@@ -54,15 +57,40 @@
return settings;
}

+define string GetDispatcherSettings() {
+ string settings = "";
+
+ foreach ( string key, dispatcher_settings, {
+ settings = settings + key + ": " +
AuditLaf::GetAuditdOption(key) + "\n";
+ } );
+
+ return settings;
+}
define boolean SettingsHandler (map<string,any> options ) {

- y2milestone ( "Options: %1", options );
+ y2milestone ( "Command line options: %1", options );

foreach( string key, any val, options, ``{
- if ( contains (logfile_settings, key) ||
contains(diskspace_settings, key) )
- AuditLaf::SetAuditdOption( key, (string)val );
+ string value = "";
+
+ if ( is( val, integer ) )
+ value = tostring(val);
else
- CommandLine::Print( _("Unknown option") );
+ value = (string)val;
+
+ if ( contains( logfile_settings, key ) ||
+ contains( diskspace_settings, key ) ||
+ contains( dispatcher_settings, key ) )
+ {
+ // option (key/value pair) can be written 'as is', e.g.
log_format = RAW
+ AuditLaf::SetAuditdOption( key, value );
+ }
+ else if ( substring( key, size(key)-6 ) == "script" )
+ {
+ AuditLaf::SetAuditdOption( substring( key, 0, size(key)-6 ) +
"action", // replace "script" by "action"
+ "EXEC " + value );
// EXEC <script>
+ }
+
});

return true; // call Write
@@ -78,21 +106,25 @@
list<string> sets = [];

foreach ( string key, any val, options, ``{
- if ( contains (["logfile","diskspace"], key) )
+ if ( contains (["logfile","diskspace", "disp"], key) )
sets = add (sets, key);
});
if ( sets == [] )
- CommandLine::Print ( "Please specify information ('logfile' or
'diskpace')");
+ CommandLine::Print ( "Please specify information ('logfile', 'diskpace'
or 'disp')");

foreach ( string option, sets, {
if ( option == "logfile" )
{
CommandLine::Print( GetLogfileSettings() );
}
- else if ( option == "diskspace" )
+ else if ( option == "diskspace" )
{
CommandLine::Print( GetDiskspaceSettings() );
}
+ else if ( option == "disp" )
+ {
+ CommandLine::Print( GetDispatcherSettings() );
+ }
else
CommandLine::Print ( "Unknown option" );
} );

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

< Previous Next >
This Thread
  • No further messages