]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
mountpoint-util: use memcmp_nn() where appropriate 27269/head
authorLennart Poettering <lennart@poettering.net>
Fri, 14 Apr 2023 11:08:03 +0000 (13:08 +0200)
committerLennart Poettering <lennart@poettering.net>
Fri, 14 Apr 2023 11:15:39 +0000 (13:15 +0200)
src/basic/mountpoint-util.c

index 601776541b7d7151ff5e37efcf6362f11623efb7..484f1e17507f5a0692c323369f19dd8bd110d39b 100644 (file)
@@ -271,9 +271,9 @@ int fd_is_mount_point(int fd, const char *filename, int flags) {
         /* If the file handle for the directory we are interested in and its parent are identical,
          * we assume this is the root directory, which is a mount point. */
 
-        if (h->handle_bytes == h_parent->handle_bytes &&
-            h->handle_type == h_parent->handle_type &&
-            memcmp(h->f_handle, h_parent->f_handle, h->handle_bytes) == 0)
+        if (h->handle_type == h_parent->handle_type &&
+            memcmp_nn(h->f_handle, h->handle_bytes,
+                      h_parent->f_handle, h_parent->handle_bytes) == 0)
                 return 1;
 
         return mount_id != mount_id_parent;