]> 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, 20 Jul 2022 15:37:16 +0000 (17:37 +0200)
commitb7f69167aeb45ae6f0deaab8d9a0b97d165d4dbb
tree65276570eac9cde5acf0e884faf340c5bf035c33
parent0d600d3cc1fcc89306aa491c723e3e716585ced3
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