wmperry(a)aventail.com (William M. Perry) writes:
** .../linux/drivers/char/console.c in the function
** tioclinux(). The following bit of code is brutal to
** us:
**
** if (current->tty != tty && !suser())
** return -EPERM;
**
** I even tried setting us as a process leader, removing
** our controlling terminal, and then using the TIOCSCTTY
** to set up a new controlling terminal, all with no luck.
If I read the code correctly you cannot use TIOCSCTTY on a tty that
already has a sesssion on it (if you are not root).
** What is even weirder is if you run XEmacs in a VC, and
** attach to it from another VC with gnuclient, go back to
** the original VC and hit a key, the mouse pointer
** displays (in BOTH VCs), until you hit a key in the
** second VC, after which it does not display in EITHER
** VC. Bizarre, no?
How do you see both VT's at once? Maybe the kernel just forgets to
remove the mouse cursor until at least one character is drawn (that
would be another kernel bug)
If anybody cares to wade through linux/drivers/char/ and show me a
way to
get this working, the appropriate files are tty_io.c and console.c.
#if 0 the check out. If you look in tty_io.c you'll see that almost
all other such checks have met the same fate.
The reason they do the check (I think) is that so somebody can't
just call
an ioctl() to set the selection on a VC that they do not own, and then call
the ioctl() to do a paste, in effect getting a screendump of that other
VC. It is still annoying though.
Yes, but as you wrote before if you don't have the tty open you cannot
call the ioctl in the first place. You can read from and write to the
tty, why shouldn't you be able to mess with the mouse cursor?
Jan