mirror of
https://github.com/RGBCube/serenity
synced 2025-05-19 00:25:07 +00:00
Add uid and gid to CharacterDevices.
The vast majority of them will be owned by 0:0 (the default.) However, PTY pairs will now be owned by the uid:gid of the opening process.
This commit is contained in:
parent
c4fce9b3f9
commit
34e745b0b4
7 changed files with 32 additions and 5 deletions
|
@ -44,12 +44,15 @@ RetainPtr<SynthFSInode> DevPtsFS::create_slave_pty_device_file(unsigned index)
|
|||
builder.appendf("%u", index);
|
||||
file->m_name = builder.build();
|
||||
|
||||
auto* device = VFS::the().get_device(11, index);
|
||||
ASSERT(device);
|
||||
|
||||
file->m_metadata.size = 0;
|
||||
file->m_metadata.uid = 0;
|
||||
file->m_metadata.gid = 0;
|
||||
file->m_metadata.mode = 0020666;
|
||||
file->m_metadata.majorDevice = 11;
|
||||
file->m_metadata.minorDevice = index;
|
||||
file->m_metadata.uid = device->uid();
|
||||
file->m_metadata.gid = device->gid();
|
||||
file->m_metadata.mode = 0020644;
|
||||
file->m_metadata.majorDevice = device->major();
|
||||
file->m_metadata.minorDevice = device->minor();
|
||||
file->m_metadata.mtime = mepoch;
|
||||
return file;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue