From: Mikko Rasa Date: Mon, 23 Sep 2019 14:08:55 +0000 (+0300) Subject: Use stat instead of access to check for udevadm presence X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=HEAD;p=pmount-gui.git Use stat instead of access to check for udevadm presence There's apparently some shenanigans in access so it may not actually check anything for X_OK. --- diff --git a/main.c b/main.c index 76632ab..9172ab6 100644 --- a/main.c +++ b/main.c @@ -95,11 +95,12 @@ Property *get_device_properties(char *node) if(!udevadm_path) { + struct stat st; udevadm_path = "/bin/udevadm"; - if(access(udevadm_path, X_OK)<0) + if(stat(udevadm_path, &st)<0 || !(st.st_mode&0111)) { udevadm_path = "/sbin/udevadm"; - if(access(udevadm_path, X_OK)<0) + if(stat(udevadm_path, &st)<0 || !(st.st_mode&0111)) { udevadm_path = NULL; perror("Unable to find udevadm");