Free Downloads, Community Forum,
FAQs and Developer Resources


Make /Tools Your Home | Link to us

Today's posts | Posts since last visit | Most Active Topics

All Forums Register Login Search Subscriptions My Profile Inbox
Tool Warehouse FAQs Resources Help Member List Address Book Logout

Maintaining pty permissions

 
Logged in as: Guest
Users viewing this topic: none
  Printable Version
All Forums >> [SFU / Interix / SUA Technology] >> Tools Discussion Forum >> Maintaining pty permissions Page: [1]
Login
Message << Older Topic   Newer Topic >>
Maintaining pty permissions - Oct. 31, '05, 2:07:34 AM   
wysoft

 

Posts: 12
Joined: Jul. 14, '05,
From: Washington State, USA
Status: offline
I'm having a problem here where /dev/ttyp* are losing ownership or permission settings. If I open xterm, the user takes ownership of its pty, and returns ownership to Administrator upon close, which is all fine and dandy. Unfortunately, it changes the permissions on the pty to 640 and leaves them there. So, when I try to open another xterm, the user can't take control of the pty. Eventually all pty dev nodes lose their permission of 666, and I can't open any more xterms without setting the permissions again.

Is there a way to prevent this from happening, so I don't have to write a cron job to set the permissions every few minutes? That's so kludgy.
Post #: 1
RE: Maintaining pty permissions - Oct. 31, '05, 2:38:55 AM   
Rodney

 

Posts: 3728
Joined: Jul. 9, '02,
From: /Tools lab
Status: offline
I don't see this behavior at all with my systems.
The subsystem is to be resetting these files, not the user processes, because
you can't count on a user process actually finishing (let alone cleanup nicely
after itself).
A mode of 640 doesn't sound like any of the code I know.
Did you mean mode 620 or 622 ?

Which version of Interix are you running? ('uname -X').

Which xterm are you running? (in ksh do "whence xterm", in csh do "which xterm")

(in reply to wysoft)
Post #: 2
RE: Maintaining pty permissions - Oct. 31, '05, 3:23:35 AM   
wysoft

 

Posts: 12
Joined: Jul. 14, '05,
From: Washington State, USA
Status: offline
Thanks Rodney,

I'd like to mention first of all, that I do not suffer from this problem when using rxvt, which was compiled from NetBSD pkgsrc.

I originally posted the incorrect mode, the pty dev nodes are being set to 620 after exiting xterm. I am using the updated xterm from the Tools repository, Interix 3.5 on Windows XP SP2. So, here's an example:

/dev/ttyp* have all been manually set to mode 666, owner/group Administrator. All nodes look like this:

crw-rw-rw- 1 Administrator +Administrators 5, 0 Oct 19 15:55 ttyp0

Now, I'll start an xterm, which binds to /dev/ttyp0 and changes the owner and permissions so that it looks like this:

crw--w---- 1 wysoft +Administrators 5, 1 Oct 19 15:55 /dev/ttyp0

And, after closing the xterm, it looks like this:

crw--w---- 1 Administrator +Administrators 5, 0 Oct 19 15:55 /dev/ttyp0

Now, this node is basically useless. A normal user can't gain ownership of it, and can't write to it. After a certain amount of time, after opening and closing a number of xterms, I run out of available nodes. Now as I've said before, rxvt seems to work fine, but if this is a problem with the updated xterm, it would help to solve it. However, it may be worth mentioning that rxvt does not change the ownership of the node while it is running, it remains owned by Administrator. I don't know if this is correct or not.

< Message edited by wysoft -- Oct. 31, '05, 3:31:28 AM >

(in reply to Rodney)
Post #: 3
RE: Maintaining pty permissions - Oct. 31, '05, 3:39:10 AM   
Rodney

 

Posts: 3728
Joined: Jul. 9, '02,
From: /Tools lab
Status: offline
I'm using the newer xterm regularly and haven't seen this problem.
So there must be something more to it.

When you start xterm which options are you providing?
What is the "ls -l" of /dev/ptyp0 (the master side) before and after?
How are you ending the xterm ?

(in reply to wysoft)
Post #: 4
RE: Maintaining pty permissions - Oct. 31, '05, 3:43:02 AM   
wysoft

 

Posts: 12
Joined: Jul. 14, '05,
From: Washington State, USA
Status: offline
Here is the command I'm using with xterm:

psxrun -u -p /usr/X11R6/bin/xterm -- xterm -bg black -fg grey -ls

The /dev/ptyp* nodes are not being bound to by xterm, rather it is binding to /dev/ttyp*

It does not matter if I exit xterm by clicking the close button, using the 'exit' command, 'logout' or Ctrl+D.

< Message edited by wysoft -- Oct. 31, '05, 3:45:45 AM >

(in reply to Rodney)
Post #: 5
RE: Maintaining pty permissions - Oct. 31, '05, 4:16:22 AM   
Rodney

 

Posts: 3728
Joined: Jul. 9, '02,
From: /Tools lab
Status: offline
> psxrun -u -p /usr/X11R6/bin/xterm -- xterm -bg black -fg grey -ls

Okay.
You're not running the newer xterm.
You're running the X11R6 (specifically X11R6.6) xterm. You should not run this version
of the xterm. You should run either /usr/X11R5/bin/xterm or /usr/local/bin/xterm. The latter
is the newer X11R6.8 xterm from here. I ported X11R6.6 for the libraries for Interix 3.0 for
the Tools Warehouse; the utilities were never actually ported but were in the source tree. The SFU
group grabbed this X11R6.6 for Interix 3.5. So blame falls through the cracks.

Anyway, change your startup line and try again to see what happens.
This newer xterm is in colour BTW. Change to:
psxrun -u -p /usr/local/bin/xterm -- xterm -bg black -fg grey -ls

> The /dev/ptyp* nodes are not being bound to by xterm, rather it is binding to /dev/ttyp*

errr, no. The xterm is using a pseudo terminal. There is a master side and a slave side.
The /dev/tty* side is the slave side and the /dev/pty* is the master side. They are a matched
set. /dev/ptyp0 and /dev/ttyp0 are a set; /dev/ptyp1 and /dev/ttyp1 are a set; etc.
Access to the slave side is only possible after the master side is correctly accessed.
This is why I need to know what the master side (/dev/pty*) is set at. I need to eliminate
that there is a problem with the master side first.

(in reply to wysoft)
Post #: 6
RE: Maintaining pty permissions - Oct. 31, '05, 5:46:58 AM   
wysoft

 

Posts: 12
Joined: Jul. 14, '05,
From: Washington State, USA
Status: offline
Rodney,

/usr/X11R6/bin/xterm is the 6.8.2 xterm. I installed it by hand, as I didn't want any conflicts to occur with pkgsrc's package database.

wysoft:~> ls -l /dev/ptyp*
crw-rw-rw- 1 Administrator +Administrators 4, 0 Oct 19 15:55 /dev/ptyp0

(in reply to Rodney)
Post #: 7
RE: Maintaining pty permissions - Oct. 31, '05, 1:46:56 PM   
Rodney

 

Posts: 3728
Joined: Jul. 9, '02,
From: /Tools lab
Status: offline
Okay, I've narrowed it down.
A new package should be available later this afternoon.

> I installed it by hand, as I didn't want any conflicts to occur with pkgsrc's package database.

It would be better to install files in the location where they are supposed to be.

(in reply to wysoft)
Post #: 8
RE: Maintaining pty permissions - Oct. 31, '05, 2:21:37 PM   
Rodney

 

Posts: 3728
Joined: Jul. 9, '02,
From: /Tools lab
Status: offline
The new package is now available.

(in reply to Rodney)
Post #: 9
RE: Maintaining pty permissions - Nov. 1, '05, 12:38:48 AM   
wysoft

 

Posts: 12
Joined: Jul. 14, '05,
From: Washington State, USA
Status: offline
Thanks! :)
I appreciate it Rodney

(in reply to Rodney)
Post #: 10
Page:   [1]
All Forums >> [SFU / Interix / SUA Technology] >> Tools Discussion Forum >> Maintaining pty permissions Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts


Search All Forums -

Advanced search


SPONSORS



Forum Software © ASPPlayground.NET Advanced Edition 2.5 ANSI

0.047