diff options
author | nicolas.dufresne <nicolas.dufresne@c587cffe-e639-0410-9787-d7902ae8ed56> | 2010-03-29 15:25:56 +0000 |
---|---|---|
committer | nicolas.dufresne <nicolas.dufresne@c587cffe-e639-0410-9787-d7902ae8ed56> | 2010-03-29 15:25:56 +0000 |
commit | dadfb8fb355b81dcfcf169fb57107e2231d1a8b5 (patch) | |
tree | e3d5cd10c175db014aecc8bf56f40b27bde726eb /libproxy/modules | |
parent | dafc3effbc4f371864d58e5dcc56c47e003fd261 (diff) | |
download | libproxy-dadfb8fb355b81dcfcf169fb57107e2231d1a8b5.tar.gz |
Check that pxgconf file exist before popen()
git-svn-id: http://libproxy.googlecode.com/svn/trunk@650 c587cffe-e639-0410-9787-d7902ae8ed56
Diffstat (limited to 'libproxy/modules')
-rw-r--r-- | libproxy/modules/config_gnome.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/libproxy/modules/config_gnome.cpp b/libproxy/modules/config_gnome.cpp index 9c013ec..1bb11df 100644 --- a/libproxy/modules/config_gnome.cpp +++ b/libproxy/modules/config_gnome.cpp @@ -138,18 +138,22 @@ public: gnome_config_extension() { // Build the command int count; + struct stat st; string cmd = LIBEXECDIR "/pxgconf"; const char *pxgconf = getenv("PX_GCONF"); if (pxgconf) cmd = string (pxgconf); + if (stat(cmd.c_str(), &st)) + throw runtime_error ("Unable to open gconf helper!"); + for (count=0 ; all_keys[count] ; count++) cmd += string(" ", 1) + all_keys[count]; // Get our pipes if (popen2(cmd.c_str(), &this->read, &this->write, &this->pid) != 0) - throw runtime_error("Unable to open gconf helper!"); + throw runtime_error("Unable to run gconf helper!"); // Read in our initial data this->read_data(count); |