1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-03-09 15:50:02 +00:00

libtt: Avoid an infinite loop in ttsession (tooltalk daemon) when /etc/mtab is a symlink, using lstat instead of stat.

Patch from Frederic Koehler <f.koehler427@gmail.com>
This commit is contained in:
Jon Trulson 2012-08-08 11:36:03 -06:00
parent a7562a8009
commit b49872206b

View 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");