Menu

#4 tcgetpgrp() fails in scp

v1.06
wont-fix
nobody
None
5
2016-07-02
2011-03-03
Anonymous
No

Hello,
"sshpass ... scp ..." doesn't display a progress bar as scp normally does.
I digged in scp code and found the following:

static int
can_output(void)
{
return (getpgrp() == tcgetpgrp(STDOUT_FILENO));
}

The tcgetpgrp call returns -1, if scp is called via sshpass.

I tried a bit hacking in sshpass without success. Without a call of setsid() in the child fork in sshpass, the tcgetpgrp call in the child works as it should, but that fails sshpass entering the password.

As I don't how theses terminals work in much detail, I am not able to find a solution to this.
I would appreciate it if someone with deeper knowledge fixes this.

Discussion

  • Shachar Shemesh

    Shachar Shemesh - 2011-08-06

    Fixing this would involve sshpass taking control not only of the TTY for the process, but also of the STDOUT and STDIN for it. I believe this is out of scope for sshpass, but I've left comments on so you can try and convince me otherwise.

     
  • Shachar Shemesh

    Shachar Shemesh - 2011-08-06
    • status: open --> closed-wont-fix
     
  • Shachar Shemesh

    Shachar Shemesh - 2016-07-02
    • status: closed-wont-fix --> wont-fix
    • Group: --> v1.06
     

Log in to post a comment.