mirror of
https://github.com/tmux/tmux.git
synced 2024-12-15 20:18:46 +00:00
Better errno, from joshe.
This commit is contained in:
parent
d4947fc4cb
commit
3932da2522
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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user