[Sugar-devel] [PATCH olpc-netutils] Change mode of "logtemp" files to be able to remove them OLPC #11851

Manuel Kaufmann humitos at gmail.com
Sun May 13 16:41:26 EDT 2012


This is a workaround to be able to remove the files copied by
"olpc-log" to a temporal directory.

The problem is that "olpc-log" is coping files from /proc and those
files are being copied preserving "mode" attributes and they are
read-only, so "olpc-log" fails when it tries to remove them.

The correct way to do this would be using "cp --no-preserve=mode" to
copy those files but it is buggy and doesn't work as the documentation
says.

Signed-off-by: Manuel Kaufmann <humitos at gmail.com>
---
 usr/bin/olpc-log |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/usr/bin/olpc-log b/usr/bin/olpc-log
index 2f43318..dce14ce 100755
--- a/usr/bin/olpc-log
+++ b/usr/bin/olpc-log
@@ -66,6 +66,9 @@ function proc {
 		cp -r -t $target/proc/$pid /proc/$pid/{cmdline,environ,limits,mounts,net,oom_adj,oom_score,sched,smaps,stat,status} &> /dev/null
 		echo -n .
 	done
+
+	# cp --no-preserve=mode is buggy
+	chmod -R u+w $target
 	echo -n =
 }
 
-- 
1.7.7.6



More information about the Sugar-devel mailing list