search for: aug_l

Displaying 20 results from an estimated 32 matches for "aug_l".

Did you mean: aug_ls
2018 Mar 05
2
virt-v2v 1.38 fails to convert .vmx VM: setfiles ... Multiple same specifications for /.*.
[This email is either empty or too large to be displayed at this time]
2018 Mar 06
3
Re: virt-v2v 1.38 fails to convert .vmx VM: setfiles ... Multiple same specifications for /.*.
...v -x --selinux-relabel -a ta.qcow2 -a ta1.qcow2 > virt-customize --selinux-relabel -a throwaway.qcow2 > rm throwaway.qcow2 Here is a most interesting snippet from `virt-customize -v -x --selinux-relabel -a ta.qcow2 -a ta1.qcow2' output: ... many lines skipped ... libguestfs: trace: aug_ls "/files/etc/selinux/config" guestfsd: <= aug_ls (0x1c) request length 72 bytes libguestfs: trace: aug_ls = ["/files/etc/selinux/config/#comment[1]", "/files/etc/selinux/config/#comment[2]", "/files/etc/selinux/config/#comment[3]", "/files/etc/selinux...
2018 Feb 07
1
[PATCH] customize: avoid Array.mem for now
...x? *) if g#is_file ~followsymlinks:true "/usr/sbin/load_policy" && @@ -44,7 +48,7 @@ let relabel (g : G.guestfs) = let config_path = "/files/etc/selinux/config" in let selinuxtype_path = config_path ^ "/SELINUXTYPE" in let keys = g#aug_ls config_path in - if Array.mem selinuxtype_path keys then + if array_find selinuxtype_path keys then g#aug_get selinuxtype_path else "targeted" in -- 2.14.3
2020 Sep 23
6
[common PATCH 0/3] SELinux_relabel: relabel only if enforcing (RHBZ#1828952)
Continuation/rework of: https://www.redhat.com/archives/libguestfs/2020-May/msg00020.html This is my approach, as I explained here: https://bugzilla.redhat.com/show_bug.cgi?id=1828952#c4 https://www.redhat.com/archives/libguestfs/2020-May/msg00035.html IOW: do not attempt to relabel if the guest is not enforcing, as it is either useless or may fail; few words more are in the comments of patch #3.
2014 Sep 29
2
[PATCH 1/2] builder, customize: disable SELinux
Having SELinux enabled (even if not enforcing) in the appliance causes troubles to applications/libraries that read/write SELinux attributes. --- builder/builder.ml | 6 +++++- customize/customize_main.ml | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/builder/builder.ml b/builder/builder.ml index a407924..5195cfd 100644 --- a/builder/builder.ml +++
2020 May 05
3
[PATCH libguestfs-common 1/2] mlcustomize: Refactor SELinux_relabel code.
...g#aug_init "/" (16+32) (* AUG_SAVE_NOOP | AUG_NO_LOAD *); - (* See: https://bugzilla.redhat.com/show_bug.cgi?id=975412#c0 *) - ignore (g#aug_rm "/augeas/load/*[\"/etc/selinux/config/\" !~ regexp('^') + glob(incl) + regexp('/.*')]"); - g#aug_load (); - debug_augeas_errors g; - - (* Get the SELinux policy name, eg. "targeted", "minimum". - * Use "targeted" if not specified, just like libselinux does. +let rec relabel (g : G.guestfs) = + (* Is the guest using SELinux? (Otherwise this is a no-...
2018 Jan 31
1
[PATCH] customize: allow missing SELINUXTYPE in SELinux config
...st-selinuxrelabel.sh \ $(settings_test_scripts) check-slow: diff --git a/customize/SELinux_relabel.ml b/customize/SELinux_relabel.ml index d404c35fa..e7d440c29 100644 --- a/customize/SELinux_relabel.ml +++ b/customize/SELinux_relabel.ml @@ -37,8 +37,18 @@ let relabel (g : G.guestfs) = g#aug_load (); debug_augeas_errors g; - (* Get the SELinux policy name, eg. "targeted", "minimum". *) - let policy = g#aug_get "/files/etc/selinux/config/SELINUXTYPE" in + (* Get the SELinux policy name, eg. "targeted", "minimum". +...
2017 Apr 28
0
Re: [PATCH v6 0/1] v2v bootloaders and augeas
...r problem. If we still can't do a hard > requirement for Augeas, let's use workaround proposed by Pino: > let () = > (* Apply the "grub" lens if it is not handling the file > * already -- Augeas < 1.7.0 will error out otherwise. > *) > if g#aug_ls ("/files" ^ grub_config) = [||] then > g#aug_transform "grub" grub_config in > > As a temporary solution looks fine. Better this solution than raising the Augeas requirements, for now. -- Pino Toscano
2017 Apr 28
1
Re: [PATCH v6 0/1] v2v bootloaders and augeas
...gt;requirement for Augeas, let's use workaround proposed by Pino: > >> let () = > >> (* Apply the "grub" lens if it is not handling the file > >> * already -- Augeas < 1.7.0 will error out otherwise. > >> *) > >> if g#aug_ls ("/files" ^ grub_config) = [||] then > >> g#aug_transform "grub" grub_config in > >> > >>As a temporary solution looks fine. > > > >Better this solution than raising the Augeas requirements, for now. > > > > Rich, What a...
2014 Sep 29
0
[PATCH 2/2] customize: fix attributes of /etc/shadow (RHBZ#1146275)
...ributes of + * /etc/shadow, so we can restore them later. + *) + let tempfile = g#mktemp "/etc/shadow.guestfsXXXXXX" in + g#write tempfile "*"; + g#copy_attributes ~all:true "/etc/shadow" tempfile; + g#aug_init "/" 0; let users = Array.to_list (g#aug_ls "/files/etc/shadow") in List.iter ( @@ -116,9 +123,11 @@ let rec set_linux_passwords ~prog ?password_crypto g root passwords = with Not_found -> () ) users; g#aug_save (); + g#aug_close (); - (* In virt-sysprep /.autorelabel will label it correctly. *) - g#chmod 0...
2015 Jul 01
0
[PATCH 2/3] mllib: add and use last_part_of
...ns(+), 16 deletions(-) diff --git a/customize/password.ml b/customize/password.ml index 25ce901..cb97804 100644 --- a/customize/password.ml +++ b/customize/password.ml @@ -97,9 +97,7 @@ let rec set_linux_passwords ?password_crypto (g : Guestfs.guestfs) root password let users = Array.to_list (g#aug_ls "/files/etc/shadow") in List.iter ( fun userpath -> - let user = - let i = String.rindex userpath '/' in - String.sub userpath (i+1) (String.length userpath -i-1) in + let user = last_part_of userpath '/' in try (* Each l...
2017 Apr 28
0
Re: [PATCH v6 1/1] v2v: bootloaders: search grub config for all distributions
...esentation. *) > class bootloader_grub1 (g : G.guestfs) inspect grub_config = > + let () = Wrong indentation here. > + (* Apply the "grub" lens if it is not handling the file > + * already -- Augeas < 1.7.0 will error out otherwise. > + *) > + if g#aug_ls ("/files" ^ grub_config) = [||] then > + g#aug_transform "grub" grub_config in > + > (* Grub prefix? Usually "/boot". *) > let grub_prefix = > let mounts = g#inspect_get_mountpoints inspect.i_root in > @@ -191,7 +202,7 @@ type defaul...
2017 May 02
2
[PATCH] v2v: bootloaders: search grub config for all distributions
...@@ let remove_hd_prefix path = (* Grub1 (AKA grub-legacy) representation. *) class bootloader_grub1 (g : G.guestfs) inspect grub_config = + let () = + (* Apply the "grub" lens if it is not handling the file + * already -- Augeas < 1.7.0 will error out otherwise. + *) + if g#aug_ls ("/files" ^ grub_config) = [||] then + g#aug_transform "grub" grub_config in + (* Grub prefix? Usually "/boot". *) let grub_prefix = let mounts = g#inspect_get_mountpoints inspect.i_root in @@ -335,33 +342,46 @@ object (self) end let detect_bootload...
2017 Apr 28
0
Re: [PATCH v6 1/1] v2v: bootloaders: search grub config for all distributions
...grub_config = > >>+ let () = > > > >Wrong indentation here. > > > >>+ (* Apply the "grub" lens if it is not handling the file > >>+ * already -- Augeas < 1.7.0 will error out otherwise. > >>+ *) > >>+ if g#aug_ls ("/files" ^ grub_config) = [||] then > >>+ g#aug_transform "grub" grub_config in > >>+ > >> (* Grub prefix? Usually "/boot". *) > >> let grub_prefix = > >> let mounts = g#inspect_get_mountpoints inspect.i_r...
2015 Jul 01
5
[PATCH 1/3] mllib: add an optional filter for rm_rf_only_files
This way it is possible to use rm_rf_only_files, but not removing specific files. --- mllib/common_utils.ml | 8 +++++++- mllib/common_utils.mli | 5 ++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/mllib/common_utils.ml b/mllib/common_utils.ml index 516cff3..3737b4c 100644 --- a/mllib/common_utils.ml +++ b/mllib/common_utils.ml @@ -640,13 +640,19 @@ let rmdir_on_exit = *
2020 Mar 09
4
[PATCH v3 0/3] Switch augeas APIs to OCaml
This reimplements the augeas APIs using ocaml-augeas (dropping all the C code). The behaviour seems unchanged, although I may have not tested all the various corner cases. Changes from v2: - dropped patch #1, as it was applied already (was a real bugfix) - rebased on master Pino Toscano (3): Revert "Revert "daemon: implement OptString for OCaml APIs"" daemon: move augeas
2020 Jan 09
5
[PATCH v2 0/4] Switch augeas APIs to OCaml
This reimplements the augeas APIs using ocaml-augeas (dropping all the C code). The behaviour seems unchanged, although I may have not tested all the various corner cases. Pino Toscano (4): daemon: fix/enhance error reporting of Augeas exceptions Revert "Revert "daemon: implement OptString for OCaml APIs"" daemon: move augeas APIs to OCaml daemon: drop usage of C
2019 May 30
5
[PATCH 0/5] RFC: switch augeas APIs to OCaml
This synchronizes the embedded ocaml-augeas copy, and reimplements the augeas APIs using it (dropping all the C code). The behaviour seems unchanged, although I may have not tested all the various corner cases. Pino Toscano (5): common/mlaugeas: Synchronize with latest ocaml-augeas daemon: fix/enhance error reporting of Augeas exceptions Revert "Revert "daemon: implement
2014 Sep 04
10
[PATCH 0/5] use augeas for /etc/shadow
Hi, currently /etc/shadow is edited manually when needed (i.e. when setting the password for an user), and it is not changed when removing users. Import the upstream shadow.aug (currently in their development serie, but not part of any released version yet), and use it only when the augeas version is less than a potential 1.2.1 (covering also the case when the new version is just 1.3.0). Pino
2016 Nov 10
5
[PATCH v5 0/3] v2v and augeas
Augeas 1.7.0 was released a couple of days ago. By encouraging everyone to upgrade to this we can drop several calls to aug_transform and also our custom copies of two lenses, and a lot of related code. Rich.