summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLarry Doolittle <larry@doolittle.boa.org>2022-04-16 15:28:31 -0700
committerLarry Doolittle <larry@doolittle.boa.org>2022-04-16 15:28:31 -0700
commitce87ae39d5ab28733b4125a09d0a643d1581b1c8 (patch)
treef7b5f20a29e78d213f600893b59c3a1c023b0659
parent83e97b2bf683f341da177bd5df5b1297cbdc16a4 (diff)
downloadxorg-app-xauth-ce87ae39d5ab28733b4125a09d0a643d1581b1c8.tar.gz
Expand checks of socket file with S_ISSOCK
Extend work done in commit 18a3c3a to earlier in the socket detection process Fixes issue #6.
-rw-r--r--parsedpy.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/parsedpy.c b/parsedpy.c
index b5ff2f4..5744a4b 100644
--- a/parsedpy.c
+++ b/parsedpy.c
@@ -175,14 +175,14 @@ parse_displayname (const char *displayname,
strncpy(path, displayname, sizeof(path) - 1);
path[sizeof(path) - 1] = '\0';
#endif
- if (0 == stat(path, &sbuf)) {
+ if (0 == stat(path, &sbuf) && S_ISSOCK(sbuf.st_mode)) {
family = FamilyLocal;
} else {
char *dot = strrchr(path, '.');
if (dot) {
*dot = '\0';
/* screen = atoi(dot + 1); */
- if (0 == stat(path, &sbuf)) {
+ if (0 == stat(path, &sbuf) && S_ISSOCK(sbuf.st_mode)) {
family = FamilyLocal;
}
}