how to cope with file renames?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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: pgpntmDGVnnyA.pgp
Description: PGP signature


[Index of Archives]     [Selinux Refpolicy]     [Linux SGX]     [Fedora Users]     [Fedora Desktop]     [Yosemite Photos]     [Yosemite Camping]     [Yosemite Campsites]     [KDE Users]     [Gnome Users]

  Powered by Linux