bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

configure fails to detect /dev/fd support when running under `su`


From: Mike Frysinger
Subject: configure fails to detect /dev/fd support when running under `su`
Date: Fri, 5 May 2006 20:53:26 -0400
User-agent: KMail/1.9.1

if you login as one user (say 'root') and then `su` to another (say 'vapier'), 
the ./configure test for /dev/fd will fail ... the reason being that the node 
in /dev/pts/ is owned by the user that logged in

might i suggest this change in the /dev/fd test:
[bash_cv_dev_fd=""
if test -d /dev/fd  && test -r /dev/fd/0 < /dev/null; then
# check for systems like FreeBSD 5 that only provide /dev/fd/[012]
   exec 3<&0
   if test -r /dev/fd/3; then
     bash_cv_dev_fd=standard
   else
     bash_cv_dev_fd=absent
   fi
   exec 3<&-
fi
if test -z "$bash_cv_dev_fd"; then
  if test -d /proc/self/fd && test -r /proc/self/fd/0 < /dev/null; then
     bash_cv_dev_fd=whacky
   else
     bash_cv_dev_fd=absent
   fi
fi
]

or perhaps just this one liner change:
    exec 3<&0
-   if test -r /dev/fd/3; then
+   if test -e /dev/fd/3; then
      bash_cv_dev_fd=standard
-mike




reply via email to

[Prev in Thread] Current Thread [Next in Thread]