tcsetpgrp() - SSH

This is a discussion on tcsetpgrp() - SSH ; I am running sshd on a custom QNX environment. If I run an application that calls tcsetpgrp(0, getpid()), the call fails with errno set to ENOTTY. There isn't anything untoward that happens otherwise, but I am wondering if there is ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: tcsetpgrp()

  1. tcsetpgrp()

    I am running sshd on a custom QNX environment. If I run an application
    that calls tcsetpgrp(0, getpid()), the call fails with errno set to
    ENOTTY. There isn't anything untoward that happens otherwise, but I am
    wondering if there is some parameter that is not being setup properly.

    The tcsetpgrp() function causes breaks on the terminal device to
    generate a SIGINT on all processes in the given group, so I am
    wondering if there is some conflict with the way ssh handles SIGINT
    internally.

    Any insight appreciated.

    Thanks,
    OH


  2. Re: tcsetpgrp()

    On 2006-06-23, oldhag wrote:
    > I am running sshd on a custom QNX environment. If I run an application
    > that calls tcsetpgrp(0, getpid()), the call fails with errno set to
    > ENOTTY. There isn't anything untoward that happens otherwise, but I am
    > wondering if there is some parameter that is not being setup properly.
    >
    > The tcsetpgrp() function causes breaks on the terminal device to
    > generate a SIGINT on all processes in the given group, so I am
    > wondering if there is some conflict with the way ssh handles SIGINT
    > internally.


    Which SSH implementation and version thereof are you running? If it's
    OpenSSH, one possibilty is this:

    http://bugzilla.mindrot.org/show_bug.cgi?id=1156

    On QNX (or at least Neutrino) the pty allocation process apparently
    has an unfortunate habit of acquiring the pty it's allocating as sshd's
    controlling terminal (this happens on a number of SysV derived systems
    including Solaris).

    You can try adding -DSSHD_ACQUIRES_CTTY to your CFLAGS to work around
    this. In the next release of OpenSSH (4.4), configure will do this
    automatically.

    --
    Darren Tucker (dtucker at zip.com.au)
    GPG key 8FF4FA69 / D9A3 86E9 7EEE AF4B B2D4 37C9 C982 80C7 8FF4 FA69
    Good judgement comes with experience. Unfortunately, the experience
    usually comes from bad judgement.

+ Reply to Thread