]> git.ipfire.org Git - thirdparty/openssh-portable.git/commitdiff
Skip d_type check on platforms that don't have it.
authorDarren Tucker <dtucker@dtucker.net>
Wed, 7 May 2025 11:05:06 +0000 (21:05 +1000)
committerDarren Tucker <dtucker@dtucker.net>
Wed, 7 May 2025 11:05:06 +0000 (21:05 +1000)
On those, the subsequent stat() should catch the sockets.

configure.ac
misc-agent.c

index 221d5f5618bff4475a8fe4b04431d889f2f1c5ba..98d98594b5c8ea427b7e88d618549b0ee59651c9 100644 (file)
@@ -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])
index 34ce2a5244ef550e82fcd13ed34c9d656e9ec8f6..db8f93bc873ba736173a4cf12d1fc1edc7fd58e0 100644 (file)
@@ -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",