tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Enhance ptyfs to handle multiple instances.



On Mar 14,  5:29pm, netbsd%izyk.ru@localhost (Ilya Zykov) wrote:
-- Subject: Re: Enhance ptyfs to handle multiple instances.

| Ok.
| 
| 1. The main problem and question in this project(IMHO), it's how get access 
for every instance through one driver ptm[x].
|       First version.
| We can do it as well "Linux devpts" do. Inside every ptyfs we can create not 
only slave side files,
| but ptm[x] too for this instance. But who must create(kernel mount function 
or userspace helper) and what permissions will assign?

We first need to decide if disclosing gaps in the pty number is a security
issue. If not, it is simple; we just allocate the next free one and we don't
care about gaps. I.e. first mount can grab 0,1,2,3,5,6 second mount can grab
4,7,8 etc. If we care, we can use an indirect mapping. I don't think that we
care. I don't think that putting ptmx inside devpts makes sense. OTOH, we
could have multiple ptmx devices with different minor numbers and use that
as the differentiating factor for the pty devices. I think that's too complex
and probably not worth it (at least in the first pass).

|       One more version. 
| We can do many ptm[x] minor numbers(165:0 165:1 for first instance, 165:2 
165:3 for second ...) this can be anywhere in fs.
| But then for every mount we must pass for what instance it's mount doing. We 
can do it with new mount option "instance=#"(for example).
| Every version has advantages and disadvantage. I think first version more 
clear. What do you think?

I think that this is not very desirable because it again introduces limits
to the number of ptys per mountpoint.

| 2. Mount without new option "minstance"(for example) must keep old behavior. 
Is it necessarily?
| Or every new mount will mount new instance?

Sure, I don't have a problem with that. An option to mount a copy as opposed
to a separate instance is fine.

christos


Home | Main Index | Thread Index | Old Index