Client: assume uid==0 is local socket
A negative uid value means it's not a "local socket" (PF_LOCAL). uid==0 means user "root" connected.
This commit is contained in:
		
							
								
								
									
										1
									
								
								NEWS
									
									
									
									
									
								
							
							
						
						
									
										1
									
								
								NEWS
									
									
									
									
									
								
							| @@ -2,6 +2,7 @@ ver 0.18.18 (not yet released) | |||||||
| * decoder | * decoder | ||||||
|   - ffmpeg: support opus |   - ffmpeg: support opus | ||||||
| * fix crash on failed filename charset conversion | * fix crash on failed filename charset conversion | ||||||
|  | * fix local socket detection from uid=0 (root) | ||||||
|  |  | ||||||
| ver 0.18.17 (2014/11/02) | ver 0.18.17 (2014/11/02) | ||||||
| * playlist | * playlist | ||||||
|   | |||||||
| @@ -109,7 +109,7 @@ public: | |||||||
| 	 * a local (UNIX domain) socket? | 	 * a local (UNIX domain) socket? | ||||||
| 	 */ | 	 */ | ||||||
| 	bool IsLocal() const { | 	bool IsLocal() const { | ||||||
| 		return uid > 0; | 		return uid >= 0; | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
| 	unsigned GetPermission() const { | 	unsigned GetPermission() const { | ||||||
|   | |||||||
| @@ -47,7 +47,7 @@ client_allow_file(const Client &client, Path path_fs, Error &error) | |||||||
| 		   instance */ | 		   instance */ | ||||||
| 		return true; | 		return true; | ||||||
|  |  | ||||||
| 	if (uid <= 0) { | 	if (uid < 0) { | ||||||
| 		/* unauthenticated client */ | 		/* unauthenticated client */ | ||||||
| 		error.Set(ack_domain, ACK_ERROR_PERMISSION, "Access denied"); | 		error.Set(ack_domain, ACK_ERROR_PERMISSION, "Access denied"); | ||||||
| 		return false; | 		return false; | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Max Kellermann
					Max Kellermann