In qfile-unpacker, set perms on the directory only on second pass.

It solves problem with transferring r.x directory. Originally, it
would fail when creating files in the directory (as it is not
writable). Now, we will create it rwx, create files in it, and fix
perms and utimes on the second pass.
[user@devel fcopy]$ ls -ald /boot
dr-xr-xr-x 4 root root 4096 Sep  1  2010 /boot
This commit is contained in:
Rafal Wojtczuk 2011-03-16 12:48:29 +01:00
parent 3ae47689bc
commit 6f8daea8f2

View File

@ -53,7 +53,11 @@ void process_one_file_reg(struct file_header *hdr, char *name)
void process_one_file_dir(struct file_header *hdr, char *name)
{
if (mkdir(name, 0700) && errno != EEXIST)
// fix perms only when the directory is sent for the second time
// it allows to transfer r.x directory contents, as we create it rwx initially
if (!mkdir(name, 0700))
return;
if (errno != EEXIST)
do_exit(errno);
fix_times_and_perms(hdr, name);
}