Displaying 18 results from an estimated 18 matches for "pathexpr".
2015 Oct 15
1
[PATCH v2] inspect: check for errors in files parsed with augeas (RHBZ#1229119)
...hanged, 19 insertions(+)
diff --git a/src/inspect-fs-unix.c b/src/inspect-fs-unix.c
index 3d19276..968aa40 100644
--- a/src/inspect-fs-unix.c
+++ b/src/inspect-fs-unix.c
@@ -1983,6 +1983,9 @@ inspect_with_augeas (guestfs_h *g, struct inspect_fs *fs,
int64_t size;
int r;
CLEANUP_FREE char *pathexpr = NULL;
+ CLEANUP_FREE_STRING_LIST char **matches = NULL;
+ char **match;
+ size_t len;
/* Security: Refuse to do this if a config file is too large. */
for (i = 0; configfiles[i] != NULL; ++i) {
@@ -2019,6 +2022,22 @@ inspect_with_augeas (guestfs_h *g, struct inspect_fs *fs,
if (gues...
2015 Oct 16
1
[PATCH] inspect: Include more information for augeas parse errors (RHBZ#1229119)
...-
1 file changed, 24 insertions(+), 8 deletions(-)
diff --git a/src/inspect-fs-unix.c b/src/inspect-fs-unix.c
index 968aa40..4fac7f4 100644
--- a/src/inspect-fs-unix.c
+++ b/src/inspect-fs-unix.c
@@ -1985,7 +1985,6 @@ inspect_with_augeas (guestfs_h *g, struct inspect_fs *fs,
CLEANUP_FREE char *pathexpr = NULL;
CLEANUP_FREE_STRING_LIST char **matches = NULL;
char **match;
- size_t len;
/* Security: Refuse to do this if a config file is too large. */
for (i = 0; configfiles[i] != NULL; ++i) {
@@ -2023,16 +2022,33 @@ inspect_with_augeas (guestfs_h *g, struct inspect_fs *fs,
goto...
2015 Mar 16
0
[PATCH] inspection: add support for systemd .mount files
...the Augeas handle is closed.
*/
static int
+inspect_with_augeas2 (guestfs_h *g, struct inspect_fs *fs,
+ const char **configfiles,
+ int (*f) (guestfs_h *, struct inspect_fs *, const char *))
+{
+ size_t i;
+ int64_t size;
+ int r;
+ CLEANUP_FREE char *pathexpr = NULL;
+
+ /* Security: Refuse to do this if a config file is too large. */
+ for (i = 0; configfiles[i] != NULL; ++i) {
+ if (guestfs_is_file_opts (g, configfiles[i],
+ GUESTFS_IS_FILE_OPTS_FOLLOWSYMLINKS, 1, -1) == 0)
+ continue;
+
+ size = guestfs_files...
2015 Mar 16
2
[PATCH] RFE: Inspection should support systemd mount units
Adds support for systemd .mount files, uses Augeas to extract mount points.
Fixes RHBZ#1113153.
Maros Zatko (1):
inspection: add support for systemd .mount files
src/inspect-fs-unix.c | 240 ++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 240 insertions(+)
--
1.9.3
2016 Dec 06
3
[PATCH 1/2] inspect: fstab: Canonicalize paths appearing in fstab.
...t;/usr/local" */
+ canonical_mountpoint (mp);
+
/* Ignore certain mountpoints. */
if (STRPREFIX (mp, "/dev/") ||
STREQ (mp, "/dev") ||
@@ -2081,3 +2085,51 @@ make_augeas_path_expression (guestfs_h *g, const char **configfiles)
debug (g, "augeas pathexpr = %s", ret);
return ret;
}
+
+/* Canonicalize the path, so "///usr//local//" -> "/usr/local"
+ *
+ * The path is modified in place because the result is always
+ * the same length or shorter than the argument passed.
+ */
+static void
+drop_char (char *mp)
+{
+ size...
2015 Oct 15
0
[PATCH] inspect: check for errors in files parsed with augeas (RHBZ#1229119)
...hanged, 19 insertions(+)
diff --git a/src/inspect-fs-unix.c b/src/inspect-fs-unix.c
index 3d19276..e9822ca 100644
--- a/src/inspect-fs-unix.c
+++ b/src/inspect-fs-unix.c
@@ -1983,6 +1983,9 @@ inspect_with_augeas (guestfs_h *g, struct inspect_fs *fs,
int64_t size;
int r;
CLEANUP_FREE char *pathexpr = NULL;
+ CLEANUP_FREE_STRING_LIST char **matches = NULL;
+ char **match;
+ size_t len;
/* Security: Refuse to do this if a config file is too large. */
for (i = 0; configfiles[i] != NULL; ++i) {
@@ -2019,6 +2022,22 @@ inspect_with_augeas (guestfs_h *g, struct inspect_fs *fs,
if (gues...
2016 Dec 07
0
Re: [PATCH 1/2] inspect: fstab: Canonicalize paths appearing in fstab.
...onical_mountpoint (mp);
> +
> /* Ignore certain mountpoints. */
> if (STRPREFIX (mp, "/dev/") ||
> STREQ (mp, "/dev") ||
> @@ -2081,3 +2085,51 @@ make_augeas_path_expression (guestfs_h *g, const char **configfiles)
> debug (g, "augeas pathexpr = %s", ret);
> return ret;
> }
> +
> +/* Canonicalize the path, so "///usr//local//" -> "/usr/local"
> + *
> + * The path is modified in place because the result is always
> + * the same length or shorter than the argument passed.
> + */
>...
2017 Aug 09
0
[PATCH v12 08/11] daemon: Implement inspection types and utility functions.
...prevents a rogue guest from performing a denial of service attack
+ * by having large, over-complicated configuration files which are
+ * unrelated to the task at hand. (Thanks Dominic Cleal).
+ * Note this requires Augeas >= 1.0.0 because of RHBZ#975412.
+ *)
+ let pathexpr = make_augeas_path_expression configfiles in
+ ignore (aug_rm_noerrors aug pathexpr);
+ Augeas.load aug;
+
+ (* Check that augeas did not get a parse error for any of the
+ * configfiles, otherwise we are silently missing information.
+ *)
+ let matches = aug_matches...
2014 Dec 09
0
[PATCH] inspection: Not an installer if there are multiple partitions (RHBZ#1171666).
...device = safe_asprintf (g, "/dev/sda%s", part);
- if (!is_partition (g, device)) {
+ if (!guestfs___is_partition (g, device)) {
free (device);
return 0;
}
@@ -1786,25 +1785,3 @@ make_augeas_path_expression (guestfs_h *g, const char **configfiles)
debug (g, "augeas pathexpr = %s", ret);
return ret;
}
-
-static int
-is_partition (guestfs_h *g, const char *partition)
-{
- CLEANUP_FREE char *device = NULL;
-
- guestfs_push_error_handler (g, NULL, NULL);
-
- if ((device = guestfs_part_to_dev (g, partition)) == NULL) {
- guestfs_pop_error_handler (g);
- r...
2017 Jun 12
1
[PATCH] UNFINISHED daemon: Reimplement most inspection APIs in the daemon.
This is the (incomplete) patch which reimplements inspection
APIs in the daemon. All ‘XXX’s in this patch indicate areas
which are not yet implemented or need further work.
Rich.
2017 Jul 21
10
[PATCH v10 00/10] Reimplement inspection in the daemon.
v9 was here:
https://www.redhat.com/archives/libguestfs/2017-July/msg00139.html
This depends on these three series (the first two being single minor
patches):
https://www.redhat.com/archives/libguestfs/2017-July/msg00207.html
https://www.redhat.com/archives/libguestfs/2017-July/msg00209.html
https://www.redhat.com/archives/libguestfs/2017-July/msg00215.html
There is no substantive change. I
2017 Jul 17
12
[PATCH v9 00/11] Reimplement inspection in the daemon.
This depends on the patch series
"[PATCH 00/27] Reimplement many daemon APIs in OCaml."
(https://www.redhat.com/archives/libguestfs/2017-July/msg00098.html)
v8 was posted here:
https://www.redhat.com/archives/libguestfs/2017-June/msg00274.html
v9:
- I split up the mega-patch into a more reviewable series of
smaller, incremental patches.
There are some other changes vs v8, but
2017 Aug 09
16
[PATCH v12 00/11] Reimplement inspection in the daemon.
This fixes almost everything. Note that it adds an extra commit which
fixes the whole utf8/iconv business.
It's probably better to list what isn't fixed:
(1) I didn't leave the osinfo code around because I'm still haven't
looked too closely at virt-builder-repository. Can't we just fetch
this code from the git history when we need it?
(2) I didn't change the way
2017 Jul 31
16
[PATCH v11 00/10] Reimplement inspection in the daemon.
v10: https://www.redhat.com/archives/libguestfs/2017-July/msg00245.html
No actual change here, but I rebased and retested. Also this series
now does not depend on any other patch series since everything else
needed is upstream.
Rich.
2017 Jun 19
29
[PATCH v7 00/29] Reimplement inspection in the daemon.
v6 was posted here:
https://www.redhat.com/archives/libguestfs/2017-June/msg00103.html
and this requires the utilities refactoring posted here:
https://www.redhat.com/archives/libguestfs/2017-June/msg00169.html
Inspection is now complete[*], although not very well tested. I'm
intending to compare the output of many guests using old & new
virt-inspector to see if I can find any
2018 Sep 19
2
virt-customize is very slow in ubuntu 18.04/centos 7.5
...: main_loop: proc 37 (is_file) took 0.00 seconds
libguestfs: trace: is_file = 0
libguestfs: trace: aug_init "/" 48
guestfsd: main_loop: new request, len 0x34
augeas version: 1.10.1
guestfsd: main_loop: proc 16 (aug_init) took 0.78 seconds
libguestfs: trace: aug_init = 0
libguestfs: augeas pathexpr = /augeas/load/*[ "/etc/fstab/" !~ regexp('^')
+ glob(incl) + regexp('/.*') and "/etc/mdadm.conf/" !~ regexp('^') +
glob(incl) + regexp('/.*') ]
libguestfs: trace: aug_rm "/augeas/load/*[ "/etc/fstab/" !~ regexp('^') +
glob(...
2017 Jun 15
45
[PATCH v6 00/41] Refactor utilities, reimplement inspection in the daemon.
v5:
https://www.redhat.com/archives/libguestfs/2017-June/msg00065.html
Since v5, this now implements inspection almost completely for Linux
and Windows guests.
Rich.
2017 Jun 21
45
[PATCH v8 00/42] Refactor utilities and reimplement inspection.
v7 was:
https://www.redhat.com/archives/libguestfs/2017-June/msg00169.html
https://www.redhat.com/archives/libguestfs/2017-June/msg00184.html
I believe this addresses all comments received so far.
Also it now passes a test where I compared about 100 disk images
processed with old and new virt-inspector binaries. The output is
identical in all cases except one which is caused by a bug in blkid