[Pkg-shadow-commits] r784 - in trunk/debian: . patches

Nicolas FRANCOIS nekral-guest at costa.debian.org
Wed Jan 11 21:27:10 UTC 2006


Author: nekral-guest
Date: 2006-01-11 21:27:08 +0000 (Wed, 11 Jan 2006)
New Revision: 784

Added:
   trunk/debian/patches/482_libmisc_copydir_check_return_values
Modified:
   trunk/debian/changelog
   trunk/debian/patches/series
Log:
Verify the return values of mkdir, chown and chmod.


Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog	2006-01-11 21:20:44 UTC (rev 783)
+++ trunk/debian/changelog	2006-01-11 21:27:08 UTC (rev 784)
@@ -16,6 +16,8 @@
       - keep the sticky bit in the directory copied by useradd in the
         skeleton or by usermod.
         Closes: #296729
+    - 482_libmisc_copydir_check_return_values:
+      - check the return value of system calls in copy_tree
   * Debian specific fixes:
     - debian/rules:
       - switch to cdbs for package build

Added: trunk/debian/patches/482_libmisc_copydir_check_return_values
===================================================================
--- trunk/debian/patches/482_libmisc_copydir_check_return_values	2006-01-11 21:20:44 UTC (rev 783)
+++ trunk/debian/patches/482_libmisc_copydir_check_return_values	2006-01-11 21:27:08 UTC (rev 784)
@@ -0,0 +1,28 @@
+Goal: Verify return values
+
+Status wrt upstream: not reported yet
+
+Index: shadow-4.0.14/libmisc/copydir.c
+===================================================================
+--- shadow-4.0.14.orig/libmisc/copydir.c	2006-01-11 21:31:39.000000000 +0100
++++ shadow-4.0.14/libmisc/copydir.c	2006-01-11 21:58:44.000000000 +0100
+@@ -225,13 +225,12 @@
+ #ifdef WITH_SELINUX
+ 			selinux_file_context (dst_name);
+ #endif
+-			mkdir (dst_name, sb.st_mode);
+-			chown (dst_name,
+-			       uid == (uid_t) - 1 ? sb.st_uid : uid,
+-			       gid == (gid_t) - 1 ? sb.st_gid : gid);
+-			chmod (dst_name, sb.st_mode);
+-
+-			if (copy_tree (src_name, dst_name, uid, gid)) {
++			if (mkdir (dst_name, sb.st_mode)
++			    || chown (dst_name,
++			              uid == (uid_t) - 1 ? sb.st_uid : uid,
++			              gid == (gid_t) - 1 ? sb.st_gid : gid)
++			    || chmod (dst_name, sb.st_mode)
++			    || copy_tree (src_name, dst_name, uid, gid)) {
+ 				err++;
+ 				break;
+ 			}

Modified: trunk/debian/patches/series
===================================================================
--- trunk/debian/patches/series	2006-01-11 21:20:44 UTC (rev 783)
+++ trunk/debian/patches/series	2006-01-11 21:27:08 UTC (rev 784)
@@ -46,6 +46,7 @@
 479_chowntty_debug
 480_getopt_args_reorder
 481_userdel_remove_remove_group
+482_libmisc_copydir_check_return_values
 # 999-2 is about using cdbs. It does not patch upstream files
 # so shouldn't be here, but we keep it for the future
 # 999-2_build_using_cdbs




More information about the Pkg-shadow-commits mailing list