Hello community,
here is the log from the commit of package yast2-kdump
checked in at Thu Oct 23 12:35:46 CEST 2008.
--------
--- yast2-kdump/yast2-kdump.changes 2008-10-08 11:16:35.000000000 +0200
+++ /mounts/work_src_done/STABLE/yast2-kdump/yast2-kdump.changes 2008-10-17 14:19:42.000000000 +0200
@@ -1,0 +2,6 @@
+Fri Oct 17 14:07:00 CEST 2008 - juhliarik@suse.cz
+
+- added fix for adding password for ssh target (bnc #436042)
+- V 2.17.7
+
+-------------------------------------------------------------------
calling whatdependson for head-i586
Old:
----
yast2-kdump-2.17.6.tar.bz2
New:
----
yast2-kdump-2.17.7.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ yast2-kdump.spec ++++++
--- /var/tmp/diff_new_pack.yp1667/_old 2008-10-23 12:35:22.000000000 +0200
+++ /var/tmp/diff_new_pack.yp1667/_new 2008-10-23 12:35:23.000000000 +0200
@@ -1,5 +1,5 @@
#
-# spec file for package yast2-kdump (Version 2.17.6)
+# spec file for package yast2-kdump (Version 2.17.7)
#
# Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
@@ -19,12 +19,12 @@
Name: yast2-kdump
-Version: 2.17.6
+Version: 2.17.7
Release: 1
License: GPL v2 only
Group: System/YaST
BuildRoot: %{_tmppath}/%{name}-%{version}-build
-Source0: yast2-kdump-2.17.6.tar.bz2
+Source0: yast2-kdump-2.17.7.tar.bz2
Prefix: /usr
Requires: yast2 yast2-storage yast2-bootloader
BuildRequires: perl-XML-Writer update-desktop-files yast2 yast2-bootloader yast2-devtools yast2-storage yast2-testsuite
@@ -43,7 +43,7 @@
Jozef Uhliarik
%prep
-%setup -n yast2-kdump-2.17.6
+%setup -n yast2-kdump-2.17.7
%build
%{prefix}/bin/y2tool y2autoconf
@@ -77,7 +77,11 @@
/usr/share/YaST2/schema/autoyast/rnc/kdump.rnc
/usr/share/YaST2/scrconf/*.scr
%doc %{prefix}/share/doc/packages/yast2-kdump
+
%changelog
+* Fri Oct 17 2008 juhliarik@suse.cz
+- added fix for adding password for ssh target (bnc #436042)
+- V 2.17.7
* Wed Oct 08 2008 juhliarik@suse.cz
- added fix for adding crashkernel option (bnc #432651)
- V 2.17.6
++++++ yast2-kdump-2.17.6.tar.bz2 -> yast2-kdump-2.17.7.tar.bz2 ++++++
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-kdump-2.17.6/src/helps.ycp new/yast2-kdump-2.17.7/src/helps.ycp
--- old/yast2-kdump-2.17.6/src/helps.ycp 2008-09-22 16:34:54.000000000 +0200
+++ new/yast2-kdump-2.17.7/src/helps.ycp 2008-10-17 10:08:25.000000000 +0200
@@ -79,7 +79,7 @@
<i>Server Name</i> - The name of server.
<i>Port</i> - The port number for connection.
<i>Directory on Server</i> - The path for saving kdump images.
- <i>User Name</i> for ssh connection.<br></p>")+
+ <i>User Name</i> for ssh connection. <i>Password</i> for ssh connection.<br></p>")+
/* Dump Format - RadioButtons 5/6*/
_("<p><b>NFS</b> - Save kdump image on NFS.
<i>Server Name</i> - The name of nfs server.
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-kdump-2.17.6/src/Kdump.ycp new/yast2-kdump-2.17.7/src/Kdump.ycp
--- old/yast2-kdump-2.17.6/src/Kdump.ycp 2008-10-08 09:45:53.000000000 +0200
+++ new/yast2-kdump-2.17.7/src/Kdump.ycp 2008-10-17 14:06:27.000000000 +0200
@@ -52,6 +52,7 @@
import "ProductControl";
import "ProductFeatures";
import "PackagesProposal";
+import "FileUtils";
/**
* Prototypes
@@ -66,6 +67,13 @@
global boolean modified = false;
/**
+ * kdump config file
+ */
+
+string kdump_file = "/etc/sysconfig/kdump";
+
+
+/**
*/
global boolean proposal_valid = false;
@@ -297,6 +305,42 @@
}
+/**
+ * Function set permission for file.
+ *
+ * @return boolean true on success
+ * @param string file name
+ * @param string permissions
+ *
+ * @example
+ * FileUtils::Chmod ("/etc/sysconfig/kdump", "600") -> true
+ * FileUtils::Chmod ("/tmp/doesnt_exist", "644") -> false
+ */
+boolean Chmod (string target, string permissions)
+{
+ if (! FileUtils::Exists(target))
+ {
+ y2error ("Target %1 doesn't exist", target);
+ return false;
+ }
+
+ if (! FileUtils::Exists("/bin/chmod"))
+ {
+ y2error ("tool: /bin/chmod not found");
+ return false;
+ }
+
+ string cmd = sformat ("/bin/chmod %1 %2", permissions, target);
+ map cmd_out = (map) SCR::Execute (.target.bash_output, cmd);
+
+ if (cmd_out["exit"]:-1 != 0)
+ {
+ y2error ("Command >%1< returned %2", cmd, cmd_out);
+ return false;
+ }
+ y2milestone("Command: %1 finish successful.", cmd);
+ return true;
+}
/**
* Read actual boot section
@@ -403,6 +447,41 @@
}
/**
+ * Function check if KDUMP_SAVEDIR or
+ * KDUMP_SMTP_PASSWORD include password
+ *
+ * @return boolean true if inlude password
+ */
+
+boolean checkPassword()
+{
+ if (KDUMP_SETTINGS["KDUMP_SMTP_PASSWORD"]:"" != "")
+ return true;
+
+ if ((search(KDUMP_SETTINGS["KDUMP_SAVEDIR"]:"", "file") != nil)
+ || (search(KDUMP_SETTINGS["KDUMP_SAVEDIR"]:"", "nfs") != nil)
+ || (KDUMP_SETTINGS["KDUMP_SAVEDIR"]:"" == ""))
+ return false;
+
+ if (search(KDUMP_SETTINGS["KDUMP_SAVEDIR"]:"", "@") == nil)
+ return false;
+
+ list<string> temp = splitstring(KDUMP_SETTINGS["KDUMP_SAVEDIR"]:"", "@");
+ string temp_1 = temp[0]:"";
+ integer position = findlastof(temp_1, ":");
+ if (position == nil)
+ return false;
+
+ // if there is 2 times ":" -> it means that password is defined
+ // for example cifs://login:password@server....
+ if (position > 6)
+ return true;
+ else
+ return false;
+}
+
+
+/**
* get alocated memory from value of crashkernel option
* there can be several ranges -> take the first range
* @param string 64M@16M or 128M-:64M@16M [(reserved_memory*2)-:reserved_memory]
@@ -700,7 +779,12 @@
SCR::Write(add(.sysconfig.kdump, option_key), option_val);
});
SCR::Write(.sysconfig.kdump, nil);
-
+
+
+ if (checkPassword())
+ Chmod(kdump_file, "600");
+ else
+ Chmod(kdump_file, "644");
return true;
}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-kdump-2.17.6/src/uifunctions.ycp new/yast2-kdump-2.17.7/src/uifunctions.ycp
--- old/yast2-kdump-2.17.6/src/uifunctions.ycp 2008-09-22 16:11:18.000000000 +0200
+++ new/yast2-kdump-2.17.7/src/uifunctions.ycp 2008-10-17 13:55:21.000000000 +0200
@@ -112,7 +112,13 @@
)),
`Left(`InputField( `id("dir"), _("&Directory on Server"))),
// text entry
- `Left(`InputField(`id ("user_name"), _("&User Name")))
+ `Left(`HBox(
+ // text entry
+ `Left(`InputField(`id ("user_name"), _("&User Name"))),
+ `HSpacing(1),
+ // password entry
+ `Left(`Password(`id ("password"), _("&Password")))
+ ))
)))
);
@@ -199,11 +205,11 @@
KDUMP_SAVE_TARGET["target"]=substring(parse_target,0,pos-1);
parse_target = substring(parse_target,pos+2);
- //file
+ // file
if (KDUMP_SAVE_TARGET["target"]:nil == "file") {
KDUMP_SAVE_TARGET["dir"]=parse_target;
- //nfs
+ // nfs
} else if (KDUMP_SAVE_TARGET["target"]:nil == "nfs") {
pos = search(parse_target, "/");
//pos1 = pos;
@@ -212,26 +218,9 @@
//KDUMP_SAVE_TARGET["share"]=substring(parse_target,pos1+1,pos-(pos1+1));
KDUMP_SAVE_TARGET["dir"]=substring(parse_target,pos);
- //ssh
- } else if (KDUMP_SAVE_TARGET["target"]:nil == "ssh") {
- pos = search(parse_target, "@");
- if (pos != nil) {
- KDUMP_SAVE_TARGET["user_name"]=substring(parse_target,0,pos);
- parse_target = substring(parse_target,pos+1);
- }
- pos1 = search(parse_target, ":");
- pos = search(parse_target, "/");
- if (pos1 != nil) {
- KDUMP_SAVE_TARGET["server"]=substring(parse_target,0,pos1);
- KDUMP_SAVE_TARGET["port"]=substring(parse_target,pos1+1,pos-(pos1+1));
- } else {
- KDUMP_SAVE_TARGET["server"]=substring(parse_target,0,pos);
- }
- KDUMP_SAVE_TARGET["dir"]=substring(parse_target,pos);
-
- //ftp and cifs
} else if ((KDUMP_SAVE_TARGET["target"]:nil == "ftp")
- || (KDUMP_SAVE_TARGET["target"]:nil == "cifs")) {
+ || (KDUMP_SAVE_TARGET["target"]:nil == "cifs")
+ || (KDUMP_SAVE_TARGET["target"]:nil == "ssh")) {
pos = search(parse_target, "@");
@@ -248,8 +237,9 @@
}
parse_target = substring(parse_target,pos+1);
}
- //only ftp
- if (KDUMP_SAVE_TARGET["target"]:nil == "ftp") {
+ // only ftp & ssh
+ if ((KDUMP_SAVE_TARGET["target"]:nil == "ftp")
+ || (KDUMP_SAVE_TARGET["target"]:nil == "ssh")) {
pos1 = search(parse_target, ":");
pos = search(parse_target, "/");
@@ -262,7 +252,7 @@
}
KDUMP_SAVE_TARGET["dir"]=substring(parse_target,pos);
- //only cifs
+ // only cifs
} else {
pos = search(parse_target, "/");
KDUMP_SAVE_TARGET["server"]=substring(parse_target,0,pos);
@@ -301,34 +291,34 @@
string tostringKDUMP_SAVE_TARGET() {
string result = "";
- //file
+ // file
if (KDUMP_SAVE_TARGET["target"]:nil == "file") {
result = "file://";
if (KDUMP_SAVE_TARGET["dir"]:nil != "")
result = result+KDUMP_SAVE_TARGET["dir"]:nil;
- //ftp
+ // ftp
} else if (KDUMP_SAVE_TARGET["target"]:nil == "ftp") {
result = "ftp://";
if (KDUMP_SAVE_TARGET["user_name"]:nil == "") {
result = result+KDUMP_SAVE_TARGET["server"]:nil;
- //add port if it is set...
+ // add port if it is set...
if (KDUMP_SAVE_TARGET["port"]:nil != "") {
result = result+":"+KDUMP_SAVE_TARGET["port"]:nil+KDUMP_SAVE_TARGET["dir"]:nil;
} else {
result = result+KDUMP_SAVE_TARGET["dir"]:nil;
}
-
+
} else {
result = result+KDUMP_SAVE_TARGET["user_name"]:nil;
if (KDUMP_SAVE_TARGET["password"]:nil != "")
result = result+":"+KDUMP_SAVE_TARGET["password"]:nil;
result = result+"@"+KDUMP_SAVE_TARGET["server"]:nil;
-
+
if (KDUMP_SAVE_TARGET["port"]:nil != "") {
result = result+":"+KDUMP_SAVE_TARGET["port"]:nil+KDUMP_SAVE_TARGET["dir"]:nil;
@@ -337,14 +327,18 @@
}
}
- //ssh
+ // ssh
} else if (KDUMP_SAVE_TARGET["target"]:nil == "ssh") {
result = "ssh://";
- if (KDUMP_SAVE_TARGET["user_name"]:nil != "")
+ if ((KDUMP_SAVE_TARGET["user_name"]:nil != "") && (KDUMP_SAVE_TARGET["password"]:nil == "")) {
result = result+KDUMP_SAVE_TARGET["user_name"]:nil+"@";
+ } else if ((KDUMP_SAVE_TARGET["user_name"]:nil != "") && (KDUMP_SAVE_TARGET["password"]:nil != "")) {
+ result = result+KDUMP_SAVE_TARGET["user_name"]:nil;
+ result = result+":"+KDUMP_SAVE_TARGET["password"]:nil +"@";
+ }
result = result+KDUMP_SAVE_TARGET["server"]:nil;
- //add port if it is set...
+ // add port if it is set...
if (KDUMP_SAVE_TARGET["port"]:nil != "") {
result = result+":"+KDUMP_SAVE_TARGET["port"]:nil+KDUMP_SAVE_TARGET["dir"]:nil;
@@ -353,11 +347,11 @@
}
- //nfs
+ // nfs
} else if (KDUMP_SAVE_TARGET["target"]:nil == "nfs") {
result = "nfs://"+KDUMP_SAVE_TARGET["server"]:nil+KDUMP_SAVE_TARGET["dir"]:nil;
- //cifs
+ // cifs
} else if (KDUMP_SAVE_TARGET["target"]:nil == "cifs") {
result = "cifs://";
@@ -419,7 +413,7 @@
UI::ChangeWidget(`id ("TargetKdump"), `Value, "ssh");
if (KDUMP_SAVE_TARGET["port"]:nil != "")
UI::ChangeWidget(`id ("port"), `Value, tointeger(KDUMP_SAVE_TARGET["port"]:nil));
- foreach (string key, ["server", "user_name", "dir" ], {
+ foreach (string key, ["server", "user_name", "dir", "password"], {
UI::ChangeWidget(`id (key), `Value, KDUMP_SAVE_TARGET[key]:nil);
});
@@ -636,7 +630,7 @@
if (KDUMP_SAVE_TARGET["port"]:nil != "")
UI::ChangeWidget(`id ("port"), `Value, tointeger(KDUMP_SAVE_TARGET["port"]:nil));
- foreach (string key, ["server", "user_name", "dir" ], {
+ foreach (string key, ["server", "user_name", "dir", "password" ], {
UI::ChangeWidget(`id (key), `Value, KDUMP_SAVE_TARGET[key]:nil);
});
@@ -770,6 +764,15 @@
KDUMP_SAVE_TARGET["user_name"] = value;
else
KDUMP_SAVE_TARGET["user_name"] = "";
+
+ //password
+ value = tostring(UI::QueryWidget(`id ("password"), `Value));
+
+ if ((value != nil) && (KDUMP_SAVE_TARGET["user_name"]:nil != ""))
+ KDUMP_SAVE_TARGET["password"] = value;
+ else
+ KDUMP_SAVE_TARGET["password"] = "";
+
} else if (radiobut == "nfs") {
KDUMP_SAVE_TARGET["target"] = "nfs";
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-kdump-2.17.6/VERSION new/yast2-kdump-2.17.7/VERSION
--- old/yast2-kdump-2.17.6/VERSION 2008-10-08 10:34:30.000000000 +0200
+++ new/yast2-kdump-2.17.7/VERSION 2008-10-17 14:08:46.000000000 +0200
@@ -1 +1 @@
-2.17.6
+2.17.7
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org