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:
parent
a7562a8009
commit
b49872206b
1 changed files with 3 additions and 2 deletions
|
@ -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");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue