[yast-commit] r62264 - in /branches/SuSE-Code-11-SP1-Branch/dbus-server: VERSION package/yast2-dbus-server.changes src/liby2dbus/src/DBusServerBase.cc src/liby2dbus/src/Makefile.am src/liby2dbus/src/search_path.h
Author: lslezak Date: Thu Jul 15 13:45:18 2010 New Revision: 62264 URL: http://svn.opensuse.org/viewcvs/yast?rev=62264&view=rev Log: - set PATH environment to the default if it's not set (bnc#617442) - 2.17.3 Added: branches/SuSE-Code-11-SP1-Branch/dbus-server/src/liby2dbus/src/search_path.h Modified: branches/SuSE-Code-11-SP1-Branch/dbus-server/VERSION branches/SuSE-Code-11-SP1-Branch/dbus-server/package/yast2-dbus-server.changes branches/SuSE-Code-11-SP1-Branch/dbus-server/src/liby2dbus/src/DBusServerBase.cc branches/SuSE-Code-11-SP1-Branch/dbus-server/src/liby2dbus/src/Makefile.am Modified: branches/SuSE-Code-11-SP1-Branch/dbus-server/VERSION URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/dbus-s... ============================================================================== --- branches/SuSE-Code-11-SP1-Branch/dbus-server/VERSION (original) +++ branches/SuSE-Code-11-SP1-Branch/dbus-server/VERSION Thu Jul 15 13:45:18 2010 @@ -1 +1 @@ -2.17.2 +2.17.3 Modified: branches/SuSE-Code-11-SP1-Branch/dbus-server/package/yast2-dbus-server.changes URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/dbus-s... ============================================================================== --- branches/SuSE-Code-11-SP1-Branch/dbus-server/package/yast2-dbus-server.changes (original) +++ branches/SuSE-Code-11-SP1-Branch/dbus-server/package/yast2-dbus-server.changes Thu Jul 15 13:45:18 2010 @@ -1,4 +1,10 @@ ------------------------------------------------------------------- +Thu Jul 15 11:05:35 UTC 2010 - lslezak@suse.cz + +- set PATH environment to the default if it's not set (bnc#617442) +- 2.17.3 + +------------------------------------------------------------------- Wed May 19 16:14:05 CEST 2010 - mvidner@suse.cz - Better fix: dbus_bool_t instead of int (bnc#606712). Modified: branches/SuSE-Code-11-SP1-Branch/dbus-server/src/liby2dbus/src/DBusServerBase.cc URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/dbus-s... ============================================================================== --- branches/SuSE-Code-11-SP1-Branch/dbus-server/src/liby2dbus/src/DBusServerBase.cc (original) +++ branches/SuSE-Code-11-SP1-Branch/dbus-server/src/liby2dbus/src/DBusServerBase.cc Thu Jul 15 13:45:18 2010 @@ -9,6 +9,7 @@ #include "DBusServerBase.h" #include "DBusMsg.h" +#include "search_path.h" #include <ycp/y2log.h> @@ -25,6 +26,9 @@ { test_mode = testmode; dbus_threads_init_default(); + + // set default PATH if not set + set_default_path(); } DBusServerBase::~DBusServerBase() Modified: branches/SuSE-Code-11-SP1-Branch/dbus-server/src/liby2dbus/src/Makefile.am URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/dbus-s... ============================================================================== --- branches/SuSE-Code-11-SP1-Branch/dbus-server/src/liby2dbus/src/Makefile.am (original) +++ branches/SuSE-Code-11-SP1-Branch/dbus-server/src/liby2dbus/src/Makefile.am Thu Jul 15 13:45:18 2010 @@ -8,7 +8,7 @@ liby2dbus_la_SOURCES = DBusMsg.cc DBusMsg.h DBusConn.cc DBusConn.h DBusCaller.cc DBusCaller.h \ DBusServerBase.cc DBusServerBase.h DBusSignature.cc DBusSignature.h \ - DBusArgument.cc DBusArgument.h + DBusArgument.cc DBusArgument.h search_path.h if HAVE_POLKIT liby2dbus_la_SOURCES += PolKit.cc PolKit.h endif Added: branches/SuSE-Code-11-SP1-Branch/dbus-server/src/liby2dbus/src/search_path.h URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/dbus-s... ============================================================================== --- branches/SuSE-Code-11-SP1-Branch/dbus-server/src/liby2dbus/src/search_path.h (added) +++ branches/SuSE-Code-11-SP1-Branch/dbus-server/src/liby2dbus/src/search_path.h Thu Jul 15 13:45:18 2010 @@ -0,0 +1,32 @@ +// +// Function for setting PATH environment variable if it's not defined +// + +#include <cstdlib> +#include <ycp/y2log.h> + +// check wheter PATH is defined, if not set it +bool set_path_env(const char *new_path) +{ + char *path = getenv("PATH"); + + if (path == NULL) + { + // 1 = overwrite the existing + return setenv("PATH", new_path, 1) == 0; + } + + return false; +} + +// set the default PATH value if not set +void set_default_path() +{ + const char *default_path = "/sbin:/usr/sbin:/usr/local/sbin:/usr/local/bin:/usr/bin:/bin"; + + if (set_path_env(default_path)) + { + y2milestone("PATH environment set to: %s", default_path); + } +} + -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org
participants (1)
-
lslezak@svn.opensuse.org