|
|
|
@ -94,9 +94,9 @@ void fix_times_and_perms(struct file_header *untrusted_hdr,
|
|
|
|
|
const char *untrusted_name)
|
|
|
|
|
{
|
|
|
|
|
struct timeval times[2] =
|
|
|
|
|
{ {untrusted_hdr->atime, untrusted_hdr->atime_nsec / 1000},
|
|
|
|
|
{untrusted_hdr->mtime,
|
|
|
|
|
untrusted_hdr->mtime_nsec / 1000}
|
|
|
|
|
{
|
|
|
|
|
{untrusted_hdr->atime, untrusted_hdr->atime_nsec / 1000},
|
|
|
|
|
{untrusted_hdr->mtime, untrusted_hdr->mtime_nsec / 1000}
|
|
|
|
|
};
|
|
|
|
|
if (chmod(untrusted_name, untrusted_hdr->mode & 07777)) /* safe because of chroot */
|
|
|
|
|
do_exit(errno, untrusted_name);
|
|
|
|
@ -155,8 +155,8 @@ void process_one_file_reg(struct file_header *untrusted_hdr,
|
|
|
|
|
void process_one_file_dir(struct file_header *untrusted_hdr,
|
|
|
|
|
const char *untrusted_name)
|
|
|
|
|
{
|
|
|
|
|
// 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
|
|
|
|
|
// 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
|
|
|
|
|
struct stat buf;
|
|
|
|
|
if (!mkdir(untrusted_name, 0700)) /* safe because of chroot */
|
|
|
|
|
return;
|
|
|
|
|