summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Zoffoli <xmerlin@gentoo.org>2005-04-15 16:16:53 +0000
committerChristian Zoffoli <xmerlin@gentoo.org>2005-04-15 16:16:53 +0000
commitf2aab818e3b76a40eaec9d790a85d17b7f749a4c (patch)
treeee947fdd627c4e006272d063e22b241d34844551 /sys-cluster
parentRemoving livecd-specific patches and all livecd-specific options as these hav... (diff)
downloadgentoo-2-f2aab818e3b76a40eaec9d790a85d17b7f749a4c.tar.gz
gentoo-2-f2aab818e3b76a40eaec9d790a85d17b7f749a4c.tar.bz2
gentoo-2-f2aab818e3b76a40eaec9d790a85d17b7f749a4c.zip
Fixed temporary files creation (security bug). Closes bug #86686. Fixed typos. Closes bug #84672.
(Portage version: 2.0.51.19)
Diffstat (limited to 'sys-cluster')
-rw-r--r--sys-cluster/openmosixview/ChangeLog10
-rw-r--r--sys-cluster/openmosixview/Manifest22
-rw-r--r--sys-cluster/openmosixview/files/openmosixview-1.5-logdirectory.diff125
-rw-r--r--sys-cluster/openmosixview/files/openmosixview-1.5-nonodestmp.diff117
-rw-r--r--sys-cluster/openmosixview/files/openmosixview-1.5-typos.patch29
-rw-r--r--sys-cluster/openmosixview/files/openmosixview-1.5-usesyslog.diff101
-rw-r--r--sys-cluster/openmosixview/openmosixview-1.5.ebuild11
7 files changed, 398 insertions, 17 deletions
diff --git a/sys-cluster/openmosixview/ChangeLog b/sys-cluster/openmosixview/ChangeLog
index 839b2aea1684..696e9764edf0 100644
--- a/sys-cluster/openmosixview/ChangeLog
+++ b/sys-cluster/openmosixview/ChangeLog
@@ -1,6 +1,14 @@
# ChangeLog for sys-cluster/openmosixview
# Copyright 2002-2005 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-cluster/openmosixview/ChangeLog,v 1.5 2005/01/18 16:40:53 tantive Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-cluster/openmosixview/ChangeLog,v 1.6 2005/04/15 16:16:53 xmerlin Exp $
+
+ 15 Apr 2005; Christian Zoffoli <xmerlin@gentoo.org>
+ +files/openmosixview-1.5-logdirectory.diff,
+ +files/openmosixview-1.5-nonodestmp.diff,
+ +files/openmosixview-1.5-typos.patch,
+ +files/openmosixview-1.5-usesyslog.diff, openmosixview-1.5.ebuild:
+ Fixed temporary files creation (security bug). Closes bug #86686.
+ Fixed typos. Closes bug #84672.
18 Jan 2005; Michael Imhof <tantive@gentoo.org> openmosixview-1.4-r1.ebuild,
openmosixview-1.5.ebuild:
diff --git a/sys-cluster/openmosixview/Manifest b/sys-cluster/openmosixview/Manifest
index 5be00b150bb7..1d1c1688f452 100644
--- a/sys-cluster/openmosixview/Manifest
+++ b/sys-cluster/openmosixview/Manifest
@@ -1,17 +1,11 @@
------BEGIN PGP SIGNED MESSAGE-----
-Hash: SHA1
-
-MD5 41664043c4624dedcfeeb07950f08d13 metadata.xml 312
-MD5 7c0418255a6387478819abcef982fcfb ChangeLog 1644
-MD5 34ece4f2532586aa90e9597fc19ddeac openmosixview-1.5.ebuild 1789
+MD5 de13fd47b49bc44a19753674035618b8 openmosixview-1.5.ebuild 2019
MD5 06779ea5c93059ea7218c08d0c1372bd openmosixview-1.4-r1.ebuild 2292
-MD5 36d55cc173a3505d4605028e44916ae9 files/digest-openmosixview-1.5 69
+MD5 7c0418255a6387478819abcef982fcfb ChangeLog 1644
+MD5 41664043c4624dedcfeeb07950f08d13 metadata.xml 312
+MD5 d61ecf92714eac96e7d05665ea2cf911 files/openmosixview-1.5-nonodestmp.diff 2724
+MD5 083d52867bbb40018618629f5c9263c4 files/openmosixview-1.5-usesyslog.diff 2698
MD5 d5017d88ab775aaf821cb3e426827008 files/digest-openmosixview-1.4-r1 70
+MD5 c825cce4d4bc77595bb8d6584d4a1c25 files/openmosixview-1.5-typos.patch 999
+MD5 fa2bdec7a865ea57b111efb92da5910f files/openmosixview-1.5-logdirectory.diff 4538
+MD5 36d55cc173a3505d4605028e44916ae9 files/digest-openmosixview-1.5 69
MD5 40351f8cbabc76e8c9b6860e8d92025a files/openmosixcollector.init 499
------BEGIN PGP SIGNATURE-----
-Version: GnuPG v1.2.6 (GNU/Linux)
-
-iD8DBQFB7TwwKtJO8LeSoosRAl9fAJ4qjJGMaaaja0C5h2tMT7E45nwv8QCeI1KC
-IMysLk7umc2is6UvofUlaKc=
-=uwWK
------END PGP SIGNATURE-----
diff --git a/sys-cluster/openmosixview/files/openmosixview-1.5-logdirectory.diff b/sys-cluster/openmosixview/files/openmosixview-1.5-logdirectory.diff
new file mode 100644
index 000000000000..c099d2f53417
--- /dev/null
+++ b/sys-cluster/openmosixview/files/openmosixview-1.5-logdirectory.diff
@@ -0,0 +1,125 @@
+--- openmosixview-1.5.orig/openmosixcollector/openmosixcollector.h
++++ openmosixview-1.5/openmosixcollector/openmosixcollector.h
+@@ -34,7 +34,7 @@
+
+ #define collectorpid "/var/run/openMosixcollector.pid"
+ #define clusterdirectory "/proc/hpc/nodes/"
+-#define logdirectory "/tmp/openmosixcollector"
++#define logdirectory "/var/lib/openmosixview"
+ #define syncfile "sync.count"
+
+ using namespace std;
+--- openmosixview-1.5.orig/openmosixcollector/openmosixcollector.cpp
++++ openmosixview-1.5/openmosixcollector/openmosixcollector.cpp
+@@ -90,11 +90,14 @@
+
+ string prochistorydir;
+ prochistorydir.erase();
+- prochistorydir = prochistorydir + logdirectory;
+- prochistorydir = prochistorydir + "/phist";
+ if (!file_exist(logdirectory)) {
+ mkdir(logdirectory, 0777);
+ }
++ prochistorydir = prochistorydir + logdirectory + "/current";
++ if (!file_exist(prochistorydir.c_str())) {
++ mkdir(prochistorydir.c_str(), 0777);
++ }
++ prochistorydir = prochistorydir + "/phist";
+ if (!file_exist(prochistorydir.c_str())) {
+ mkdir(prochistorydir.c_str(), 0777);
+ }
+@@ -385,7 +388,7 @@
+ now = now + currentdate();
+ nodelogfile_txt.erase();
+ nodelogfile_txt = nodelogfile_txt + logdirectory;
+- nodelogfile_txt = nodelogfile_txt + "/";
++ nodelogfile_txt = nodelogfile_txt + "/current/";
+ nodelogfile_txt = nodelogfile_txt + nodeid;
+
+ // here we check if the nodelog-file exist
+@@ -425,7 +428,7 @@
+ string cread;
+ int countit=0;
+ char zeile[21];
+- tmpstr=tmpstr + logdirectory + "/" + syncfile;
++ tmpstr=tmpstr + logdirectory + "/current/" + syncfile;
+ std::ifstream readval(tmpstr.c_str());
+ if (readval) {
+ readval.getline(zeile, 20);
+@@ -499,7 +502,7 @@
+ now1 = now1 + currentdate();
+ clusterlogfile_txt.erase();
+ clusterlogfile_txt = clusterlogfile_txt + logdirectory;
+- clusterlogfile_txt = clusterlogfile_txt + "/cluster";
++ clusterlogfile_txt = clusterlogfile_txt + "/current/cluster";
+ std::ofstream clusterlogfile(clusterlogfile_txt.c_str(), ios::app);
+ if (clusterlogfile) {
+ // T -> currenttime
+@@ -652,7 +655,7 @@
+ now = now + currentdate();
+ processlogfile_txt.erase();
+ processlogfile_txt = processlogfile_txt + logdirectory;
+- processlogfile_txt = processlogfile_txt + "/phist/";
++ processlogfile_txt = processlogfile_txt + "/current/phist/";
+ processlogfile_txt = processlogfile_txt + int2string(tsecs);
+ processlogfile_txt = processlogfile_txt + "tsecs.dat";
+ std::ofstream processlogfile(processlogfile_txt.c_str(), ios::app);
+@@ -720,7 +723,7 @@
+ // write checkpoint to nodefiles
+ nodelogfile_txt.erase();
+ nodelogfile_txt = nodelogfile_txt + logdirectory;
+- nodelogfile_txt = nodelogfile_txt + "/";
++ nodelogfile_txt = nodelogfile_txt + "/current/";
+ nodelogfile_txt = nodelogfile_txt + nodeid;
+ now.erase();
+ now = now + currentdate();
+@@ -755,7 +758,7 @@
+ // write checkpoint to clusterfile
+ clusterlogfile_txt.erase();
+ clusterlogfile_txt = clusterlogfile_txt + logdirectory;
+- clusterlogfile_txt = clusterlogfile_txt + "/cluster";
++ clusterlogfile_txt = clusterlogfile_txt + "/current/cluster";
+ now1.erase();
+ now1 = now1 + currentdate();
+ std::ofstream clusterlogfile(clusterlogfile_txt.c_str(), ios::app);
+@@ -798,14 +801,15 @@
+ copycommand.erase();
+ copycommand = copycommand + "/bin/mv ";
+ copycommand = copycommand + logdirectory;
+- copycommand = copycommand + "/ ";
++ copycommand = copycommand + "/current/ ";
+ copycommand = copycommand + logdirectory;
+- copycommand = copycommand + "_";
++ copycommand = copycommand + "/";
+ copycommand = copycommand + now;
++ error=system(copycommand.c_str());
+ if((error=system(copycommand.c_str())) > 0) {
+- cout << "Could not store the logfiles" << endl;
+- } else {
+- cout << "Successfully stored the logfiles" << endl;
++ syslog(LOG_ERR, "Could not store the logfiles");
++ } else {
++ syslog(LOG_DEBUG, "Successfully stored the logfiles");
+ }
+ }
+
+@@ -817,7 +821,7 @@
+ string cread;
+ int countit=0;
+ char zeile[21];
+- tmpstr=tmpstr + logdirectory + "/" + syncfile;
++ tmpstr=tmpstr + logdirectory + "/current/" + syncfile;
+ std::ifstream readval(tmpstr.c_str());
+ if (readval) {
+ readval.getline(zeile, 20);
+--- openmosixview-1.5.orig/openmosixanalyzer/main.cpp
++++ openmosixview-1.5/openmosixanalyzer/main.cpp
+@@ -46,7 +46,7 @@
+ if(argc==2) {
+ openmosixanalyzer->drawcluster(argv[1]);
+ } else {
+- openmosixanalyzer->drawcluster("/tmp/openmosixcollector/");
++ openmosixanalyzer->drawcluster("/var/lib/openmosixview/current/");
+ }
+
+
diff --git a/sys-cluster/openmosixview/files/openmosixview-1.5-nonodestmp.diff b/sys-cluster/openmosixview/files/openmosixview-1.5-nonodestmp.diff
new file mode 100644
index 000000000000..f49b7e986934
--- /dev/null
+++ b/sys-cluster/openmosixview/files/openmosixview-1.5-nonodestmp.diff
@@ -0,0 +1,117 @@
+--- openmosixview-1.5.orig/openmosixprocs/openmosixprocs.cpp
++++ openmosixview-1.5/openmosixprocs/openmosixprocs.cpp
+@@ -19,6 +19,9 @@
+ #include <config.h>
+ #endif
+
++#include <cstring>
++#include <cstdio>
++
+ #include <qaccel.h>
+ #include "openmosixprocs.h"
+
+@@ -126,22 +129,29 @@
+ string which;
+ char zeile[201];
+ string nodename;
+- which = which + clustercommand + " whois ";
+- which = which + node + " > /tmp/nodes.tmp";
+- system(which.c_str());
+- if (file_exist("/tmp/nodes.tmp")) {
+- std::ifstream readnodename("/tmp/nodes.tmp");
+- if (readnodename) {
+- readnodename.getline(zeile, 200);
+- nodename.erase();
+- nodename= nodename+zeile;
+- readnodename.close();
+- } else {
+- cout << "could not read from /tmp/nodes.tmp" << endl;
+- return 0;
+- }
++
++ which += " whois ";
++ which += node;
++
++ FILE *fp = popen(which.c_str(), "r");
++ if (!fp)
++ {
++ cout << "could not run " << clustercommand << endl;
+ }
+- unlink("/tmp/nodes.tmp");
++
++ int n;
++ while ((n = fread(zeile, 1, 200, fp)) > 0)
++ {
++ int count; // only copy the first line, and skip the \n
++ for (count = 0; count < n; count++)
++ if (zeile[count] == '\n')
++ break;
++ nodename.append(zeile,count);
++ if (count != n)
++ break;
++ }
++ fclose(fp);
++
+ return nodename;
+
+ }
+
+--- openmosixview-1.5.orig/openmosixview/openmosixview.cpp
++++ openmosixview-1.5/openmosixview/openmosixview.cpp
+@@ -16,6 +16,8 @@
+ ***************************************************************************/
+
+ #include <qaccel.h>
++#include <cstring>
++#include <cstdio>
+ #include "openmosixview.h"
+ #include "filesave.xpm"
+ #include "fileopen.xpm"
+@@ -454,24 +456,32 @@
+ // converts a cluster id to an hostname
+ string OpenMosixViewApp::getnodename(string node) {
+ // gather nodes hostname
+- string which;
++ string which(clustercommand);
+ char zeile[201];
+ string nodename;
+- which = which + clustercommand + " whois ";
+- which = which + node + " > /tmp/nodes.tmp";
+- system(which.c_str());
+- if (file_exist("/tmp/nodes.tmp")) {
+- std::ifstream readnodename("/tmp/nodes.tmp");
+- if (readnodename) {
+- readnodename.getline(zeile, 200);
+- nodename.erase();
+- nodename= nodename+zeile;
+- readnodename.close();
+- } else {
+- cout << "could not read from /tmp/nodes.tmp" << endl;
+- return 0;
+- }
++
++ which += " whois ";
++ which += node;
++
++ FILE *fp = popen(which.c_str(), "r");
++ if (!fp)
++ {
++ cout << "could not run " << clustercommand << endl;
+ }
++
++ int n;
++ while ((n = fread(zeile, 1, 200, fp)) > 0)
++ {
++ int count;
++ for (count = 0; count < n; count++)
++ if (zeile[count] == '\n')
++ break;
++ nodename.append(zeile,count);
++ if (count != n)
++ break;
++ }
++ fclose(fp);
++
+ return nodename;
+ }
+
diff --git a/sys-cluster/openmosixview/files/openmosixview-1.5-typos.patch b/sys-cluster/openmosixview/files/openmosixview-1.5-typos.patch
new file mode 100644
index 000000000000..1d3e8b20816c
--- /dev/null
+++ b/sys-cluster/openmosixview/files/openmosixview-1.5-typos.patch
@@ -0,0 +1,29 @@
+--- openmosixview-1.5/openmosixview/openmosixview.cpp.chris 2005-04-15 18:06:22.683738000 +0200
++++ openmosixview-1.5/openmosixview/openmosixview.cpp 2005-04-15 18:09:10.008301632 +0200
+@@ -174,7 +174,7 @@
+
+
+ // the toolbar
+- fileOpen = new QToolButton(ontop, "run programm");
++ fileOpen = new QToolButton(ontop, "run program");
+ fileOpen->setGeometry(0,25,25,25);
+ fileOpen->setPixmap(openIcon);
+ connect(fileOpen, SIGNAL(clicked()), this, SLOT(slotFileOpen()));
+@@ -397,7 +397,7 @@
+
+
+ fileMenu=new QPopupMenu();
+- fileMenu->insertItem("run programm", this, SLOT(slotFileOpen()), 0, ID_FILE_OPEN);
++ fileMenu->insertItem("run program", this, SLOT(slotFileOpen()), 0, ID_FILE_OPEN);
+ fileMenu->insertSeparator();
+ fileQuit->addTo(fileMenu);
+
+@@ -2136,7 +2136,7 @@
+ p++;
+ } // end of while loop
+
+- statusBar()->message("running programm...");
++ statusBar()->message("running program...");
+ QString fileName = QFileDialog::getOpenFileName(0,0,this);
+
+ if (!fileName.isEmpty()) {
diff --git a/sys-cluster/openmosixview/files/openmosixview-1.5-usesyslog.diff b/sys-cluster/openmosixview/files/openmosixview-1.5-usesyslog.diff
new file mode 100644
index 000000000000..8a2ee2c9e06e
--- /dev/null
+++ b/sys-cluster/openmosixview/files/openmosixview-1.5-usesyslog.diff
@@ -0,0 +1,101 @@
+--- openmosixview-1.5.orig/openmosixcollector/main.cpp
++++ openmosixview-1.5/openmosixcollector/main.cpp
+@@ -19,6 +19,7 @@
+ #include <config.h>
+ #endif
+
++#include <syslog.h>
+
+ #include "openmosixcollector.h"
+
+@@ -76,7 +77,7 @@
+ while (1) {
+ if(!collector->checknodes()) {
+ collector->updatenodelist();
+- cout << "updating nodelist" << endl;
++ syslog(LOG_INFO, "updating nodelist");
+ }
+ collector->lognodes();
+ tsecs = collector->incrementcounter();
+--- openmosixview-1.5.orig/openmosixcollector/openmosixcollector.cpp
++++ openmosixview-1.5/openmosixcollector/openmosixcollector.cpp
+@@ -15,6 +15,8 @@
+ * *
+ ***************************************************************************/
+
++#include <syslog.h>
++
+ #include "openmosixcollector.h"
+
+ openmosixcollector::openmosixcollector(){
+@@ -204,6 +206,7 @@
+ }
+ exit(0);
+ }
++ openlog("openmosixcollector",LOG_PID,LOG_USER);
+ return 1;
+ }
+ }
+@@ -418,7 +421,8 @@
+ nodelogfile << "\n";
+ nodelogfile.close();
+ } else {
+- cout << "could not write to " << nodelogfile_txt << endl;
++ syslog(LOG_ERR, "could not write to %s",
++ nodelogfile_txt.c_str());
+ }
+
+ } else {
+@@ -467,11 +471,11 @@
+ synclogfile << "\n";
+ synclogfile.close();
+ } else {
+- cout << "could not write to " << nodelogfile_txt << endl;
++ syslog(LOG_ERR, "could not write to %s",
++ nodelogfile_txt.c_str());
+ }
+ } // end of for
+- cout << "synced the file " << nodelogfile_txt << endl;
+-
++ syslog(LOG_DEBUG, "synced the file %s", nodelogfile_txt.c_str());
+
+ }
+ // end of sync check
+@@ -526,7 +530,8 @@
+ clusterlogfile << "\n";
+ clusterlogfile.close();
+ } else {
+- cout << "could not write to " << clusterlogfile_txt << endl;
++ syslog(LOG_ERR, "could not write to %s",
++ clusterlogfile_txt.c_str());
+ }
+ }
+
+@@ -554,7 +559,8 @@
+ return cread;
+ }
+ } else {
+- cout << "could not read from " << clusterdirectory << what << tmpstr << endl;
++ syslog(LOG_ERR, "could not read from %s%s%s",
++ clusterdirectory, what.c_str(), tmpstr.c_str());
+ return "0";
+ }
+ }
+@@ -696,7 +702,7 @@
+ processlogfile << "\n";
+ processlogfile.close();
+ } else {
+- cout << "could not write to " << processlogfile_txt << endl;
++ syslog(LOG_ERR, "could not write to %s", processlogfile_txt.c_str());
+ }
+ }
+ }
+@@ -840,7 +846,7 @@
+ writeval.close();
+ return countit;
+ } else {
+- cout << "could not write to " << tmpstr << endl;
++ syslog(LOG_ERR, "could not write to %s", tmpstr.c_str());
+ return 0;
+ }
+ }
diff --git a/sys-cluster/openmosixview/openmosixview-1.5.ebuild b/sys-cluster/openmosixview/openmosixview-1.5.ebuild
index e1da0079eeab..898063663579 100644
--- a/sys-cluster/openmosixview/openmosixview-1.5.ebuild
+++ b/sys-cluster/openmosixview/openmosixview-1.5.ebuild
@@ -1,8 +1,8 @@
# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-cluster/openmosixview/openmosixview-1.5.ebuild,v 1.4 2005/01/18 16:40:53 tantive Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-cluster/openmosixview/openmosixview-1.5.ebuild,v 1.5 2005/04/15 16:16:53 xmerlin Exp $
-inherit toolchain-funcs
+inherit toolchain-funcs eutils
S=${WORKDIR}/openmosixview-${PV}
DESCRIPTION="cluster-management GUI for OpenMosix"
@@ -22,6 +22,11 @@ src_unpack() {
cd ${WORKDIR}
unpack openmosixview-${PV}.tar.gz
+ epatch ${FILESDIR}/${P}-logdirectory.diff || die
+ epatch ${FILESDIR}/${P}-nonodestmp.diff || die
+ epatch ${FILESDIR}/${P}-usesyslog.diff || die
+ epatch ${FILESDIR}/${P}-typos.patch || die
+
cat > configuration << EOF
# test which version of qt is installed
if [ -d /usr/qt/3 ]; then
@@ -44,6 +49,8 @@ src_install() {
dodoc COPYING README
+ keepdir /var/lib/openmosixview
+
exeinto /etc/init.d
rm ${D}/etc/init.d/openmosixcollector
newexe ${FILESDIR}/openmosixcollector.init openmosixcollector