mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 13:32:45 +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
				
			
		|  | @ -32,10 +32,17 @@ public: | |||
| 
 | ||||
|     virtual const char* class_name() const = 0; | ||||
| 
 | ||||
|     uid_t uid() const { return m_uid; } | ||||
|     uid_t gid() const { return m_gid; } | ||||
| 
 | ||||
| protected: | ||||
|     CharacterDevice(unsigned major, unsigned minor) : m_major(major), m_minor(minor) { } | ||||
|     void set_uid(uid_t uid) { m_uid = uid; } | ||||
|     void set_gid(gid_t gid) { m_gid = gid; } | ||||
| 
 | ||||
| private: | ||||
|     unsigned m_major { 0 }; | ||||
|     unsigned m_minor { 0 }; | ||||
|     uid_t m_uid { 0 }; | ||||
|     gid_t m_gid { 0 }; | ||||
| }; | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Andreas Kling
						Andreas Kling