diff options
author | Dr. Tilmann Bubeck <tilmann@bubecks.de> | 2020-08-20 20:28:52 +0200 |
---|---|---|
committer | Dr. Tilmann Bubeck <tilmann@bubecks.de> | 2020-08-20 20:28:52 +0200 |
commit | 18a3c3a7672ff5d65bf0b79b89464eac7540b95b (patch) | |
tree | 81f915b26682cb937f9ac596e1604270476a38bf | |
parent | aaf037ec5c576e46318935feaf6e2b7407ff11a0 (diff) | |
download | xorg-app-xauth-18a3c3a7672ff5d65bf0b79b89464eac7540b95b.tar.gz |
Additionally check socket file with S_ISSOCK
This fixes bug https://bugzilla.redhat.com/show_bug.cgi?id=1870201
-rw-r--r-- | gethost.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -202,14 +202,14 @@ struct addrlist *get_address_info ( strncpy(path, fulldpyname, sizeof(path)); path[sizeof(path) - 1] = '\0'; #endif - if (0 == stat(path, &sbuf)) { + if (0 == stat(path, &sbuf) && S_ISSOCK(sbuf.st_mode) ) { is_path_to_socket = 1; } 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)) { is_path_to_socket = 1; } } |