Author: gs
Date: Thu Jul 24 18:51:36 2008
New Revision: 49397
URL: http://svn.opensuse.org/viewcvs/yast?rev=49397&view=rev
Log:
new module created with y2tool
Added:
trunk/auditd/
trunk/auditd/.cvsignore
trunk/auditd/MAINTAINER
trunk/auditd/Makefile.cvs
trunk/auditd/RPMNAME
trunk/auditd/VERSION
trunk/auditd/agents/
trunk/auditd/agents/.cvsignore
trunk/auditd/agents/Makefile.am
trunk/auditd/configure.in.in
trunk/auditd/doc/
trunk/auditd/doc/.cvsignore
trunk/auditd/doc/Makefile.am
trunk/auditd/doc/autodocs/
trunk/auditd/doc/autodocs/.cvsignore
trunk/auditd/doc/autodocs/Makefile.am
trunk/auditd/package/
trunk/auditd/package/.cvsignore
trunk/auditd/package/yast2-auditd.changes
trunk/auditd/src/
trunk/auditd/src/.cvsignore
trunk/auditd/src/Auditd.ycp
trunk/auditd/src/Auditd2.pm
trunk/auditd/src/Auditd3.py
trunk/auditd/src/Makefile.am
trunk/auditd/src/auditd.desktop
trunk/auditd/src/auditd.ycp
trunk/auditd/src/auditd_auto.ycp
trunk/auditd/src/auditd_proposal.ycp
trunk/auditd/src/complex.ycp
trunk/auditd/src/dialogs.ycp
trunk/auditd/src/helps.ycp
trunk/auditd/src/wizards.ycp
trunk/auditd/testsuite/
trunk/auditd/testsuite/.cvsignore
trunk/auditd/testsuite/Makefile.am
trunk/auditd/testsuite/tests/
trunk/auditd/testsuite/tests/.cvsignore
trunk/auditd/testsuite/tests/Auditd.err
trunk/auditd/testsuite/tests/Auditd.out
trunk/auditd/testsuite/tests/Auditd.ycp
trunk/auditd/yast2-auditd.spec.in
Added: trunk/auditd/.cvsignore
URL: http://svn.opensuse.org/viewcvs/yast/trunk/auditd/.cvsignore?rev=49397&view=auto
==============================================================================
--- trunk/auditd/.cvsignore (added)
+++ trunk/auditd/.cvsignore Thu Jul 24 18:51:36 2008
@@ -0,0 +1,20 @@
+Makefile
+Makefile.am
+Makefile.am.common
+Makefile.in
+aclocal.m4
+config.cache
+config.guess
+config.h.in
+config.log
+config.status
+config.sub
+configure
+configure.in
+depcomp
+install-sh
+missing
+mkinstalldirs
+stamp-h
+auditd.pot
+autom4te.cache
Added: trunk/auditd/MAINTAINER
URL: http://svn.opensuse.org/viewcvs/yast/trunk/auditd/MAINTAINER?rev=49397&view=auto
==============================================================================
--- trunk/auditd/MAINTAINER (added)
+++ trunk/auditd/MAINTAINER Thu Jul 24 18:51:36 2008
@@ -0,0 +1 @@
+Gabriele Mohr
Added: trunk/auditd/Makefile.cvs
URL: http://svn.opensuse.org/viewcvs/yast/trunk/auditd/Makefile.cvs?rev=49397&view=auto
==============================================================================
--- trunk/auditd/Makefile.cvs (added)
+++ trunk/auditd/Makefile.cvs Thu Jul 24 18:51:36 2008
@@ -0,0 +1,22 @@
+#
+# Makefile.cvs
+#
+PREFIX = /usr
+
+LIB = $(shell y2tool get-lib)
+
+configure: all
+ ./configure --prefix=$(PREFIX) --libdir=$(PREFIX)/$(LIB)
+
+all:
+ y2tool y2autoconf
+ y2tool y2automake
+ autoreconf --force --install
+
+install: configure
+ make
+ make install
+
+reconf: all
+ ./config.status --recheck
+ ./config.status
Added: trunk/auditd/RPMNAME
URL: http://svn.opensuse.org/viewcvs/yast/trunk/auditd/RPMNAME?rev=49397&view=auto
==============================================================================
--- trunk/auditd/RPMNAME (added)
+++ trunk/auditd/RPMNAME Thu Jul 24 18:51:36 2008
@@ -0,0 +1 @@
+yast2-auditd
Added: trunk/auditd/VERSION
URL: http://svn.opensuse.org/viewcvs/yast/trunk/auditd/VERSION?rev=49397&view=auto
==============================================================================
--- trunk/auditd/VERSION (added)
+++ trunk/auditd/VERSION Thu Jul 24 18:51:36 2008
@@ -0,0 +1 @@
+2.15.0
Added: trunk/auditd/agents/.cvsignore
URL: http://svn.opensuse.org/viewcvs/yast/trunk/auditd/agents/.cvsignore?rev=49397&view=auto
==============================================================================
--- trunk/auditd/agents/.cvsignore (added)
+++ trunk/auditd/agents/.cvsignore Thu Jul 24 18:51:36 2008
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
Added: trunk/auditd/agents/Makefile.am
URL: http://svn.opensuse.org/viewcvs/yast/trunk/auditd/agents/Makefile.am?rev=49397&view=auto
==============================================================================
--- trunk/auditd/agents/Makefile.am (added)
+++ trunk/auditd/agents/Makefile.am Thu Jul 24 18:51:36 2008
@@ -0,0 +1,7 @@
+# Makefile.am for auditd/agents
+
+agent_SCRIPTS =
+
+scrconf_DATA =
+
+EXTRA_DIST = $(agent_SCRIPTS) $(scrconf_DATA)
Added: trunk/auditd/configure.in.in
URL: http://svn.opensuse.org/viewcvs/yast/trunk/auditd/configure.in.in?rev=49397&view=auto
==============================================================================
--- trunk/auditd/configure.in.in (added)
+++ trunk/auditd/configure.in.in Thu Jul 24 18:51:36 2008
@@ -0,0 +1,12 @@
+## YCP module configure.in.in
+
+## Initialize
+@YAST2-INIT-COMMON@
+@YAST2-INIT-YCP@
+
+## some common checks
+@YAST2-CHECKS-COMMON@
+@YAST2-CHECKS-YCP@
+
+## and generate the output...
+@YAST2-OUTPUT@
Added: trunk/auditd/doc/.cvsignore
URL: http://svn.opensuse.org/viewcvs/yast/trunk/auditd/doc/.cvsignore?rev=49397&view=auto
==============================================================================
--- trunk/auditd/doc/.cvsignore (added)
+++ trunk/auditd/doc/.cvsignore Thu Jul 24 18:51:36 2008
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
Added: trunk/auditd/doc/Makefile.am
URL: http://svn.opensuse.org/viewcvs/yast/trunk/auditd/doc/Makefile.am?rev=49397&view=auto
==============================================================================
--- trunk/auditd/doc/Makefile.am (added)
+++ trunk/auditd/doc/Makefile.am Thu Jul 24 18:51:36 2008
@@ -0,0 +1,10 @@
+# Makefile.am for auditd/doc
+
+SUBDIRS = autodocs
+
+htmldir = $(docdir)
+
+doc_DATA =
+html_DATA =
+
+EXTRA_DIST = $(doc_DATA) $(html_DATA)
Added: trunk/auditd/doc/autodocs/.cvsignore
URL: http://svn.opensuse.org/viewcvs/yast/trunk/auditd/doc/autodocs/.cvsignore?rev=49397&view=auto
==============================================================================
--- trunk/auditd/doc/autodocs/.cvsignore (added)
+++ trunk/auditd/doc/autodocs/.cvsignore Thu Jul 24 18:51:36 2008
@@ -0,0 +1,3 @@
+Makefile
+Makefile.in
+*.html
Added: trunk/auditd/doc/autodocs/Makefile.am
URL: http://svn.opensuse.org/viewcvs/yast/trunk/auditd/doc/autodocs/Makefile.am?rev=49397&view=auto
==============================================================================
--- trunk/auditd/doc/autodocs/Makefile.am (added)
+++ trunk/auditd/doc/autodocs/Makefile.am Thu Jul 24 18:51:36 2008
@@ -0,0 +1,3 @@
+# Makefile.am for auditd/doc/autodocs
+
+include $(top_srcdir)/autodocs-ycp.ami
Added: trunk/auditd/package/.cvsignore
URL: http://svn.opensuse.org/viewcvs/yast/trunk/auditd/package/.cvsignore?rev=49397&view=auto
==============================================================================
--- trunk/auditd/package/.cvsignore (added)
+++ trunk/auditd/package/.cvsignore Thu Jul 24 18:51:36 2008
@@ -0,0 +1,2 @@
+*.spec
+*.bz2
Added: trunk/auditd/package/yast2-auditd.changes
URL: http://svn.opensuse.org/viewcvs/yast/trunk/auditd/package/yast2-auditd.changes?rev=49397&view=auto
==============================================================================
--- trunk/auditd/package/yast2-auditd.changes (added)
+++ trunk/auditd/package/yast2-auditd.changes Thu Jul 24 18:51:36 2008
@@ -0,0 +1,4 @@
+-------------------------------------------------------------------
+Thu Jul 24 18:11:47 2008 - gs@suse.de
+
+- initial version
Added: trunk/auditd/src/.cvsignore
URL: http://svn.opensuse.org/viewcvs/yast/trunk/auditd/src/.cvsignore?rev=49397&view=auto
==============================================================================
--- trunk/auditd/src/.cvsignore (added)
+++ trunk/auditd/src/.cvsignore Thu Jul 24 18:51:36 2008
@@ -0,0 +1,4 @@
+Makefile
+Makefile.in
+*.ybc
+.dep
Added: trunk/auditd/src/Auditd.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/auditd/src/Auditd.ycp?rev=49397&view=auto
==============================================================================
--- trunk/auditd/src/Auditd.ycp (added)
+++ trunk/auditd/src/Auditd.ycp Thu Jul 24 18:51:36 2008
@@ -0,0 +1,323 @@
+/* ------------------------------------------------------------------------------
+ * Copyright (c) 2006 Novell, Inc. All Rights Reserved.
+ *
+ *
+ * This program is free software; you can redistribute it and/or modify it under
+ * the terms of version 2 of the GNU General Public License as published by the
+ * Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, contact Novell, Inc.
+ *
+ * To contact Novell about this file by physical or electronic mail, you may find
+ * current contact information at www.novell.com.
+ * ------------------------------------------------------------------------------
+ */
+
+/**
+ * File: modules/Auditd.ycp
+ * Package: Configuration of auditd
+ * Summary: Auditd settings, input and output functions
+ * Authors: Gabriele Mohr
+ *
+ * $Id: Auditd.ycp 41350 2007-10-10 16:59:00Z dfiser $
+ *
+ * Representation of the configuration of auditd.
+ * Input and output routines.
+ */
+
+{
+
+module "Auditd";
+textdomain "auditd";
+
+import "Progress";
+import "Report";
+import "Summary";
+import "Message";
+
+/**
+ * Prototypes
+ */
+global boolean Modified();
+
+/**
+ * Data was modified?
+ */
+boolean modified = false;
+
+/**
+ */
+boolean proposal_valid = false;
+
+/**
+ * Write only, used during autoinstallation.
+ * Don't run services and SuSEconfig, it's all done at one place.
+ */
+boolean write_only = false;
+
+/**
+ * Abort function
+ * return boolean return true if abort
+ */
+boolean() AbortFunction = Modified;
+
+/**
+ * Abort function
+ * @return boolean return true if abort
+ */
+global define boolean Abort() ``{
+ if(AbortFunction != nil)
+ {
+ return AbortFunction () == true;
+ }
+ return false;
+}
+
+/**
+ * Data was modified?
+ * @return true if modified
+ */
+global boolean Modified() {
+ y2debug("modified=%1",modified);
+ return modified;
+}
+
+/**
+ * Mark as modified, for Autoyast.
+ */
+global void SetModified(boolean value) {
+ modified = true;
+ }
+
+global boolean ProposalValid() {
+ return proposal_valid;
+}
+
+global void SetProposalValid(boolean value) {
+ proposal_valid = value;
+}
+
+/**
+ * @return true if module is marked as "write only" (don't start services etc...)
+ */
+global boolean WriteOnly() {
+ return write_only;
+}
+
+/**
+ * Set write_only flag (for autoinstalation).
+ */
+global void SetWriteOnly(boolean value) {
+ write_only = value;
+}
+
+
+global void SetAbortFunction(boolean() function) {
+ AbortFunction = function;
+}
+
+
+// Settings: Define all variables needed for configuration of auditd
+// TODO FIXME: Define all the variables necessary to hold
+// TODO FIXME: the configuration here (with the appropriate
+// TODO FIXME: description)
+// TODO FIXME: For example:
+// /**
+// * List of the configured cards.
+// */
+// list cards = [];
+//
+// /**
+// * Some additional parameter needed for the configuration.
+// */
+// boolean additional_parameter = true;
+
+/**
+ * Read all auditd settings
+ * @return true on success
+ */
+global boolean Read() {
+
+ /* Auditd read dialog caption */
+ string caption = _("Initializing auditd Configuration");
+
+ // TODO FIXME Set the right number of stages
+ integer steps = 4;
+
+ integer sl = 500;
+ sleep(sl);
+
+ // TODO FIXME Names of real stages
+ // We do not set help text here, because it was set outside
+ Progress::New( caption, " ", steps, [
+ /* Progress stage 1/3 */
+ _("Read the database"),
+ /* Progress stage 2/3 */
+ _("Read the previous settings"),
+ /* Progress stage 3/3 */
+ _("Detect the devices")
+ ], [
+ /* Progress step 1/3 */
+ _("Reading the database..."),
+ /* Progress step 2/3 */
+ _("Reading the previous settings..."),
+ /* Progress step 3/3 */
+ _("Detecting the devices..."),
+ /* Progress finished */
+ _("Finished")
+ ],
+ ""
+ );
+
+ // read database
+ if(Abort()) return false;
+ Progress::NextStage();
+ /* Error message */
+ if(false) Report::Error(_("Cannot read database1."));
+ sleep(sl);
+
+ // read another database
+ if(Abort()) return false;
+ Progress::NextStep();
+ /* Error message */
+ if(false) Report::Error(_("Cannot read database2."));
+ sleep(sl);
+
+ // read current settings
+ if(Abort()) return false;
+ Progress::NextStage();
+ /* Error message */
+ if(false) Report::Error(Message::CannotReadCurrentSettings());
+ sleep(sl);
+
+ // detect devices
+ if(Abort()) return false;
+ Progress::NextStage();
+ /* Error message */
+ if(false) Report::Warning(_("Cannot detect devices."));
+ sleep(sl);
+
+ if(Abort()) return false;
+ /* Progress finished */
+ Progress::NextStage();
+ sleep(sl);
+
+ if(Abort()) return false;
+ modified = false;
+ return true;
+}
+
+/**
+ * Write all auditd settings
+ * @return true on success
+ */
+global boolean Write() {
+
+ /* Auditd read dialog caption */
+ string caption = _("Saving auditd Configuration");
+
+ // TODO FIXME And set the right number of stages
+ integer steps = 2;
+
+ integer sl = 500;
+ sleep(sl);
+
+ // TODO FIXME Names of real stages
+ // We do not set help text here, because it was set outside
+ Progress::New(caption, " ", steps, [
+ /* Progress stage 1/2 */
+ _("Write the settings"),
+ /* Progress stage 2/2 */
+ _("Run SuSEconfig")
+ ], [
+ /* Progress step 1/2 */
+ _("Writing the settings..."),
+ /* Progress step 2/2 */
+ _("Running SuSEconfig..."),
+ /* Progress finished */
+ _("Finished")
+ ],
+ ""
+ );
+
+ // write settings
+ if(Abort()) return false;
+ Progress::NextStage();
+ /* Error message */
+ if(false) Report::Error (_("Cannot write settings."));
+ sleep(sl);
+
+ // run SuSEconfig
+ if(Abort()) return false;
+ Progress::NextStage ();
+ /* Error message */
+ if(false) Report::Error (Message::SuSEConfigFailed());
+ sleep(sl);
+
+ if(Abort()) return false;
+ /* Progress finished */
+ Progress::NextStage();
+ sleep(sl);
+
+ if(Abort()) return false;
+ return true;
+}
+
+/**
+ * Get all auditd settings from the first parameter
+ * (For use by autoinstallation.)
+ * @param settings The YCP structure to be imported.
+ * @return boolean True on success
+ */
+global boolean Import (map settings) {
+ // TODO FIXME: your code here (fill the above mentioned variables)...
+ return true;
+}
+
+/**
+ * Dump the auditd settings to a single map
+ * (For use by autoinstallation.)
+ * @return map Dumped settings (later acceptable by Import ())
+ */
+global map Export () {
+ // TODO FIXME: your code here (return the above mentioned variables)...
+ return $[];
+}
+
+/**
+ * Create a textual summary and a list of unconfigured cards
+ * @return summary of the current configuration
+ */
+global list Summary() {
+ // TODO FIXME: your code here...
+ /* Configuration summary text for autoyast */
+ return [ _("Configuration summary..."), [] ];
+}
+
+/**
+ * Create an overview table with all configured cards
+ * @return table items
+ */
+global list Overview() {
+ // TODO FIXME: your code here...
+ return [];
+}
+
+/**
+ * Return packages needed to be installed and removed during
+ * Autoinstallation to insure module has all needed software
+ * installed.
+ * @return map with 2 lists.
+ */
+global map AutoPackages() {
+ // TODO FIXME: your code here...
+ return $[ "install":[], "remove":[] ];
+}
+
+/* EOF */
+}
Added: trunk/auditd/src/Auditd2.pm
URL: http://svn.opensuse.org/viewcvs/yast/trunk/auditd/src/Auditd2.pm?rev=49397&view=auto
==============================================================================
--- trunk/auditd/src/Auditd2.pm (added)
+++ trunk/auditd/src/Auditd2.pm Thu Jul 24 18:51:36 2008
@@ -0,0 +1,326 @@
+#! /usr/bin/perl -w
+
+# ------------------------------------------------------------------------------
+# Copyright (c) 2006 Novell, Inc. All Rights Reserved.
+#
+#
+# This program is free software; you can redistribute it and/or modify it under
+# the terms of version 2 of the GNU General Public License as published by the
+# Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along with
+# this program; if not, contact Novell, Inc.
+#
+# To contact Novell about this file by physical or electronic mail, you may find
+# current contact information at www.novell.com.
+# ------------------------------------------------------------------------------
+
+# File: modules/Auditd.pm
+# Package: Configuration of auditd
+# Summary: Auditd settings, input and output functions
+# Authors: Gabriele Mohr
+#
+# $Id: Auditd2.pm 41350 2007-10-10 16:59:00Z dfiser $
+#
+# Representation of the configuration of auditd.
+# Input and output routines.
+
+
+package Auditd;
+
+use strict;
+
+use YaST::YCP qw(Boolean :LOGGING);
+use YaPI;
+
+textdomain("auditd");
+
+our %TYPEINFO;
+
+YaST::YCP::Import ("Progress");
+YaST::YCP::Import ("Report");
+YaST::YCP::Import ("Summary");
+YaST::YCP::Import ("Message");
+
+##
+ # Data was modified?
+ #
+my $modified = 0;
+
+##
+ #
+my $proposal_valid = 0;
+
+##
+ # Write only, used during autoinstallation.
+ # Don't run services and SuSEconfig, it's all done at one place.
+ #
+my $write_only = 0;
+
+##
+ # Data was modified?
+ # @return true if modified
+ #
+BEGIN { $TYPEINFO {Modified} = ["function", "boolean"]; }
+sub Modified {
+ y2debug ("modified=$modified");
+ return Boolean($modified);
+}
+
+##
+ # Mark as modified, for Autoyast.
+ #
+BEGIN { $TYPEINFO {SetModified} = ["function", "void", "boolean" ]; }
+sub SetModified {
+ my $value = $_[1];
+ $modified = $value;
+}
+
+BEGIN { $TYPEINFO {ProposalValid} = ["function", "boolean"]; }
+sub ProposalValid {
+ return Boolean($proposal_valid);
+}
+
+BEGIN { $TYPEINFO {SetProposalValid} = ["function", "void", "boolean" ]; }
+sub SetProposalValid{
+ my $value = $_[1];
+ $proposal_valid = $value;
+}
+
+BEGIN { $TYPEINFO {WriteOnly} = ["function", "boolean"]; }
+sub WriteOnly {
+ return Boolean($write_only);
+}
+
+BEGIN { $TYPEINFO {SetWriteOnly} = ["function", "void", "boolean" ]; }
+sub SetWriteOnly{
+ my $value = $_[1];
+ $write_only = $value;
+}
+
+
+# Settings: Define all variables needed for configuration of auditd
+# TODO FIXME: Define all the variables necessary to hold
+# TODO FIXME: the configuration here (with the appropriate
+# TODO FIXME: description)
+# TODO FIXME: For example:
+# ##
+# # List of the configured cards.
+# #
+# my @cards = ();
+#
+# ##
+# # Some additional parameter needed for the configuration.
+# #
+# my $additional_parameter = 1;
+
+##
+ # Read all auditd settings
+ # @return true on success
+ #
+BEGIN { $TYPEINFO{Read} = ["function", "boolean"]; }
+sub Read {
+
+ # Auditd read dialog caption
+ my $caption = __("Initializing auditd Configuration");
+
+ # TODO FIXME Set the right number of stages
+ my $steps = 4;
+
+ my $sl = 0.5;
+ sleep($sl);
+
+ # TODO FIXME Names of real stages
+ # We do not set help text here, because it was set outside
+ Progress->New( $caption, " ", $steps, [
+ # Progress stage 1/3
+ __("Read the database"),
+ # Progress stage 2/3
+ __("Read the previous settings"),
+ # Progress stage 3/3
+ __("Detect the devices")
+ ], [
+ # Progress step 1/3
+ __("Reading the database..."),
+ # Progress step 2/3
+ __("Reading the previous settings..."),
+ # Progress step 3/3
+ __("Detecting the devices..."),
+ # Progress finished
+ __("Finished")
+ ],
+ ""
+ );
+
+ # read database
+ Progress->NextStage();
+ # Error message
+ if(0)
+ {
+ Report->Error(__("Cannot read the database1."));
+ }
+ sleep($sl);
+
+ # read another database
+ Progress->NextStep();
+ # Error message
+ if(0)
+ {
+ Report->Error(__("Cannot read the database2."));
+ }
+ sleep($sl);
+
+ # read current settings
+ Progress->NextStage();
+ # Error message
+ if(0)
+ {
+ Report->Error(Message->CannotReadCurrentSettings());
+ }
+ sleep($sl);
+
+ # detect devices
+ Progress->NextStage();
+ # Error message
+ if(0)
+ {
+ Report->Warning(__("Cannot detect devices."));
+ }
+ sleep($sl);
+
+ # Progress finished
+ Progress->NextStage();
+ sleep($sl);
+
+ $modified = 0;
+ return Boolean(1);
+}
+
+##
+ # Write all auditd settings
+ # @return true on success
+ #
+BEGIN { $TYPEINFO{Write} = ["function", "boolean"]; }
+sub Write {
+
+ # Auditd read dialog caption
+ my $caption = __("Saving auditd Configuration");
+
+ # TODO FIXME And set the right number of stages
+ my $steps = 2;
+
+ my $sl = 0.5;
+ sleep($sl);
+
+ # TODO FIXME Names of real stages
+ # We do not set help text here, because it was set outside
+ Progress->New($caption, " ", $steps, [
+ # Progress stage 1/2
+ __("Write the settings"),
+ # Progress stage 2/2
+ __("Run SuSEconfig")
+ ], [
+ # Progress step 1/2
+ __("Writing the settings..."),
+ # Progress step 2/2
+ __("Running SuSEconfig..."),
+ # Progress finished
+ __("Finished")
+ ],
+ ""
+ );
+
+ # write settings
+ Progress->NextStage();
+ # Error message
+ if(0)
+ {
+ Report->Error (__("Cannot write settings."));
+ }
+ sleep($sl);
+
+ # run SuSEconfig
+ Progress->NextStage ();
+ # Error message
+ if(0)
+ {
+ Report->Error (Message->SuSEConfigFailed());
+ }
+ sleep($sl);
+
+ # Progress finished
+ Progress->NextStage();
+ sleep($sl);
+
+ return Boolean(1);
+}
+
+##
+ # Get all auditd settings from the first parameter
+ # (For use by autoinstallation.)
+ # @param settings The YCP structure to be imported.
+ # @return boolean True on success
+ #
+BEGIN { $TYPEINFO{Import} = ["function", "boolean", [ "map", "any", "any" ] ]; }
+sub Import {
+ my %settings = %{$_[0]};
+ # TODO FIXME: your code here (fill the above mentioned variables)...
+ return Boolean(1);
+}
+
+##
+ # Dump the auditd settings to a single map
+ # (For use by autoinstallation.)
+ # @return map Dumped settings (later acceptable by Import ())
+ #
+BEGIN { $TYPEINFO{Export} =["function", [ "map", "any", "any" ] ]; }
+sub Export {
+ # TODO FIXME: your code here (return the above mentioned variables)...
+ return {};
+}
+
+##
+ # Create a textual summary and a list of unconfigured cards
+ # @return summary of the current configuration
+ #
+BEGIN { $TYPEINFO{Summary} = ["function", [ "list", "string" ] ]; }
+sub Summary {
+ # TODO FIXME: your code here...
+ # Configuration summary text for autoyast
+ return (
+ __("Configuration summary ...")
+ );
+}
+
+##
+ # Create an overview table with all configured cards
+ # @return table items
+ #
+BEGIN { $TYPEINFO{Overview} = ["function", [ "list", "string" ] ]; }
+sub Overview {
+ # TODO FIXME: your code here...
+ return ();
+}
+
+##
+ # Return packages needed to be installed and removed during
+ # Autoinstallation to insure module has all needed software
+ # installed.
+ # @return map with 2 lists.
+ #
+BEGIN { $TYPEINFO{AutoPackages} = ["function", ["map", "string", ["list", "string"]]]; }
+sub AutoPackages {
+ # TODO FIXME: your code here...
+ my %ret = (
+ "install" => (),
+ "remove" => (),
+ );
+ return \%ret;
+}
+
+1;
+# EOF
Added: trunk/auditd/src/Auditd3.py
URL: http://svn.opensuse.org/viewcvs/yast/trunk/auditd/src/Auditd3.py?rev=49397&view=auto
==============================================================================
--- trunk/auditd/src/Auditd3.py (added)
+++ trunk/auditd/src/Auditd3.py Thu Jul 24 18:51:36 2008
@@ -0,0 +1,301 @@
+#!/usr/bin/env python
+
+# ------------------------------------------------------------------------------
+# Copyright (c) 2006 Novell, Inc. All Rights Reserved.
+#
+#
+# This program is free software; you can redistribute it and/or modify it under
+# the terms of version 2 of the GNU General Public License as published by the
+# Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along with
+# this program; if not, contact Novell, Inc.
+#
+# To contact Novell about this file by physical or electronic mail, you may find
+# current contact information at www.novell.com.
+# ------------------------------------------------------------------------------
+
+# File: modules/Auditd3.py
+# Package: Configuration of auditd
+# Summary: Auditd settings, input and output functions
+# Authors: Gabriele Mohr
+#
+# $Id: Auditd3.py 27914 2006-02-13 14:32:08Z locilka $
+#
+# Representation of the configuration of auditd.
+# Input and output routines.
+
+
+from time import sleep
+from YCPDeclarations import YCPDeclare
+import ycp
+from ycp import Term, Symbol, Path
+from ycp import y2internal, y2security, y2error, y2warning, y2milestone, y2debug
+
+##
+ # Set textdomain
+ #
+import gettext
+gettext.install("auditd")
+
+ycp.import_module("Progress")
+ycp.import_module("Report")
+ycp.import_module("Summary")
+ycp.import_module("Message")
+
+##
+ # Data was modified?
+ #
+modified = False
+
+##
+ #
+proposal_valid = False
+
+##
+ # Write only, used during autoinstallation.
+ # Don't run services and SuSEconfig, it's all done at one place.
+ #
+write_only = False
+
+##
+ # Data was modified?
+ # @return true if modified
+ #
+@YCPDeclare("boolean")
+def Modified():
+ global modified
+ y2debug ("modified=%d" % (modified));
+ return modified
+
+##
+ # Mark as modified, for Autoyast.
+ #
+@YCPDeclare("void", "boolean")
+def SetModified(value):
+ global modified
+ modified = value
+
+@YCPDeclare("boolean")
+def ProposalValid():
+ global proposal_valid
+ return proposal_valid
+
+@YCPDeclare("void", "boolean")
+def SetProposalValid(value):
+ global proposal_valid
+ proposal_valid = value
+
+@YCPDeclare("boolean")
+def WriteOnly():
+ global write_only
+ return write_only
+
+@YCPDeclare("void", "boolean")
+def SetWriteOnly(value):
+ global write_only
+ write_only = value
+
+
+# Settings: Define all variables needed for configuration of auditd
+# TODO FIXME: Define all the variables necessary to hold
+# TODO FIXME: the configuration here (with the appropriate
+# TODO FIXME: description)
+# TODO FIXME: For example:
+# ##
+# # List of the configured cards.
+# #
+# cards = []
+#
+# ##
+# # Some additional parameter needed for the configuration.
+# #
+# additional_parameter = 1
+
+##
+ # Read all auditd settings
+ # @return true on success
+ #
+@YCPDeclare("boolean")
+def Read():
+ global modified
+
+ # Auditd read dialog caption
+ caption = _("Initializing auditd Configuration")
+
+ # TODO FIXME Set the right number of stages
+ steps = 4
+
+ sl = 0.5
+ sleep(sl)
+
+ # TODO FIXME Names of real stages
+ # We do not set help text here, because it was set outside
+ ycp.Progress.New(caption, " ", steps, [
+ # Progress stage 1/3
+ _("Read the database"),
+ # Progress stage 2/3
+ _("Read the previous settings"),
+ # Progress stage 3/3
+ _("Detect the devices")
+ ], [
+ # Progress step 1/3
+ _("Reading the database..."),
+ # Progress step 2/3
+ _("Reading the previous settings..."),
+ # Progress step 3/3
+ _("Detecting the devices..."),
+ # Progress finished
+ _("Finished")
+ ],
+ ""
+ )
+
+ # read database
+ ycp.Progress.NextStage();
+ # Error message
+ if False:
+ ycp.Report.Error(_("Cannot read the database1."))
+ sleep(sl)
+
+ # read another database
+ ycp.Progress.NextStep()
+ # Error message
+ if False:
+ ycp.Report.Error(_("Cannot read the database2."))
+ sleep(sl)
+
+ # read current settings
+ ycp.Progress.NextStage()
+ # Error message
+ if False:
+ ycp.Report.Error(ycp.Message.CannotReadCurrentSettings())
+ sleep(sl)
+
+ # detect devices
+ ycp.Progress.NextStage()
+ # Error message
+ if False:
+ ycp.Report.Warning(_("Cannot detect devices."))
+ sleep(sl)
+
+ # Progress finished
+ ycp.Progress.NextStage()
+ sleep(sl)
+
+ modified = False
+
+ return True
+
+##
+ # Write all auditd settings
+ # @return true on success
+ #
+@YCPDeclare("boolean")
+def Write():
+ # Auditd read dialog caption
+ caption = _("Saving auditd Configuration")
+
+ # TODO FIXME And set the right number of stages
+ steps = 2
+
+ sl = 0.5
+ sleep(sl)
+
+ # TODO FIXME Names of real stages
+ # We do not set help text here, because it was set outside
+ ycp.Progress.New(caption, " ", steps, [
+ # Progress stage 1/2
+ _("Write the settings"),
+ # Progress stage 2/2
+ _("Run SuSEconfig")
+ ], [
+ # Progress step 1/2
+ _("Writing the settings..."),
+ # Progress step 2/2
+ _("Running SuSEconfig..."),
+ # Progress finished
+ _("Finished")
+ ],
+ ""
+ )
+
+ # write settings
+ ycp.Progress.NextStage()
+ # Error message
+ if False:
+ ycp.Report.Error (_("Cannot write settings."))
+ sleep(sl)
+
+ # run SuSEconfig
+ ycp.Progress.NextStage()
+ # Error message
+ if False:
+ ycp.Report.Error(ycp.Message.SuSEConfigFailed())
+ sleep(sl)
+
+ # Progress finished
+ ycp.Progress.NextStage()
+ sleep(sl)
+
+ return True
+
+##
+ # Get all auditd settings from the first parameter
+ # (For use by autoinstallation.)
+ # @param settings The YCP structure to be imported.
+ # @return boolean True on success
+ #
+@YCPDeclare("boolean", "map")
+def Import(map_settings):
+ # TODO FIXME: your code here (fill the above mentioned variables)...
+ return True
+
+##
+ # Dump the auditd settings to a single map
+ # (For use by autoinstallation.)
+ # @return map Dumped settings (later acceptable by Import ())
+ #
+@YCPDeclare("map")
+def Export():
+ # TODO FIXME: your code here (return the above mentioned variables)...
+ return {}
+
+##
+ # Create a textual summary and a list of unconfigured cards
+ # @return summary of the current configuration
+ #
+@YCPDeclare("list")
+def Summary():
+ # TODO FIXME: your code here...
+ # Configuration summary text for autoyast
+ return [ _("Configuration summary ...") ]
+
+##
+ # Create an overview table with all configured cards
+ # @return table items
+ #
+@YCPDeclare("list")
+def Overview():
+ # TODO FIXME: your code here...
+ return []
+
+##
+ # Return packages needed to be installed and removed during
+ # Autoinstallation to insure module has all needed software
+ # installed.
+ # @return map with 2 lists.
+ #
+@YCPDeclare("map")
+def AutoPackages():
+ # TODO FIXME: your code here...
+ return {
+ "install" : [],
+ "remove" : []
+ }
+
+# EOF
Added: trunk/auditd/src/Makefile.am
URL: http://svn.opensuse.org/viewcvs/yast/trunk/auditd/src/Makefile.am?rev=49397&view=auto
==============================================================================
--- trunk/auditd/src/Makefile.am (added)
+++ trunk/auditd/src/Makefile.am Thu Jul 24 18:51:36 2008
@@ -0,0 +1,31 @@
+# Makefile.am for auditd/src
+
+yncludedir = @yncludedir@/auditd
+
+client_DATA = \
+ auditd.ycp \
+ auditd_auto.ycp \
+ auditd_proposal.ycp
+
+ynclude_DATA = \
+ helps.ycp \
+ wizards.ycp \
+ dialogs.ycp \
+ complex.ycp
+
+desktop_DATA = \
+ auditd.desktop
+
+module_DATA = \
+ Auditd.ycp \
+ Auditd2.pm \
+ Auditd3.py
+
+# create a symlink for local build, #145327
+auditd:
+ ln -sf . $@
+ycpchook = auditd
+
+EXTRA_DIST = $(client_DATA) $(ynclude_DATA) $(module_DATA) $(desktop_DATA)
+
+include $(top_srcdir)/Makefile.am.common
Added: trunk/auditd/src/auditd.desktop
URL: http://svn.opensuse.org/viewcvs/yast/trunk/auditd/src/auditd.desktop?rev=49397&view=auto
==============================================================================
--- trunk/auditd/src/auditd.desktop (added)
+++ trunk/auditd/src/auditd.desktop Thu Jul 24 18:51:36 2008
@@ -0,0 +1,25 @@
+[Desktop Entry]
+Type=Application
+Categories=Settings;System;Qt;X-SuSE-YaST;X-SuSE-YaST-Misc;
+
+X-KDE-ModuleType=Library
+X-KDE-RootOnly=true
+X-KDE-HasReadOnlyMode=true
+X-KDE-Library=yast2
+X-SuSE-YaST-Call=auditd
+
+X-SuSE-YaST-Group=Misc
+X-SuSE-YaST-Argument=
+X-SuSE-YaST-RootOnly=true
+X-SuSE-YaST-AutoInst=
+X-SuSE-YaST-Geometry=
+X-SuSE-YaST-SortKey=
+X-SuSE-YaST-AutoInstResource=auditd
+
+Icon=yast-auditd
+Exec=/sbin/yast2 auditd
+
+Name=Auditd
+GenericName=auditd
+X-KDE-SubstituteUID=true
+StartupNotify=true
Added: trunk/auditd/src/auditd.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/auditd/src/auditd.ycp?rev=49397&view=auto
==============================================================================
--- trunk/auditd/src/auditd.ycp (added)
+++ trunk/auditd/src/auditd.ycp Thu Jul 24 18:51:36 2008
@@ -0,0 +1,93 @@
+/* ------------------------------------------------------------------------------
+ * Copyright (c) 2006 Novell, Inc. All Rights Reserved.
+ *
+ *
+ * This program is free software; you can redistribute it and/or modify it under
+ * the terms of version 2 of the GNU General Public License as published by the
+ * Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, contact Novell, Inc.
+ *
+ * To contact Novell about this file by physical or electronic mail, you may find
+ * current contact information at www.novell.com.
+ * ------------------------------------------------------------------------------
+ */
+
+/**
+ * File: clients/auditd.ycp
+ * Package: Configuration of auditd
+ * Summary: Main file
+ * Authors: Gabriele Mohr
+ *
+ * $Id: auditd.ycp 27914 2006-02-13 14:32:08Z locilka $
+ *
+ * Main file for auditd configuration. Uses all other files.
+ */
+
+{
+
+/***
+ * <h3>Configuration of auditd</h3>
+ */
+
+textdomain "auditd";
+
+/* The main () */
+y2milestone ("----------------------------------------");
+y2milestone ("Auditd module started");
+
+import "Progress";
+import "Report";
+import "Summary";
+
+import "CommandLine";
+include "auditd/wizards.ycp";
+
+map cmdline_description = $[
+ "id" : "auditd",
+ /* Command line help text for the Xauditd module */
+ "help" : _("Configuration of auditd"),
+ "guihandler" : AuditdSequence,
+ "initialize" : Auditd::Read,
+ "finish" : Auditd::Write,
+ "actions" : $[
+ // FIXME TODO: fill the functionality description here
+ ],
+ "options" : $[
+ // FIXME TODO: fill the option descriptions here
+ ],
+ "mappings" : $[
+ // FIXME TODO: fill the mappings of actions and options here
+ ]
+];
+
+/* is this proposal or not? */
+boolean propose = false;
+list args = WFM::Args();
+if(size(args) > 0) {
+ if(is(WFM::Args(0), path) && WFM::Args(0) == .propose) {
+ y2milestone("Using PROPOSE mode");
+ propose = true;
+ }
+}
+
+/* main ui function */
+any ret = nil;
+
+if(propose) ret = AuditdAutoSequence();
+else ret = CommandLine::Run(cmdline_description);
+y2debug("ret=%1", ret);
+
+/* Finish */
+y2milestone("Auditd module finished");
+y2milestone("----------------------------------------");
+
+return ret;
+
+/* EOF */
+}
Added: trunk/auditd/src/auditd_auto.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/auditd/src/auditd_auto.ycp?rev=49397&view=auto
==============================================================================
--- trunk/auditd/src/auditd_auto.ycp (added)
+++ trunk/auditd/src/auditd_auto.ycp Thu Jul 24 18:51:36 2008
@@ -0,0 +1,134 @@
+/* ------------------------------------------------------------------------------
+ * Copyright (c) 2006 Novell, Inc. All Rights Reserved.
+ *
+ *
+ * This program is free software; you can redistribute it and/or modify it under
+ * the terms of version 2 of the GNU General Public License as published by the
+ * Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, contact Novell, Inc.
+ *
+ * To contact Novell about this file by physical or electronic mail, you may find
+ * current contact information at www.novell.com.
+ * ------------------------------------------------------------------------------
+ */
+
+/**
+ * File: clients/auditd_auto.ycp
+ * Package: Configuration of auditd
+ * Summary: Client for autoinstallation
+ * Authors: Gabriele Mohr
+ *
+ * $Id: auditd_auto.ycp 41350 2007-10-10 16:59:00Z dfiser $
+ *
+ * This is a client for autoinstallation. It takes its arguments,
+ * goes through the configuration and return the setting.
+ * Does not do any changes to the configuration.
+ */
+
+/**
+ * @param function to execute
+ * @param map/list of auditd settings
+ * @return map edited settings, Summary or boolean on success depending on called function
+ * @example map mm = $[ "FAIL_DELAY" : "77" ];
+ * @example map ret = WFM::CallFunction ("auditd_auto", [ "Summary", mm ]);
+ */
+
+{
+
+textdomain "auditd";
+
+y2milestone("----------------------------------------");
+y2milestone("Auditd auto started");
+
+import "Auditd";
+include "auditd/wizards.ycp";
+
+any ret = nil;
+string func = "";
+map param = $[];
+
+/* Check arguments */
+if(size(WFM::Args()) > 0 && is(WFM::Args(0), string)) {
+ func = (string)WFM::Args(0);
+ if(size(WFM::Args()) > 1 && is(WFM::Args(1), map))
+ param = (map) WFM::Args(1);
+}
+y2debug("func=%1", func);
+y2debug("param=%1", param);
+
+/* Create a summary*/
+if(func == "Summary") {
+ ret = select(Auditd::Summary(), 0, "");
+}
+/* Reset configuration */
+else if (func == "Reset") {
+ Auditd::Import($[]);
+ ret = $[];
+}
+/* Change configuration (run AutoSequence) */
+else if (func == "Change") {
+ ret = AuditdAutoSequence();
+}
+/* Import configuration */
+else if (func == "Import") {
+ ret = Auditd::Import(param);
+}
+/* Return actual state */
+else if (func == "Export") {
+ ret = Auditd::Export();
+}
+/* Return needed packages */
+else if (func == "Packages") {
+ ret = Auditd::AutoPackages();
+}
+/* Read current state */
+else if (func == "Read") {
+ import "Progress";
+ boolean progress_orig = Progress::set (false);
+ ret = Auditd::Read();
+ Progress::set (progress_orig);
+}
+/* Write givven settings */
+else if (func == "Write") {
+ import "Progress";
+ boolean progress_orig = Progress::set (false);
+ Auditd::SetWriteOnly (true);
+ ret = Auditd::Write();
+ Progress::set (progress_orig);
+}
+/**
+ * did configuration changed
+ * return boolean
+ */
+else if (func == "GetModified") {
+ ret = Auditd::Modified ();
+}
+/**
+ * set configuration as changed
+ * return boolean
+ */
+else if (func == "SetModified") {
+ Auditd::SetModified (true);
+ ret = true;
+}
+
+/* Unknown function */
+else {
+ y2error("Unknown function: %1", func);
+ ret = false;
+}
+
+y2debug("ret=%1", ret);
+y2milestone("Auditd auto finished");
+y2milestone("----------------------------------------");
+
+return ret;
+
+/* EOF */
+}
Added: trunk/auditd/src/auditd_proposal.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/auditd/src/auditd_proposal.ycp?rev=49397&view=auto
==============================================================================
--- trunk/auditd/src/auditd_proposal.ycp (added)
+++ trunk/auditd/src/auditd_proposal.ycp Thu Jul 24 18:51:36 2008
@@ -0,0 +1,107 @@
+/* ------------------------------------------------------------------------------
+ * Copyright (c) 2006 Novell, Inc. All Rights Reserved.
+ *
+ *
+ * This program is free software; you can redistribute it and/or modify it under
+ * the terms of version 2 of the GNU General Public License as published by the
+ * Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, contact Novell, Inc.
+ *
+ * To contact Novell about this file by physical or electronic mail, you may find
+ * current contact information at www.novell.com.
+ * ------------------------------------------------------------------------------
+ */
+
+/**
+ * File: clients/auditd_proposal.ycp
+ * Package: Configuration of auditd
+ * Summary: Proposal function dispatcher.
+ * Authors: Gabriele Mohr
+ *
+ * $Id: auditd_proposal.ycp 41350 2007-10-10 16:59:00Z dfiser $
+ *
+ * Proposal function dispatcher for auditd configuration.
+ * See source/installation/proposal/proposal-API.txt
+ */
+
+{
+
+textdomain "auditd";
+
+import "Auditd";
+import "Progress";
+
+/* The main () */
+y2milestone("----------------------------------------");
+y2milestone("Auditd proposal started");
+
+string func = (string) WFM::Args(0);
+map param = (map) WFM::Args(1);
+map ret = $[];
+
+/* create a textual proposal */
+if(func == "MakeProposal") {
+ string proposal = "";
+ string warning = nil;
+ symbol warning_level = nil;
+ boolean force_reset = param["force_reset"]:false;
+
+ if(force_reset || !Auditd::ProposalValid()) {
+ Auditd::SetProposalValid (true);
+ boolean progress_orig = Progress::set (false);
+ Auditd::Read();
+ Progress::set (progress_orig);
+ }
+ list sum = Auditd::Summary();
+ proposal = sum[0]:"";
+
+ ret = $[
+ "preformatted_proposal" : proposal,
+ "warning_level" : warning_level,
+ "warning" : warning,
+ ];
+}
+/* run the module */
+else if(func == "AskUser") {
+ map stored = Auditd::Export();
+ symbol seq = (symbol) WFM::CallFunction("auditd", [.propose]);
+ if(seq != `next) Auditd::Import(stored);
+ y2debug("stored=%1",stored);
+ y2debug("seq=%1",seq);
+ ret = $[
+ "workflow_sequence" : seq
+ ];
+}
+/* create titles */
+else if(func == "Description") {
+ ret = $[
+ /* Rich text title for Auditd in proposals */
+ "rich_text_title" : _("Auditd"),
+ /* Menu title for Auditd in proposals */
+ "menu_title" : _("&Auditd"),
+ "id" : "auditd",
+ ];
+}
+/* write the proposal */
+else if(func == "Write") {
+ Auditd::Write();
+}
+/* unknown function */
+else {
+ y2error("unknown function: %1", func);
+}
+
+/* Finish */
+y2debug("ret=%1",ret);
+y2milestone("Auditd proposal finished");
+y2milestone("----------------------------------------");
+return ret;
+
+/* EOF */
+}
Added: trunk/auditd/src/complex.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/auditd/src/complex.ycp?rev=49397&view=auto
==============================================================================
--- trunk/auditd/src/complex.ycp (added)
+++ trunk/auditd/src/complex.ycp Thu Jul 24 18:51:36 2008
@@ -0,0 +1,205 @@
+/* ------------------------------------------------------------------------------
+ * Copyright (c) 2006 Novell, Inc. All Rights Reserved.
+ *
+ *
+ * This program is free software; you can redistribute it and/or modify it under
+ * the terms of version 2 of the GNU General Public License as published by the
+ * Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, contact Novell, Inc.
+ *
+ * To contact Novell about this file by physical or electronic mail, you may find
+ * current contact information at www.novell.com.
+ * ------------------------------------------------------------------------------
+ */
+
+/**
+ * File: include/auditd/complex.ycp
+ * Package: Configuration of auditd
+ * Summary: Dialogs definitions
+ * Authors: Gabriele Mohr
+ *
+ * $Id: complex.ycp 41350 2007-10-10 16:59:00Z dfiser $
+ */
+
+{
+
+textdomain "auditd";
+
+import "Label";
+import "Popup";
+import "Wizard";
+import "Wizard_hw";
+import "Confirm";
+import "Auditd";
+
+
+include "auditd/helps.ycp";
+
+/**
+ * Return a modification status
+ * @return true if data was modified
+ */
+boolean Modified() {
+ return Auditd::Modified();
+}
+
+boolean ReallyAbort() {
+ return !Auditd::Modified() || Popup::ReallyAbort(true);
+}
+
+boolean PollAbort() {
+ return UI::PollInput() == `abort;
+}
+
+/**
+ * Read settings dialog
+ * @return `abort if aborted and `next otherwise
+ */
+symbol ReadDialog() {
+ Wizard::RestoreHelp(HELPS["read"]:"");
+ // Auditd::SetAbortFunction(PollAbort);
+ if (!Confirm::MustBeRoot()) return `abort;
+ boolean ret = Auditd::Read();
+ return ret ? `next : `abort;
+}
+
+/**
+ * Write settings dialog
+ * @return `abort if aborted and `next otherwise
+ */
+symbol WriteDialog() {
+ Wizard::RestoreHelp(HELPS["write"]:"");
+ // Auditd::SetAbortFunction(PollAbort);
+ boolean ret = Auditd::Write();
+ return ret ? `next : `abort;
+}
+
+/**
+ * Summary dialog
+ * @return dialog result
+ */
+any SummaryDialog() {
+
+ /* Auditd summary dialog caption */
+ string caption = _("Auditd Configuration");
+
+ /* FIXME */
+ list summary = Auditd::Summary();
+ list unconfigured = summary[1]:[];
+ string configured = summary[0]:"";
+
+ /* Frame label */
+ term contents = Wizard_hw::DetectedContent(_("Auditd to Configure"),
+ unconfigured, false, configured);
+
+ Wizard::SetContentsButtons(caption, contents, HELPS["summary"]:"",
+ Label::BackButton(), Label::FinishButton());
+
+ any ret = nil;
+ while(true) {
+
+ ret = UI::UserInput();
+
+ /* abort? */
+ if(ret == `abort || ret == `cancel || ret == `back) {
+ if(ReallyAbort()) break;
+ else continue;
+ }
+ /* overview dialog */
+ else if(ret == `edit_button) {
+ ret = `overview;
+ break;
+ }
+ /* configure the selected device */
+ else if(ret == `configure_button) {
+ // TODO FIXME: check for change of the configuration
+ any selected = UI::QueryWidget(`id(`detected_selbox), `CurrentItem);
+ if(selected == `other) {
+ ret = `other;
+ }
+ else {
+ ret = `configure;
+ }
+ break;
+ }
+ else if(ret == `next) {
+ break;
+ }
+ else {
+ y2error("unexpected retcode: %1", ret);
+ continue;
+ }
+ }
+
+ return ret;
+}
+
+/**
+ * Overview dialog
+ * @return dialog result
+ */
+any OverviewDialog() {
+
+ /* Auditd overview dialog caption */
+ string caption = _("Auditd Overview");
+
+ list overview = Auditd::Overview();
+
+ /* FIXME table header */
+ term contents = Wizard_hw::ConfiguredContent(
+ /* Table header */
+ `header(_("Number"), _("Auditd")),
+ overview, nil, nil, nil, nil );
+
+ contents = Wizard_hw::SpacingAround(contents, 1.5, 1.5, 1.0, 1.0);
+
+ Wizard::SetContentsButtons(caption, contents, HELPS["overview"]:"",
+ Label::BackButton(), Label::FinishButton());
+
+ any ret = nil;
+ while(true) {
+
+ ret = UI::UserInput();
+
+ /* abort? */
+ if(ret == `abort || ret == `cancel) {
+ if(ReallyAbort()) break;
+ else continue;
+ }
+ /* add */
+ else if(ret == `add_button) {
+ /* FIXME */
+ ret = `add;
+ break;
+ }
+ /* edit */
+ else if(ret == `edit_button) {
+ /* FIXME */
+ ret = `edit;
+ break;
+ }
+ /* delete */
+ else if(ret == `delete_button) {
+ /* FIXME */
+ continue;
+ }
+ else if(ret == `next || ret == `back) {
+ break;
+ }
+ else {
+ y2error("unexpected retcode: %1", ret);
+ continue;
+ }
+ }
+
+ return ret;
+}
+
+/* EOF */
+}
Added: trunk/auditd/src/dialogs.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/auditd/src/dialogs.ycp?rev=49397&view=auto
==============================================================================
--- trunk/auditd/src/dialogs.ycp (added)
+++ trunk/auditd/src/dialogs.ycp Thu Jul 24 18:51:36 2008
@@ -0,0 +1,115 @@
+/* ------------------------------------------------------------------------------
+ * Copyright (c) 2006 Novell, Inc. All Rights Reserved.
+ *
+ *
+ * This program is free software; you can redistribute it and/or modify it under
+ * the terms of version 2 of the GNU General Public License as published by the
+ * Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, contact Novell, Inc.
+ *
+ * To contact Novell about this file by physical or electronic mail, you may find
+ * current contact information at www.novell.com.
+ * ------------------------------------------------------------------------------
+ */
+
+/**
+ * File: include/auditd/dialogs.ycp
+ * Package: Configuration of auditd
+ * Summary: Dialogs definitions
+ * Authors: Gabriele Mohr
+ *
+ * $Id: dialogs.ycp 27914 2006-02-13 14:32:08Z locilka $
+ */
+
+{
+
+textdomain "auditd";
+
+import "Label";
+import "Wizard";
+import "Auditd";
+
+include "auditd/helps.ycp";
+
+/**
+ * Configure1 dialog
+ * @return dialog result
+ */
+any Configure1Dialog () {
+
+ /* Auditd configure1 dialog caption */
+ string caption = _("Auditd Configuration");
+
+ /* Auditd configure1 dialog contents */
+ term contents = `Label (_("First part of configuration of auditd"));
+
+ Wizard::SetContentsButtons(caption, contents, HELPS["c1"]:"",
+ Label::BackButton(), Label::NextButton());
+
+ any ret = nil;
+ while(true) {
+
+ ret = UI::UserInput();
+
+ /* abort? */
+ if(ret == `abort || ret == `cancel) {
+ if(ReallyAbort()) break;
+ else continue;
+ }
+ else if(ret == `next || ret == `back) {
+ break;
+ }
+ else {
+ y2error("unexpected retcode: %1", ret);
+ continue;
+ }
+ }
+
+ return ret;
+}
+
+/**
+ * Configure2 dialog
+ * @return dialog result
+ */
+any Configure2Dialog () {
+
+ /* Auditd configure2 dialog caption */
+ string caption = _("Auditd Configuration");
+
+ /* Auditd configure2 dialog contents */
+ term contents = `Label (_("Second part of configuration of auditd"));
+
+ Wizard::SetContentsButtons(caption, contents, HELPS["c2"]:"",
+ Label::BackButton(), Label::NextButton());
+
+ any ret = nil;
+ while(true) {
+
+ ret = UI::UserInput();
+
+ /* abort? */
+ if(ret == `abort || ret == `cancel) {
+ if(ReallyAbort()) break;
+ else continue;
+ }
+ else if(ret == `next || ret == `back) {
+ break;
+ }
+ else {
+ y2error("unexpected retcode: %1", ret);
+ continue;
+ }
+ }
+
+ return ret;
+}
+
+/* EOF */
+}
Added: trunk/auditd/src/helps.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/auditd/src/helps.ycp?rev=49397&view=auto
==============================================================================
--- trunk/auditd/src/helps.ycp (added)
+++ trunk/auditd/src/helps.ycp Thu Jul 24 18:51:36 2008
@@ -0,0 +1,119 @@
+/* ------------------------------------------------------------------------------
+ * Copyright (c) 2006 Novell, Inc. All Rights Reserved.
+ *
+ *
+ * This program is free software; you can redistribute it and/or modify it under
+ * the terms of version 2 of the GNU General Public License as published by the
+ * Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, contact Novell, Inc.
+ *
+ * To contact Novell about this file by physical or electronic mail, you may find
+ * current contact information at www.novell.com.
+ * ------------------------------------------------------------------------------
+ */
+
+/**
+ * File: include/auditd/helps.ycp
+ * Package: Configuration of auditd
+ * Summary: Help texts of all the dialogs
+ * Authors: Gabriele Mohr
+ *
+ * $Id: helps.ycp 27914 2006-02-13 14:32:08Z locilka $
+ */
+
+{
+
+textdomain "auditd";
+
+/**
+ * All helps are here
+ */
+map HELPS = $[
+
+ /* Read dialog help 1/2 */
+ "read" : _("<p><b><big>Initializing auditd Configuration</big></b><br>
+Please wait...<br></p>
+") +
+
+ /* Read dialog help 2/2 */
+ _("<p><b><big>Aborting Initialization:</big></b><br>
+Safely abort the configuration utility by pressing <b>Abort</b> now.</p>
+"),
+
+ /* Write dialog help 1/2 */
+ "write" : _("<p><b><big>Saving auditd Configuration</big></b><br>
+Please wait...<br></p>
+") +
+
+ /* Write dialog help 2/2 */
+_("<p><b><big>Aborting Saving:</big></b><br>
+Abort the save procedure by pressing <b>Abort</b>.
+An additional dialog informs whether it is safe to do so.
+</p>
+"),
+
+ /* Summary dialog help 1/3 */
+ "summary" : _("<p><b><big>Auditd Configuration</big></b><br>
+Configure auditd here.<br></p>
+") +
+
+ /* Summary dialog help 2/3 */
+ _("<p><b><big>Adding a auditd:</big></b><br>
+Choose an auditd from the list of detected auditds.
+If your auditd was not detected, use <b>Other (not detected)</b>.
+Then press <b>Configure</b>.</p>
+") +
+
+ /* Summary dialog help 3/3 */
+ _("<p><b><big>Editing or Deleting:</big></b><br>
+If you press <b>Edit</b>, an additional dialog in which to change
+the configuration opens.</p>
+"),
+
+ /* Ovreview dialog help 1/3 */
+ "overview" : _("<p><b><big>Auditd Configuration Overview</big></b><br>
+Obtain an overview of installed auditds. Additionally
+edit their configurations.<br></p>
+") +
+
+ /* Ovreview dialog help 2/3 */
+_("<p><b><big>Adding a auditd:</big></b><br>
+Press <b>Add</b> to configure a auditd.</p>") +
+
+ /* Ovreview dialog help 3/3 */
+_("<p><b><big>Editing or Deleting:</big></b><br>
+Choose a auditd to change or remove.
+Then press <b>Edit</b> or <b>Delete</b> as desired.</p>
+"),
+
+ /* Configure1 dialog help 1/2 */
+ "c1" : _("<p><b><big>Configuration Part One</big></b><br>
+Press <b>Next</b> to continue.
+<br></p>") +
+
+ /* Configure1 dialog help 2/2 */
+_("<p><b><big>Selecting Something</big></b><br>
+It is not possible. You must code it first. :-)
+</p>"),
+
+ /* Configure2 dialog help 1/2 */
+ "c2" : _("<p><b><big>Configuration Part Two</big></b><br>
+Press <b>Next</b> to continue.
+<br></p>
+") +
+
+ /* Configure2 dialog help 2/2 */
+_("<p><b><big>Selecting Something</big></b><br>
+It is not possible. You must code it first. :-)
+</p>"),
+
+];
+
+/* EOF */
+}
Added: trunk/auditd/src/wizards.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/auditd/src/wizards.ycp?rev=49397&view=auto
==============================================================================
--- trunk/auditd/src/wizards.ycp (added)
+++ trunk/auditd/src/wizards.ycp Thu Jul 24 18:51:36 2008
@@ -0,0 +1,177 @@
+/* ------------------------------------------------------------------------------
+ * Copyright (c) 2006 Novell, Inc. All Rights Reserved.
+ *
+ *
+ * This program is free software; you can redistribute it and/or modify it under
+ * the terms of version 2 of the GNU General Public License as published by the
+ * Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, contact Novell, Inc.
+ *
+ * To contact Novell about this file by physical or electronic mail, you may find
+ * current contact information at www.novell.com.
+ * ------------------------------------------------------------------------------
+ */
+
+/**
+ * File: include/auditd/wizards.ycp
+ * Package: Configuration of auditd
+ * Summary: Wizards definitions
+ * Authors: Gabriele Mohr
+ *
+ * $Id: wizards.ycp 27914 2006-02-13 14:32:08Z locilka $
+ */
+
+{
+
+textdomain "auditd";
+
+import "Sequencer";
+import "Wizard";
+
+include "auditd/complex.ycp";
+include "auditd/dialogs.ycp";
+
+/**
+ * Add a configuration of auditd
+ * @return sequence result
+ */
+any AddSequence() {
+
+ /* FIXME: adapt to your needs */
+ map aliases = $[
+ "config1" : ``(Configure1Dialog()),
+ "config2" : ``(Configure2Dialog()),
+ ];
+
+ /* FIXME: adapt to your needs */
+ map sequence = $[
+ "ws_start" : "config1",
+ "config1" : $[
+ `abort : `abort,
+ `next : "config2"
+ ],
+ "config2" : $[
+ `abort : `abort,
+ `next : `next
+ ]
+ ];
+
+ return Sequencer::Run(aliases, sequence);
+}
+
+/**
+ * Main workflow of the auditd configuration
+ * @return sequence result
+ */
+any MainSequence() {
+
+ /* FIXME: adapt to your needs */
+ map aliases = $[
+ "summary" : ``( SummaryDialog() ),
+ "overview" : ``( OverviewDialog() ),
+ "configure" : [ ``( AddSequence() ), true ],
+ "add" : [ ``( AddSequence() ), true ],
+ "edit" : [ ``( AddSequence() ), true ]
+ ];
+
+ /* FIXME: adapt to your needs */
+ map sequence = $[
+ "ws_start" : "summary",
+ "summary" : $[
+ `abort : `abort,
+ `next : `next,
+ `overview : "overview",
+ `configure : "configure",
+ `other : "configure",
+ ],
+ "overview" : $[
+ `abort : `abort,
+ `next : `next,
+ `add : "add",
+ `edit : "edit",
+ ],
+ "configure" : $[
+ `abort : `abort,
+ `next : "summary",
+ ],
+ "add" : $[
+ `abort : `abort,
+ `next : "overview",
+ ],
+ "edit" : $[
+ `abort : `abort,
+ `next : "overview",
+ ]
+ ];
+
+ any ret = Sequencer::Run(aliases, sequence);
+
+ return ret;
+}
+
+/**
+ * Whole configuration of auditd
+ * @return sequence result
+ */
+any AuditdSequence() {
+
+ map aliases = $[
+ "read" : [ ``( ReadDialog() ), true ],
+ "main" : ``( MainSequence() ),
+ "write" : [ ``( WriteDialog() ), true ]
+ ];
+
+ map sequence = $[
+ "ws_start" : "read",
+ "read" : $[
+ `abort : `abort,
+ `next : "main"
+ ],
+ "main" : $[
+ `abort : `abort,
+ `next : "write"
+ ],
+ "write" : $[
+ `abort : `abort,
+ `next : `next
+ ]
+ ];
+
+ Wizard::CreateDialog();
+
+ any ret = Sequencer::Run(aliases, sequence);
+
+ UI::CloseDialog();
+ return ret;
+}
+
+/**
+ * Whole configuration of auditd but without reading and writing.
+ * For use with autoinstallation.
+ * @return sequence result
+ */
+any AuditdAutoSequence() {
+
+ /* Initialization dialog caption */
+ string caption = _("Auditd Configuration");
+ /* Initialization dialog contents */
+ term contents = `Label(_("Initializing..."));
+
+ Wizard::CreateDialog();
+ Wizard::SetContentsButtons(caption, contents, "",
+ Label::BackButton(), Label::NextButton());
+
+ any ret = MainSequence();
+
+ UI::CloseDialog();
+ return ret;
+}
+
+/* EOF */
+}
Added: trunk/auditd/testsuite/.cvsignore
URL: http://svn.opensuse.org/viewcvs/yast/trunk/auditd/testsuite/.cvsignore?rev=49397&view=auto
==============================================================================
--- trunk/auditd/testsuite/.cvsignore (added)
+++ trunk/auditd/testsuite/.cvsignore Thu Jul 24 18:51:36 2008
@@ -0,0 +1,11 @@
+Makefile
+Makefile.in
+site.exp
+*.sum
+*.log
+tmp.out*
+tmp.err*
+tmp.log*
+config
+run
+*.test
Added: trunk/auditd/testsuite/Makefile.am
URL: http://svn.opensuse.org/viewcvs/yast/trunk/auditd/testsuite/Makefile.am?rev=49397&view=auto
==============================================================================
--- trunk/auditd/testsuite/Makefile.am (added)
+++ trunk/auditd/testsuite/Makefile.am Thu Jul 24 18:51:36 2008
@@ -0,0 +1,21 @@
+#
+# Makefile.am for .../testsuite
+#
+# Do not edit this file (Makefile.am) as it will be overwritten!
+#
+
+AUTOMAKE_OPTIONS = dejagnu
+EXTRA_DIST = $(wildcard tests/*.out) $(wildcard tests/*.err) $(wildcard tests/*.ycp) $(wildcard tests/*.yh)
+
+testsuite_prepare = @ydatadir@/testsuite/Makefile.testsuite
+
+all-local: $(testsuite_prepare)
+ make -f $(testsuite_prepare) RPMNAME=$(RPMNAME) srcdir=$(srcdir)
+
+clean-local: $(testsuite_prepare)
+ make -f $(testsuite_prepare) RPMNAME=$(RPMNAME) srcdir=$(srcdir) clean
+
+check-local: $(testsuite_prepare)
+ make -f $(testsuite_prepare) RPMNAME=$(RPMNAME) srcdir=$(srcdir) check
+
+# EOF
Added: trunk/auditd/testsuite/tests/.cvsignore
URL: http://svn.opensuse.org/viewcvs/yast/trunk/auditd/testsuite/tests/.cvsignore?rev=49397&view=auto
==============================================================================
(empty)
Added: trunk/auditd/testsuite/tests/Auditd.err
URL: http://svn.opensuse.org/viewcvs/yast/trunk/auditd/testsuite/tests/Auditd.err?rev=49397&view=auto
==============================================================================
(empty)
Added: trunk/auditd/testsuite/tests/Auditd.out
URL: http://svn.opensuse.org/viewcvs/yast/trunk/auditd/testsuite/tests/Auditd.out?rev=49397&view=auto
==============================================================================
--- trunk/auditd/testsuite/tests/Auditd.out (added)
+++ trunk/auditd/testsuite/tests/Auditd.out Thu Jul 24 18:51:36 2008
@@ -0,0 +1,2 @@
+Dump Auditd::Modified
+Return false
Added: trunk/auditd/testsuite/tests/Auditd.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/auditd/testsuite/tests/Auditd.ycp?rev=49397&view=auto
==============================================================================
--- trunk/auditd/testsuite/tests/Auditd.ycp (added)
+++ trunk/auditd/testsuite/tests/Auditd.ycp Thu Jul 24 18:51:36 2008
@@ -0,0 +1,13 @@
+{
+
+// testedfiles: Auditd.ycp
+
+include "testsuite.ycp";
+TESTSUITE_INIT([], nil);
+
+import "Auditd";
+
+DUMP("Auditd::Modified");
+TEST(``(Auditd::Modified()), [], nil);
+
+}
Added: trunk/auditd/yast2-auditd.spec.in
URL: http://svn.opensuse.org/viewcvs/yast/trunk/auditd/yast2-auditd.spec.in?rev=49397&view=auto
==============================================================================
--- trunk/auditd/yast2-auditd.spec.in (added)
+++ trunk/auditd/yast2-auditd.spec.in Thu Jul 24 18:51:36 2008
@@ -0,0 +1,31 @@
+@HEADER-COMMENT@
+
+@HEADER@
+Requires: yast2
+BuildRequires: perl-XML-Writer update-desktop-files yast2 yast2-devtools yast2-testsuite
+
+BuildArchitectures: noarch
+
+Summary: Configuration of auditd
+
+%description
+-
+
+@PREP@
+
+@BUILD@
+
+@INSTALL@
+
+@CLEAN@
+
+%files
+%defattr(-,root,root)
+%dir @yncludedir@/auditd
+@yncludedir@/auditd/*
+@clientdir@/auditd.ycp
+@clientdir@/auditd_*.ycp
+@moduledir@/Auditd.*
+@moduledir@/Auditd2.*
+@desktopdir@/auditd.desktop
+%doc @docdir@
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org