Skip to content

[OPTIONAL PATCH] Re: Configure using /tmp #1549

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
p5pRT opened this issue Mar 28, 2000 · 1 comment
Closed

[OPTIONAL PATCH] Re: Configure using /tmp #1549

p5pRT opened this issue Mar 28, 2000 · 1 comment

Comments

@p5pRT
Copy link

p5pRT commented Mar 28, 2000

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

Searchable as RT2766$

@p5pRT
Copy link
Author

p5pRT commented Mar 28, 2000

From @doughera88

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

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

This patch elimates Configure's use of /tmp in determining whether the OS
supports long file names (>14 characters). Configure originally did part
of the test in /tmp to be (reasonably) sure that it was working on a local
file system rather than an NFS mount.

Although such arrangements used to be reasonably common, they probably
aren't so common any more. This patch eliminates use of /tmp in that
test, but introduces the possibility of error in those uncommon cases. In
my hasty judgment, it's probably worthwhile to apply this patch, but I
think it's a close call.

Incidentally, this does not eliminate all use of /tmp from Configure.
Configure compiles and runs many little programs. Many compilers use /tmp
to store temporary files. There's no way we can reliably test whether all
compilers do so securely and, if not, whether we can stop all of them from
doing so.

So don't run Configure/make as root.

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

Inline Patch
--- Configure.RC1	Wed Mar 15 10:59:25 2000
+++ Configure	Wed Mar 15 11:19:07 2000
@@ -6616,36 +6616,15 @@
 
 : see if we can have long filenames
 echo " "
-rmlist="$rmlist /tmp/cf$$"
-$test -d /tmp/cf$$ || mkdir /tmp/cf$$
 first=123456789abcdef
-second=/tmp/cf$$/$first
-$rm -f $first $second
+$rm -f $first
 if (echo hi >$first) 2>/dev/null; then
 	if $test -f 123456789abcde; then
 		echo 'You cannot have filenames longer than 14 characters.  Sigh.' >&4
 		val="$undef"
 	else
-		if (echo hi >$second) 2>/dev/null; then
-			if $test -f /tmp/cf$$/123456789abcde; then
-				$cat <<'EOM'
-That's peculiar... You can have filenames longer than 14 characters, but only
-on some of the filesystems.  Maybe you are using NFS.  Anyway, to avoid problems
-I shall consider your system cannot support long filenames at all.
-EOM
-				val="$undef"
-			else
-				echo 'You can have filenames longer than 14 characters.' >&4
-				val="$define"
-			fi
-		else
-			$cat <<'EOM'
-How confusing! Some of your filesystems are sane enough to allow filenames
-longer than 14 characters but some others like /tmp can't even think about them.
-So, for now on, I shall assume your kernel does not allow them at all.
-EOM
-			val="$undef"
-		fi
+		echo 'You can have filenames longer than 14 characters.' >&4
+		val="$define"
 	fi
 else
 	$cat <<'EOM'
@@ -6655,7 +6634,7 @@
 fi 
 set d_flexfnam
 eval $setvar
-$rm -rf /tmp/cf$$ 123456789abcde*
+$rm -rf 123456789abcde*
 
 : determine where library module manual pages go
 set man3dir man3dir none

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant