login via spawn

When starting login via spawn (with its output redirected on the serial port
via iov[] ) login start fine, asks for user name but never asks for password
and keeps asking for user name as if it couldn’t access /etc/passwd file or
something.

I assume this must have something to do with the qnx option spawn flags (I’m
using SETID) but can seems to find the proper combinaison.

  • Mario

Mario Charest postmaster@127.0.0.1 wrote:

When starting login via spawn (with its output redirected on the serial port
via iov[] ) login start fine, asks for user name but never asks for password
and keeps asking for user name as if it couldn’t access /etc/passwd file or
something.

I’m betting login will NOT just use its redirected fds, but will instead
do an open(/dev/tty) to get the passwd (so it knows it is reading directly
from the controlling terminal). If you haven’t done the stuff to make
sure its controlling terminal is setup properly, you’ll probably see
behaviour like this.

system(“on -t /dev/serx login”) is probably the easiest way to get
it right – though it does have the extra over head of the shell.


I assume this must have something to do with the qnx option spawn flags (I’m
using SETID) but can seems to find the proper combinaison.

You probably want the _SPAWN_SETSID flag and the ctfd parameter of the
spawn option to be set to a fd that points to the serial port. You may
also need _SPAWN_TCSETPGRP. (But, SETSID may do that already.)

-David

QNX Training Services
http://www.qnx.com/support/training/
Please followup in this newsgroup if you have further questions.