YaST Commits
Threads by month
- ----- 2024 -----
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
September 2008
- 26 participants
- 1212 discussions
[yast-commit] r50569 - /trunk/ldap-server/src/lib/slapd-config.cpp
by rhafer@svn.opensuse.org 02 Sep '08
by rhafer@svn.opensuse.org 02 Sep '08
02 Sep '08
Author: rhafer
Date: Tue Sep 2 14:26:11 2008
New Revision: 50569
URL: http://svn.opensuse.org/viewcvs/yast?rev=50569&view=rev
Log:
fixed end-of-ACL checks
Modified:
trunk/ldap-server/src/lib/slapd-config.cpp
Modified: trunk/ldap-server/src/lib/slapd-config.cpp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/ldap-server/src/lib/slapd-config…
==============================================================================
--- trunk/ldap-server/src/lib/slapd-config.cpp (original)
+++ trunk/ldap-server/src/lib/slapd-config.cpp Tue Sep 2 14:26:11 2008
@@ -601,9 +601,18 @@
throw std::runtime_error( "Unsupported access level" );
}
log_it(SLAPD_LOG_INFO, "access: " + level );
-
- spos = aclString.find_first_not_of("\t ", tmppos+1 );
- tmppos = aclString.find_first_of("\t ", spos );
+ if (tmppos != std::string::npos )
+ {
+ spos = aclString.find_first_not_of("\t ", tmppos+1 );
+ if ( spos != std::string::npos )
+ {
+ tmppos = aclString.find_first_of("\t ", spos );
+ }
+ else
+ {
+ tmppos = spos;
+ }
+ }
}
log_it(SLAPD_LOG_INFO, "level <"+level+"> type <"+type+"> value <"+value+">" );
boost::shared_ptr<OlcAclBy> by( new OlcAclBy(level, type, value) );
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0
[yast-commit] r50568 - in /trunk/autoinstallation: doc/CreateProfileDetails.xml package/autoyast2.changes src/config/files.desktop src/modules/AutoinstFile.ycp
by ug@svn.opensuse.org 02 Sep '08
by ug@svn.opensuse.org 02 Sep '08
02 Sep '08
Author: ug
Date: Tue Sep 2 14:25:24 2008
New Revision: 50568
URL: http://svn.opensuse.org/viewcvs/yast?rev=50568&view=rev
Log:
remote_file implemented
Modified:
trunk/autoinstallation/doc/CreateProfileDetails.xml
trunk/autoinstallation/package/autoyast2.changes
trunk/autoinstallation/src/config/files.desktop
trunk/autoinstallation/src/modules/AutoinstFile.ycp
Modified: trunk/autoinstallation/doc/CreateProfileDetails.xml
URL: http://svn.opensuse.org/viewcvs/yast/trunk/autoinstallation/doc/CreateProfi…
==============================================================================
--- trunk/autoinstallation/doc/CreateProfileDetails.xml (original)
+++ trunk/autoinstallation/doc/CreateProfileDetails.xml Tue Sep 2 14:25:24 2008
@@ -2404,9 +2404,14 @@
<para>
This feature requires the autoyast2 package to be installed. If the package is
missing, AutoYaST will silently ignore the <emphasis>files</emphasis> section.
- Since openSUSE 11.0 and SLES11 AutoYaST will install the package on it's own if
+ Since openSUSE 11.1 and SLES11 AutoYaST will install the package on it's own if
it's missing.
</para>
+ <para>
+ Since openSUSE 11.1 and SLES11 you can specify a <emphasis>file_location</emphasis>
+ where the file should be retrieved from, like an HTTP server for example. That would
+ look like this <emphasis><file_location>http://my.server.site/issue</file_location></emphasis>
+ </para>
&example.files;
<para>
Modified: trunk/autoinstallation/package/autoyast2.changes
URL: http://svn.opensuse.org/viewcvs/yast/trunk/autoinstallation/package/autoyas…
==============================================================================
--- trunk/autoinstallation/package/autoyast2.changes (original)
+++ trunk/autoinstallation/package/autoyast2.changes Tue Sep 2 14:25:24 2008
@@ -1,4 +1,9 @@
-------------------------------------------------------------------
+Tue Sep 2 14:23:45 CEST 2008 - ug(a)suse.de
+
+- <remote_file> to files section
+
+-------------------------------------------------------------------
Thu Aug 28 10:21:45 CEST 2008 - ug(a)suse.de
- arvin's multipath patch added
Modified: trunk/autoinstallation/src/config/files.desktop
URL: http://svn.opensuse.org/viewcvs/yast/trunk/autoinstallation/src/config/file…
==============================================================================
--- trunk/autoinstallation/src/config/files.desktop (original)
+++ trunk/autoinstallation/src/config/files.desktop Tue Sep 2 14:25:24 2008
@@ -16,7 +16,7 @@
X-SuSE-YaST-SortKey=
X-SuSE-YaST-AutoInstDataType=list
X-SuSE-YaST-AutoInstSchema=files.rnc
-X-SuSE-YaST-AutoInstRequires=users
+X-SuSE-YaST-AutoInstRequires=users,lan
Icon=yast-files
Exec=
Modified: trunk/autoinstallation/src/modules/AutoinstFile.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/autoinstallation/src/modules/Aut…
==============================================================================
--- trunk/autoinstallation/src/modules/AutoinstFile.ycp (original)
+++ trunk/autoinstallation/src/modules/AutoinstFile.ycp Tue Sep 2 14:25:24 2008
@@ -13,6 +13,7 @@
import "AutoinstConfig";
import "Summary";
+ include "autoinstall/io.ycp";
/* default value of settings modified */
global boolean modified = false;
@@ -93,10 +94,10 @@
foreach(map file, Files,
``{
+ string alternate_location = sformat("%1/%2", AutoinstConfig::files_dir, counter);
+ string alter_file = sformat("file_%1", counter);
if (file["file_contents"]:"" != "")
{
- string alternate_location = sformat("%1/%2", AutoinstConfig::files_dir, counter);
- string alter_file = sformat("file_%1", counter);
y2milestone("AutoInstall: Copying file %1", file["file_path"]:alternate_location );
list t = splitstring( file["file_path"]:alternate_location, "/");
integer pos = size(t) - 1;
@@ -104,56 +105,60 @@
// SCR::Write (.target.string, AutoInstall::var_dir + "/files" + t[pos]:alter_file, file["file_contents"]:"");
SCR::Write (.target.string, file["file_path"]:alternate_location , file["file_contents"]:"");
- if (file["file_permissions"]:"" != "")
+ } else if( file["file_location"]:"" != "" ) {
+ y2milestone("trying to get file from %1 storing in %2", file["file_location"]:"", file["file_path"]:alternate_location);
+ if (!GetURL(file["file_location"]:"", file["file_path"]:alternate_location ) ) {
+ y2error("file could not be retrieved");
+ } else {
+ y2milestone("file was retrieved");
+ }
+ }
+ if (file["file_permissions"]:"" != "") {
+ SCR::Execute (.target.bash, sformat("chmod %1 %2", file["file_permissions"]:"", file["file_path"]:alternate_location ));
+ }
+ if (file["file_owner"]:"" != "") {
+ SCR::Execute (.target.bash, sformat("chown %1 %2", file["file_owner"]:"", file["file_path"]:alternate_location ));
+ }
+ map script = file["file_script"]:$[];
+ if (script != $[])
+ {
+ string current_logdir = AutoinstConfig::logs_dir;
+ list name_tok = splitstring(file["file_path"]:alternate_location, "/");
+ string scriptName = "";
+ if (size(name_tok)>0)
{
- SCR::Execute (.target.bash, sformat("chmod %1 %2", file["file_permissions"]:"", file["file_path"]:alternate_location ));
+ string name = name_tok[size(name_tok) - 1 ]:"";
+ scriptName = "script_" + name;
}
- if (file["file_owner"]:"" != "")
+ string scriptPath = sformat("%1/%2", AutoinstConfig::scripts_dir, scriptName);
+ y2milestone("Writing (file) script into %1", scriptPath);
+ SCR::Write(.target.string, scriptPath, script["source"]:"echo Empty script!");
+ // string message = sformat(_("Executing user supplied script: %1"), scriptName);
+
+ string scriptInterpreter = script["interpreter"]:"shell";
+ string executionString = "";
+ if (scriptInterpreter == "shell")
{
- SCR::Execute (.target.bash, sformat("chown %1 %2", file["file_owner"]:"", file["file_path"]:alternate_location ));
+ executionString = sformat("/bin/sh -x %1 2&> %2/%3.log", scriptPath, current_logdir, scriptName);
+ SCR::Execute (.target.bash, executionString);
}
-
- map script = file["file_script"]:$[];
- if (script != $[])
+ else if (scriptInterpreter == "perl")
+ {
+ executionString = sformat("/usr/bin/perl %1 2&> %2/%3.log", scriptPath, current_logdir, scriptName);
+ SCR::Execute (.target.bash,executionString);
+ }
+ else if (scriptInterpreter == "python")
+ {
+ executionString = sformat("/usr/bin/python %1 2&> %2/%3.log", scriptPath, current_logdir, scriptName);
+ SCR::Execute (.target.bash,executionString);
+ }
+ else
{
- string current_logdir = AutoinstConfig::logs_dir;
- list name_tok = splitstring(file["file_path"]:alternate_location, "/");
- string scriptName = "";
- if (size(name_tok)>0)
- {
- string name = name_tok[size(name_tok) - 1 ]:"";
- scriptName = "script_" + name;
- }
- string scriptPath = sformat("%1/%2", AutoinstConfig::scripts_dir, scriptName);
- y2milestone("Writing (file) script into %1", scriptPath);
- SCR::Write(.target.string, scriptPath, script["source"]:"echo Empty script!");
- // string message = sformat(_("Executing user supplied script: %1"), scriptName);
-
- string scriptInterpreter = script["interpreter"]:"shell";
- string executionString = "";
- if (scriptInterpreter == "shell")
- {
- executionString = sformat("/bin/sh -x %1 2&> %2/%3.log", scriptPath, current_logdir, scriptName);
- SCR::Execute (.target.bash, executionString);
- }
- else if (scriptInterpreter == "perl")
- {
- executionString = sformat("/usr/bin/perl %1 2&> %2/%3.log", scriptPath, current_logdir, scriptName);
- SCR::Execute (.target.bash,executionString);
- }
- else if (scriptInterpreter == "python")
- {
- executionString = sformat("/usr/bin/python %1 2&> %2/%3.log", scriptPath, current_logdir, scriptName);
- SCR::Execute (.target.bash,executionString);
- }
- else
- {
- y2error("Unknown interpreter: %1", scriptInterpreter);
- }
- y2milestone("Script Execution command: %1", executionString );
+ y2error("Unknown interpreter: %1", scriptInterpreter);
}
- success = ( SCR::Execute (.target.bash, sformat("cp %1 %2", file["file_path"]:alternate_location, AutoinstConfig::files_dir)) == 0 );
+ y2milestone("Script Execution command: %1", executionString );
}
+ success = ( SCR::Execute (.target.bash, sformat("cp %1 %2", file["file_path"]:alternate_location, AutoinstConfig::files_dir)) == 0 );
counter = counter + 1;
});
return success;;
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0
[yast-commit] r50567 - in /trunk/ldap-server/src: LdapDatabase.ycp tree_structure.ycp
by rhafer@svn.opensuse.org 02 Sep '08
by rhafer@svn.opensuse.org 02 Sep '08
02 Sep '08
Author: rhafer
Date: Tue Sep 2 14:01:22 2008
New Revision: 50567
URL: http://svn.opensuse.org/viewcvs/yast?rev=50567&view=rev
Log:
Handle "unsupported" ACLs
Modified:
trunk/ldap-server/src/LdapDatabase.ycp
trunk/ldap-server/src/tree_structure.ycp
Modified: trunk/ldap-server/src/LdapDatabase.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/ldap-server/src/LdapDatabase.ycp…
==============================================================================
--- trunk/ldap-server/src/LdapDatabase.ycp (original)
+++ trunk/ldap-server/src/LdapDatabase.ycp Tue Sep 2 14:01:22 2008
@@ -964,66 +964,85 @@
global boolean DbAclRead( integer dbindex, list<map> readAcls )
{
acllist = [];
- foreach( map acl, readAcls,
- {
- map targetMap = acl["target"]:$[];
- map resMap =$[];
- resMap["target"] = $[];
- resMap["access"] = [];
- if ( size(targetMap) == 0 )
- {
- resMap["target", "what"] = `dn_all;
- }
- else
+ if ( readAcls == nil )
+ {
+ y2milestone("Unparseable ACLs");
+ acllist = nil;
+ UI::ChangeWidget( `id(`tab_acl), `Enabled, false) ;
+ UI::ChangeWidget( `id(`pb_add), `Enabled, false) ;
+ UI::ChangeWidget( `id(`pb_del), `Enabled, false) ;
+ UI::ChangeWidget( `id(`pb_edit), `Enabled, false) ;
+ Popup::Error(_("The selected Database contains Access Control Rules that are currently
+not supported by this YaST Module. The Access Control Dialog will be disabled." ) );
+ }
+ else
+ {
+ foreach( map acl, readAcls,
{
- map dnMap = targetMap["dn"]:$[];
- if (size(dnMap) > 0)
- {
- if (dnMap["style"]:"" == "subtree" )
- {
- resMap["target", "what"] = `dn_subtree;
- }
- else if (dnMap["style"]:"" == "base" )
+ map targetMap = acl["target"]:$[];
+ map resMap =$[];
+ resMap["target"] = $[];
+ resMap["access"] = [];
+ if ( size(targetMap) == 0 )
+ {
+ resMap["target", "what"] = `dn_all;
+ }
+ else
+ {
+ map dnMap = targetMap["dn"]:$[];
+ if (size(dnMap) > 0)
+ {
+ if (dnMap["style"]:"" == "subtree" )
+ {
+ resMap["target", "what"] = `dn_subtree;
+ }
+ else if (dnMap["style"]:"" == "base" )
+ {
+ resMap["target", "what"] = `dn_base;
+ }
+ resMap["target", "dn"] = dnMap["value"]:"";
+ }
+ resMap["target", "filter"] = targetMap["filter"]:"";
+ resMap["target", "attrs"] = targetMap["attrs"]:"";
+ }
+ list<map> accessList = [];
+ foreach( map access, acl["access"]:[],
{
- resMap["target", "what"] = `dn_base;
+ map<string,any> accessMap = $[];
+ accessMap["level"] = accessString2Id[access["level"]:""]:`access_none;
+ accessMap["type"] = whoString2Id[access["type"]:""]:`nil;
+ accessMap["dn"] = access["value"]:"";
+ accessList = add( accessList, accessMap );
}
- resMap["target", "dn"] = dnMap["value"]:"";
- }
- resMap["target", "filter"] = targetMap["filter"]:"";
- resMap["target", "attrs"] = targetMap["attrs"]:"";
+ );
+ resMap["access"] = accessList;
+ acllist = add( acllist, resMap );
}
- list<map> accessList = [];
- foreach( map access, acl["access"]:[],
- {
- map<string,any> accessMap = $[];
- accessMap["level"] = accessString2Id[access["level"]:""]:`access_none;
- accessMap["type"] = whoString2Id[access["type"]:""]:`nil;
- accessMap["dn"] = access["value"]:"";
- accessList = add( accessList, accessMap );
- }
- );
- resMap["access"] = accessList;
- acllist = add( acllist, resMap );
- }
- );
- integer pos = -1;
- list itemlist = maplist (map v, acllist,
- {
- pos=pos+1;
- return `item( `id(pos),
- whatId2String[v["target","what"]:`none,0]:"",
- v["target","dn"]:"",
- v["target","filter"]:"",
- v["target","attrs"]:"All Attributes"
- );
- }
- );
- UI::ChangeWidget( `tab_acl, `Items, itemlist) ;
+ );
+ integer pos = -1;
+ list itemlist = maplist (map v, acllist,
+ {
+ pos=pos+1;
+ return `item( `id(pos),
+ whatId2String[v["target","what"]:`none,0]:"",
+ v["target","dn"]:"",
+ v["target","filter"]:"",
+ v["target","attrs"]:"All Attributes"
+ );
+ }
+ );
+ UI::ChangeWidget( `tab_acl, `Items, itemlist) ;
+ }
return true;
}
global list<map> DbAclWrite( integer dbindex )
{
+ if ( acllist == nil )
+ {
+ return nil;
+ }
+
list<map> outlist = [];
foreach( map acl, acllist,
{
Modified: trunk/ldap-server/src/tree_structure.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/ldap-server/src/tree_structure.y…
==============================================================================
--- trunk/ldap-server/src/tree_structure.ycp (original)
+++ trunk/ldap-server/src/tree_structure.ycp Tue Sep 2 14:01:22 2008
@@ -754,6 +754,7 @@
string treeItem = current_tree_item;
integer index = (integer)widget_map[current_tree_item,"index"]:nil;
list<map> acllist = LdapServer::ReadDatabaseAcl( index );
+
return LdapDatabase::DbAclRead( index, acllist );
}
@@ -772,6 +773,10 @@
string treeItem = current_tree_item;
integer index = (integer)widget_map[current_tree_item,"index"]:nil;
list<map> changedAcls = LdapDatabase::DbAclWrite( index );
+ if ( changedAcls == nil )
+ {
+ return true;
+ }
return LdapServer::ChangeDatabaseAcl( index, (list<map<string,any> >)changedAcls );
}
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0
[yast-commit] r50566 - in /trunk/ldap-server/testsuite: testacl-1.ldif testacl-2.ldif testacl-3.ldif
by rhafer@svn.opensuse.org 02 Sep '08
by rhafer@svn.opensuse.org 02 Sep '08
02 Sep '08
Author: rhafer
Date: Tue Sep 2 14:01:18 2008
New Revision: 50566
URL: http://svn.opensuse.org/viewcvs/yast?rev=50566&view=rev
Log:
more ACL test cases
Added:
trunk/ldap-server/testsuite/testacl-1.ldif
trunk/ldap-server/testsuite/testacl-2.ldif
trunk/ldap-server/testsuite/testacl-3.ldif
Added: trunk/ldap-server/testsuite/testacl-1.ldif
URL: http://svn.opensuse.org/viewcvs/yast/trunk/ldap-server/testsuite/testacl-1.…
==============================================================================
--- trunk/ldap-server/testsuite/testacl-1.ldif (added)
+++ trunk/ldap-server/testsuite/testacl-1.ldif Tue Sep 2 14:01:18 2008
@@ -0,0 +1,8 @@
+# unsupported target type "dn.regex"
+dn: olcDatabase={1}hdb,cn=config
+changetype: modify
+replace: olcAccess
+olcAccess: {0}to dn.regex="ou=ldapconfig,dc=site"
+ filter="objectclass=posixAccount" attrs=uid,loginshell
+ by * read
+olcAccess: {1}to * by * none
Added: trunk/ldap-server/testsuite/testacl-2.ldif
URL: http://svn.opensuse.org/viewcvs/yast/trunk/ldap-server/testsuite/testacl-2.…
==============================================================================
--- trunk/ldap-server/testsuite/testacl-2.ldif (added)
+++ trunk/ldap-server/testsuite/testacl-2.ldif Tue Sep 2 14:01:18 2008
@@ -0,0 +1,8 @@
+# unsupported "break" in "by" clause
+dn: olcDatabase={1}hdb,cn=config
+changetype: modify
+replace: olcAccess
+olcAccess: {0}to dn.subtree="ou=ldapconfig,dc=site"
+ filter="objectclass=posixAccount" attrs=uid,loginshell
+ by * read break
+olcAccess: {1}to * by * none
Added: trunk/ldap-server/testsuite/testacl-3.ldif
URL: http://svn.opensuse.org/viewcvs/yast/trunk/ldap-server/testsuite/testacl-3.…
==============================================================================
--- trunk/ldap-server/testsuite/testacl-3.ldif (added)
+++ trunk/ldap-server/testsuite/testacl-3.ldif Tue Sep 2 14:01:18 2008
@@ -0,0 +1,8 @@
+# unsupported access privs clause
+dn: olcDatabase={1}hdb,cn=config
+changetype: modify
+replace: olcAccess
+olcAccess: {0}to dn.subtree="ou=ldapconfig,dc=site"
+ filter="objectclass=posixAccount" attrs=uid,loginshell
+ by * +rwx
+olcAccess: {1}to * by * none
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0
[yast-commit] r50565 - in /trunk/ldap-server/src: agent/SlapdConfigAgent.cc lib/slapd-config.cpp lib/slapd-config.h
by rhafer@svn.opensuse.org 02 Sep '08
by rhafer@svn.opensuse.org 02 Sep '08
02 Sep '08
Author: rhafer
Date: Tue Sep 2 14:01:15 2008
New Revision: 50565
URL: http://svn.opensuse.org/viewcvs/yast?rev=50565&view=rev
Log:
reworked API to indicate "unsupported" ACLs
Modified:
trunk/ldap-server/src/agent/SlapdConfigAgent.cc
trunk/ldap-server/src/lib/slapd-config.cpp
trunk/ldap-server/src/lib/slapd-config.h
Modified: trunk/ldap-server/src/agent/SlapdConfigAgent.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/ldap-server/src/agent/SlapdConfi…
==============================================================================
--- trunk/ldap-server/src/agent/SlapdConfigAgent.cc (original)
+++ trunk/ldap-server/src/agent/SlapdConfigAgent.cc Tue Sep 2 14:01:15 2008
@@ -620,60 +620,68 @@
else if ( dbComponent == "acl" )
{
YCPList resList;
- OlcAccessList aclList = (*i)->getAcl();
- OlcAccessList::const_iterator j;
- for ( j = aclList.begin(); j != aclList.end(); j++ )
- {
- YCPMap aclMap;
- YCPMap targetMap;
- YCPList accessList;
- if ( (*j)->matchesAll() )
- {
- }
- else
- {
- std::string filter = (*j)->getFilter();
- if (filter != "" )
+ OlcAccessList aclList;
+ bool parsed = (*i)->getAcl(aclList);
+ if ( parsed )
+ {
+ OlcAccessList::const_iterator j;
+ for ( j = aclList.begin(); j != aclList.end(); j++ )
+ {
+ YCPMap aclMap;
+ YCPMap targetMap;
+ YCPList accessList;
+ if ( (*j)->matchesAll() )
{
- targetMap.add( YCPString("filter"), YCPString(filter) );
}
- std::string attrs = (*j)->getAttributes();
- if (attrs != "" )
- {
- targetMap.add( YCPString("attrs"), YCPString(attrs) );
- }
- std::string dn_value = (*j)->getDnValue();
- if ( dn_value != "" )
+ else
{
- YCPMap dnMap;
- std::string dn_type = (*j)->getDnType();
- if (dn_type == "dn.subtree" )
+ std::string filter = (*j)->getFilter();
+ if (filter != "" )
{
- dnMap.add(YCPString("style"), YCPString("subtree") );
+ targetMap.add( YCPString("filter"), YCPString(filter) );
}
- else
+ std::string attrs = (*j)->getAttributes();
+ if (attrs != "" )
{
- dnMap.add(YCPString("style"), YCPString("base") );
+ targetMap.add( YCPString("attrs"), YCPString(attrs) );
+ }
+ std::string dn_value = (*j)->getDnValue();
+ if ( dn_value != "" )
+ {
+ YCPMap dnMap;
+ std::string dn_type = (*j)->getDnType();
+ if (dn_type == "dn.subtree" )
+ {
+ dnMap.add(YCPString("style"), YCPString("subtree") );
+ }
+ else
+ {
+ dnMap.add(YCPString("style"), YCPString("base") );
+ }
+ dnMap.add(YCPString("value"), YCPString(dn_value) );
+ targetMap.add( YCPString("dn"), dnMap );
}
- dnMap.add(YCPString("value"), YCPString(dn_value) );
- targetMap.add( YCPString("dn"), dnMap );
}
+ aclMap.add( YCPString("target"), targetMap );
+ OlcAclByList byList =(*j)->getAclByList() ;
+ OlcAclByList::const_iterator k;
+ for ( k = byList.begin() ; k != byList.end(); k++ )
+ {
+ YCPMap byMap;
+ byMap.add(YCPString("level"), YCPString( (*k)->getLevel() ) );
+ byMap.add(YCPString("type"), YCPString( (*k)->getType() ) );
+ byMap.add(YCPString("value"), YCPString( (*k)->getValue() ) );
+ accessList.add(byMap);
+ }
+ aclMap.add( YCPString("access"), accessList );
+ resList.add(aclMap);
}
- aclMap.add( YCPString("target"), targetMap );
- OlcAclByList byList =(*j)->getAclByList() ;
- OlcAclByList::const_iterator k;
- for ( k = byList.begin() ; k != byList.end(); k++ )
- {
- YCPMap byMap;
- byMap.add(YCPString("level"), YCPString( (*k)->getLevel() ) );
- byMap.add(YCPString("type"), YCPString( (*k)->getType() ) );
- byMap.add(YCPString("value"), YCPString( (*k)->getValue() ) );
- accessList.add(byMap);
- }
- aclMap.add( YCPString("access"), accessList );
- resList.add(aclMap);
+ return resList;
+ }
+ else
+ {
+ return YCPNull();
}
- return resList;
}
else
{
Modified: trunk/ldap-server/src/lib/slapd-config.cpp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/ldap-server/src/lib/slapd-config…
==============================================================================
--- trunk/ldap-server/src/lib/slapd-config.cpp (original)
+++ trunk/ldap-server/src/lib/slapd-config.cpp Tue Sep 2 14:01:15 2008
@@ -535,6 +535,10 @@
{
if ( aclString.substr(spos, tmppos-spos) != "by" )
{
+ if (tmppos != std::string::npos )
+ {
+ throw std::runtime_error( "Error while parsing ACL by clause" );
+ }
break;
}
else
@@ -561,7 +565,7 @@
if ( tmppos == std::string::npos )
{
log_it(SLAPD_LOG_ERR, "Unexpected end of ACL" );
- break;
+ throw std::runtime_error( "Error while parsing ACL" );
}
else
{
@@ -569,17 +573,35 @@
type = aclString.substr(spos, tmppos-spos);
log_it(SLAPD_LOG_INFO, "bytype: " + type );
- if ( aclString[tmppos] == '=' )
+ if ( type == "group" || type == "dn.base" || type == "dn.subtree" )
{
- spos = tmppos+1;
- tmppos = extractAlcToken( aclString, spos, true );
- value = aclString.substr(spos, tmppos-spos);
- log_it(SLAPD_LOG_INFO, "byvalue: " + value );
+ if ( aclString[tmppos] == '=' )
+ {
+ spos = tmppos+1;
+ tmppos = extractAlcToken( aclString, spos, true );
+ value = aclString.substr(spos, tmppos-spos);
+ log_it(SLAPD_LOG_INFO, "byvalue: " + value );
+ }
+ else
+ {
+ throw std::runtime_error( "Error while parsing ACL, expected \"=\"" );
+ }
+ }
+ else if ( type != "users" && type != "anonymous" && type != "self" && type != "*" )
+ {
+ throw std::runtime_error( "Unsupported \"by\" clause" );
}
spos = tmppos+1;
tmppos = extractAlcToken( aclString, spos, false );
level = aclString.substr(spos, tmppos-spos);
+ if ( level != "none" && level != "disclose" && level != "auth" &&
+ level != "compare" && level != "read" &&
+ level != "write" && level != "manage" )
+ {
+ throw std::runtime_error( "Unsupported access level" );
+ }
log_it(SLAPD_LOG_INFO, "access: " + level );
+
spos = aclString.find_first_not_of("\t ", tmppos+1 );
tmppos = aclString.find_first_of("\t ", spos );
}
@@ -713,10 +735,11 @@
return this->m_type;
}
-OlcAccessList OlcDatabase::getAcl() const
+bool OlcDatabase::getAcl(OlcAccessList &aclList) const
{
const LDAPAttribute* aclAttr = m_dbEntryChanged.getAttributeByName("olcAccess");
- OlcAccessList aclList;
+ aclList.clear();
+ bool ret = true;
if ( aclAttr )
{
StringList values = aclAttr->getValues();
@@ -731,10 +754,16 @@
aclList.push_back(acl);
}
catch ( std::runtime_error e )
- {}
+ {
+ log_it(SLAPD_LOG_INFO, "Can't parse ACL");
+ log_it(SLAPD_LOG_INFO, e.what() );
+ aclList.clear();
+ ret = false;
+ break;
+ }
}
}
- return aclList;
+ return ret;
}
void OlcDatabase::addAccessControl(const std::string& acl, int index )
Modified: trunk/ldap-server/src/lib/slapd-config.h
URL: http://svn.opensuse.org/viewcvs/yast/trunk/ldap-server/src/lib/slapd-config…
==============================================================================
--- trunk/ldap-server/src/lib/slapd-config.h (original)
+++ trunk/ldap-server/src/lib/slapd-config.h Tue Sep 2 14:01:15 2008
@@ -194,7 +194,7 @@
const std::string getSuffix() const;
const std::string getType() const;
- OlcAccessList getAcl() const;
+ bool getAcl( OlcAccessList& accessList ) const;
virtual void addAccessControl( const std::string& acl, int index=-1 );
virtual void replaceAccessControl( const StringList acllist );
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0
[yast-commit] r50564 - /trunk/packager/src/clients/sw_single.ycp
by kmachalkova@svn.opensuse.org 02 Sep '08
by kmachalkova@svn.opensuse.org 02 Sep '08
02 Sep '08
Author: kmachalkova
Date: Tue Sep 2 13:46:40 2008
New Revision: 50564
URL: http://svn.opensuse.org/viewcvs/yast?rev=50564&view=rev
Log:
Further adaptations to new PackageSlideShow
(make sw_single work again)
Modified:
trunk/packager/src/clients/sw_single.ycp
Modified: trunk/packager/src/clients/sw_single.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/packager/src/clients/sw_single.y…
==============================================================================
--- trunk/packager/src/clients/sw_single.ycp (original)
+++ trunk/packager/src/clients/sw_single.ycp Tue Sep 2 13:46:40 2008
@@ -26,6 +26,7 @@
import "Mode";
import "PackageCallbacks";
import "PackageLock";
+ import "PackageSlideShow";
import "SlideShow";
import "SlideShowCallbacks";
import "Kernel";
@@ -157,7 +158,7 @@
Pkg::TargetLogfile (Installation::destdir + Directory::logdir + "/y2logRPM");
- SlideShow::InitPkgData(true); // force reinitialization
+ PackageSlideShow::InitPkgData(true); // force reinitialization
foreach (string package, arg_list, {
if (SCR::Read (.target.size, package) > 0)
@@ -525,14 +526,14 @@
SCR::Write (.target.ycp, "/var/lib/YaST2/failed_packages", []);
boolean anyToDelete = Pkg::PkgAnyToDelete();
SlideShow::SetLanguage (UI::GetLanguage(true));
- SlideShow::InitPkgData(true); // force reinitialization
- SlideShow::OpenSlideShowDialog();
+ PackageSlideShow::InitPkgData(true); // force reinitialization
+ SlideShow::OpenDialog();
list< map<string,any> > stages = [
$[
"name" : "packages",
"description": _("Installing Packages..."),
- "value" : SlideShow::total_size_to_install / 1024 , // kilobytes
+ "value" : PackageSlideShow::total_size_to_install / 1024 , // kilobytes
"units" : `kb,
],
];
@@ -547,7 +548,7 @@
list commit_result = PackageInstallation::CommitPackages (0, 0); // Y: commit them !
integer newvmlinuzsize = (integer) SCR::Read(.target.size, "/boot/vmlinuz");
- SlideShow::CloseSlideShowDialog();
+ SlideShow::CloseDialog();
if (Mode::normal () // run SuSEconfig only in normal system, not during installation
&& Installation::destdir == "/"
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0
02 Sep '08
Author: aschnell
Date: Tue Sep 2 13:39:14 2008
New Revision: 50563
URL: http://svn.opensuse.org/viewcvs/yast?rev=50563&view=rev
Log:
- fixed syntax
Modified:
trunk/network/src/modules/DNS.ycp
Modified: trunk/network/src/modules/DNS.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/network/src/modules/DNS.ycp?rev=…
==============================================================================
--- trunk/network/src/modules/DNS.ycp (original)
+++ trunk/network/src/modules/DNS.ycp Tue Sep 2 13:39:14 2008
@@ -322,7 +322,7 @@
searchlist = (list<string>) eval(settings["searchlist"]:[]);
//if not defined, set to 'auto'
resolv_conf_policy = settings["resolv_conf_policy"]:"auto";
- modified = true
+ modified = true;
initialized = true;
return true;
}
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0
[yast-commit] r50562 - in /trunk/audit-laf: ./ agents/ doc/ doc/autodocs/ package/ src/ testsuite/ testsuite/tests/
by gs@svn.opensuse.org 02 Sep '08
by gs@svn.opensuse.org 02 Sep '08
02 Sep '08
Author: gs
Date: Tue Sep 2 12:34:50 2008
New Revision: 50562
URL: http://svn.opensuse.org/viewcvs/yast?rev=50562&view=rev
Log:
configuration of LAF Auditing (auditd module renamde to
audit-laf)
Added:
trunk/audit-laf/
trunk/audit-laf/.cvsignore
trunk/audit-laf/MAINTAINER
trunk/audit-laf/Makefile.cvs
trunk/audit-laf/RPMNAME
trunk/audit-laf/VERSION
trunk/audit-laf/agents/
trunk/audit-laf/agents/.cvsignore
trunk/audit-laf/agents/Makefile.am
trunk/audit-laf/agents/auditd.scr
trunk/audit-laf/configure.in.in
trunk/audit-laf/doc/
trunk/audit-laf/doc/.cvsignore
trunk/audit-laf/doc/Makefile.am
trunk/audit-laf/doc/autodocs/
trunk/audit-laf/doc/autodocs/.cvsignore
trunk/audit-laf/doc/autodocs/Makefile.am
trunk/audit-laf/package/
trunk/audit-laf/package/.cvsignore
trunk/audit-laf/package/yast2-audit-laf.changes
trunk/audit-laf/src/
trunk/audit-laf/src/.cvsignore
trunk/audit-laf/src/AuditLaf.ycp
trunk/audit-laf/src/Makefile.am
trunk/audit-laf/src/audit-laf.desktop
trunk/audit-laf/src/audit-laf.ycp
trunk/audit-laf/src/audit-laf_auto.ycp
trunk/audit-laf/src/audit-laf_proposal.ycp
trunk/audit-laf/src/complex.ycp
trunk/audit-laf/src/dialogs.ycp
trunk/audit-laf/src/helps.ycp
trunk/audit-laf/src/wizards.ycp
trunk/audit-laf/testsuite/
trunk/audit-laf/testsuite/.cvsignore
trunk/audit-laf/testsuite/Makefile.am
trunk/audit-laf/testsuite/tests/
trunk/audit-laf/testsuite/tests/.cvsignore
trunk/audit-laf/testsuite/tests/TestModule.err
trunk/audit-laf/testsuite/tests/TestModule.out
trunk/audit-laf/testsuite/tests/TestModule.ycp
trunk/audit-laf/yast2-audit-laf.spec.in
Added: trunk/audit-laf/.cvsignore
URL: http://svn.opensuse.org/viewcvs/yast/trunk/audit-laf/.cvsignore?rev=50562&v…
==============================================================================
--- trunk/audit-laf/.cvsignore (added)
+++ trunk/audit-laf/.cvsignore Tue Sep 2 12:34:50 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
+sshd.pot
+autom4te.cache
Added: trunk/audit-laf/MAINTAINER
URL: http://svn.opensuse.org/viewcvs/yast/trunk/audit-laf/MAINTAINER?rev=50562&v…
==============================================================================
--- trunk/audit-laf/MAINTAINER (added)
+++ trunk/audit-laf/MAINTAINER Tue Sep 2 12:34:50 2008
@@ -0,0 +1 @@
+Gabriele Mohr <gs(a)suse.de>
Added: trunk/audit-laf/Makefile.cvs
URL: http://svn.opensuse.org/viewcvs/yast/trunk/audit-laf/Makefile.cvs?rev=50562…
==============================================================================
--- trunk/audit-laf/Makefile.cvs (added)
+++ trunk/audit-laf/Makefile.cvs Tue Sep 2 12:34:50 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/audit-laf/RPMNAME
URL: http://svn.opensuse.org/viewcvs/yast/trunk/audit-laf/RPMNAME?rev=50562&view…
==============================================================================
--- trunk/audit-laf/RPMNAME (added)
+++ trunk/audit-laf/RPMNAME Tue Sep 2 12:34:50 2008
@@ -0,0 +1 @@
+yast2-audit-laf
Added: trunk/audit-laf/VERSION
URL: http://svn.opensuse.org/viewcvs/yast/trunk/audit-laf/VERSION?rev=50562&view…
==============================================================================
--- trunk/audit-laf/VERSION (added)
+++ trunk/audit-laf/VERSION Tue Sep 2 12:34:50 2008
@@ -0,0 +1 @@
+2.15.0
Added: trunk/audit-laf/agents/.cvsignore
URL: http://svn.opensuse.org/viewcvs/yast/trunk/audit-laf/agents/.cvsignore?rev=…
==============================================================================
--- trunk/audit-laf/agents/.cvsignore (added)
+++ trunk/audit-laf/agents/.cvsignore Tue Sep 2 12:34:50 2008
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
Added: trunk/audit-laf/agents/Makefile.am
URL: http://svn.opensuse.org/viewcvs/yast/trunk/audit-laf/agents/Makefile.am?rev…
==============================================================================
--- trunk/audit-laf/agents/Makefile.am (added)
+++ trunk/audit-laf/agents/Makefile.am Tue Sep 2 12:34:50 2008
@@ -0,0 +1,5 @@
+# Makefile.am for laf-audit/agents
+
+scrconf_DATA = $(wildcard *.scr)
+
+EXTRA_DIST = $(scrconf_DATA)
Added: trunk/audit-laf/agents/auditd.scr
URL: http://svn.opensuse.org/viewcvs/yast/trunk/audit-laf/agents/auditd.scr?rev=…
==============================================================================
--- trunk/audit-laf/agents/auditd.scr (added)
+++ trunk/audit-laf/agents/auditd.scr Tue Sep 2 12:34:50 2008
@@ -0,0 +1,41 @@
+/**
+ * File:
+ * auditd.scr
+ * Summary:
+ * SCR Agent for reading/writing /etc/audit/auditd.conf
+ * using the ini-agent
+ * Access:
+ * read/write
+ * Authors:
+ * Gabriele Mohr <gs(a)suse.de>
+ * Example:
+ * Dir(.auditd)
+ * (["log_file", "log_format", "priority_boost", "flush", ...])
+ *
+ * Read(.auditd.log_format)
+ * (["RAW"])
+ *
+ * Write(.auditd.max_log_file, 5)
+ * (true)
+ *
+ * $Id: auditd.scr
+ *
+ */
+
+.auditd
+
+`ag_ini(
+ `IniAgent( "/etc/audit/auditd.conf",
+ $[
+ "options" : [ "global_values", "repeat_names", "flat" ],
+ "comments" : [ "^[ \t]*#.*$", "^[ \t]*$" ],
+ "params" : [
+ // Options with one value ('yes' / 'no')
+ $[ "match" : [ "^[ \t]*([^ \t]+)[ \t = ]+([^ \t]+)[ \t]+$", "%s = %s" ]],
+ // Options with more possible values
+ $[ "match" : [ "^[ \t]*([^ \t]+)[ \t = ]+(.+)[ \t]*$", "%s = %s" ]],
+ ],
+ "subindent" : " ",
+ ]
+ )
+)
Added: trunk/audit-laf/configure.in.in
URL: http://svn.opensuse.org/viewcvs/yast/trunk/audit-laf/configure.in.in?rev=50…
==============================================================================
--- trunk/audit-laf/configure.in.in (added)
+++ trunk/audit-laf/configure.in.in Tue Sep 2 12:34:50 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/audit-laf/doc/.cvsignore
URL: http://svn.opensuse.org/viewcvs/yast/trunk/audit-laf/doc/.cvsignore?rev=505…
==============================================================================
--- trunk/audit-laf/doc/.cvsignore (added)
+++ trunk/audit-laf/doc/.cvsignore Tue Sep 2 12:34:50 2008
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
Added: trunk/audit-laf/doc/Makefile.am
URL: http://svn.opensuse.org/viewcvs/yast/trunk/audit-laf/doc/Makefile.am?rev=50…
==============================================================================
--- trunk/audit-laf/doc/Makefile.am (added)
+++ trunk/audit-laf/doc/Makefile.am Tue Sep 2 12:34:50 2008
@@ -0,0 +1,10 @@
+# Makefile.am for audit-laf/doc
+
+SUBDIRS = autodocs
+
+htmldir = $(docdir)
+
+doc_DATA =
+html_DATA =
+
+EXTRA_DIST = $(doc_DATA) $(html_DATA)
Added: trunk/audit-laf/doc/autodocs/.cvsignore
URL: http://svn.opensuse.org/viewcvs/yast/trunk/audit-laf/doc/autodocs/.cvsignor…
==============================================================================
--- trunk/audit-laf/doc/autodocs/.cvsignore (added)
+++ trunk/audit-laf/doc/autodocs/.cvsignore Tue Sep 2 12:34:50 2008
@@ -0,0 +1,3 @@
+Makefile
+Makefile.in
+*.html
Added: trunk/audit-laf/doc/autodocs/Makefile.am
URL: http://svn.opensuse.org/viewcvs/yast/trunk/audit-laf/doc/autodocs/Makefile.…
==============================================================================
--- trunk/audit-laf/doc/autodocs/Makefile.am (added)
+++ trunk/audit-laf/doc/autodocs/Makefile.am Tue Sep 2 12:34:50 2008
@@ -0,0 +1,3 @@
+# Makefile.am for audit-laf/doc/autodocs
+
+include $(top_srcdir)/autodocs-ycp.ami
Added: trunk/audit-laf/package/.cvsignore
URL: http://svn.opensuse.org/viewcvs/yast/trunk/audit-laf/package/.cvsignore?rev…
==============================================================================
--- trunk/audit-laf/package/.cvsignore (added)
+++ trunk/audit-laf/package/.cvsignore Tue Sep 2 12:34:50 2008
@@ -0,0 +1,2 @@
+*.spec
+*.bz2
Added: trunk/audit-laf/package/yast2-audit-laf.changes
URL: http://svn.opensuse.org/viewcvs/yast/trunk/audit-laf/package/yast2-audit-la…
==============================================================================
--- trunk/audit-laf/package/yast2-audit-laf.changes (added)
+++ trunk/audit-laf/package/yast2-audit-laf.changes Tue Sep 2 12:34:50 2008
@@ -0,0 +1,4 @@
+-------------------------------------------------------------------
+Tue Sep 2 10:28:35 2008 - gs(a)suse.de
+
+- initial version
Added: trunk/audit-laf/src/.cvsignore
URL: http://svn.opensuse.org/viewcvs/yast/trunk/audit-laf/src/.cvsignore?rev=505…
==============================================================================
--- trunk/audit-laf/src/.cvsignore (added)
+++ trunk/audit-laf/src/.cvsignore Tue Sep 2 12:34:50 2008
@@ -0,0 +1,4 @@
+Makefile
+Makefile.in
+*.ybc
+.dep
Added: trunk/audit-laf/src/AuditLaf.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/audit-laf/src/AuditLaf.ycp?rev=5…
==============================================================================
--- trunk/audit-laf/src/AuditLaf.ycp (added)
+++ trunk/audit-laf/src/AuditLaf.ycp Tue Sep 2 12:34:50 2008
@@ -0,0 +1,530 @@
+/* ------------------------------------------------------------------------------
+ * 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/AuditLaf.ycp
+ * Package: Configuration of audit-laf
+ * Summary: AuditLaf settings, input and output functions
+ * Authors: Gabriele Mohr <gs(a)suse.de>
+ *
+ *
+ * Representation of the configuration of audit-laf.
+ * Input and output routines.
+ */
+
+{
+
+module "AuditLaf";
+textdomain "audit-laf";
+
+import "Progress";
+import "Report";
+import "Summary";
+import "Message";
+import "Popup";
+import "Mode";
+import "FileUtils";
+import "Service";
+
+
+/**
+ * Prototypes
+ */
+global boolean Modified();
+
+/**
+ * Data was modified?
+ */
+boolean modified = false;
+
+/**
+ */
+boolean proposal_valid = false;
+
+/**
+ * Filename (path) rules file
+ */
+string rules_file = "/etc/audit/audit.rules";
+
+/**
+ * Filename (path) config file
+ */
+string config_file = "/etc/audit/auditd.conf";
+
+/**
+ * Write only, used during autoinstallation.
+ * Don't run services and SuSEconfig, it's all done at one place.
+ */
+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
+ */
+global string GetRulesFile() {
+ return rules_file;
+}
+
+global string GetConfigFile() {
+ return config_file;
+}
+
+global list <string> GetWatches() {
+ return ( [ "exit,always watch=/etc/passwd perm=rwx",
+ "entry,always watch=/etc/sysconfig/yast2 perm=rwx"] );
+}
+
+/**
+ * Data was modified?
+ * @return true if modified
+ */
+global boolean Modified() {
+ y2milestone("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;
+}
+
+/**
+ Returns a confirmation popup dialog whether user wants to really abort.
+ */
+global boolean Abort() {
+ return Popup::ReallyAbort(Modified());
+}
+
+/**
+ * Checks whether an Abort button has been pressed.
+ * If so, calls function to confirm the abort call.
+ *
+ * @return boolean true if abort confirmed
+ */
+global boolean PollAbort() {
+ // Do not check UI when running in CommandLine mode
+ if (Mode::commandline())
+ return false;
+
+ if (UI::PollInput() == `abort)
+ return Abort();
+
+ return false;
+}
+
+//
+// Settings: Define all variables needed for configuration of auditd
+//
+
+/**
+ * map of audit settings (from /etc/audit/auditd.conf)
+ */
+map <string, list <string> > SETTINGS = $[];
+
+/**
+ * default settings for /etc/audit/auditd.conf
+ */
+map <string, list <string> > DEFAULT_CONFIG = $[
+ "log_file" : ["/var/log/audit/audit.log"],
+ "log_format" : ["RAW"],
+ "priority_boost" : ["3"],
+ "flush" : ["INCREMENTAL"],
+ "freq" : ["20"],
+ "num_logs" : ["4"],
+ "dispatcher" : ["/sbin/audispd"],
+ "disp_qos" : ["lossy"],
+ "max_log_file" : ["5"],
+ "max_log_file_action" : ["ROTATE"],
+ "space_left" : ["75"],
+ "space_left_action" : ["SYSLOG"],
+ "action_mail_acct" : ["root"],
+ "admin_space_left": ["50"],
+ "admin_space_left_action" : ["SUSPEND"],
+ "disk_full_action" : ["SUSPEND"],
+ "disk_error_action" : ["SUSPEND"]
+];
+
+/**
+ * Rules for the subsystem audit (passed via auditctl)
+ * are read from /etc/audit/audit.rules
+ */
+string RULES = "";
+
+/**
+ * Get value of given option from SEETINGS
+ */
+global string GetAuditdOption( string key) {
+ list <string> option_list = SETTINGS[key]:DEFAULT_CONFIG[key]:[];
+
+ if ( option_list != [] )
+ return option_list[0]:"";
+ else
+ return "";
+}
+
+/**
+ * Set option to given value in SETTINGS
+ */
+
+global boolean SetAuditdOption( string key, string value ) {
+ list <string> option_list = [];
+
+ if ( value != "" )
+ {
+ option_list = add( option_list, value );
+ SETTINGS[key] = option_list;
+ y2milestone( "Setting %1 to %2", key, option_list );
+ return true;
+ }
+ else
+ return false;
+}
+
+/**
+ * Get all rules
+ */
+global string GetRules() {
+ return RULES;
+}
+
+/*
+ * Set rules
+ */
+global boolean SetRules( string rules ) {
+ if ( rules != nil && rules != "" )
+ {
+ RULES = rules;
+ return true;
+ }
+ else
+ return false;
+}
+
+/**
+ * Read rules from audit.rules
+ */
+boolean ReadAuditRules() {
+
+ string rules = (string)SCR::Read(.target.string, rules_file );
+
+ if ( rules != nil && rules != "" )
+ {
+ RULES = rules;
+ return true;
+ }
+ else
+ return false;
+}
+
+/**
+ * Write rules to audit.rules
+ */
+boolean WriteAuditRules() {
+ boolean success = (boolean)SCR::Write(.target.string, rules_file, RULES );
+ return success;
+}
+
+
+/**
+ * Read settings from auditd.conf
+ * @return true on success
+ */
+boolean ReadAuditdSettings() {
+
+ if ( ! FileUtils::Exists ( config_file) )
+ return false;
+
+ list <string> optionsList = (list <string>) SCR::Dir(.auditd);
+ y2milestone( "List of options: %1", optionsList );
+
+ // list all options set in auditd.conf
+ foreach (string key, (list <string>) SCR::Dir(.auditd),
+ {
+ // and read the value for each of them
+ list <string> val = (list <string>) SCR::Read(add(.auditd, key));
+ if (val != nil) SETTINGS[key] = val;
+ });
+
+ y2milestone("%1 has been read: %2", config_file, SETTINGS);
+ return true;
+}
+
+/**
+ * Read all auditd settings
+ * @return true on success
+ */
+global boolean Read() {
+ boolean success = true;
+
+ /* AuditLaf read dialog caption */
+ string caption = _("Initializing Audit Configuration");
+
+ // Set the right number of stages
+ integer steps = 3;
+
+ integer sl = 500;
+ sleep(sl);
+
+ // We do not set help text here, because it was set outside
+ Progress::New( caption, " ", steps, [
+ /* Progress stage 1/4 */
+ _("Read the configuration for auditd"),
+ /* Progress stage 2/4 */
+ _("Read the rules file"),
+ /* Progress stage 3/4 */
+ _("Check status of auditd")
+ /* Progress stage 3/4 */
+ ], [
+ /* Progress step 1/3 */
+ _("Reading the configuration..."),
+ /* Progress step 2/3 */
+ _("Reading the rules file..."),
+ /* Progress step 3/3 */
+ _("Cecking status..." ),
+ Message::Finished()
+ ],
+ ""
+ );
+
+ // read database
+ if(PollAbort()) return false;
+ Progress::NextStage();
+
+ success = ReadAuditdSettings();
+
+ // Report error
+ if( !success) Report::Error(_("Cannot read auditd.conf."));
+ sleep(sl);
+
+ // read another database
+ if(PollAbort()) return false;
+ Progress::NextStep();
+
+ success = ReadAuditRules();
+
+ /* Error message */
+ if(!success) Report::Error(_("Cannot read audit.rules."));
+ sleep(sl);
+
+ // read current settings
+ if(PollAbort()) return false;
+ Progress::NextStage();
+ /* Error message */
+ if(false) Report::Error(Message::CannotReadCurrentSettings());
+ sleep(sl);
+
+ Progress::NextStage();
+ integer auditd_stat = Service::Status( "auditd" );
+ y2milestone( "Auditd running: %1", (auditd_stat == 0 )?"yes":"no" );
+
+ integer apparmor_stat = (integer)SCR::Execute(.target.bash, "rcapparmor status" );
+ y2milestone( "Apparmor loaded: %1", (apparmor_stat == 0 )?"yes":"no" );
+
+ if ( apparmor_stat == 0 && auditd_stat != 0 )
+ {
+ Popup::LongText( _("Auditd not running"),
+ `RichText(_("<p>The <i>apparmor</i> kernel module is loaded
+but the daemon <i>auditd</i> doesn't run.<br>
+Please start the YaST module 'System Services' (Runlevel Editor), and
+activate (start) <i>auditd</i>.<p>")), 40, 12 );
+ return false;
+ }
+
+ if(PollAbort()) return false;
+ modified = false;
+ return true;
+}
+
+/**
+ * Write settings to auditd.conf
+ * @return true on success
+ */
+boolean WriteAuditdSettings() {
+ boolean success = true;
+
+ if ( ! FileUtils::Exists ( config_file ) )
+ return false;
+
+ // list all options set in auditd.conf
+ foreach (string key, list <string> value, SETTINGS, {
+ // and write each value
+ success = (boolean)SCR::Write(add(.auditd, key), value );
+ });
+
+ // This is very important
+ // it flushes the cache, and stores the configuration on the disk
+ SCR::Write(.etc.ssh.sshd_config, nil);
+ y2milestone("%1 has been written: %2", config_file, SETTINGS);
+
+ return true;
+}
+
+/**
+ * Write all auditd settings
+ * @return true on success
+ */
+global boolean Write() {
+ boolean success = true;
+
+ /* Auditd read dialog caption */
+ string caption = _("Saving Audit Configuration");
+
+ // set the right number of stages
+ integer steps = 2;
+
+ integer sl = 500;
+ sleep(sl);
+
+ // Names of the 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 */
+ _("Write the rules")
+ ], [
+ /* Progress step 1/2 */
+ _("Writing the settings..."),
+ /* Progress step 2/2 */
+ _("Writing the rules..."),
+ Message::Finished()
+ ],
+ ""
+ );
+
+ // write settings
+ if(PollAbort()) return false;
+ Progress::NextStage();
+
+ success = WriteAuditdSettings();
+ /* Error message */
+ if(!success) Report::Error (_("Cannot write settings to auditd.conf.") );
+ sleep(sl);
+
+ // restart auditd
+ integer exitCode = Service::RunInitScript( "auditd", "restart" );
+
+ if(PollAbort()) return false;
+ Progress::NextStage ();
+ success = WriteAuditRules();
+ /* Error message */
+ if(!success) Report::Error (_("Cannot write settings to auditd.rules.") );
+ sleep(sl);
+
+ // call auditctl -R audit.rules
+ map output = (map)SCR::Execute( .target.bash_output, "auditctl -R /etc/audit/audit.rules" );
+
+ if ( output["exit"]:0 != 0 )
+ {
+ Report::Error( sformat( "%1\n%2",
+ output["stderr"]:"",
+ _("Please start yast2-audit-laf again and check the rules") ) );
+ }
+
+ if(PollAbort()) 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/audit-laf/src/Makefile.am
URL: http://svn.opensuse.org/viewcvs/yast/trunk/audit-laf/src/Makefile.am?rev=50…
==============================================================================
--- trunk/audit-laf/src/Makefile.am (added)
+++ trunk/audit-laf/src/Makefile.am Tue Sep 2 12:34:50 2008
@@ -0,0 +1,29 @@
+# Makefile.am for audit-laf/src
+
+yncludedir = @yncludedir@/audit-laf
+
+client_DATA = \
+ audit-laf.ycp \
+ audit-laf_auto.ycp \
+ audit-laf_proposal.ycp
+
+ynclude_DATA = \
+ helps.ycp \
+ wizards.ycp \
+ dialogs.ycp \
+ complex.ycp
+
+desktop_DATA = \
+ audit-laf.desktop
+
+module_DATA = \
+ AuditLaf.ycp
+
+# create a symlink for local build, #145327
+audit-laf:
+ ln -sf . $@
+ycpchook = audit-laf
+
+EXTRA_DIST = $(client_DATA) $(ynclude_DATA) $(module_DATA) $(desktop_DATA)
+
+include $(top_srcdir)/Makefile.am.common
Added: trunk/audit-laf/src/audit-laf.desktop
URL: http://svn.opensuse.org/viewcvs/yast/trunk/audit-laf/src/audit-laf.desktop?…
==============================================================================
--- trunk/audit-laf/src/audit-laf.desktop (added)
+++ trunk/audit-laf/src/audit-laf.desktop Tue Sep 2 12:34:50 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=audit-laf
+
+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=audit-laf
+
+Icon=yast-audit-laf
+Exec=/sbin/yast2 audit-laf
+
+Name=AuditLaf
+GenericName=audit-laf
+X-KDE-SubstituteUID=true
+StartupNotify=true
Added: trunk/audit-laf/src/audit-laf.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/audit-laf/src/audit-laf.ycp?rev=…
==============================================================================
--- trunk/audit-laf/src/audit-laf.ycp (added)
+++ trunk/audit-laf/src/audit-laf.ycp Tue Sep 2 12:34:50 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/audit-laf.ycp
+ * Package: Configuration of audit-laf
+ * Summary: Main file
+ * Authors: Gabriele Mohr <gs(a)suse.de>
+ *
+ *
+ * Main file for audit-laf configuration. Uses all other files.
+ */
+
+{
+
+/***
+ * <h3>Configuration of audit-laf</h3>
+ */
+
+textdomain "audit-laf";
+
+/* The main () */
+y2milestone ("----------------------------------------");
+y2milestone ("yast2-audit-laf module started");
+
+import "Progress";
+import "Report";
+import "Summary";
+
+import "CommandLine";
+
+include "audit-laf/wizards.ycp";
+
+map cmdline_description = $[
+ "id" : "audit-laf",
+ /* Command line help text for the Xaudit-laf module */
+ "help" : _("Configuration of audit-laf"),
+ "guihandler" : AuditLafSequence,
+ "initialize" : AuditLaf::Read,
+ "finish" : AuditLaf::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 = AuditLafAutoSequence();
+else ret = CommandLine::Run(cmdline_description);
+y2debug("ret=%1", ret);
+
+/* Finish */
+y2milestone("yast2-audit-laf module finished");
+y2milestone("----------------------------------------");
+
+return ret;
+
+/* EOF */
+}
Added: trunk/audit-laf/src/audit-laf_auto.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/audit-laf/src/audit-laf_auto.ycp…
==============================================================================
--- trunk/audit-laf/src/audit-laf_auto.ycp (added)
+++ trunk/audit-laf/src/audit-laf_auto.ycp Tue Sep 2 12:34:50 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/audit-laf_auto.ycp
+ * Package: Configuration of audit-laf
+ * Summary: Client for autoinstallation
+ * Authors: Gabriele Mohr <gs(a)suse.de>
+ *
+ * $Id: audit-laf_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 audit-laf 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 ("audit-laf_auto", [ "Summary", mm ]);
+ */
+
+{
+
+textdomain "audit-laf";
+
+y2milestone("----------------------------------------");
+y2milestone("AuditLaf auto started");
+
+import "AuditLaf";
+include "audit-laf/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(AuditLaf::Summary(), 0, "");
+}
+/* Reset configuration */
+else if (func == "Reset") {
+ AuditLaf::Import($[]);
+ ret = $[];
+}
+/* Change configuration (run AutoSequence) */
+else if (func == "Change") {
+ ret = AuditLafAutoSequence();
+}
+/* Import configuration */
+else if (func == "Import") {
+ ret = AuditLaf::Import(param);
+}
+/* Return actual state */
+else if (func == "Export") {
+ ret = AuditLaf::Export();
+}
+/* Return needed packages */
+else if (func == "Packages") {
+ ret = AuditLaf::AutoPackages();
+}
+/* Read current state */
+else if (func == "Read") {
+ import "Progress";
+ boolean progress_orig = Progress::set (false);
+ ret = AuditLaf::Read();
+ Progress::set (progress_orig);
+}
+/* Write givven settings */
+else if (func == "Write") {
+ import "Progress";
+ boolean progress_orig = Progress::set (false);
+ AuditLaf::SetWriteOnly (true);
+ ret = AuditLaf::Write();
+ Progress::set (progress_orig);
+}
+/**
+ * did configuration changed
+ * return boolean
+ */
+else if (func == "GetModified") {
+ ret = AuditLaf::Modified ();
+}
+/**
+ * set configuration as changed
+ * return boolean
+ */
+else if (func == "SetModified") {
+ AuditLaf::SetModified (true);
+ ret = true;
+}
+
+/* Unknown function */
+else {
+ y2error("Unknown function: %1", func);
+ ret = false;
+}
+
+y2debug("ret=%1", ret);
+y2milestone("AuditLaf auto finished");
+y2milestone("----------------------------------------");
+
+return ret;
+
+/* EOF */
+}
Added: trunk/audit-laf/src/audit-laf_proposal.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/audit-laf/src/audit-laf_proposal…
==============================================================================
--- trunk/audit-laf/src/audit-laf_proposal.ycp (added)
+++ trunk/audit-laf/src/audit-laf_proposal.ycp Tue Sep 2 12:34:50 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/audit-laf_proposal.ycp
+ * Package: Configuration of audit-laf
+ * Summary: Proposal function dispatcher.
+ * Authors: Gabriele Mohr <gs(a)suse.de>
+ *
+ * $Id: audit-laf_proposal.ycp 41350 2007-10-10 16:59:00Z dfiser $
+ *
+ * Proposal function dispatcher for audit-laf configuration.
+ * See source/installation/proposal/proposal-API.txt
+ */
+
+{
+
+textdomain "audit-laf";
+
+import "AuditLaf";
+import "Progress";
+
+/* The main () */
+y2milestone("----------------------------------------");
+y2milestone("AuditLaf 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 || !AuditLaf::ProposalValid()) {
+ AuditLaf::SetProposalValid (true);
+ boolean progress_orig = Progress::set (false);
+ AuditLaf::Read();
+ Progress::set (progress_orig);
+ }
+ list sum = AuditLaf::Summary();
+ proposal = sum[0]:"";
+
+ ret = $[
+ "preformatted_proposal" : proposal,
+ "warning_level" : warning_level,
+ "warning" : warning,
+ ];
+}
+/* run the module */
+else if(func == "AskUser") {
+ map stored = AuditLaf::Export();
+ symbol seq = (symbol) WFM::CallFunction("audit-laf", [.propose]);
+ if(seq != `next) AuditLaf::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 AuditLaf in proposals */
+ "rich_text_title" : _("AuditLaf"),
+ /* Menu title for AuditLaf in proposals */
+ "menu_title" : _("&AuditLaf"),
+ "id" : "audit-laf",
+ ];
+}
+/* write the proposal */
+else if(func == "Write") {
+ AuditLaf::Write();
+}
+/* unknown function */
+else {
+ y2error("unknown function: %1", func);
+}
+
+/* Finish */
+y2debug("ret=%1",ret);
+y2milestone("AuditLaf proposal finished");
+y2milestone("----------------------------------------");
+return ret;
+
+/* EOF */
+}
Added: trunk/audit-laf/src/complex.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/audit-laf/src/complex.ycp?rev=50…
==============================================================================
--- trunk/audit-laf/src/complex.ycp (added)
+++ trunk/audit-laf/src/complex.ycp Tue Sep 2 12:34:50 2008
@@ -0,0 +1,414 @@
+/* ------------------------------------------------------------------------------
+ * 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/audit-laf/complex.ycp
+ * Package: Configuration of LAF Auditing
+ * Summary: Dialogs definitions
+ * Authors: Gabriele Mohr <gs(a)suse.de>
+ *
+ */
+
+{
+
+textdomain "audit-laf";
+
+import "Label";
+import "Popup";
+import "Wizard";
+import "Wizard_hw";
+import "Confirm";
+import "AuditLaf";
+
+
+include "audit-laf/helps.ycp";
+
+/**
+ * Return a modification status
+ * @return true if data was modified
+ */
+boolean Modified() {
+ return AuditLaf::Modified();
+}
+
+boolean ReallyAbort() {
+ return !AuditLaf::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"]:"");
+ // AuditLaf::SetAbortFunction(PollAbort);
+ if (!Confirm::MustBeRoot()) return `abort;
+ boolean ret = AuditLaf::Read();
+ return ret ? `next : `abort;
+}
+
+/**
+ * Write settings dialog
+ * @return `abort if aborted and `next otherwise
+ */
+symbol WriteDialog() {
+ Wizard::RestoreHelp(HELPS["write"]:"");
+ // AuditLaf::SetAbortFunction(PollAbort);
+ boolean ret = AuditLaf::Write();
+ return ret ? `next : `abort;
+}
+
+void InitLogfileSettingsDialog (string id) {
+
+ UI::ChangeWidget( `id("max_log_file"), `ValidChars, "0123456789" );
+
+ // Set all values to values read from /etc/audit/auditd.conf
+ UI::ChangeWidget( `id("freq"), `Value, tointeger( AuditLaf::GetAuditdOption("freq")) );
+ UI::ChangeWidget( `id("num_logs"), `Value, tointeger( AuditLaf::GetAuditdOption("num_logs")) );
+ foreach (string key, ["log_file",
+ "max_log_file",
+ "action_mail_acct",
+ "name"
+ ], {
+ UI::ChangeWidget(`id(key), `Value, (AuditLaf::GetAuditdOption(key)));
+ });
+
+ foreach (string key, ["log_format",
+ "flush",
+ "max_log_file_action",
+ "name_format"
+ ], {
+ UI::ChangeWidget(`id(key), `Value, toupper(AuditLaf::GetAuditdOption(key)) );
+ });
+
+
+ y2milestone( "Init logfile settings");
+}
+
+symbol HandleLogfileSettingsDialog(string id, map event) {
+ any action = event["ID"]:nil;
+
+ if ( action == "select_file" )
+ {
+ string file_name = UI::AskForExistingFile("/var/log/audit", "*.log", _("Select the log file") );
+
+ UI::ChangeWidget( `id("log_file"), `Value, file_name );
+ y2milestone( "Logfile set to: %1", file_name );
+ }
+ return nil;
+}
+
+boolean ReallyExit () {
+ // yes-no popup
+ return Popup::YesNo (_("Really exit?
+All changes will be lost."));
+}
+
+void StoreLogfileSettingsDialog (string id, map event) {
+
+ AuditLaf::SetModified( true );
+
+ // Store all values in SETTINGS
+ AuditLaf::SetAuditdOption( "freq", tostring( (integer)UI::QueryWidget( `id("freq"), `Value ) ) );
+ AuditLaf::SetAuditdOption( "num_logs", tostring( (integer)UI::QueryWidget( `id("num_logs"), `Value ) ) );
+
+ foreach (string key, ["log_file",
+ "log_format",
+ "max_log_file",
+ "flush",
+ "max_log_file_action",
+ "action_mail_acct",
+ "name_format",
+ "name"
+ ], {
+ AuditLaf::SetAuditdOption( key, (string) UI::QueryWidget(`id(key), `Value) );
+ });
+ y2milestone( "Store logfile settings" );
+
+}
+void InitDispatcherDialog (string id) {
+
+ // Set all values to values read from /etc/audit/auditd.conf
+ foreach (string key, ["dispatcher",
+ "disp_qos" ], {
+ UI::ChangeWidget(`id(key), `Value, (AuditLaf::GetAuditdOption(key)));
+ });
+
+ y2milestone( "Init dispatcher dialog" );
+}
+
+symbol HandleDispatcherDialog(string id, map event) {
+ any action = event["ID"]:nil;
+
+ if ( action == "select_disp" )
+ {
+ string file_name = UI::AskForExistingFile("/sbin", "*", _("Select the dispatcher program") );
+
+ UI::ChangeWidget( `id("dispatcher"), `Value, file_name );
+ y2milestone( "Dispatcher program set to: %1", file_name );
+ }
+ return nil;
+}
+
+void StoreDispatcherDialog (string id, map event) {
+
+ AuditLaf::SetModified( true );
+
+ // Store all values in SETTINGS
+ foreach (string key, ["dispatcher",
+ "disp_qos"], {
+ AuditLaf::SetAuditdOption( key, (string) UI::QueryWidget(`id(key), `Value) );
+ });
+
+ y2milestone( "Store dispatcher dialog" );
+}
+
+
+void InitDiskspaceSettingsDialog (string id) {
+ UI::ChangeWidget( `id("space_left"), `ValidChars, "0123456789" );
+ UI::ChangeWidget( `id("admin_space_left"), `ValidChars, "0123456789" );
+
+ // Set all values to values read from /etc/audit/auditd.conf
+ foreach (string key, ["space_left",
+ "admin_space_left"
+ ], {
+ UI::ChangeWidget(`id(key), `Value, (AuditLaf::GetAuditdOption(key)));
+ });
+
+ foreach (string key, ["space_left_action",
+ "admin_space_left_action",
+ "disk_full_action",
+ "disk_error_action"
+ ], {
+ UI::ChangeWidget(`id(key), `Value, toupper(AuditLaf::GetAuditdOption(key)) );
+ });
+
+
+ y2milestone( "Init diskspace settings" );
+}
+
+void StoreDiskspaceSettingsDialog (string id, map event) {
+ AuditLaf::SetModified( true );
+
+ foreach (string key, ["space_left",
+ "admin_space_left",
+ "space_left_action",
+ "admin_space_left_action",
+ "disk_full_action",
+ "disk_error_action"
+ ], {
+ AuditLaf::SetAuditdOption( key, (string) UI::QueryWidget(`id(key), `Value) );
+ });
+
+ y2milestone( "Store diskspace settings" );
+}
+
+void InitRulesDialog( string id ) {
+ string rules = AuditLaf::GetRules();
+ string combo_box_id = "disabled";
+
+ UI::ChangeWidget( `id( "rules"), `Value, rules );
+ list <string> rules_list = splitstring( rules, "\n" );
+
+ foreach ( string rule, rules_list, {
+ if ( regexpmatch( rule, "^[ /t]*-e[ /t]*2" ) )
+ {
+ combo_box_id = "locked";
+ }
+ else if ( regexpmatch( rule, "^[ /t]*-e[ /t]*1" ) )
+ {
+ combo_box_id = "enabled";
+ }
+ else if ( regexpmatch( rule, "^[ /t]*-e[ /t]*0" ) )
+ {
+ combo_box_id = "disabled";
+ }
+ } );
+ UI::ChangeWidget( `id( "audit_enabled"), `Value, combo_box_id );
+
+ y2milestone ( "Init rules dialog" );
+}
+
+symbol HandleRulesDialog(string id, map event) {
+ any action = event["ID"]:nil;
+
+ if ( action == "audit_enabled" )
+ {
+ string value = (string)UI::QueryWidget( `id("audit_enabled"), `Value );
+ string rule = "";
+ string rules = AuditLaf::GetRules();
+ list <string> rules_list = [];
+
+ y2milestone( "Setting status to: %1", value );
+
+ switch ( value )
+ {
+ case "locked": {
+ rule = "-e 2";
+ break;
+ }
+ case "enabled": {
+ rule = "-e 1";
+ break;
+ }
+ case "disabled": {
+ rule = "-e 0";
+ break;
+ }
+ }
+
+ if ( rules != nil && rules != "")
+ {
+ rules_list = splitstring( rules, "\n");
+ }
+
+ boolean rule_found = false;
+
+ if ( rules_list != [] )
+ {
+ list<string> new_rules = maplist( string line, rules_list, {
+ if ( regexpmatch( line, "^[ /t]*-e" ) )
+ {
+ rule_found = true;
+ return rule;
+ }
+ else
+ {
+ return line;
+ }
+ });
+ if ( !rule_found )
+ new_rules = add( new_rules, rule );
+
+ UI::ChangeWidget(`id("rules"), `Value, mergestring( new_rules, "\n" ) );
+ }
+ }
+ else if ( action == "restore" )
+ {
+ UI::ChangeWidget( `id("rules"), `Value, AuditLaf::GetRules() );
+ }
+ else if ( action == "reset" )
+ {
+ UI::ChangeWidget( `id("rules"), `Value, AuditLaf::GetRules() );
+ integer exit_code = (integer)SCR::Execute( .target.bash, "auditctl -D" );
+ if ( exit_code == 0 )
+ exit_code = (integer)SCR::Execute( .target.bash, "auditctl -R /etc/audit/audit.rules" );
+ if ( exit_code == 0 )
+ Popup::Message( _("Rules successfully restored" ) );
+ else
+ Report::Error( _("Cannot reset rules, please test again" ) );
+ }
+ else if ( action == "test" )
+ {
+ boolean go_on = true;
+
+ 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 = Report::Warning( _("Lock is set in audit.rules (-e 2).\n
+It doesn't make sense to continue, because the rules would
+be locked until next boot.") );
+ go_on = false;
+ }
+ } );
+
+ if ( go_on )
+ {
+ string tmpfile = (string) SCR::Read (.target.tmpdir) + "/rules_test_file";
+
+ boolean success = (boolean)SCR::Write(.target.string, tmpfile, rules );
+ if ( success )
+ {
+ map output = (map)SCR::Execute(.target.bash_output, sformat( "auditctl -R %1", tmpfile ) );
+ if ( output["exit"]:0 != 0 )
+ {
+ Report::Error( sformat( output["stderr"]:"" ) );
+ }
+ else
+ {
+ Popup::Message( "Success");
+ }
+ }
+ else
+ {
+ Report::Error( _("Cannnot create tmp file for rules" ) );
+ }
+ }
+ }
+ else if ( action == "load" )
+ {
+ string file_name = UI::AskForExistingFile("/usr/share/doc/packages/audit", "*.rules", _("Select an example") );
+ string example_rules = (string)SCR::Read(.target.string, file_name );
+
+ UI::ChangeWidget( `id("rules"), `Value, example_rules );
+ y2milestone( "Example rules loaded: %1", file_name );
+ }
+
+ return nil;
+}
+
+void StoreRulesDialog( string id, map event) {
+ string rules = (string)UI::QueryWidget( `id("rules"), `Value );
+
+ AuditLaf::SetRules( rules );
+
+ y2debug( "RULES: %1", rules );
+ y2milestone( "Store rules dialog" );
+}
+
+symbol CheckSettings() {
+ symbol ret = `next;
+ AuditLaf::SetRulesLocked( false );
+
+ string rules = AuditLaf::GetRules();
+ list <string> rules_list = splitstring( rules, "\n");
+
+ y2milestone( "Checking rules..." );
+
+ foreach ( string rule, rules_list, {
+ if ( regexpmatch( rule, "^[ /t]*-e[ /t]*2" ) )
+ {
+ boolean yes = Popup::AnyQuestion( _("Lock set"), _("The audit configuration is locked (option -e 2).
+This means the rules are locked next boot! In this case
+the lock option must be the last entry in the rules file.
+If you want to check or to change the rules,
+please go back to rules editor."),
+ Label::ContinueButton(),
+ Label::BackButton(),
+ `focus_no );
+ if ( yes )
+ ret = `next;
+ else
+ ret = `back;
+ AuditLaf::SetRulesLocked( true );
+ }
+ } );
+ return ret;
+}
+
+/* EOF */
+}
Added: trunk/audit-laf/src/dialogs.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/audit-laf/src/dialogs.ycp?rev=50…
==============================================================================
--- trunk/audit-laf/src/dialogs.ycp (added)
+++ trunk/audit-laf/src/dialogs.ycp Tue Sep 2 12:34:50 2008
@@ -0,0 +1,284 @@
+/* ------------------------------------------------------------------------------
+ * 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/audit-laf/dialogs.ycp
+ * Package: Configuration of LAF Auditing
+ * Summary: Dialogs definitions
+ * Authors: Gabriele Mohr <gs(a)suse.de>
+ *
+ */
+
+{
+
+textdomain "audit-laf";
+
+import "Label";
+import "Wizard";
+import "AuditLaf";
+
+include "audit-laf/helps.ycp";
+
+map current_ui_settings = UI::GetDisplayInfo();
+
+integer mbox_x = 1;
+integer mbox_y = 0.5;
+
+// Tabs have a different layout in textmode
+if (current_ui_settings["TextMode"]:false == true) {
+ mbox_x = 0;
+ mbox_y = 0;
+}
+
+term LogfileSettingsDialogContent () {
+ return `MarginBox( mbox_x, mbox_y,
+ `VBox(
+ `VStretch(),
+ `Frame (
+ _("General Settings"),
+ `VBox (
+
+ `VSquash(
+ `HBox(
+ // Label for InputField
+ `InputField(`id("log_file"), `opt(`hstretch), _("Logfile")),
+ `HSpacing(2.0),
+ `VBox(
+ `VSpacing(),
+ // Label for PushButton
+ `Bottom(`PushButton(`id("select_file"), _("Select Fi&le")))
+ )
+ )
+ ),
+ `VBox(
+ `HBox(`HWeight( 1,`ComboBox(`id("log_format"), _("Format"),
+ [
+ `item(`id("RAW"), "RAW", true ),
+ `item(`id("NOLOG"), "NOLOG" )
+ ])
+ ),
+ `HSpacing(2.0),
+ `HWeight( 1, `IntField(`id("num_logs"), `opt(`hstretch), _("Number of Logfiles"), 0, 99, 4) )
+ ),
+ `HBox(
+ `HWeight( 1, `ComboBox(`id("flush"), _("Flush"),
+ [`item(`id("NONE"), "NONE" ),
+ `item(`id("INCREMENTAL"), "INCREMENTAL", true ),
+ `item(`id("DATA"), "DATA" ),
+ `item(`id("SYNC"), "SYNC" )
+ ])
+ ),
+ `HSpacing(2.0),
+ `HWeight( 1, `IntField(`id("freq"), `opt(`hstretch), _("Frequence"), 0, 10000, 20 ))
+ )
+ )
+ )
+ ),
+ `VStretch(),
+ `Frame (
+ _("Size and Action"),
+ `HBox (
+ /* A text entry */
+ `HWeight( 1, `InputField(`id("max_log_file"), _("Ma&x File Size (MB)")) ),
+ `HSpacing(2.0),
+ `HWeight( 1, `ComboBox(`id("max_log_file_action"), _("Maximum File Size Action"),
+ [`item(`id("IGNORE"), "IGNORE" ),
+ `item(`id("SYSLOG"), "SYSLOG", true ),
+ `item(`id("SUSPEND"), "SUSPEND" ),
+ `item(`id("ROTATE"), "ROTATE" ),
+ `item(`id("KEEP_LOGS"), "KEEP_LOGS" )
+ ] )
+ ),
+ `HSpacing(2.0),
+ `HWeight( 1, `InputField(`id("action_mail_acct"), _("Action Mail Account")))
+ )
+ ),
+ `VStretch(),
+ `Frame(
+ _("Computer Names"),
+ `HBox(
+ `HWeight( 1, `ComboBox(`id("name_format"), _("Computer Name Format"),
+ [`item(`id("NONE"), "NONE" ),
+ `item(`id("HOSTNAME"), "HOSTNAME", true ),
+ `item(`id("FQD"), "FQD" ),
+ `item(`id("USER"), "USER" )
+ ])
+ ),
+ `HSpacing(2.0),
+ `HWeight( 1, `InputField(`id("name"), _("User Defined Name") ))
+ )
+ ),
+ `VStretch()
+ )
+ );
+}
+
+term DispatcherDialogContent () {
+ return `MarginBox( mbox_x, mbox_y,
+ `VBox(
+ `VSpacing(2.0),
+ `Frame (
+ _("Dispatcher Settings"),
+ `VBox (
+ `VSquash(
+ `HBox(
+ // Label for InputField
+ `InputField(`id("dispatcher"), `opt(`hstretch), _("Dispatcher Program")),
+ `HSpacing(2.0),
+ `VBox(
+ `VSpacing(),
+ // Label for PushButton
+ `Bottom(`PushButton(`id("select_disp"), _("Select Fi&le")))
+ )
+ )
+ ),
+ `Left(`ComboBox(`id("disp_qos"), _("Communication"),
+ [`item(`id("lossy"), "lossy", true ),
+ `item(`id("lossless"), "lossless" )
+ ])
+ )
+ )
+ ),
+ `VStretch()
+ )
+ );
+}
+
+term DiskspaceSettingsDialogContent () {
+ return `MarginBox( mbox_x, mbox_y,
+ `VBox(
+ `VStretch(),
+ `Frame(
+ // Frame label - keep it short!
+ _("Value and action for space is starting to run low"),
+ `HBox(
+ // InputField label - space on disk is starting to run low if the entered value is reached
+ `HWeight( 1, `InputField(`id("space_left"), _("&Space left on disk (MB)") )),
+ `HSpacing(2.0),
+ `HWeight( 1, `ComboBox(`id("space_left_action"), `opt(`editable),
+ // ComboBox label - select an action which is performed if space on disk is low
+ _("Action"),
+ [`item(`id("IGNORE"), "IGNORE" ),
+ `item(`id("SYSLOG"), "SYSLOG", true ),
+ `item(`id("SUSPEND"), "SUSPEND" ),
+ `item(`id("SINGLE"), "SINGLE" ),
+ `item(`id("HALT"), "HALT" ),
+ `item(`id("EXEC"), "EXEC" ),
+ `item(`id("EMAIL"), "EMAIL" )
+ ])
+ )
+ )
+ ),
+ `VStretch(),
+ `Frame (
+ // Frame label - keep it short!
+ _("Value and action for space is running low"),
+ `HBox(
+ // InputField label - space on disk is running low if the entered value is reached
+ `HWeight( 1, `InputField(`id("admin_space_left"), _("&Admin space left on disk (MB) ")) ),
+ `HSpacing(2.0),
+ `HWeight( 1, `ComboBox(`id("admin_space_left_action"), `opt(`editable),
+ // ComboBox label - select an action which is performed if space on disk is running low
+ _("Action"),
+ [`item(`id("IGNORE"), "IGNORE" ),
+ `item(`id("SYSLOG"), "SYSLOG", true ),
+ `item(`id("SUSPEND"), "SUSPEND" ),
+ `item(`id("SINGLE"), "SINGLE" ),
+ `item(`id("HALT"), "HALT" ),
+ `item(`id("EXEC"), "EXEC" ),
+ `item(`id("EMAIL"), "EMAIL" )
+ ]) )
+
+ )
+ ),
+ `VStretch(),
+ `Frame(
+ // Frame label - keep it short!
+ _("Action on Error or Disk full"),
+ `VBox(
+ `ComboBox(`id("disk_full_action"), `opt(`editable),
+ // ComboBox label - select an action which is performed if disk is full
+ _("Disk Full Action"),
+ [`item(`id("IGNORE"), "IGNORE" ),
+ `item(`id("SYSLOG"), "SYSLOG", true ),
+ `item(`id("SUSPEND"), "SUSPEND" ),
+ `item(`id("SINGLE"), "SINGLE" ),
+ `item(`id("HALT"), "HALT" ),
+ `item(`id("EXEC"), "EXEC" )
+ ]),
+ `ComboBox(`id("disk_error_action"), `opt(`editable ),
+ // ComboBox label - select an action which is performed on error
+ _("Disk Error Action"),
+ [`item(`id("IGNORE"), "IGNORE" ),
+ `item(`id("SYSLOG"), "SYSLOG", true ),
+ `item(`id("SUSPEND"), "SUSPEND" ),
+ `item(`id("SINGLE"), "SINGLE" ),
+ `item(`id("HALT"), "HALT" ),
+ `item(`id("EXEC"), "EXEC" )
+ ])
+ )
+ ),
+ `VStretch()
+ )
+ );
+}
+
+term RulesDialogContent() {
+
+ return `MarginBox( mbox_x, mbox_y,
+ `VBox(
+ `VSpacing(0.2),
+ `VWeight( 20, `VBox(
+ // label of a combo box with the possibilitiy to enable/disable auditing or lock the rules
+ `Left(`ComboBox( `id("audit_enabled"), `opt(`notify), _("Set Enabled Flag"),
+ [`item(`id("enabled"), _("Auditing enabled"), true ), // -e 1
+ `item(`id("disabled"), _("Auditing disabled") ), // -e 0
+ `item(`id("locked"), _("Rules are locked (until next boot)")) // -e 2
+ ]
+ ) ),
+ `VStretch()
+ ) ),
+ `VSpacing(0.2),
+ `VWeight( 90, `VBox(
+ `Left(`Label(_("Edit the rules for the audit subsystem here:") ) ),
+ `MultiLineEdit(`id("rules"), `opt(`vstretch), "audit.rules" )
+
+ ) ),
+ `VWeight( 10,
+ // label of a push button (please keep it short)
+ `HBox(`PushButton( `id( "test" ), _("Check Syntax") ),
+ `HSpacing(2.0),
+ // label of push button (please keep it short)
+ `PushButton( `id( "restore" ), _("Restore 'audit.rules'") ),
+ `HSpacing(2.0),
+ // label of push button (please keep it short)
+ `PushButton( `id( "reset" ), _("Restore and Reset") ),
+ `HSpacing(2.0),
+ // label of push button
+ `PushButton( `id( "load" ), _("Load ") )
+ )
+ )
+
+ )
+ );
+}
+
+} /* EOF */
+
Added: trunk/audit-laf/src/helps.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/audit-laf/src/helps.ycp?rev=5056…
==============================================================================
--- trunk/audit-laf/src/helps.ycp (added)
+++ trunk/audit-laf/src/helps.ycp Tue Sep 2 12:34:50 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/audit-laf/helps.ycp
+ * Package: Configuration of LAF auditing
+ * Summary: Help texts of all the dialogs
+ * Authors: Gabriele Mohr <gs(a)suse.de>
+ *
+ */
+
+{
+
+textdomain "audit-laf";
+
+/**
+ * All helps are here
+ */
+map HELPS = $[
+
+ /* Read dialog help 1/2 */
+ "read" : _("<p><b><big>Initializing Configuration of LAF Auditing</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 and Rules</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>
+"),
+
+ /* logfile_settings dialog help 1/5 */
+ "logfile_settings" : _("<p><b><big>Auditd Logfile Configuration</big></b><br>
+Detailed information about the settings can be obtained from 'man auditd.conf'.</p>") +
+ /* logfile_settings dialog help 1/3 */
+ _("<p><b>Logfile</b>: Enter the full path name to the log file
+(or use <b>Select File</b>.)</p>") +
+ /* logfile_settings dialog help 1/3 */
+ _("<p><b>Format</b>: set <i>RAW</i> to log all data or <i>NOLOG</i>
+to discard all audit information (does not affect data sent to the dispatcher).</p> ") +
+ /* logfile_settings dialog help 1/3 */
+ _("<p><b>Flush</b>: describes how to write the data to disk. If set to
+<i>INCREMANTAL</i> the <b>Frequence</b> parameter tells how often a flush to disk is issued.</p>" ) +
+ /* logfile_settings dialog help 1/3 */
+ _("<p>Configure the maximum log file size and the action to take when this
+value is reached in <b>Size and Action</b> frame. If action is set to
+<b>ROTATE</b> the <b>Number of Logfiles</b> specifies the number of files to keep.</p>") +
+ /* logfile_settings dialog help 1/3 */
+ _("<p><b>Computer Name Format</b> describes how to the computer name is written
+to the log file. If <i>User</i> is set the <b>User Defined Name</b> is used.</p> "),
+
+ /* dispatcher dialog help 1/3 */
+ "dispatcher" : _("<p><b><big>Auditd Dispatcher Configuration</big></b><br>
+Detailed information about the dispatcher settings can be obtained from 'man auditd.conf'.<br></p>") +
+ /* dispatcher dialog help 2/3 */
+ _("<p><b>Dispatcher</b>: The dispatcher program is started by the audit daemon and
+gets all all audit events on stdin.</p>") +
+ /* dispatcher dialog help 3/3 */
+ _("<p><b>Communication</b>: Controls the communication
+between the daemon and the dispatcher program.<p>"),
+
+ /* disksapce dialog help 1/3 */
+ "diskspace_settings" : _("<p><b><big>Auditd Diskspace Configuration</big></b><br>
+Configure diskspace settings on log partition here..<br></p>
+"),
+
+ /* rules dialog help 1/5*/
+ "audit_rules" : _("<p><b><big>Rules for auditctl</big></b><br>
+This dialog offers the possibiltiy to enable or to disable the syscall
+auditing as well as to lock the audit configuration.
+The selected flag from <b>Set Enabled Flag</b> will be added to the rules.</p>" ) +
+ /* rules dialog help 2/5*/
+ _("<p><b>Please note:</b><br>Locking the rules means they cannot be changed until next reboot! </p>" ) +
+ /* rules dialog help 3/5 */
+ _("<p>To enable the auditing whithout adding additional rules will cause the
+ applications which use 'libaudit', e.g. PAM to log to audit.log.</p> ") +
+ /* rules dialog help 4/5 */
+ _("<p>This module also allows you to edit the rules manually. Detailed information
+about all options gives 'man auditctl'.<br>
+<b>Check Syntax</b> sends the rules via <i>auditctl</i> to the audit subsystem and tells
+whether the syntax is correct.</p>") +
+ /* rules dialog help 5/5 */
+ _("<p>Use the <b>Restore and Reset</b> to restore previous rules and reset the changes
+by calling <i>auditctl</i> with it.<br>
+The <b>Load</b> button opens an file selection dialog and you are able to load
+an example rules file.</p>")
+
+];
+
+/* EOF */
+}
Added: trunk/audit-laf/src/wizards.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/audit-laf/src/wizards.ycp?rev=50…
==============================================================================
--- trunk/audit-laf/src/wizards.ycp (added)
+++ trunk/audit-laf/src/wizards.ycp Tue Sep 2 12:34:50 2008
@@ -0,0 +1,204 @@
+/* ------------------------------------------------------------------------------
+ * 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/audit-laf/wizards.ycp
+ * Package: Configuration of LAF Auditing
+ * Summary: Wizards definitions
+ * Authors: Gabriele Mohr <gs(a)suse.de>
+ *
+ */
+
+{
+
+textdomain "audit-laf";
+
+import "Sequencer";
+import "Wizard";
+import "CWM";
+import "CWMTab";
+
+include "audit-laf/complex.ycp";
+include "audit-laf/dialogs.ycp";
+
+
+/**
+ * Main workflow of the LAF Auditing configuration
+ * @return sequence result
+ */
+any MainSequence() {
+ map <string, map <string, any> > widgets = $[
+ "log" : $[
+ "widget" : `custom,
+ "help" : HELPS["logfile_settings"]:"",
+ "custom_widget" : LogfileSettingsDialogContent(),
+ "handle" : HandleLogfileSettingsDialog,
+ "init" : InitLogfileSettingsDialog,
+ "store" : StoreLogfileSettingsDialog,
+ ],
+ "disp" : $[
+ "widget" : `custom,
+ "help" : HELPS["dispatcher"]:"",
+ "custom_widget" : DispatcherDialogContent(),
+ "handle" : HandleDispatcherDialog,
+ "init" : InitDispatcherDialog,
+ "store" : StoreDispatcherDialog,
+ ],
+ "disk" : $[
+ "widget" : `custom,
+ "help" : HELPS["diskspace_settings"]:"",
+ "custom_widget" : DiskspaceSettingsDialogContent(),
+ "init" : InitDiskspaceSettingsDialog,
+ "store" : StoreDiskspaceSettingsDialog,
+ ],
+ "rules" : $[
+ "widget" : `custom,
+ "help" : HELPS["audit_rules"]:"",
+ "custom_widget" : RulesDialogContent(),
+ "handle" : HandleRulesDialog,
+ "init" : InitRulesDialog,
+ "store" : StoreRulesDialog,
+ ],
+ ];
+
+ map <string, any> tabs = $[
+ "logfile_settings" : $[
+ "header" : _("&Logfile"),
+ "widget_names" : ["log"],
+ "contents" : LogfileSettingsDialogContent(),
+ ],
+ "dispatcher" : $[
+ "header" : _("&Dispatcher"),
+ "widget_names" : ["disp"],
+ "contents" : DispatcherDialogContent(),
+ ],
+ "diskspace_settings" : $[
+ "header" : _("&Diskspace on Log Partion"),
+ "widget_names" : ["disk"],
+ "contents" : DiskspaceSettingsDialogContent(),
+ ],
+ "audit_rules" : $[
+ "header" : _("&Rules for auditctl"),
+ "widget_names" : ["rules"],
+ "contents" : RulesDialogContent(),
+ ],
+ ];
+
+ string ini_tab = "";
+
+ if ( AuditLaf::RulesLocked() )
+ ini_tab = "audit_rules";
+ else
+ ini_tab = "logfile_settings";
+
+ map <string, any> wd = $[
+ "tab" : CWMTab::CreateWidget ($[
+ "tab_order" : ["logfile_settings", "dispatcher", "diskspace_settings", "audit_rules"],
+ "tabs" : tabs,
+ "widget_descr" : widgets,
+ "initial_tab" : ini_tab,
+ ])
+ ];
+
+ term contents = `VBox("tab");
+
+ list <map <string, any> > w = CWM::CreateWidgets (["tab"], (map <string, map <string, any> >) wd);
+
+ string caption = _("Configuration of LAF Auditing");
+ contents = CWM::PrepareDialog (contents, w);
+
+ Wizard::SetContentsButtons (
+ caption,
+ contents,
+ "",
+ Label::BackButton (),
+ Label::FinishButton()
+ );
+ Wizard::DisableBackButton ();
+ //Wizard::SetTitleIcon("yast-audit-laf");
+
+ return CWM::Run (w, $[`abort : ReallyExit]);
+}
+
+/**
+ * Whole configuration of LAF Auditing
+ * @return sequence result
+ */
+any AuditLafSequence() {
+
+ map aliases = $[
+ "read" : [ ``( ReadDialog() ), true ],
+ "main" : ``( MainSequence() ),
+ "check" : ``( CheckSettings() ),
+ "write" : [ ``( WriteDialog() ), true ]
+ ];
+
+ map sequence = $[
+ "ws_start" : "read",
+ "read" : $[
+ `abort : `abort,
+ `next : "main"
+ ],
+ "main" : $[
+ `abort : `abort,
+ `next : "check"
+ ],
+ "check" : $[
+ `abort: `abort,
+ `next: "write"
+ ],
+ "write" : $[
+ `abort : `abort,
+ `next : `next
+ ]
+ ];
+
+ Wizard::CreateDialog();
+
+ any ret = Sequencer::Run(aliases, sequence);
+
+ UI::CloseDialog();
+ return ret;
+}
+
+/**
+ * Whole configuration of LAFAuditing but without reading and writing.
+ * For use with autoinstallation.
+ * @return sequence result
+ */
+any AuditLafAutoSequence() {
+
+ /* Initialization dialog caption */
+ string caption = _("Configuration of LAFAuditing");
+ /* 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/audit-laf/testsuite/.cvsignore
URL: http://svn.opensuse.org/viewcvs/yast/trunk/audit-laf/testsuite/.cvsignore?r…
==============================================================================
--- trunk/audit-laf/testsuite/.cvsignore (added)
+++ trunk/audit-laf/testsuite/.cvsignore Tue Sep 2 12:34:50 2008
@@ -0,0 +1,11 @@
+Makefile
+Makefile.in
+site.exp
+*.sum
+*.log
+tmp.out*
+tmp.err*
+tmp.log*
+config
+run
+*.test
Added: trunk/audit-laf/testsuite/Makefile.am
URL: http://svn.opensuse.org/viewcvs/yast/trunk/audit-laf/testsuite/Makefile.am?…
==============================================================================
--- trunk/audit-laf/testsuite/Makefile.am (added)
+++ trunk/audit-laf/testsuite/Makefile.am Tue Sep 2 12:34:50 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/audit-laf/testsuite/tests/.cvsignore
URL: http://svn.opensuse.org/viewcvs/yast/trunk/audit-laf/testsuite/tests/.cvsig…
==============================================================================
(empty)
Added: trunk/audit-laf/testsuite/tests/TestModule.err
URL: http://svn.opensuse.org/viewcvs/yast/trunk/audit-laf/testsuite/tests/TestMo…
==============================================================================
(empty)
Added: trunk/audit-laf/testsuite/tests/TestModule.out
URL: http://svn.opensuse.org/viewcvs/yast/trunk/audit-laf/testsuite/tests/TestMo…
==============================================================================
--- trunk/audit-laf/testsuite/tests/TestModule.out (added)
+++ trunk/audit-laf/testsuite/tests/TestModule.out Tue Sep 2 12:34:50 2008
@@ -0,0 +1,2 @@
+Dump TestModule::Modified
+Return false
Added: trunk/audit-laf/testsuite/tests/TestModule.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/audit-laf/testsuite/tests/TestMo…
==============================================================================
--- trunk/audit-laf/testsuite/tests/TestModule.ycp (added)
+++ trunk/audit-laf/testsuite/tests/TestModule.ycp Tue Sep 2 12:34:50 2008
@@ -0,0 +1,13 @@
+{
+
+// testedfiles: TestModule.ycp
+
+include "testsuite.ycp";
+TESTSUITE_INIT([], nil);
+
+import "TestModule";
+
+DUMP("TestModule::Modified");
+TEST(``(TestModule::Modified()), [], nil);
+
+}
Added: trunk/audit-laf/yast2-audit-laf.spec.in
URL: http://svn.opensuse.org/viewcvs/yast/trunk/audit-laf/yast2-audit-laf.spec.i…
==============================================================================
--- trunk/audit-laf/yast2-audit-laf.spec.in (added)
+++ trunk/audit-laf/yast2-audit-laf.spec.in Tue Sep 2 12:34:50 2008
@@ -0,0 +1,30 @@
+@HEADER-COMMENT@
+
+@HEADER@
+Requires: yast2
+BuildRequires: perl-XML-Writer update-desktop-files yast2 yast2-devtools yast2-testsuite
+
+BuildArchitectures: noarch
+
+Summary: Configuration of audit-laf
+
+%description
+-
+
+@PREP@
+
+@BUILD@
+
+@INSTALL@
+
+@CLEAN@
+
+%files
+%defattr(-,root,root)
+%dir @yncludedir@/audit-laf
+@yncludedir@/audit-laf/*
+@clientdir@/audit-laf.ycp
+@clientdir@/audit-laf_*.ycp
+@moduledir@/AuditLaf.*
+@desktopdir@/audit-laf.desktop
+%doc @docdir@
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0
[yast-commit] r50561 - in /trunk/storage/storage/src/include: ep-dm-dialogs.ycp ep-loop-dialogs.ycp ep-lvm-dialogs.ycp ep-nfs.ycp ep-raid-dialogs.ycp
by aschnell@svn.opensuse.org 02 Sep '08
by aschnell@svn.opensuse.org 02 Sep '08
02 Sep '08
Author: aschnell
Date: Tue Sep 2 11:50:27 2008
New Revision: 50561
URL: http://svn.opensuse.org/viewcvs/yast?rev=50561&view=rev
Log:
- work on messages
Modified:
trunk/storage/storage/src/include/ep-dm-dialogs.ycp
trunk/storage/storage/src/include/ep-loop-dialogs.ycp
trunk/storage/storage/src/include/ep-lvm-dialogs.ycp
trunk/storage/storage/src/include/ep-nfs.ycp
trunk/storage/storage/src/include/ep-raid-dialogs.ycp
Modified: trunk/storage/storage/src/include/ep-dm-dialogs.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/include/ep-d…
==============================================================================
--- trunk/storage/storage/src/include/ep-dm-dialogs.ycp (original)
+++ trunk/storage/storage/src/include/ep-dm-dialogs.ycp Tue Sep 2 11:50:27 2008
@@ -23,6 +23,7 @@
"Password" : $[ `finish : `finish ]
];
+ // dialog title
string title = sformat(_("Edit DM %1"), device);
symbol widget = MiniWorkflow::Run(title, dm_icon, aliases, sequence, "FormatMount");
Modified: trunk/storage/storage/src/include/ep-loop-dialogs.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/include/ep-l…
==============================================================================
--- trunk/storage/storage/src/include/ep-loop-dialogs.ycp (original)
+++ trunk/storage/storage/src/include/ep-loop-dialogs.ycp Tue Sep 2 11:50:27 2008
@@ -8,38 +8,38 @@
textdomain "storage";
- string MiniWorkflowStepLoopNameSizeHelp()
+ string MiniWorkflowStepLoopNameSizeHelptext()
{
// TODO
- // help text
- string help = _("
+ // helptext
+ string helptext = _("
<p><b>Path Name of Loop File:</b><br>This must be an absolute path to the file
containing the data for the encrypted loop device to set up.</p>
");
- // help text
- help = help + _("
+ // helptext
+ helptext = helptext + _("
<p><b>Create Loop File:</b><br>If this is checked, the file will be created
with the size given in the next field. <b>NOTE:</b> If the file already
exists, all data in it is lost.</p>
");
- // help text
- help = help + _("
+ // helptext
+ helptext = helptext + _("
<p><b>Size:</b><br>This is the size of the loop file. The file system to
create in the encrypted loop device will have this size.</p>
");
- // help text
- help = help + _("
+ // helptext
+ helptext = helptext + _("
<p><b>NOTE:</b> During installation, there cannot be any consistency
checks about file size and path names because the file system is not
accessible. It will be created at the end of installation. Be
careful about the size and path name you provide.</p>
");
- return help;
+ return helptext;
}
@@ -54,16 +54,20 @@
term contents = `HVSquash(
`VBox(
+ // input field label
`Left(`MinWidth(25, `InputField(`id(`fpath), `opt(`hstretch), _("Path Name of Loop File"), fpath))),
+ // push button text
Mode::normal() ? `Left(`PushButton(`id(`browse), _("Browse..."))) : `Empty(),
`VSpacing(0.75),
+ // check box text
`LeftCheckBoxWithAttachment(`id(`create_file), `opt(`notify), _("Create Loop File"),
+ // input field label
`MinWidth(15, `InputField(`id(`size), `opt(`shrinkable), _("Size"),
Storage::KByteToHumanString(size_k))))
)
);
- MiniWorkflow::SetContents(Greasemonkey::Transform(contents), MiniWorkflowStepLoopNameSizeHelp());
+ MiniWorkflow::SetContents(Greasemonkey::Transform(contents), MiniWorkflowStepLoopNameSizeHelptext());
MiniWorkflow::SetLastStep(false);
UI::ChangeWidget(`id(`create_file), `Value, create_file);
@@ -100,12 +104,14 @@
string tmp = (string) UI::QueryWidget(`id(`size), `Value);
if (!Storage::HumanStringToKByte(tmp, size_k))
{
+ // error popup, %1 and %2 are replaced by sizes
Popup::Error(sformat(_("The size entered is invalid. Enter a value like \"%1\" or \"%2\"."),
Storage::KByteToHumanString(500*1024), Storage::KByteToHumanString(1024*1024)));
widget = `again;
}
else if (size_k < min_size_k)
{
+ // error popup, %1 is replaced by size
Popup::Error(sformat(_("The size entered is invalid. Enter a size of at least %1."),
Storage::KByteToHumanString(min_size_k)));
widget = `again;
@@ -147,6 +153,7 @@
"Password" : $[ `finish : `finish ]
];
+ // dialog title
string title = _("Add Crypt File");
symbol widget = MiniWorkflow::Run(title, lvm_lv_icon, aliases, sequence, "NameSize");
@@ -170,6 +177,7 @@
"Password" : $[ `finish : `finish ]
];
+ // dialog title
string title = sformat(_("Edit Crypt File %1"), device);
symbol widget = MiniWorkflow::Run(title, dm_icon, aliases, sequence, "FormatMount");
Modified: trunk/storage/storage/src/include/ep-lvm-dialogs.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/include/ep-l…
==============================================================================
--- trunk/storage/storage/src/include/ep-lvm-dialogs.ycp (original)
+++ trunk/storage/storage/src/include/ep-lvm-dialogs.ycp Tue Sep 2 11:50:27 2008
@@ -293,7 +293,10 @@
"TheOne" : $[ `finish : `finish ]
];
- symbol widget = MiniWorkflow::Run(_("Add Volume Group"), lvm_icon, aliases, sequence, "TheOne");
+ // dialog title
+ string title = _("Add Volume Group");
+
+ symbol widget = MiniWorkflow::Run(title, lvm_icon, aliases, sequence, "TheOne");
return widget == `finish;
}
@@ -438,6 +441,7 @@
"Commit" : $[ `finish : `finish ]
];
+ // dialog title
string title = sformat(_("Resize Volume Group %1"), data["device"]:"error");
symbol widget = MiniWorkflow::Run(title, lvm_icon, aliases, sequence, "TheOne");
@@ -517,6 +521,7 @@
"Commit" : $[ `finish : `finish ]
];
+ // dialog title
string title = sformat(_("Add Logical Volume on %1"), "/dev/" + data["vg_name"]:"error");
symbol widget = MiniWorkflow::Run(title, lvm_lv_icon, aliases, sequence, "Name");
@@ -540,6 +545,7 @@
"Password" : $[ `finish : `finish ]
];
+ // dialog title
string title = sformat(_("Edit Logical Volume %1"), device);
symbol widget = MiniWorkflow::Run(title, lvm_lv_icon, aliases, sequence, "FormatMount");
Modified: trunk/storage/storage/src/include/ep-nfs.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/include/ep-n…
==============================================================================
--- trunk/storage/storage/src/include/ep-nfs.ycp (original)
+++ trunk/storage/storage/src/include/ep-nfs.ycp Tue Sep 2 11:50:27 2008
@@ -30,6 +30,7 @@
Greasemonkey::Transform(
`VBox(
`HStretch(),
+ // heading
`IconAndHeading(_("Network File System (NFS)"), nfs_icon),
/*`Table(`id(`table), `opt(`keepSorting, `notify),
table_header, table_contents),
@@ -43,6 +44,7 @@
)
);
+ // helptext
string helptext = _("<p>NFS TODO</p>");
WFM::CallFunction("nfs-client4part", [ "FromStorage", $[ "shares" : nfs_shares ] ] );
@@ -73,11 +75,14 @@
UI::ReplaceWidget(`tree_panel,
Greasemonkey::Transform(
`VBox(
+ // heading
`IconAndHeading(sformat(_("NFS Path: %1"), part_device), nfs_icon),
`HStretch(),
StorageFields::Overview(fields, target_map, part_device),
`HBox(
+ // push button text
`PushButton(`id(`edit), "Edit..."),
+ // push button text
`PushButton(`id(`delete), "Delete..."),
`HStretch()
)
@@ -85,6 +90,7 @@
)
);
+ // helptext
string helptext = _("<p>NFS TODO</p>");
Wizard::RestoreHelp(helptext + StorageFields::OverviewHelptext(fields));
Modified: trunk/storage/storage/src/include/ep-raid-dialogs.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/include/ep-r…
==============================================================================
--- trunk/storage/storage/src/include/ep-raid-dialogs.ycp (original)
+++ trunk/storage/storage/src/include/ep-raid-dialogs.ycp Tue Sep 2 11:50:27 2008
@@ -24,6 +24,7 @@
{
map<string, string> info = $[ "raid0" : "RAID0", "raid1" : "RAID1", "raid5" : "RAID5", "raid6" : "RAID6",
"raid10" : "RAID10", "multipath" : "Multipath RAID" ];
+ // error popup, %1 is replaced by raid type e.g. "RAID1", %2 is replaced by integer
Popup::Error(sformat(_("For %1, select at least %2 device.", "For %1, select at least %2 devices.", min_num),
info[raid_type]:"error", min_num));
return false;
@@ -42,7 +43,7 @@
}
- string MiniWorkflowStepRaidTypeDevicesHelp()
+ string MiniWorkflowStepRaidTypeDevicesHelptext()
{
// TODO
@@ -103,6 +104,7 @@
contains(devices, dev["device"]:""); });
term contents = `VBox(`Left(
+ // heading
`HVSquash(`Frame(_("RAID Type"),
`RadioButtonGroup(`id(`raid_type),
`VBox(
@@ -124,10 +126,12 @@
contents = add(contents, `VSpacing(1));
contents = add(contents, DevicesSelectionBox::Create(unused_devices, used_devices, fields, callback,
+ // label for selection box
_("Available Devices:"),
+ // label for selection box
_("Selected Devices:")));
- MiniWorkflow::SetContents(Greasemonkey::Transform(contents), MiniWorkflowStepRaidTypeDevicesHelp());
+ MiniWorkflow::SetContents(Greasemonkey::Transform(contents), MiniWorkflowStepRaidTypeDevicesHelptext());
MiniWorkflow::SetLastStep(false);
symbol widget = nil;
@@ -174,7 +178,7 @@
}
- string MiniWorkflowStepRaidOptionsHelp()
+ string MiniWorkflowStepRaidOptionsHelptext()
{
// TODO
@@ -212,7 +216,9 @@
if (raid_type == "raid5")
options = add(options,
- `Left(`ComboBoxSelected(`id(`parity_algorithm), `opt(`hstretch), _("Parity &Algorithm"),
+ `Left(`ComboBoxSelected(`id(`parity_algorithm), `opt(`hstretch),
+ // combo box label
+ _("Parity &Algorithm"),
[ `item(`id(`left_asymmetric), "left-asymmetric"),
`item(`id(`left_symmetric), "left-symmetric"),
`item(`id(`right_asymmetric), "right-asymmetric"),
@@ -220,9 +226,10 @@
`id(parity_algorithm)))
);
+ // heading
term contents = `HVSquash(`Frame(_("RAID Options"), options));
- MiniWorkflow::SetContents(Greasemonkey::Transform(contents), MiniWorkflowStepRaidOptionsHelp());
+ MiniWorkflow::SetContents(Greasemonkey::Transform(contents), MiniWorkflowStepRaidOptionsHelptext());
MiniWorkflow::SetLastStep(false);
symbol widget = nil;
@@ -333,6 +340,7 @@
"Password" : $[ `finish : `finish ]
];
+ // dialog title
string title = sformat(_("Add RAID %1"), data["device"]:"error");
symbol widget = MiniWorkflow::Run(title, raid_icon, aliases, sequence, "TypeDevices");
@@ -351,6 +359,7 @@
"TheOne" : $[ `finish : `finish ]
];
+ // dialog title
string title = sformat(_("Resize RAID %1"), data["device"]:"error");
symbol widget = MiniWorkflow::Run(title, raid_icon, aliases, sequence, "TheOne");
@@ -374,6 +383,7 @@
"Password" : $[ `finish : `finish ]
];
+ // dialog title
string title = sformat(_("Edit RAID %1"), device);
symbol widget = MiniWorkflow::Run(title, raid_icon, aliases, sequence, "FormatMount");
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0
02 Sep '08
Author: locilka
Date: Tue Sep 2 11:31:40 2008
New Revision: 50560
URL: http://svn.opensuse.org/viewcvs/yast?rev=50560&view=rev
Log:
Created tag stable-2_17_16 for yast2
Added:
tags/stable-2_17_16/yast2/
- copied from r50559, trunk/yast2/
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0