lkml.org 
[lkml]   [2019]   [Feb]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH 2/4] Expose O_PATHSTATIC to userspace
Date
On Feb 12, 2019, at 7:54 AM, demiobenour@gmail.com wrote:
>
> From: "Demi M. Obenour" <demiobenour@gmail.com>
>
> This adds the file open flag O_PATHSTATIC, which ensures that symbolic
> links are *never* followed, even in path components other than the last.
> This is distinct from O_NOFOLLOW, which only prevents symlinks in the
> *last* component from being followed.
>
> This is useful for avoiding race conditions in userspace code that
> should expose only a subset of the filesystem to clients. This includes
> FTP and SFTP servers, QEMU, and others.
>
> Currently, O_NOFOLLOW must be set if O_PATHSTATIC is set. Otherwise,
> open() fails with -EINVAL.

I don't want to bikeshed (discard suggestion if you disagree), but why not
name the flag "O_NEVER_FOLLOW" so that users can see it is also related to
"O_NOFOLLOW"? Otherwise it seems like they are two completely different
things from looking at the names, when in fact they are closely related.

Cheers, Andreas





[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2019-02-12 21:19    [W:0.052 / U:1.320 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site