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
1 changed files with 3 additions and 2 deletions

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