- fix pidfd_self FD leak when ioctl(PIDFD_GET_MNT_NAMESPACE) fails
- fix "namesapces" typo in man page
- document "./" disambiguation for files starting with ":"
- use standard C initializer = { 0 } instead of = {}
Addresses: https://github.com/util-linux/util-linux/pull/4044
Signed-off-by: Karel Zak <kzak@redhat.com>
The *--user-parent* option requires Linux 4.9 or higher, older kernels will raise inappropriate ioctl for device error.
-Specifying namesapces by _nsid_ requires Linux 6.19 or higher.
+Specifying namespaces by _nsid_ requires Linux 6.19 or higher. If a namespace
+file name starts with a colon, prepend "./" for disambiguation.
== AUTHORS
#ifdef HAVE_STRUCT_NSFS_FILE_HANDLE
-static struct file_handle nsfs_fh_tmpl = {};
+static struct file_handle nsfs_fh_tmpl = { 0 };
static int nsfs_fd = -1;
static int fill_nsfs_file_handle(struct file_handle *fh, uint64_t ns_id)
/* Mount namespace can not be disabled by kernel config */
nsfs_fd = ioctl(pidfd_self, PIDFD_GET_MNT_NAMESPACE, 0);
+ close(pidfd_self);
if (nsfs_fd < 0)
return -errno;
- close(pidfd_self);
fh->handle_bytes = sizeof(struct nsfs_file_handle);
if (name_to_handle_at(nsfs_fd, "", fh, &mount_id,