Perl / perl5

🐪 The Perl programming language
https://dev.perl.org/perl5/
Other
2.07k stars 574 forks source link

Re: Configure using /tmp #1547

Closed p5pRT closed 21 years ago

p5pRT commented 25 years ago

Migrated from rt.perl.org#2764 (status was 'resolved')

Searchable as RT2764$

p5pRT commented 25 years ago

From @doughera88

On Wed\, 15 Mar 2000\, M.J.T. Guy wrote​:

I notice that a couple of Configure's temporary files are in /tmp/c... while most of them go in the UU directory. Is there a reason for this?

In the context of the current witchhunt\, does this use of /tmp raise any security issues?

I sure hope nobody is running Configure as root :-). Nobody should trust that such a twisty maze of shell scripts is perfectly secure.

On a quick scan\, the first uses of /tmp are not essential at all -- the patch below eliminates them. We could probably safely skip the Xenix csh bug tests too\, but I'm not proposing anything that radical today.

The other use of /tmp at least historically was useful for determining whether a system supported long file names (d_flexfnam) on some file systems but not on others. /tmp was chosen as a file system that was likely to be local\, instead of an NFS mount. I haven't touched that one. If folks are truly concerned\, we can probably just remove the /tmp tests entirely and hope the user is working on a filesystem that is typical of the system as a whole. [I'll send that as a separate optional patch for consideration.] (Actually NT-mounted filesystems are probably more of a real issue nowadays than v7/System III/System V 14-char filename limits.

--   Andy Dougherty doughera@​lafayette.edu   Dept. of Physics   Lafayette College\, Easton PA 18042

Inline Patch ```diff --- Configure.RC1 Wed Mar 15 10:59:25 2000 +++ Configure Wed Mar 15 11:01:15 2000 @@ -23,7 +23,7 @@ # Generated on Sun Mar 12 19:42:40 EET 2000 [metaconfig 3.0 PL70] # (with additional metaconfig patches by perlbug@perl.com) -cat >/tmp/c1$$ <c1$$ </tmp/c2$$ <c2$$ <
p5pRT commented 24 years ago

From @doughera88

While cleaning up my open bugs in the bug db\, I came across this entry​: Configure currently creates two temporary files in /tmp. They can easily be done in the current working directory. This patch moves them. I sure hope no one is running Configure as root. (The patch is contained in the original bug report\, this is just repackaging it for metaconfig to make it easier to apply. It applies to Configure also.)

Inline Patch ```diff --- p4/metaconfig/U/modified/Head.U Fri Oct 13 14:57:22 2000 +++ p4-andy/metaconfig/U/modified/Head.U Wed Dec 13 10:15:47 2000 @@ -91,7 +91,7 @@ # Generated on [metaconfig PL] # (with additional metaconfig patches by ) -cat >/tmp/c1$$ <c1$$ </tmp/c2$$ <c2$$ <
p5pRT commented 24 years ago

From @tux

On Wed\, 13 Dec 2000 10​:36​:09 -0500 (EST)\, Andy Dougherty \doughera@&#8203;lafayette\.edu wrote​:

While cleaning up my open bugs in the bug db\, I came across this entry​: Configure currently creates two temporary files in /tmp. They can easily be done in the current working directory. This patch moves them. I sure hope no one is running Configure as root. (The patch is contained in the original bug report\, this is just repackaging it for metaconfig to make it easier to apply. It applies to Configure also.)

Can this please be made configurable from Policy.sh? I *do* like/want Configure to use /tmp. IMHO that's what /tmp is for!

p5pRT commented 24 years ago

From The RT System itself

Fixed in change 8100

p5pRT commented 24 years ago

From @doughera88

  On Wed\, 13 Dec 2000\, H.Merijn Brand wrote​:

On Wed\, 13 Dec 2000 10​:36​:09 -0500 (EST)\, Andy Dougherty \doughera@&#8203;lafayette\.edu wrote​:

While cleaning up my open bugs in the bug db\, I came across this entry​: Configure currently creates two temporary files in /tmp. They can easily be done in the current working directory. This patch moves them. I sure hope no one is running Configure as root. (The patch is contained in the original bug report\, this is just repackaging it for metaconfig to make it easier to apply. It applies to Configure also.)

Can this please be made configurable from Policy.sh?

For these two tiny files made at the very beginning of Configure and then removed almost immediately thereafter\, I really don't think it's worth the efffort. Besides\, those two files are read way way way at the top\, long before Configure has figured out how to even find a Policy.SH file.

I *do* like/want Configure to use /tmp. IMHO that's what /tmp is for!

The issue came up in a security review of the use of /tmp. The build process already builds lots of files in the current directory. What's two more?

p5pRT commented 24 years ago

From @tux

On Wed\, 13 Dec 2000 11​:39​:43 -0500 (EST)\, Andy Dougherty \doughera@&#8203;lafayette\.edu wrote​:

On Wed\, 13 Dec 2000\, H\.Merijn Brand wrote&#8203;:

On Wed\, 13 Dec 2000 10​:36​:09 -0500 (EST)\, Andy Dougherty \doughera@&#8203;lafayette\.edu wrote​:

While cleaning up my open bugs in the bug db\, I came across this entry​: Configure currently creates two temporary files in /tmp. They can easily be done in the current working directory. This patch moves them. I sure hope no one is running Configure as root. (The patch is contained in the original bug report\, this is just repackaging it for metaconfig to make it easier to apply. It applies to Configure also.)

Can this please be made configurable from Policy.sh?

For these two tiny files made at the very beginning of Configure and then removed almost immediately thereafter\, I really don't think it's worth the efffort. Besides\, those two files are read way way way at the top\, long before Configure has figured out how to even find a Policy.SH file.

I *do* like/want Configure to use /tmp. IMHO that's what /tmp is for!

The issue came up in a security review of the use of /tmp. The build process already builds lots of files in the current directory. What's two more?

Convinced. Surrendered.