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:
@@ -427,9 +427,10 @@ updateFileSystemEntries ()
|
|||||||
pollfd poll_fd;
|
pollfd poll_fd;
|
||||||
while (mount_table_stat.st_size == 0) {
|
while (mount_table_stat.st_size == 0) {
|
||||||
(void)poll (&poll_fd, 0, 100);
|
(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;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
FILE *mount_table = ttOpenMntTbl(TtMntTab, "r");
|
FILE *mount_table = ttOpenMntTbl(TtMntTab, "r");
|
||||||
|
|||||||
Reference in New Issue
Block a user