Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 316681
Collapse All | Expand All

(-)a/thunar-vfs/thunar-vfs-io-jobs.c (-4 / +13 lines)
Lines 432-439 _thunar_vfs_io_jobs_create (ThunarVfsJob *job, Link Here
432
      absolute_path = thunar_vfs_path_dup_string (lp->data);
432
      absolute_path = thunar_vfs_path_dup_string (lp->data);
433
433
434
again:
434
again:
435
      /* try to create the file at the given path */
435
      /* Try to create the file at the given path.
436
      fd = g_open (absolute_path, O_CREAT | O_EXCL | O_WRONLY, DEFFILEMODE);
436
       *
437
       * Note that despite the 0666 mask, we won't really create a world-writable
438
       * file unless the user's umask permits it (ie the umask is 0000).
439
       */
440
      fd = g_open (absolute_path, O_CREAT | O_EXCL | O_WRONLY, 0666);
437
      if (G_UNLIKELY (fd < 0))
441
      if (G_UNLIKELY (fd < 0))
438
        {
442
        {
439
          /* check if the file already exists */
443
          /* check if the file already exists */
Lines 707-714 _thunar_vfs_io_jobs_mkdir (ThunarVfsJob *job, Link Here
707
      /* update the progress information */
711
      /* update the progress information */
708
      _thunar_vfs_job_process_path (job, lp);
712
      _thunar_vfs_job_process_path (job, lp);
709
713
710
      /* try to create the target directory */
714
      /* try to create the target directory
711
      if (!_thunar_vfs_io_ops_mkdir (lp->data, 0777 & ~umask(0), THUNAR_VFS_IO_OPS_NONE, error))
715
       *
716
       * Note that the mode specified here is limited by the user's umask, so we will not
717
       * actually be creating a world writable directory unless the user's umask permits
718
       * it.
719
       */
720
      if (!_thunar_vfs_io_ops_mkdir (lp->data, 0777, THUNAR_VFS_IO_OPS_NONE, error))
712
        return FALSE;
721
        return FALSE;
713
    }
722
    }
714
723

Return to bug 316681