On Fri, Jul 24, 2020 at 8:38 PM Vivek Goyal <vgoyal@xxxxxxxxxx> wrote: > > With handle_killpriv_v2, server needs to kill suid/sgid on truncate (setattr) > but it does not know if caller has CAP_FSETID or not. So like write, send > killpriv information in fuse_setattr_in and add a flag FUSE_SETATTR_KILL_PRIV. > > Signed-off-by: Vivek Goyal <vgoyal@xxxxxxxxxx> [...] > +/** > + * Setattr flags > + * FUSE_SETATTR_KILL_PRIV: kill suid and sgid bits. sgid should be killed > + * only if group execute bit (S_IXGRP) is set. Meant to be used together > + * with FUSE_HANDLE_KILLPRIV_V2. > + */ > +#define FUSE_SETATTR_KILL_PRIV (1 << 0) Why not a FATTR_KILL_PRIV set in fuse_setattr_in.valid? Thanks, Miklos