[openssh-commits] [openssh] 02/02: Skip d_type check on platforms that don't have it.

git+noreply at mindrot.org git+noreply at mindrot.org
Wed May 7 21:06:24 AEST 2025


This is an automated email from the git hooks/post-receive script.

dtucker pushed a commit to branch master
in repository openssh.

commit 755c3d082e59e6884f28d30e6333a1444e9173d1
Author: Darren Tucker <dtucker at dtucker.net>
AuthorDate: Wed May 7 21:05:06 2025 +1000

    Skip d_type check on platforms that don't have it.
    
    On those, the subsequent stat() should catch the sockets.
---
 configure.ac | 6 ++++++
 misc-agent.c | 2 ++
 2 files changed, 8 insertions(+)

diff --git a/configure.ac b/configure.ac
index 221d5f561..98d98594b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1700,6 +1700,12 @@ AC_RUN_IFELSE(
 	]
 )
 
+AC_CHECK_MEMBERS([struct dirent.d_type], [], [], [[
+#ifdef HAVE_DIRENT_H
+#include <dirent.h>
+#endif
+]])
+
 AC_MSG_CHECKING([for /proc/pid/fd directory])
 if test -d "/proc/$$/fd" ; then
 	AC_DEFINE([HAVE_PROC_PID], [1], [Define if you have /proc/$pid/fd])
diff --git a/misc-agent.c b/misc-agent.c
index 34ce2a524..db8f93bc8 100644
--- a/misc-agent.c
+++ b/misc-agent.c
@@ -298,8 +298,10 @@ agent_cleanup_stale(const char *homedir, int ignore_hosthash)
 		goto out;
 	}
 	while ((dp = readdir(d)) != NULL) {
+#ifdef HAVE_DIRENT_D_TYPE
 		if (dp->d_type != DT_SOCK && dp->d_type != DT_UNKNOWN)
 			continue;
+#endif
 		if (fstatat(dirfd(d), dp->d_name,
 		    &sb, AT_SYMLINK_NOFOLLOW) != 0 && errno != ENOENT) {
 			error_f("stat \"%s/%s\": %s",

-- 
To stop receiving notification emails like this one, please contact
djm at mindrot.org.


More information about the openssh-commits mailing list