[Pkg-php-commits] [php/debian-sid] Fix a race condition on shtool's mkdir -p (Closes: #570111)
Raphael Geissert
geissert at debian.org
Fri Feb 19 01:29:08 UTC 2010
---
debian/patches/series | 1 +
.../patches/shtool_mkdir_-p_-race-condition.patch | 27 ++++++++++++++++++++
2 files changed, 28 insertions(+), 0 deletions(-)
create mode 100644 debian/patches/shtool_mkdir_-p_-race-condition.patch
diff --git a/debian/patches/series b/debian/patches/series
index 1aebf73..65b87f4 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -42,3 +42,4 @@ unaligned_memory_access.patch
fix_broken_5.3_tests.patch
dont-gitclean-in-build.patch
broken_5.3_test-posix_uname.patch
+shtool_mkdir_-p_-race-condition.patch
diff --git a/debian/patches/shtool_mkdir_-p_-race-condition.patch b/debian/patches/shtool_mkdir_-p_-race-condition.patch
new file mode 100644
index 0000000..bf8765d
--- /dev/null
+++ b/debian/patches/shtool_mkdir_-p_-race-condition.patch
@@ -0,0 +1,27 @@
+Description: Workaround a race condition in shtool's mkdir -p
+ This workaround can be affected by another race condition where a
+ different process running under a different user creates the directory,
+ which would make the chown/chmod calls fail.
+ .
+ This is the version of the patch sent to shtool upstream.
+Origin: vendor
+Forwarded: yes
+Last-Update: 2010-02-18
+
+Index: php/build/shtool
+===================================================================
+--- php.orig/build/shtool
++++ php/build/shtool
+@@ -991,7 +991,11 @@ mkdir )
+ if [ ".$opt_t" = .yes ]; then
+ echo "mkdir $pathcomp" 1>&2
+ fi
+- mkdir $pathcomp || errstatus=$?
++ mkdir $pathcomp || {
++ _errstatus=$?
++ [ -d "$pathcomp" ] || errstatus=${_errstatus}
++ unset _errstatus
++ }
+ if [ ".$opt_o" != . ]; then
+ if [ ".$opt_t" = .yes ]; then
+ echo "chown $opt_o $pathcomp" 1>&2
--
1.6.3.3
More information about the Pkg-php-commits
mailing list