Subject: Re: root password prompt fails
To: None <tech-pkg@NetBSD.org>
From: Chapman Flack <nblists@anastigmatix.net>
List: tech-pkg
Date: 06/14/2006 10:20:59
Lubomir Sedlacik wrote:
> you seem to be forgetting that pkgsrc is not restricted to
> NetBSD-current, only.

How many of those platforms have buggy su, though? NetBSD didn't,
pre-PAM.

For those that do, might it be simplest to install a little wrapper
for su, e.g.:

#!/bin/sh

SU=/usr/bin/su

test $# -ge 1 || set -- root

unset endopts
for i
do
  case "${endopts+set}:$i" in
    :-- | :[!-]* )
      shift
      set -- "$@" "$i" -c 'exec 0<&9 9<&- "$SHELL" "$@"' dummy
      endopts=
      ;;
    :-* | set:* )
      shift
      set -- "$@" "$i"
      ;;
  esac
done

exec 9<&0 0</dev/tty "$SU" "$@"


-Chap