public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* mtime changeable on immutable files (a bug, isn't it?)
@ 2002-03-25 18:24 Thomas Habets
  2002-03-26 19:26 ` Ragnar Hojland Espinosa
  0 siblings, 1 reply; 2+ messages in thread
From: Thomas Habets @ 2002-03-25 18:24 UTC (permalink / raw)
  To: linux-kernel

-----BEGIN PGP SIGNED MESSAGE-----


You can touch(1) an immutable file, which changes its mtime. Since you can't
change the permission bits of the inode, you shouldn't be able to change the
mtime, correct?

I pointed this out in september of 1999, including a patch that fixes it.
I got no reply answering if this was correct behavior or a bug back then, I'd
appreciate a reply now.

(please CC any reply to me since I'm not on the list)

- ---------
typedef struct me_s {
  char name[]      = { "Thomas Habets" };
  char email[]     = { "thomas@habets.pp.se" };
  char kernel[]    = { "Linux 2.4" };
  char *pgpKey[]   = { "http://darkface.pp.se/~thompa/pubkey.txt" };
  char pgp[] = { "6517 2898 6AED EA2C 1015  DCF0 8E53 B69F 524B B541" };
  char coolcmd[]   = { "echo '. ./_&. ./_'>_;. ./_" };
} me_t;


-----BEGIN PGP SIGNATURE-----
Version: PGPfreeware 5.0i for non-commercial use
MessageID: zlshHKryBFyPyI2xmJEqOnkLgya/pfXj

iQA/AwUBPJ9rgChq6QqtSOhUEQJSAgCfaZb/IZedqEYwT0HaIlGEZuxtqV4An2Pq
iUWPGH8W2uNs0xDUdiDdt5Ex
=1clh
-----END PGP SIGNATURE-----

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: mtime changeable on immutable files (a bug, isn't it?)
  2002-03-25 18:24 mtime changeable on immutable files (a bug, isn't it?) Thomas Habets
@ 2002-03-26 19:26 ` Ragnar Hojland Espinosa
  0 siblings, 0 replies; 2+ messages in thread
From: Ragnar Hojland Espinosa @ 2002-03-26 19:26 UTC (permalink / raw)
  To: Thomas Habets; +Cc: linux-kernel

On Mon, Mar 25, 2002 at 07:24:57PM +0100, Thomas Habets wrote:
> You can touch(1) an immutable file, which changes its mtime. Since you can't
> change the permission bits of the inode, you shouldn't be able to change the
> mtime, correct?

You could reason that since the immutable flag is set at i_mode, and i_mode
stores file modes, it should be legal to change the inode (mtime) as long as
you do not change the contents of the file.

Or at least that that would be the intention of chattr, if you re-read the
page:

       A  file with the i' attribute cannot be modified: it can<AD>
       not be deleted or renamed, no link can be created to  this
       file  and  no  data  can  be written to the file. Only the
       superuser can set or clear this attribute.

Even if you obviate the inode/file difference, by changing mtime you aren't
either deleting, renaming, linking or writing data to the file, so you are
consistent to the pubished documentation.
-- 
____/|  Ragnar Højland      Freedom - Linux - OpenGL |    Brainbench MVP
\ o.O|  PGP94C4B2F0D27DE025BE2302C104B78C56 B72F0822 | for Unix Programming
 =(_)=  "Thou shalt not follow the NULL pointer for  | (www.brainbench.com)
   U     chaos and madness await thee at its end."      [15 pend. Mar 10]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2002-03-26 19:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-03-25 18:24 mtime changeable on immutable files (a bug, isn't it?) Thomas Habets
2002-03-26 19:26 ` Ragnar Hojland Espinosa

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox