mirror of
				https://github.com/tmux/tmux.git
				synced 2025-11-04 09:26:05 +00:00 
			
		
		
		
	Better errno, from joshe.
This commit is contained in:
		
							
								
								
									
										8
									
								
								tmux.c
									
									
									
									
									
								
							
							
						
						
									
										8
									
								
								tmux.c
									
									
									
									
									
								
							@@ -1,4 +1,4 @@
 | 
			
		||||
/* $Id: tmux.c,v 1.111 2009-04-01 18:21:40 nicm Exp $ */
 | 
			
		||||
/* $Id: tmux.c,v 1.112 2009-04-01 20:15:48 nicm Exp $ */
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
 | 
			
		||||
@@ -190,11 +190,11 @@ makesockpath(const char *label)
 | 
			
		||||
 | 
			
		||||
	if (lstat(base, &sb) != 0)
 | 
			
		||||
		return (NULL);
 | 
			
		||||
	if (!S_ISDIR(sb.st_mode) || sb.st_uid != uid) {
 | 
			
		||||
		errno = EACCES;
 | 
			
		||||
	if (!S_ISDIR(sb.st_mode)) {
 | 
			
		||||
		errno = ENOTDIR;
 | 
			
		||||
		return (NULL);
 | 
			
		||||
	}
 | 
			
		||||
	if ((sb.st_mode & (S_IRWXG|S_IRWXO)) != 0) {
 | 
			
		||||
	if (sb.st_uid != uid || (sb.st_mode & (S_IRWXG|S_IRWXO)) != 0) {
 | 
			
		||||
		errno = EACCES;
 | 
			
		||||
		return (NULL);
 | 
			
		||||
	}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user