]> git.ipfire.org Git - thirdparty/util-linux.git/commit
rename: allow renaming in subdirectories
authorSami Kerola <kerolasa@iki.fi>
Sun, 25 May 2014 21:17:25 +0000 (22:17 +0100)
committerSami Kerola <kerolasa@iki.fi>
Fri, 18 Jul 2014 17:34:14 +0000 (18:34 +0100)
commitbd9ced628bb8621babc1d677669c14277845745d
tree215440d3bfda455c117b3e9b116ac7c6fff91446
parent7887c6e0f0fad362f2e82193de880b8ad487c13e
rename: allow renaming in subdirectories

Earlier the rename(1) considered path as possible string to be renamed,
could lead to an issue with none existing destination.  See below for
demonstration of this issue.  After this change all directory elements
are ignored when the match finding happens.

$ cd $(mktemp -d)
$ mkdir aa ab
$ touch a{a,b}/aa
$ rename -v a x */aa
rename: aa/aa: rename to xa/aa failed: No such file or directory

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
misc-utils/rename.c