Date: Sat, 16 Mar 2013 23:19:13 +0000 (UTC) From: Pawel Jakub Dawidek <pjd@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r248397 - head/sys/kern Message-ID: <201303162319.r2GNJDFL047067@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: pjd Date: Sat Mar 16 23:19:13 2013 New Revision: 248397 URL: http://svnweb.freebsd.org/changeset/base/248397 Log: Require CAP_SEEK if both O_APPEND and O_TRUNC flags are absent. In other words we don't require CAP_SEEK if either O_APPEND or O_TRUNC flag is given, because O_APPEND doesn't allow to overwrite existing data and O_TRUNC requires CAP_FTRUNCATE already. Sponsored by: The FreeBSD Foundation Modified: head/sys/kern/vfs_syscalls.c Modified: head/sys/kern/vfs_syscalls.c ============================================================================== --- head/sys/kern/vfs_syscalls.c Sat Mar 16 23:13:49 2013 (r248396) +++ head/sys/kern/vfs_syscalls.c Sat Mar 16 23:19:13 2013 (r248397) @@ -971,7 +971,7 @@ flags_to_rights(int flags) /* FALLTHROUGH */ case O_WRONLY: rights |= CAP_WRITE; - if (!(flags & O_APPEND)) + if (!(flags & (O_APPEND | O_TRUNC))) rights |= CAP_SEEK; break; }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201303162319.r2GNJDFL047067>