summaryrefslogtreecommitdiffstats
path: root/libmount
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-14 19:22:57 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-14 19:22:57 +0000
commitce95875445c67808caa5d4fb0e6f80dbdaef0cb7 (patch)
tree6da8cbc66ef15086c9d295e4abe733b24818551e /libmount
parentAdding upstream version 2.40. (diff)
downloadutil-linux-upstream.tar.xz
util-linux-upstream.zip
Adding upstream version 2.40.1.upstream/2.40.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'libmount')
-rw-r--r--libmount/docs/version.xml2
-rw-r--r--libmount/meson.build44
-rw-r--r--libmount/python/meson.build11
-rw-r--r--libmount/src/context.c3
-rw-r--r--libmount/src/context_mount.c5
-rw-r--r--libmount/src/context_umount.c4
-rw-r--r--libmount/src/fs.c2
-rw-r--r--libmount/src/tab_update.c6
8 files changed, 38 insertions, 39 deletions
diff --git a/libmount/docs/version.xml b/libmount/docs/version.xml
index 4bdd32f..0e1a032 100644
--- a/libmount/docs/version.xml
+++ b/libmount/docs/version.xml
@@ -1 +1 @@
-2.40
+2.40.1
diff --git a/libmount/meson.build b/libmount/meson.build
index d1262e7..6b16aab 100644
--- a/libmount/meson.build
+++ b/libmount/meson.build
@@ -1,3 +1,9 @@
+if not build_libmount
+ mount_dep = disabler()
+ mount_static_dep = disabler()
+ subdir_done()
+endif
+
dir_libmount = include_directories('.', 'src')
defs = configuration_data()
@@ -70,16 +76,16 @@ lib__mount = static_library(
'_mount',
lib_mount_sources,
include_directories : [dir_include,
- dir_libmount,
- dir_libblkid])
+ dir_libmount],
+ dependencies : [blkid_dep])
lib_mount_static = static_library(
'mount_static',
link_whole : lib__mount,
- link_with : [lib_common,
- lib_blkid.get_static_lib()],
- dependencies : [realtime_libs],
+ link_with : [lib_common],
+ dependencies : [blkid_static_dep, realtime_libs],
install : false)
+mount_static_dep = declare_dependency(link_with: lib_mount_static, include_directories: '.')
lib__mount_deps = [
lib_selinux,
@@ -90,25 +96,21 @@ lib_mount = library(
'mount',
link_whole : lib__mount,
include_directories : [dir_include,
- dir_libmount,
- dir_libblkid],
+ dir_libmount],
link_depends : libmount_sym,
version : libmount_version,
link_args : ['-Wl,--version-script=@0@'.format(libmount_sym_path)],
- link_with : [lib_common,
- lib_blkid],
- dependencies : lib__mount_deps,
+ link_with : [lib_common],
+ dependencies : lib__mount_deps + blkid_dep,
install : build_libmount)
mount_dep = declare_dependency(link_with: lib_mount, include_directories: '.')
-if build_libmount
- pkgconfig.generate(lib_mount,
- description : 'mount library',
- subdirs : 'libmount',
- version : pc_version)
- if meson.version().version_compare('>=0.54.0')
- meson.override_dependency('mount', mount_dep)
- endif
+pkgconfig.generate(lib_mount,
+ description : 'mount library',
+ subdirs : 'libmount',
+ version : pc_version)
+if meson.version().version_compare('>=0.54.0')
+ meson.override_dependency('mount', mount_dep)
endif
libmount_tests = [
@@ -136,9 +138,9 @@ if program_tests
exe = executable(
test_name,
'src/' + libmount_test_src_override.get(libmount_test, libmount_test) + '.c',
- include_directories : [dir_include, dir_libblkid],
- link_with : [lib__mount, lib_common, lib_blkid_static],
- dependencies : lib__mount_deps,
+ include_directories : [dir_include],
+ link_with : [lib__mount, lib_common],
+ dependencies : lib__mount_deps + blkid_static_dep,
c_args : ['-DTEST_PROGRAM'],
)
# the test-setup expects the helpers in the toplevel build-directory
diff --git a/libmount/python/meson.build b/libmount/python/meson.build
index e1a79d1..0957bca 100644
--- a/libmount/python/meson.build
+++ b/libmount/python/meson.build
@@ -1,9 +1,3 @@
-python_module = import('python')
-
-python = python_module.find_installation(
- get_option('python'),
- required : get_option('build-python'),
- disabler : true)
build_python = python.found()
pylibmount_sources = '''
@@ -21,10 +15,9 @@ if build_python
python.extension_module(
'pylibmount',
pylibmount_sources,
- include_directories : [dir_include, dir_libmount],
+ include_directories : [dir_include],
subdir : 'libmount',
- link_with : lib_mount,
- dependencies : python.dependency(),
+ dependencies : [mount_dep, python.dependency()],
c_args : [
'-Wno-cast-function-type',
diff --git a/libmount/src/context.c b/libmount/src/context.c
index 952287a..5206c1d 100644
--- a/libmount/src/context.c
+++ b/libmount/src/context.c
@@ -367,8 +367,7 @@ const char *mnt_context_get_writable_tabpath(struct libmnt_context *cxt)
{
assert(cxt);
- context_init_paths(cxt, 1);
- return cxt->utab_path;
+ return mnt_context_utab_writable(cxt) ? cxt->utab_path : NULL;
}
diff --git a/libmount/src/context_mount.c b/libmount/src/context_mount.c
index 478a9fd..f9d610f 100644
--- a/libmount/src/context_mount.c
+++ b/libmount/src/context_mount.c
@@ -546,9 +546,10 @@ static int do_mount(struct libmnt_context *cxt, const char *try_type)
cxt->syscall_status = 0;
}
- if (org_type && rc != 0)
+ if (org_type && rc != 0) {
__mnt_fs_set_fstype_ptr(cxt->fs, org_type);
- org_type = NULL;
+ org_type = NULL;
+ }
if (rc == 0 && try_type && cxt->update) {
struct libmnt_fs *fs = mnt_update_get_fs(cxt->update);
diff --git a/libmount/src/context_umount.c b/libmount/src/context_umount.c
index 79b6237..bf70ed2 100644
--- a/libmount/src/context_umount.c
+++ b/libmount/src/context_umount.c
@@ -267,6 +267,9 @@ static int lookup_umount_fs_by_statfs(struct libmnt_context *cxt, const char *tg
* So, let's use statfs() if possible (it's bad idea for --lazy/--force
* umounts as target is probably unreachable NFS, also for --detach-loop
* as this additionally needs to know the name of the loop device).
+ *
+ * For the "umount --read-only" command, we need to read the mountinfo
+ * to obtain the mount source.
*/
if (mnt_context_is_restricted(cxt)
|| *tgt != '/'
@@ -275,6 +278,7 @@ static int lookup_umount_fs_by_statfs(struct libmnt_context *cxt, const char *tg
|| mnt_context_is_lazy(cxt)
|| mnt_context_is_nocanonicalize(cxt)
|| mnt_context_is_loopdel(cxt)
+ || mnt_context_is_rdonly_umount(cxt)
|| mnt_safe_stat(tgt, &st) != 0 || !S_ISDIR(st.st_mode)
|| has_utab_entry(cxt, tgt))
return 1; /* not found */
diff --git a/libmount/src/fs.c b/libmount/src/fs.c
index 79e32a1..26f2c69 100644
--- a/libmount/src/fs.c
+++ b/libmount/src/fs.c
@@ -1454,7 +1454,7 @@ int mnt_fs_get_attribute(struct libmnt_fs *fs, const char *name,
* mnt_fs_get_comment:
* @fs: fstab/mtab/mountinfo entry pointer
*
- * Returns: 0 on success, 1 when not found the @name or negative number in case of error.
+ * Returns: comment string
*/
const char *mnt_fs_get_comment(struct libmnt_fs *fs)
{
diff --git a/libmount/src/tab_update.c b/libmount/src/tab_update.c
index 87512af..d44d190 100644
--- a/libmount/src/tab_update.c
+++ b/libmount/src/tab_update.c
@@ -982,9 +982,9 @@ int mnt_update_already_done(struct libmnt_update *upd)
if (mnt_optstr_get_missing(fs->user_optstr, upd->fs->user_optstr, NULL) == 0) {
upd->missing_options = 1;
DBG(UPDATE, ul_debugobj(upd, " missing options detected"));
- }
- } else
- rc = 1;
+ } else
+ rc = 1;
+ }
} else if (upd->target) {
/* umount */