mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 02:27:36 +03:00
Restrict filesystem creation if name referred either '.' or '..'
This change restricts filesystem creation if the given name contains either '.' or '..' Reviewed-by: Matt Ahrens <mahrens@delphix.com> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Richard Elling <Richard.Elling@RichardElling.com> Signed-off-by: TulsiJain <tulsi.jain@delphix.com> Closes #8842 Closes #8564
This commit is contained in:
@@ -197,6 +197,16 @@ zfs_validate_name(libzfs_handle_t *hdl, const char *path, int type,
|
||||
"reserved disk name"));
|
||||
break;
|
||||
|
||||
case NAME_ERR_SELF_REF:
|
||||
zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
|
||||
"self reference, '.' is found in name"));
|
||||
break;
|
||||
|
||||
case NAME_ERR_PARENT_REF:
|
||||
zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
|
||||
"parent reference, '..' is found in name"));
|
||||
break;
|
||||
|
||||
default:
|
||||
zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
|
||||
"(%d) not defined"), why);
|
||||
|
||||
Reference in New Issue
Block a user