mirror of
https://github.com/sheumann/hush.git
synced 2025-02-09 17:30:36 +00:00
Patch from Claus Klein to increase, and make more apparent
the hard coded limit on the number of mounts
This commit is contained in:
parent
abf58d6ba5
commit
a62665b72f
@ -27,11 +27,12 @@
|
|||||||
#include <mntent.h>
|
#include <mntent.h>
|
||||||
#include "libbb.h"
|
#include "libbb.h"
|
||||||
|
|
||||||
|
#define MTAB_MAX_ENTRIES 40
|
||||||
static const int MS_RDONLY = 1; /* Mount read-only. */
|
static const int MS_RDONLY = 1; /* Mount read-only. */
|
||||||
|
|
||||||
void erase_mtab(const char *name)
|
void erase_mtab(const char *name)
|
||||||
{
|
{
|
||||||
struct mntent entries[20];
|
struct mntent entries[MTAB_MAX_ENTRIES];
|
||||||
int count = 0;
|
int count = 0;
|
||||||
FILE *mountTable = setmntent(bb_path_mtab_file, "r");
|
FILE *mountTable = setmntent(bb_path_mtab_file, "r");
|
||||||
struct mntent *m;
|
struct mntent *m;
|
||||||
@ -44,7 +45,8 @@ void erase_mtab(const char *name)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
while ((m = getmntent(mountTable)) != 0) {
|
while (((m = getmntent(mountTable)) != 0) && (count < MTAB_MAX_ENTRIES))
|
||||||
|
{
|
||||||
entries[count].mnt_fsname = strdup(m->mnt_fsname);
|
entries[count].mnt_fsname = strdup(m->mnt_fsname);
|
||||||
entries[count].mnt_dir = strdup(m->mnt_dir);
|
entries[count].mnt_dir = strdup(m->mnt_dir);
|
||||||
entries[count].mnt_type = strdup(m->mnt_type);
|
entries[count].mnt_type = strdup(m->mnt_type);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user