From 0dfbf3d314a8dee888ee324548439175813833bc Mon Sep 17 00:00:00 2001 From: tg Date: Sat, 30 Nov 2013 18:16:54 +0000 Subject: [PATCH] =?UTF-8?q?note=20that=20even=20set=20-o=20noclobber=20can?= =?UTF-8?q?=20be=20co=C3=ABrced=20into=20dropping=20O=5FEXCL=20by=20a=20TO?= =?UTF-8?q?CTOU?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mksh.1 | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/mksh.1 b/mksh.1 index 120e4c4..2b97e58 100644 --- a/mksh.1 +++ b/mksh.1 @@ -1,4 +1,4 @@ -.\" $MirOS: src/bin/mksh/mksh.1,v 1.324 2013/11/17 22:24:06 tg Exp $ +.\" $MirOS: src/bin/mksh/mksh.1,v 1.325 2013/11/30 18:16:54 tg Exp $ .\" $OpenBSD: ksh.1,v 1.148 2013/09/04 15:49:18 millert Exp $ .\"- .\" Copyright © 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, @@ -74,7 +74,7 @@ .\" with -mandoc, it might implement .Mx itself, but we want to .\" use our own definition. And .Dd must come *first*, always. .\" -.Dd $Mdocdate: November 17 2013 $ +.Dd $Mdocdate: November 30 2013 $ .\" .\" Check which macro package we use, and do other -mdoc setup. .\" @@ -4044,6 +4044,12 @@ Only used if job control is enabled .It Fl C \*(Ba Fl o Ic noclobber Prevent \*(Gt redirection from overwriting existing files. Instead, \*(Gt\*(Ba must be used to force an overwrite. +Note that this is not safe to use for creation of temporary files or +lockfiles due to a TOCTOU in a check allowing one to redirect output to +.Pa /dev/null +or other device files even in +.Ic noclobber +mode. .It Fl e \*(Ba Fl o Ic errexit Exit (after executing the .Dv ERR