Avoid creating directories in devfs by changing all '/' in labels to '_'.

Idea from:	Stanislav Sedov <stas@310.ru>
MFC after:	3 days
This commit is contained in:
Pawel Jakub Dawidek 2005-08-12 00:05:09 +00:00
parent 50b334506f
commit 055c32a1bc

View File

@ -257,12 +257,20 @@ g_label_taste(struct g_class *mp, struct g_provider *pp, int flags __unused)
} while (0);
for (i = 0; g_labels[i] != NULL; i++) {
char label[64];
char *p;
g_topology_unlock();
g_labels[i]->ld_taste(cp, label, sizeof(label));
g_topology_lock();
if (label[0] == '\0')
continue;
/*
* Don't allow / in labels.
*/
for (p = label; *p != '\0'; p++) {
if (*p == '/')
*p = '_';
}
g_label_create(NULL, mp, pp, label, g_labels[i]->ld_dir,
pp->mediasize);
}