summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuli Suominen <ssuominen@gentoo.org>2010-04-22 15:42:00 +0000
committerSamuli Suominen <ssuominen@gentoo.org>2010-04-22 15:42:00 +0000
commit6fad30a8a3e71d8cc277d7be4aaab7530fbaf87f (patch)
tree1de8c0d14f88937ea18dc953146271dfeea41cfb /xfce-base
parentVersion bump <http://my.opera.com/desktopteam/blog/2010/04/22/a-couple-of-mor... (diff)
downloadgentoo-2-6fad30a8a3e71d8cc277d7be4aaab7530fbaf87f.tar.gz
gentoo-2-6fad30a8a3e71d8cc277d7be4aaab7530fbaf87f.tar.bz2
gentoo-2-6fad30a8a3e71d8cc277d7be4aaab7530fbaf87f.zip
Fix umask handling after Create Folder operation wrt #316681 by Ivan Ponomarev.
(Portage version: 2.2_rc67/cvs/Linux x86_64)
Diffstat (limited to 'xfce-base')
-rw-r--r--xfce-base/thunar/ChangeLog7
-rw-r--r--xfce-base/thunar/files/thunar-1.0.1-fix-umask-handling.patch52
-rw-r--r--xfce-base/thunar/thunar-1.0.1-r1.ebuild79
3 files changed, 137 insertions, 1 deletions
diff --git a/xfce-base/thunar/ChangeLog b/xfce-base/thunar/ChangeLog
index 98b85e622d93..4e3dfa5c0cd7 100644
--- a/xfce-base/thunar/ChangeLog
+++ b/xfce-base/thunar/ChangeLog
@@ -1,6 +1,11 @@
# ChangeLog for xfce-base/thunar
# Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/xfce-base/thunar/ChangeLog,v 1.87 2010/03/09 10:41:19 ssuominen Exp $
+# $Header: /var/cvsroot/gentoo-x86/xfce-base/thunar/ChangeLog,v 1.88 2010/04/22 15:42:00 ssuominen Exp $
+
+ 22 Apr 2010; Samuli Suominen <ssuominen@gentoo.org>
+ +thunar-1.0.1-r1.ebuild, +files/thunar-1.0.1-fix-umask-handling.patch:
+ Fix umask handling after Create Folder operation wrt #316681 by Ivan
+ Ponomarev.
09 Mar 2010; Samuli Suominen <ssuominen@gentoo.org> thunar-1.0.1.ebuild,
+files/thunar-1.0.1-libpng14.patch:
diff --git a/xfce-base/thunar/files/thunar-1.0.1-fix-umask-handling.patch b/xfce-base/thunar/files/thunar-1.0.1-fix-umask-handling.patch
new file mode 100644
index 000000000000..2070b5802c69
--- /dev/null
+++ b/xfce-base/thunar/files/thunar-1.0.1-fix-umask-handling.patch
@@ -0,0 +1,52 @@
+commit eb58c6a6ba7f77c2c16016db064524df598ef421
+Author: Jannis Pohlmann <jannis@xfce.org>
+Date: Sat Oct 3 11:49:41 2009 +0200
+
+ Fix bugs #3532 (umask < 0022 not honoured) and #5813 properly (I hope).
+
+ The previous patch applied in e53de71e6add9b28ba034111a1d19db7def8f7e7
+ made things worse than before: it used DEFFILEMODE which seems to be
+ BSD-specific for creating files. It also reset the umask to 0 when
+ creating the first directory with _thunar_vfs_io_jobs_mkdir().
+
+ What we really want is to use 0777 (dirs) and 0666 (files) and let the
+ standard C system calls like open() apply the umask value. This should
+ work on all POSIX-compliant systems.
+
+ Patch provided by Craig Ringer <craig@postnewspapers.com.au>.
+
+diff --git a/thunar-vfs/thunar-vfs-io-jobs.c b/thunar-vfs/thunar-vfs-io-jobs.c
+index 8d70812..c94523a 100644
+--- a/thunar-vfs/thunar-vfs-io-jobs.c
++++ b/thunar-vfs/thunar-vfs-io-jobs.c
+@@ -432,8 +432,12 @@ _thunar_vfs_io_jobs_create (ThunarVfsJob *job,
+ absolute_path = thunar_vfs_path_dup_string (lp->data);
+
+ again:
+- /* try to create the file at the given path */
+- fd = g_open (absolute_path, O_CREAT | O_EXCL | O_WRONLY, DEFFILEMODE);
++ /* Try to create the file at the given path.
++ *
++ * Note that despite the 0666 mask, we won't really create a world-writable
++ * file unless the user's umask permits it (ie the umask is 0000).
++ */
++ fd = g_open (absolute_path, O_CREAT | O_EXCL | O_WRONLY, 0666);
+ if (G_UNLIKELY (fd < 0))
+ {
+ /* check if the file already exists */
+@@ -707,8 +711,13 @@ _thunar_vfs_io_jobs_mkdir (ThunarVfsJob *job,
+ /* update the progress information */
+ _thunar_vfs_job_process_path (job, lp);
+
+- /* try to create the target directory */
+- if (!_thunar_vfs_io_ops_mkdir (lp->data, 0777 & ~umask(0), THUNAR_VFS_IO_OPS_NONE, error))
++ /* try to create the target directory
++ *
++ * Note that the mode specified here is limited by the user's umask, so we will not
++ * actually be creating a world writable directory unless the user's umask permits
++ * it.
++ */
++ if (!_thunar_vfs_io_ops_mkdir (lp->data, 0777, THUNAR_VFS_IO_OPS_NONE, error))
+ return FALSE;
+ }
+
diff --git a/xfce-base/thunar/thunar-1.0.1-r1.ebuild b/xfce-base/thunar/thunar-1.0.1-r1.ebuild
new file mode 100644
index 000000000000..228a93860015
--- /dev/null
+++ b/xfce-base/thunar/thunar-1.0.1-r1.ebuild
@@ -0,0 +1,79 @@
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/xfce-base/thunar/thunar-1.0.1-r1.ebuild,v 1.3 2010/04/22 15:42:00 ssuominen Exp $
+
+EAPI=2
+MY_P=${P/t/T}
+inherit virtualx xfconf
+
+DESCRIPTION="File manager for Xfce4"
+HOMEPAGE="http://thunar.xfce.org"
+
+LICENSE="GPL-2 LGPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd ~x86-freebsd ~x86-interix ~amd64-linux ~x86-linux ~x86-solaris"
+IUSE="dbus debug doc exif gnome hal pcre startup-notification +trash-plugin"
+
+RDEPEND=">=dev-lang/perl-5.6
+ >=dev-libs/glib-2.6:2
+ >=dev-util/desktop-file-utils-0.14
+ >=media-libs/freetype-2
+ >=media-libs/jpeg-6b:0
+ >=media-libs/libpng-1.2.0
+ virtual/fam
+ >=x11-libs/gtk+-2.6:2
+ x11-libs/libSM
+ >=x11-misc/shared-mime-info-0.20
+ >=xfce-base/exo-0.3.92[hal?]
+ <xfce-base/exo-0.5
+ >=xfce-base/libxfce4util-4.6
+ dbus? ( dev-libs/dbus-glib )
+ exif? ( >=media-libs/libexif-0.6 )
+ hal? ( dev-libs/dbus-glib
+ sys-apps/hal )
+ gnome? ( gnome-base/gconf )
+ pcre? ( >=dev-libs/libpcre-6 )
+ startup-notification? ( x11-libs/startup-notification )
+ trash-plugin? ( dev-libs/dbus-glib
+ >=xfce-base/xfce4-panel-4.6 )"
+DEPEND="${RDEPEND}
+ dev-util/intltool
+ dev-util/pkgconfig
+ sys-devel/gettext
+ doc? ( dev-libs/libxslt )"
+
+pkg_setup() {
+ PATCHES=( "${FILESDIR}/${P}-libpng14.patch"
+ "${FILESDIR}/${P}-fix-umask-handling.patch" )
+ XFCONF="--disable-dependency-tracking
+ $(use_enable dbus)
+ $(use_enable gnome gnome-thumbnailers)
+ $(use_enable startup-notification)
+ $(use_enable doc xsltproc)
+ $(use_enable exif)
+ $(use_enable pcre)
+ $(use_enable debug)"
+
+ if use hal; then
+ XFCONF="${XFCONF} --enable-dbus --with-volume-manager=hal"
+ else
+ XFCONF="${XFCONF} --with-volume-manager=none"
+ fi
+
+ if use trash-plugin; then
+ XFCONF="${XFCONF} --enable-dbus"
+ else
+ XFCONF="${XFCONF} --disable-tpa-plugin"
+ fi
+ DOCS="AUTHORS ChangeLog FAQ HACKING NEWS README THANKS TODO"
+}
+
+src_test() {
+ Xemake check || die "Xemake check failed"
+}
+
+pkg_postinst() {
+ xfconf_pkg_postinst
+ elog "If you are seeing some odd dbus error, make sure your user is in the"
+ elog "plugdev group. See Gentoo bug #279077 for more info"
+}