[9changes] patch: patchapply-write-perm

3 views
Skip to first unread message

9cha...@9grid.fr

unread,
Mar 4, 2015, 12:00:45 AM3/4/15
to 9cha...@googlegroups.com
Testing for write permission is done by rc write redirection (echo >.tmp). If it fails then commands intended for such condition will not be executed. Use touch(1) for that test instead.

Reference: /n/sources/patch/patchapply-write-perm
Date: Wed Mar 4 02:29:10 CET 2015
Signed-off-by: an...@ml.lv

--- /rc/bin/patch/apply Wed Mar 4 02:26:01 2015
+++ /rc/bin/patch/apply Wed Mar 4 02:25:58 2015
@@ -23,7 +23,7 @@
exit badpatch
}

-if(! echo >.tmp || ! rm .tmp){
+if(! touch .tmp || ! rm .tmp){
echo no write permission >[1=2]
exit 'no write permission'
}
Reply all
Reply to author
Forward
0 new messages