All of lore.kernel.org
 help / color / mirror / Atom feed
* how to cope with file renames?
@ 2010-03-11  8:19 Michal Svoboda
  2010-03-11 13:32 ` Daniel J Walsh
  2010-03-11 13:46 ` Stephen Smalley
  0 siblings, 2 replies; 9+ messages in thread
From: Michal Svoboda @ 2010-03-11  8:19 UTC (permalink / raw)
  To: selinux

[-- Attachment #1: Type: text/plain, Size: 801 bytes --]

Hello,

I'm struggling with the problem seemingly as old as filesystems - if you
rename() a file, it retains all its permissions, incl. the context,
because its inode stays the same.

My particular problem is moving stuff from /tmp using PHP's
move_uploaded_file function. I'm aware of the copy/delete workaround,
but that just isn't the same (performance, atomicity, etc.) Also there
is the way of post-relabeling the moved file but that requires more
permissions plus there are no selinux bindings in PHP that i'm aware of.

In short, I was wondering if there was a way for a rename()d file to be
subjected to a type transition as if a new file was created? (I tried a
type_trans rule but to no avail.) Or any other way to deal with renaming
files between variously contexted dirs?

Michal Svoboda


[-- Attachment #2: Type: application/pgp-signature, Size: 198 bytes --]

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

end of thread, other threads:[~2010-03-11 19:08 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-11  8:19 how to cope with file renames? Michal Svoboda
2010-03-11 13:32 ` Daniel J Walsh
2010-03-11 13:46 ` Stephen Smalley
2010-03-11 14:45   ` Richard Bullington-McGuire
2010-03-11 17:00   ` Michal Svoboda
2010-03-11 17:27     ` Stephen Smalley
2010-03-11 18:28       ` Michal Svoboda
2010-03-11 19:08         ` Stephen Smalley
2010-03-11 17:42     ` Daniel J Walsh

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.