[OpenIndiana-discuss] stty source code

James Carlson carlsonj at workingcode.com
Thu Sep 6 15:45:45 UTC 2012


Reginald Beardsley wrote:
> Sorry, I missed that detail.  I just opened the connection w/ tip, went to the window where I was setuid to uucp and did "stty olcuc </dev/cua/0" then back to the tip window. No effect.  Everything is still lower case.

Don't forget opost.

And don't forget that the "output" options you're changing on /dev/cua/0
will reflect how that port processes output text going *TO* that serial
port, and not the data you see coming back.

If your concern is (as it was before) with the characters coming from
that remote system and being displayed on your xterm, then here are the
players involved:

	- remote system transmits some characters
	- the /dev/cua/0 tty receives them and processes according to
	  the current input settings on that device
	- tip reads some data from the tty and writes it to stdout
	- tip's stdout is the slave side of the pty connected to xterm
	  (this is your session tty)
	- the pty's output is processed by the output settings on that
	  pty
	- xterm reads the master side of the pty and decides (based on
	  configuration) how to render those characters for the display
	- xterm writes the characters to the display

As you can see, doing stty on /dev/cua/0 may or may not do what you
desire to do here.  More likely, I'd expect that cranking up tip and
then doing stty on the pty that tip is using will produce the sorts of
results you want.  But it's still the Wrong Way To Solve The Problem
because it's based on a fairly fundamental set of misunderstandings.

By far, I believe the best way to solve the problems you're having here
are to either (a) use something with more sophisticated terminal
emulation processing than just 'tip', which inherently assumes that
you've configured the remote terminal configuration to be compatible
with the local terminal emulator (which you have not done), or (b)
reconfigure xterm and/or the remote system such that they have
compatible terminal emulation modes.

> At this point, I think I need to make a non-setuid copy of tip and run tip under truss from a shell which is setuid to uucp.  I'll have to wait until tomorrow to try that though as other things will take up the rest of the day.

If you run truss as user 'uucp' or as 'root', you shouldn't have that
problem.  Simple enough to try if all you're doing is debugging.  No
need to make a copy.

> I'm beginning to suspect that there's something in the USB serial driver which is being more "helpful" than it should.  So another thing is to spin up OI on a box w/ a real serial port and see how it behaves.

I still think you're really barking up the wrong tree here, and it makes
the problem far harder to solve.

-- 
James Carlson         42.703N 71.076W         <carlsonj at workingcode.com>



More information about the OpenIndiana-discuss mailing list