diff options
author | ek110237 <none@none> | 2007-10-26 15:37:43 -0700 |
---|---|---|
committer | ek110237 <none@none> | 2007-10-26 15:37:43 -0700 |
commit | f0ed2251df2f0c744e0d198d9b79ae5ed937de7b (patch) | |
tree | e9afbf1daec777a2778656ed766cd8ca9d545453 /usr/src | |
parent | 3f1fa9a7503d89687e51977c57301260a551d2d8 (diff) | |
download | illumos-joyent-f0ed2251df2f0c744e0d198d9b79ae5ed937de7b.tar.gz |
6621890 shouldn't be able to create a pool with '%' in its name
Diffstat (limited to 'usr/src')
-rw-r--r-- | usr/src/common/zfs/zfs_namecheck.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/usr/src/common/zfs/zfs_namecheck.c b/usr/src/common/zfs/zfs_namecheck.c index cee25a62b1..0e832fb5d2 100644 --- a/usr/src/common/zfs/zfs_namecheck.c +++ b/usr/src/common/zfs/zfs_namecheck.c @@ -54,14 +54,14 @@ valid_char(char c) return ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || (c >= '0' && c <= '9') || - c == '-' || c == '_' || c == '.' || c == ':' || c == '%'); + c == '-' || c == '_' || c == '.' || c == ':'); } /* * Snapshot names must be made up of alphanumeric characters plus the following * characters: * - * [-_.:%] + * [-_.:] */ int snapshot_namecheck(const char *path, namecheck_err_t *why, char *what) @@ -127,6 +127,9 @@ permset_namecheck(const char *path, namecheck_err_t *why, char *what) * characters: * * [-_.:%] + * + * We allow '%' here as we use that character internally to create unique + * names for temporary clones (for online recv). */ int dataset_namecheck(const char *path, namecheck_err_t *why, char *what) @@ -196,7 +199,7 @@ dataset_namecheck(const char *path, namecheck_err_t *why, char *what) /* Validate the contents of this component */ while (loc != end) { - if (!valid_char(*loc)) { + if (!valid_char(*loc) && *loc != '%') { if (why) { *why = NAME_ERR_INVALCHAR; *what = *loc; |