Skip to content
Permalink
Browse files

pool and root mount is not allowed

fixed root and pool mount equality

correted root_path case

root and pool mount restrcited

debugging for restricting mount

debugging for restricting mount

debugging for restricting mount

debugging for restricting mount

debugging for restricting mount

debugging for restricting mount

debugging for restricting mount

debugging for restricting mount

debugging for restricting mount

debugging for restricting mount

debugging for restricting mount

debugging for restricting mount

debugging for restricting mount

debugging for restricting mount

debugging for restricting mount

debugging for restricting mount

debugging for restricting mount

debugging for restricting mount

debugging for restricting mount

debugging for restricting mount

self mount, parent mount restricted

removed unwanted changes

review update

Signed-off-by: TulsiJain <tulsi.jain@delphix.com>

remove unwanted files

Signed-off-by: TulsiJain <tulsi.jain@delphix.com>

parent reference error corrected

Signed-off-by: TulsiJain <tulsi.jain@delphix.com>

80 words limit meet

Signed-off-by: TulsiJain <tulsi.jain@delphix.com>

added test cases

added test cases

added test cases

Signed-off-by: TulsiJain <tulsi.jain@delphix.com>

comment corrected

Signed-off-by: TulsiJain <tulsi.jain@delphix.com>

master match

master match

master match
  • Loading branch information...
TulsiJain committed May 29, 2019
1 parent 047262e commit b31d5c3c4f552cec8fd80deb8751824dddba726b
@@ -43,6 +43,8 @@ typedef enum {
NAME_ERR_RESERVED, /* entire name is reserved */
NAME_ERR_DISKLIKE, /* reserved disk name (c[0-9].*) */
NAME_ERR_TOOLONG, /* name is too long */
NAME_ERR_SELF_REFERENCE, /* reserved self path name ('.') */
NAME_ERR_PARENT_REFERENCE, /* reserved parent path name ('..') */
NAME_ERR_NO_AT, /* permission set is missing '@' */
} namecheck_err_t;

@@ -196,6 +196,16 @@ zfs_validate_name(libzfs_handle_t *hdl, const char *path, int type,
zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
"reserved disk name"));
break;

case NAME_ERR_SELF_REFERENCE:
zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
"self reference, '.' is found in name"));
break;

case NAME_ERR_PARENT_REFERENCE:
zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
"parent reference, '..' is found in name"));
break;

default:
zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
@@ -232,6 +232,27 @@ entity_namecheck(const char *path, namecheck_err_t *why, char *what)
}
}

if (*end == '\0' || *end == '/'){
int component_length = end - start;
/* Validate the contents of this component is not '.'*/
if (component_length == 1){
if (start[0] == '.') {
if (why)
*why = NAME_ERR_SELF_REFERENCE;
return (-1);
}
}

/* Validate the contents of this component is not '..'*/
if (component_length == 2){
if (start[0] == '.' && start[1] == '.') {
if (why)
*why = NAME_ERR_PARENT_REFERENCE;
return (-1);
}
}
}

/* Snapshot or bookmark delimiter found */
if (*end == '@' || *end == '#') {
/* Multiple delimiters are not allowed */
@@ -3025,7 +3025,7 @@ dsl_scan_async_block_should_pause(dsl_scan_t *scn)
if (zfs_recover)
return (B_FALSE);

if (zfs_async_block_max_blocks != 0 &&
if (zfs_async_block_max_blocks != 0 &&
scn->scn_visited_this_txg >= zfs_async_block_max_blocks) {
return (B_TRUE);
}
@@ -90,7 +90,9 @@ set -A args "$TESTPOOL/" "$TESTPOOL//blah" "$TESTPOOL/@blah" \
"$TESTPOOL/blah*blah" "$TESTPOOL/blah blah" \
"-s $TESTPOOL/$TESTFS1" "-b 1092 $TESTPOOL/$TESTFS1" \
"-b 64k $TESTPOOL/$TESTFS1" "-s -b 32k $TESTPOOL/$TESTFS1" \
"$TESTPOOL/$BYND_MAX_NAME" "$TESTPOOL/$BYND_NEST_LIMIT"
"$TESTPOOL/$BYND_MAX_NAME" "$TESTPOOL/$BYND_NEST_LIMIT" \
"$TESTPOOL/." "$TESTPOOL/.." "$TESTPOOL/../blah" "$TESTPOOL/./blah" \
"$TESTPOOL/blah/./blah" "$TESTPOOL/blah/../blah"

log_assert "Verify 'zfs create <filesystem>' fails with bad <filesystem> argument."

0 comments on commit b31d5c3

Please sign in to comment.
You can’t perform that action at this time.