]> git.ipfire.org Git - thirdparty/util-linux.git/commit
libmount: fix and improve utab update on MS_MOVE
authorKarel Zak <kzak@redhat.com>
Wed, 4 May 2022 10:13:08 +0000 (12:13 +0200)
committerKarel Zak <kzak@redhat.com>
Wed, 4 May 2022 10:13:08 +0000 (12:13 +0200)
commit1ec32f426c0f4705ea4e6e33b812b3b4c2c47faa
treecc03eabfd7033fb645407db2103974df171a178a
parente6829b5cf463146eacc1c80353e4ac31ea95e899
libmount: fix and improve utab update on MS_MOVE

* avoid double '//'

* don't update /fooxxx when /foo update requested (make sure that
  startswith() returns path terminated by '/')

* canonicalize only once the new path -- all in utab/mtab is already
  canonicalized, so after MS_MOVE we need to care about the new path
  only

* use asprintf() rather than strcpy() and strcat(), don't compose a
  new path from prefix and subdir when replace entire path

Addresses: https://github.com/util-linux/util-linux/pull/1660
Signed-off-by: Karel Zak <kzak@redhat.com>
libmount/src/tab_update.c