From b49872206bfbee7207655b03fcfe72511d25f64a Mon Sep 17 00:00:00 2001 From: Jon Trulson Date: Wed, 8 Aug 2012 11:36:03 -0600 Subject: [PATCH] libtt: Avoid an infinite loop in ttsession (tooltalk daemon) when /etc/mtab is a symlink, using lstat instead of stat. Patch from Frederic Koehler --- cde/lib/tt/lib/util/tt_file_system.C | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cde/lib/tt/lib/util/tt_file_system.C b/cde/lib/tt/lib/util/tt_file_system.C index 8d98ff97..ef96dc3f 100644 --- a/cde/lib/tt/lib/util/tt_file_system.C +++ b/cde/lib/tt/lib/util/tt_file_system.C @@ -427,9 +427,10 @@ updateFileSystemEntries () pollfd poll_fd; while (mount_table_stat.st_size == 0) { (void)poll (&poll_fd, 0, 100); - if (stat(TtMntTab, &mount_table_stat)) { + // Must use lstat here; mtab is often a symlink + if (lstat(TtMntTab, &mount_table_stat)) { return; - } + } } FILE *mount_table = ttOpenMntTbl(TtMntTab, "r"); -- 2.25.1