mirror of
				https://github.com/asterisk/asterisk.git
				synced 2025-10-31 02:37:10 +00:00 
			
		
		
		
	Make sure asterisk builds on OpenBSD
OpenBSD defines SO_PEERCRED, but it returns a 'struct sockpeercred', not 'struct ucred', which causes compilation of main/asterisk.c to fail in read_credentials(). This allows configure to check for sockpeercred and asterisk to deal with it properly. (closes issue ASTERISK-18929) Reported-by: Barry Miller Patch-by: Barry Miller git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@350730 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
		| @@ -1193,7 +1193,12 @@ static pthread_t lthread; | ||||
| static int read_credentials(int fd, char *buffer, size_t size, struct console *con) | ||||
| { | ||||
| #if defined(SO_PEERCRED) | ||||
| #ifdef HAVE_STRUCT_SOCKPEERCRED_UID | ||||
| #define HAVE_STRUCT_UCRED_UID | ||||
| 	struct sockpeercred cred; | ||||
| #else | ||||
| 	struct ucred cred; | ||||
| #endif | ||||
| 	socklen_t len = sizeof(cred); | ||||
| #endif | ||||
| #if defined(HAVE_GETPEEREID) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user