Package: coreutils
Version: 8.13-3.5
Severity: normal


The su command switching user in the current shell, when run as root without tty.


environment:

root@foo:~/sutest# echo $SHELL
/bin/bash

root@foo:~/sutest# bash --version
GNU bash, version 4.2.37(1)-release (x86_64-pc-linux-gnu)
Copyright (C) 2011 Free Software Foundation, Inc.


sutest.sh:

whoami
su www-data
whoami


reproduction steps:

root@foo:~/sutest# ./sutest.sh
root
sh-4.2$ whoami
www-data
sh-4.2$ exit
root

root@foo:~/sutest# cat sutest.sh | bash
root
www-data


So the same script runs differently, running as root from stdin it does not yield message that says "it's not tty" (like as normal user), but silently switches user in the current shell.


-- System Information:
Debian Release: 7.5
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 3.2.0-4-amd64 (SMP w/4 CPU cores)
Locale: LANG=hu_HU, LC_CTYPE=hu_HU (charmap=ISO-8859-2)
Shell: /bin/sh linked to /bin/bash

Versions of packages coreutils depends on:
ii  dpkg          1.16.15
ii  install-info  4.13a.dfsg.1-10
ii  libacl1       2.2.51-8
ii  libattr1      1:2.4.46-8
ii  libc6         2.13-38+deb7u1
ii  libselinux1   2.1.9-5

coreutils recommends no packages.

coreutils suggests no packages.

-- no debconf information


--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to