libtt: Avoid an infinite loop in ttsession (tooltalk daemon) when /etc/mtab is a...
authorJon Trulson <jon@radscan.com>
Wed, 8 Aug 2012 17:36:03 +0000 (11:36 -0600)
committerJon Trulson <jon@radscan.com>
Wed, 8 Aug 2012 17:36:03 +0000 (11:36 -0600)
Patch from Frederic Koehler <f.koehler427@gmail.com>

cde/lib/tt/lib/util/tt_file_system.C

index 8d98ff9701ebdf159cc180142c355683496771d1..ef96dc3f929e3b488203c7b5f93ce31956bb1e3d 100644 (file)
@@ -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");