Mercurial > illumos > illumos-gate
changeset 3394:b937d1aa5870
6488665 Invalid argument cause Abort (core dumped).
author | pd144616 |
---|---|
date | Tue, 09 Jan 2007 10:02:06 -0800 |
parents | 660717ce3a70 |
children | 8bacbec85945 |
files | usr/src/common/zfs/zfs_namecheck.c |
diffstat | 1 files changed, 14 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/usr/src/common/zfs/zfs_namecheck.c Tue Jan 09 09:13:45 2007 -0800 +++ b/usr/src/common/zfs/zfs_namecheck.c Tue Jan 09 10:02:06 2007 -0800 @@ -19,7 +19,7 @@ * CDDL HEADER END */ /* - * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Copyright 2007 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -149,9 +149,19 @@ } /* Zero-length components are not allowed */ - if (loc == end && *end != '@') { - if (why) - *why = NAME_ERR_EMPTY_COMPONENT; + if (loc == end) { + if (why) { + /* + * Make sure this is really a zero-length + * component and not a '@@'. + */ + if (*end == '@' && found_snapshot) { + *why = NAME_ERR_MULTIPLE_AT; + } else { + *why = NAME_ERR_EMPTY_COMPONENT; + } + } + return (-1); }