! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
sudo: sorry, you must have a tty to run sudo +
Status:
RESOLVED: WONTFIX
Product:
Xfce4-session
Component:
General

Comments

Description Kawada Tsuyoshi 2007-10-28 10:11:55 CET
xfsm-shutdown-helper.c

execl (helper->sudo, "sudo", "-H", "-S", "-p",
             "XFSM_SUDO_PASS ", "--", "/usr/libexec/xfsm-shutdown-helper", NULL);

  n = read (parent_pipe[0], buf, 15);

the buf message is "sudo: sorry, you must have a tty to run sudo +"

if I execute startx command. xfce4-session has tty.
But I login from xdm, gdm, kdm.
xfce4-session doest not have tty.

So I can not reboot and poweroff as root.
Comment 1 Kawada Tsuyoshi 2007-10-28 10:35:55 CET
Please see.

I can  reboot and poweroff as root.

+++ sudo-1.6.9p5/sudo.c 2007-10-28 19:17:40.000000000 +0900
@@ -337,6 +337,7 @@ main(argc, argv, envp)
     /* Bail if a tty is required and we don't have one.  */
     if (def_requiretty) {
    if ((fd = open(_PATH_TTY, O_RDWR|O_NOCTTY)) == -1)
+       if ((fd = open("/dev/tty1", O_RDWR|O_NOCTTY)) == -1)
        log_error(NO_MAIL, "sorry, you must have a tty to run sudo");
    else
        (void) close(fd);
Comment 2 Benedikt Meurer editbugs 2007-11-28 18:53:23 CET
Hm, the display managers usually allocate a pseudo tty for the session. Dunno why this is not the case here. Anyway, the sudo way is deprecated, please use HAL to shutdown your system.
Comment 3 Brian J. Tarricone (not reading bugmail) 2008-10-17 09:43:46 CEST
I don't think there's much we can do about this anyway...

Bug #3630

Reported by:
Kawada Tsuyoshi
Reported on: 2007-10-28
Last modified on: 2009-07-14

People

Assignee:
Benedikt Meurer
CC List:
0 users

Version

Attachments

Additional information