diff options
author | Pacho Ramos <pacho@gentoo.org> | 2011-06-07 08:17:08 +0000 |
---|---|---|
committer | Pacho Ramos <pacho@gentoo.org> | 2011-06-07 08:17:08 +0000 |
commit | 5def209b4ed335b7a11d36be9f9c280b36559c5b (patch) | |
tree | 6c67f2417b187a69d2d384e070c7bf5f7227c6ab /gnome-extra/libgda/files | |
parent | Version Bump. (diff) | |
download | historical-5def209b4ed335b7a11d36be9f9c280b36559c5b.tar.gz historical-5def209b4ed335b7a11d36be9f9c280b36559c5b.tar.bz2 historical-5def209b4ed335b7a11d36be9f9c280b36559c5b.zip |
Fix sandbox violations with USE doc, bug #370013, upstream #651922.
Package-Manager: portage-2.1.9.50/cvs/Linux x86_64
Diffstat (limited to 'gnome-extra/libgda/files')
-rw-r--r-- | gnome-extra/libgda/files/libgda-4.2.8-sandbox-fix.patch | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/gnome-extra/libgda/files/libgda-4.2.8-sandbox-fix.patch b/gnome-extra/libgda/files/libgda-4.2.8-sandbox-fix.patch new file mode 100644 index 000000000000..8d24430972d5 --- /dev/null +++ b/gnome-extra/libgda/files/libgda-4.2.8-sandbox-fix.patch @@ -0,0 +1,55 @@ +From 9c1a1809650321c3d752a143f87089d325c49237 Mon Sep 17 00:00:00 2001 +From: Vivien Malerba <malerba@gnome-db.org> +Date: Mon, 06 Jun 2011 18:42:19 +0000 +Subject: Correction for bug #651922 - libgda-4.2.8 wants to write on /etc/libgda-4.0/config during compilation with --enable-gtk-doc + +--- +diff --git a/libgda/gda-config.c b/libgda/gda-config.c +index e1b65c0..e0a51c7 100644 +--- a/libgda/gda-config.c ++++ b/libgda/gda-config.c +@@ -20,6 +20,7 @@ + * Boston, MA 02111-1307, USA. + */ + ++#include <unistd.h> + #include <stdio.h> + #include <gmodule.h> + #include <libgda/gda-config.h> +@@ -630,12 +631,34 @@ gda_config_constructor (GType type, + LIBGDA_ABI_NAME, "config", NULL); + unique_instance->priv->system_config_allowed = FALSE; + if (unique_instance->priv->system_file) { ++#ifdef G_OS_WIN32 ++ + FILE *file; + file = fopen (unique_instance->priv->system_file, "a"); /* Flawfinder: ignore */ + if (file) { + unique_instance->priv->system_config_allowed = TRUE; + fclose (file); + } ++#else ++ struct stat stbuf; ++ if (stat (unique_instance->priv->system_file, &stbuf) == 0) { ++ /* use effective user and group IDs */ ++ uid_t euid; ++ gid_t egid; ++ euid = geteuid (); ++ egid = getegid (); ++ if (euid == stbuf.st_uid) { ++ if ((stbuf.st_mode & S_IWUSR) && (stbuf.st_mode & S_IRUSR)) ++ unique_instance->priv->system_config_allowed = TRUE; ++ } ++ else if (egid == stbuf.st_gid) { ++ if ((stbuf.st_mode & S_IWGRP) && (stbuf.st_mode & S_IRGRP)) ++ unique_instance->priv->system_config_allowed = TRUE; ++ } ++ else if ((stbuf.st_mode & S_IWOTH) && (stbuf.st_mode & S_IROTH)) ++ unique_instance->priv->system_config_allowed = TRUE; ++ } ++#endif + } + + /* Setup file monitoring */ +-- +cgit v0.9 |