All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nick Piggin <npiggin@suse.de>
To: Christoph Hellwig <hch@lst.de>
Cc: Al Viro <viro@ZenIV.linux.org.uk>,
	linux-fsdevel@vger.kernel.org, Miklos Szeredi <miklos@szeredi.hu>
Subject: Re: Filesystem setattr/truncate notes and problems
Date: Thu, 3 Jun 2010 19:18:48 +1000	[thread overview]
Message-ID: <20100603091848.GB6822@laptop> (raw)
In-Reply-To: <20100603072812.GA3346@lst.de>

On Thu, Jun 03, 2010 at 09:28:12AM +0200, Christoph Hellwig wrote:
> On Thu, Jun 03, 2010 at 06:08:55AM +1000, Nick Piggin wrote:
> > xfs in the 0 length file shortcut, isn't this missing suid kill case?
> > (ftruncate mandatory mtime update seems like it wasn't working right
> > there either before this patch).
> 
> The wording from Posix for truncate is:
> 
> "Upon successful completion, if the file size is changed, this function
>  shall mark for update the st_ctime and st_mtime fields of the file, and
>  the S_ISUID and S_ISGID bits of the file mode may be cleared."
> 
> and for truncate:
> 
> "Upon successful completion, if fildes refers to a regular file, the
>  ftruncate() function shall mark for update the st_ctime and st_mtime
>  fields of the file and the S_ISUID and S_ISGID bits of the file mode
>  may be cleared."
> 
> Which translates to me that the suid/sgid clearing behaviour is
> exactly the same as the c/mtime update and it can be skipped for
> truncate only if there is no size change.  Except that the wording
> is rather nasty as the suid/sgid bits are only accepted into Posix
> as an ugly headed stepchild and may not actually be present on
> some systems.

Well at least we should do suid bit clearing consistently with ctime/mtime
updates if we do them at all, that part of the wording seems clear.


  parent reply	other threads:[~2010-06-03  9:18 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-01 13:39 [patch] fix truncate inode time modification breakage Nick Piggin
2010-06-01 13:48 ` Christoph Hellwig
2010-06-01 13:56   ` Nick Piggin
2010-06-02 19:55     ` [patch v2] " Nick Piggin
2010-06-02 20:08       ` Filesystem setattr/truncate notes and problems Nick Piggin
2010-06-03  7:28         ` Christoph Hellwig
2010-06-03  7:32           ` Christoph Hellwig
2010-06-03  9:50             ` Nick Piggin
2010-06-03  9:18           ` Nick Piggin [this message]
2010-06-03  9:26         ` Nick Piggin
2010-06-03  8:18       ` [patch v2] fix truncate inode time modification breakage Miklos Szeredi
2010-06-03  8:40         ` Boaz Harrosh
2010-06-03  9:05           ` Miklos Szeredi
2010-06-03 12:13             ` Boaz Harrosh
2010-06-03  9:14         ` Nick Piggin
2010-06-03  9:28           ` Miklos Szeredi
2010-06-03 10:07             ` Nick Piggin
2010-06-03 10:58               ` Miklos Szeredi
2010-06-03 11:09                 ` Christoph Hellwig
2010-06-03 12:01                   ` [patch v3] " Nick Piggin
2010-06-03 11:49                 ` [patch v2] " Nick Piggin
2010-06-03 12:03                   ` Miklos Szeredi
2010-06-01 14:10 ` [patch] " Boaz Harrosh
2010-06-01 14:32   ` Nick Piggin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100603091848.GB6822@laptop \
    --to=npiggin@suse.de \
    --cc=hch@lst.de \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=miklos@szeredi.hu \
    --cc=viro@ZenIV.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.