Bug 62432 - su reporting "standard in must be a tty" in sh-utils-2.0.11-12
su reporting "standard in must be a tty" in sh-utils-2.0.11-12
Status: CLOSED RAWHIDE
Product: Red Hat Raw Hide
Classification: Retired
Component: sh-utils (Show other bugs)
1.0
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: wdovlrrw
Ben Levenson
:
: 62513 62546 (view as bug list)
Depends On:
Blocks: 61590 61925
  Show dependency treegraph
 
Reported: 2002-03-31 19:22 EST by Jonathan Kamens
Modified: 2007-04-18 12:41 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2002-04-03 03:38:37 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Jonathan Kamens 2002-03-31 19:22:03 EST
I just upgraded to sh-utils-2.0.11-12.  Now, /etc/cron.hourly/inn-cron-nntpsend
and /etc/cron.hourly/inn-cron-rnews are failing with "standard in must be a
tty".  They both use "su - news -c <whatever>".  The problem seems to occur even
if I delete the "-", i.e., "su news" instead of "su - news".

Either this new behavior needs to be removed from su, or anything which uses "su
<whatever>" as root in a non-interactive job needs to be fixed to use some other
mechanism.
Comment 1 Bernhard Rosenkraenzer 2002-04-02 05:23:51 EST
*** Bug 62513 has been marked as a duplicate of this bug. ***
Comment 2 Bernhard Rosenkraenzer 2002-04-02 05:27:45 EST
This is because of the fix for bug #61925 (which requested that root should  
not be able to su to other users unless the pam files state so).  
 
The error message is coming from pam despite the 
 
auth sufficient /lib/security/pam_rootok.so 
 
line in /etc/pam.d/su. 
 
Bug in pam?
Comment 3 Nalin Dahyabhai 2002-04-02 10:43:23 EST
Erm, no.  Excerpt from su in sh-utils-2.0.11-11:

  if (getuid () == 0)
    return 1;

  if (!isatty(0)) {
        fprintf(stderr, "standard in must be a tty\n");
        exit(1);
  }

The section from -12:

  if (!isatty(0)) {
        fprintf(stderr, "standard in must be a tty\n");
        exit(1);
  }

The original code apparently allowed the superuser to use su without a tty, but
not any other users.  The misc_conv() function used by PAM only warns when stdin
isn't a TTY.  If this is enough (the case we looked at was cron, where text
piped to "su" won't normally be echoed, so it probably is enough), then you can
just remove this check.
Comment 4 Bill Nottingham 2002-04-02 15:35:12 EST
*** Bug 62546 has been marked as a duplicate of this bug. ***
Comment 5 Bernhard Rosenkraenzer 2002-04-08 11:51:24 EDT
Fixed in -14

Note You need to log in before you can comment on or make changes to this bug.