Subject: | No way to avoid 0600 |
Hi.
I am writing a software which download files from network and writes it
to disk.
I need to create "temp" file, write data to it, then rename it to a
"real" normal file (which user will be acessing by his own). Let's call
it "normal" file.
I don't want to have attributes 0600 for normal file, as it should have
attributes that user expects (defined by umask).
temp file will reside in same directory as normal file.
I don't see why in this case temp file receives 0600 attributes and
there is no way to avoid it. ( I don't see security issues here as both
temp file and normal file resides in same directory, normal file should
definitely have permissions which user wants, so any security issue with
temp file can happen with normal file as well)