cmd: ubi: don't allow to rename a volume to a name that already exist
PATCH 1/1 cmd: ubi: don't allow to rename a volume to a name that already exist
This commits add a check on the command ubi rename. This check avoids to rename a volume to with a name that is already used on another ubi volume. If two volumes has the same name, then the ubi device can't be mounted anymore.
Signed-off-by Philippe Reynes <[email protected]>
--- cmd/ubi.c | 5 +++++ 1 file changed, 5 insertions(+)
cmd/ubi.c +5 -0
@@ -264,6 +264,11 @@ static int ubi_rename_vol(char *oldname, char *newname)return ENODEV ; } +if (!ubi_check (newname)) { +printf ("%s: volume %s already exist\n" , __func__, newname); +return EINVAL ; + } +printf ("Rename UBI volume %s to %s\n" , oldname, newname);if (ubi->ro_mode) {
Signature · 1 line
2.17.1
PATCH 1/1 cmd: ubi: don't allow to rename a volume to a name that already exist
Quoted 6 lines · Philippe Reynes
This commits add a check on the command ubi rename. This check avoids to rename a volume to with a name that is already used on another ubi volume. If two volumes has the same name, then the ubi device can't be mounted anymore.
Signed-off-by Philippe Reynes <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 659 bytes Desc: not available URL: <https://lists.denx.de/pipermail/u-boot/attachments/20210105/e0ca38bd/attachment.sig>