Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 104584 - system-tools-backends <= 1.2.0 insecure temporary directory creation
Summary: system-tools-backends <= 1.2.0 insecure temporary directory creation
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Security
Classification: Unclassified
Component: Auditing (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo Security
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-09-02 05:15 UTC by Romang
Modified: 2005-09-02 05:27 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Romang 2005-09-02 05:15:22 UTC
Hello,

Take a look at : partition.pl.in

How is used after in /usr/share/setup-tool-backends/scripts/partition.pl

683 sub gst_partition_mount_temp
684 {
685    my ($device) = @_;
686    my ($filesys);
687 
688    my ($dev) = ($device =~ /\/dev\/(.*)/);
689    my $point = "/tmp/disks-conf-$dev";
690 
691    mkdir ($point);
692 
693    $cmd = "mount $device $point";
694    $fd = &gst_file_run_pipe_read_with_stderr ($cmd);
695 
696    if (!$fd)
697    {
698       my $err = `umount $device`;
699       rmdir ($point);
700       return "error";
701    }
702 
703    # Not mounted: not supported or unformatted
704    while (<$fd>)
705    {
706       if (/not supported/)
707       {
708          #($filesys) = ($_ =~ /^mount: fs type (.*) not supported by kernel$/);
709          &gst_file_close ($fd);
710          rmdir ($point);
711          return "not_supported::$_";
712       }
713       elsif (/looks like swapspace/)
714       {
715          #$filesys = "swap";
716          &gst_file_close ($fd);
717          rmdir ($point);
718          return "swap";
719       }
720       elsif (/you must specify the filesystem type/)
721       {
722          #$filesys = "none";
723          &gst_file_close ($fd);
724          rmdir ($point);
725          return "none";
726       }
727    }
728 
729    &gst_file_close ($fd);
730 
731    return $point;
732 }

Regards.
Comment 1 Tavis Ormandy (RETIRED) gentoo-dev 2005-09-02 05:27:07 UTC
AFAIK, there is no such thing as a "insecure temporary directory creation", as 
the mkdir syscall will fail if the pathname passed exists.

Please REOPEN if I have misunderstood your report.