rpms/Thunar/F-12 Thunar-1.0.1-umask-dir.patch, NONE, 1.1 Thunar.spec, 1.27, 1.28

Kevin Fenzi kevin at fedoraproject.org
Thu Apr 15 20:39:14 UTC 2010


Author: kevin

Update of /cvs/pkgs/rpms/Thunar/F-12
In directory cvs01.phx2.fedoraproject.org:/tmp/cvs-serv19994

Modified Files:
	Thunar.spec 
Added Files:
	Thunar-1.0.1-umask-dir.patch 
Log Message:
Add patch to fix directory umask issue. Fixes bug #579087


Thunar-1.0.1-umask-dir.patch:
 thunar-vfs-io-jobs.c |   18 +++++++++++++-----
 1 file changed, 13 insertions(+), 5 deletions(-)

--- NEW FILE Thunar-1.0.1-umask-dir.patch ---
>From eb58c6a6ba7f77c2c16016db064524df598ef421 Mon Sep 17 00:00:00 2001
From: Jannis Pohlmann <jannis at xfce.org>
Date: Sat, 03 Oct 2009 09:49:41 +0000
Subject: 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 at 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;
     }
 
--
cgit v0.8.2.1


Index: Thunar.spec
===================================================================
RCS file: /cvs/pkgs/rpms/Thunar/F-12/Thunar.spec,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -p -r1.27 -r1.28
--- Thunar.spec	26 Oct 2009 18:14:40 -0000	1.27
+++ Thunar.spec	15 Apr 2010 20:39:13 -0000	1.28
@@ -3,12 +3,16 @@
 Summary: Thunar File Manager
 Name: Thunar
 Version: 1.0.1
-Release: 4%{?dist}
+Release: 6%{?dist}
 License: GPLv2+
 URL: http://thunar.xfce.org/
 Source0: http://www.xfce.org/archive/xfce-4.6.1/src/Thunar-%{version}.tar.bz2
 Source1: thunar-sendto-bluetooth.desktop
 Source2: thunar-sendto-audacious-playlist.desktop
+# Upstream bug: http://bugzilla.xfce.org/show_bug.cgi?id=6232
+Patch0: Thunar-1.0.1-dsofix.patch
+# Upstream bug: http://bugzilla.xfce.org/show_bug.cgi?id=3532
+Patch1: Thunar-1.0.1-umask-dir.patch
 Group: User Interface/Desktops
 Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 BuildRequires: fam-devel
@@ -59,6 +63,9 @@ libraries and header files for the Thuna
 %prep
 %setup -q
 
+%patch0 -p1 
+%patch1 -p1 
+
 # fix icon in thunar-sendto-email.desktop
 sed -i 's!internet-mail!mail-message-new!' \
         plugins/thunar-sendto-email/thunar-sendto-email.desktop.in.in
@@ -201,6 +208,12 @@ fi
 %{_datadir}/gtk-doc/html/*
 
 %changelog
+* Thu Apr 15 2010 Kevin Fenzi <kevin at tummy.com> - 1.0.1-5
+- Add patch to fix directory umask issue. Fixes bug #579087
+
+* Sat Feb 13 2010 Kevin Fenzi <kevin at tummy.com> - 1.0.1-4
+- Add patch for DSO linking. Fixes bug #564714
+
 * Thu Sep 10 2009 Kevin Fenzi <kevin at tummy.com> - 1.0.1-3
 - Require dbus-x11 (#505499)
 



More information about the scm-commits mailing list