2005-12-22 Zoltan Varga <vargaz@gmail.com>
[mono.git] / support / fstab.c
index c9ff50547a84f6dae119375892199b9fc249110e..2fb79be2671092f6a128e009d687012529ab2fdc 100644 (file)
@@ -174,6 +174,9 @@ etc_fstab;
 static int
 setfsent (void)
 {
+       /* protect from bad users calling setfsent(), setfsent(), ... endfsent() */
+       if (etc_fstab != NULL)
+               fclose (etc_fstab);
        etc_fstab = fopen ("/etc/vfstab", "r");
        if (etc_fstab != NULL)
                return 1;