Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 546038 - sys-apps/shadow : su not handling Ctrl+D
Summary: sys-apps/shadow : su not handling Ctrl+D
Status: RESOLVED UPSTREAM
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-04-09 08:54 UTC by Peter Sori
Modified: 2015-04-13 05:19 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Sori 2015-04-09 08:54:08 UTC
If loged in in normal user and then ishuing su - command and writing password but wanting to quit with Ctrl+D, the su - does not quit but it switches user to root.

Reproducible: Always

Steps to Reproduce:
1. login to normal user
2. # su -
3. enter password
4. enter Ctrl-D
Actual Results:  
Switched user to root

Expected Results:  
Application quits and returns back to normal user.
Comment 1 Jason Zaman gentoo-dev 2015-04-09 21:30:54 UTC
can you attach the output of "emerge --info sys-apps/shadow" too please
Comment 2 Peter Sori 2015-04-09 23:20:07 UTC
Portage 2.2.14 (python 2.7.9-final-0, default/linux/amd64/13.0, gcc-4.8.4, glibc-2.20-r2, 3.18.9-gentoo x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-3.18.9-gentoo-x86_64-Intel-R-_Xeon-R-_CPU_E5335_@_2.00GHz-with-gentoo-2.2
KiB Mem:     4096800 total,   2960996 free
KiB Swap:    4193276 total,   4193276 free
Timestamp of tree: Sun, 05 Apr 2015 00:45:01 +0000
ld GNU ld (Gentoo 2.24 p1.4) 2.24
app-shells/bash:          4.2_p53
dev-lang/perl:            5.20.2
dev-lang/python:          2.7.9-r1, 3.3.5-r1
dev-util/cmake:           2.8.12.2-r1
dev-util/pkgconfig:       0.28-r1
sys-apps/baselayout:      2.2
sys-apps/openrc:          0.13.11
sys-apps/sandbox:         2.6-r1
sys-devel/autoconf:       2.69
sys-devel/automake:       1.13.4
sys-devel/binutils:       2.24-r3
sys-devel/gcc:            4.8.4
sys-devel/gcc-config:     1.7.3
sys-devel/libtool:        2.4.6
sys-devel/make:           4.1-r1
sys-kernel/linux-headers: 3.18 (virtual/os-headers)
sys-libs/glibc:           2.20-r2
Repositories: gentoo
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=core2 -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/s                                                                                                                             andbox.d /etc/terminfo"
CXXFLAGS="-march=core2 -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news p                                                                                                                             arallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans                                                                                                                              userfetch userpriv usersandbox usersync"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://gentoo.inode.at/ http://gd.tuwien.ac.at/opsys/linux/gentoo/ http://gentoo.wheel.sk/"
LANG="en_US.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j9"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-fi                                                                                                                             le --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY=""
SYNC="rsync://rsync.sk.gentoo.org/gentoo-portage"
USE="acl amd64 berkdb bindist bzip2 cli cracklib crypt cxx dri fortran gdbm iconv ipv6 libav mmx mmxext modules mul                                                                                                                             tilib ncurses nls nptl openmp pam pcre readline session sse sse2 ssl tcpd unicode zlib" ABI_X86="64" ALSA_CARDS="al                                                                                                                             i5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8                                                                                                                             x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="authn_core authz_core socach                                                                                                                             e_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_de                                                                                                                             fault authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir di                                                                                                                             sk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic n                                                                                                                             egotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words f                                                                                                                             low plan sheets stage tables krita karbon braindump author" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load                                                                                                                              memory rrdtool swap syslog" CPU_FLAGS_X86="mmx mmxext sse sse2" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthma                                                                                                                             te evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rt                                                                                                                             cm104v3 sirf superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD                                                                                                                             _DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-                                                                                                                             console presenter-minimizer" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python2                                                                                                                             _7" PYTHON_TARGETS="python2_7 python3_3" RUBY_TARGETS="ruby19 ruby20" USERLAND="GNU" VIDEO_CARDS="fbdev glint intel                                                                                                                              mach64 mga nouveau nv r128 radeon savage sis tdfx trident vesa via vmware dummy v4l" XTABLES_ADDONS="quota2 psd pk                                                                                                                             nock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark                                                                                                                              dhcpmac delude chaos account"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PO                                                                                                                             RTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON

=================================================================
                        Package Settings
=================================================================

sys-apps/shadow-4.1.5.1-r1 was built with the following:
USE="acl cracklib nls pam -audit (-selinux) -skey -xattr" ABI_X86="64"
CFLAGS="-O2 -pipe"
CXXFLAGS="-O2 -pipe"
(In reply to Jason Zaman from comment #1)
> can you attach the output of "emerge --info sys-apps/shadow" too please
Comment 3 SpanKY gentoo-dev 2015-04-13 05:19:25 UTC
i'm not aware of any spec that requires EOF byte stopping input on su

su merely uses getpass which means the tty is left in line buffering mode and signal handling is turned off (sigint/etc...).  that means the only way to stop the input is to hit enter as the program hasn't even seen the data until you do that.

since the behavior isn't a big deal, and it's (afaict) always been this way, i don't see the need to change it.  feel free to ask the shadow peeps directly:
http://pkg-shadow.alioth.debian.org/