Author hynek
Recipients flox, hynek, loewis, pitrou, radoslaw.zarzynski
Date 2012-06-19.13:17:09
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1340111831.51.0.707148922755.issue15100@psf.upfronthosting.co.za>
In-reply-to
Content
It's not that simple as we currently use public functions for copying the files and the metadata. copyfile is explicitly _not_ supposed to copy any metadata so we can't patch it up to do so. Also that won't help for other stat & xattr data so this fix would be rather incomplete.

umask is ruled out too, because that isn't (if I'm not mistaken) thread safe thus wouldn't help against stat & xattr disclosures anyway.

Therefore we'll have to re-implement the whole metadata "stack" for copy and copy2 using fd-based functions. Taking into account #4489, I guess it's the best way (+ hoping someone implements safe versions for other platforms too).

The mode itself can also be copied pretty easily using a custom opener for open (os.open has a mode argument).

I doubt I will be able to do that till beta1 though. But I suppose we can commit this while in the betas?
History
Date User Action Args
2012-06-19 13:17:11hyneksetrecipients: + hynek, loewis, pitrou, flox, radoslaw.zarzynski
2012-06-19 13:17:11hyneksetmessageid: <1340111831.51.0.707148922755.issue15100@psf.upfronthosting.co.za>
2012-06-19 13:17:10hyneklinkissue15100 messages
2012-06-19 13:17:09hynekcreate