diff options
author | pjd <pjd@FreeBSD.org> | 2005-08-12 00:05:09 +0000 |
---|---|---|
committer | pjd <pjd@FreeBSD.org> | 2005-08-12 00:05:09 +0000 |
commit | df75611e8a568a9740fd073a029d8e1cc2f8a18b (patch) | |
tree | e1c22f50d861689d2997475445e71081494ffcfa /sys/geom | |
parent | 9330b6a79d765eb42dda031a1d96dce8436496b6 (diff) | |
download | FreeBSD-src-df75611e8a568a9740fd073a029d8e1cc2f8a18b.zip FreeBSD-src-df75611e8a568a9740fd073a029d8e1cc2f8a18b.tar.gz |
Avoid creating directories in devfs by changing all '/' in labels to '_'.
Idea from: Stanislav Sedov <stas@310.ru>
MFC after: 3 days
Diffstat (limited to 'sys/geom')
-rw-r--r-- | sys/geom/label/g_label.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/sys/geom/label/g_label.c b/sys/geom/label/g_label.c index c8908c0..30b5b02 100644 --- a/sys/geom/label/g_label.c +++ b/sys/geom/label/g_label.c @@ -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); } |