mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-10 23:24:38 +00:00
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 <philippe.reynes@softathome.com>
This commit is contained in:
parent
19408a397c
commit
1639988fa4
1 changed files with 5 additions and 0 deletions
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue