search for: safe_strdup

Displaying 20 results from an estimated 224 matches for "safe_strdup".

2019 Feb 28
1
[PATCH v2] inspect: return osinfo short IDs for recent Windows versions
...sertions(+) diff --git a/lib/inspect-osinfo.c b/lib/inspect-osinfo.c index 816d317f1..e0d19c672 100644 --- a/lib/inspect-osinfo.c +++ b/lib/inspect-osinfo.c @@ -69,6 +69,69 @@ guestfs_impl_inspect_get_osinfo (guestfs_h *g, const char *root) if (STREQ (distro, "msdos")) return safe_strdup (g, "msdos6.22"); } + else if (STREQ (type, "windows")) { + CLEANUP_FREE char *product_name = NULL; + CLEANUP_FREE char *product_variant = NULL; + + product_name = guestfs_inspect_get_product_name (g, root); + if (!product_name) + return NULL; + product_v...
2019 Feb 25
1
[PATCH] inspect: return osinfo short IDs for recent Windows versions
...sertions(+) diff --git a/lib/inspect-osinfo.c b/lib/inspect-osinfo.c index 816d317f1..f93f7ac52 100644 --- a/lib/inspect-osinfo.c +++ b/lib/inspect-osinfo.c @@ -69,6 +69,66 @@ guestfs_impl_inspect_get_osinfo (guestfs_h *g, const char *root) if (STREQ (distro, "msdos")) return safe_strdup (g, "msdos6.22"); } + else if (STREQ (type, "windows")) { + CLEANUP_FREE char *product_name = NULL; + CLEANUP_FREE char *product_variant = NULL; + + product_name = guestfs_inspect_get_product_name (g, root); + if (!product_name) + return NULL; + product_v...
2014 Dec 03
0
[PATCH 4/4] Add freebsd and netbsd distros
...OS_DISTRO_OPENBSD: case OS_DISTRO_UNKNOWN: ; /* nothing */ diff --git a/src/inspect.c b/src/inspect.c index c3b88e1..bdb45c3 100644 --- a/src/inspect.c +++ b/src/inspect.c @@ -203,12 +203,14 @@ guestfs__inspect_get_distro (guestfs_h *g, const char *root) case OS_DISTRO_CIRROS: ret = safe_strdup (g, "cirros"); break; case OS_DISTRO_DEBIAN: ret = safe_strdup (g, "debian"); break; case OS_DISTRO_FEDORA: ret = safe_strdup (g, "fedora"); break; + case OS_DISTRO_FREEBSD: ret = safe_strdup (g, "freebsd"); break; case OS_DISTRO_FREEDOS: ret = safe...
2014 Dec 02
0
[PATCH 5/5] Add freebsd and netbsd distros
...OS_DISTRO_OPENBSD: case OS_DISTRO_UNKNOWN: ; /* nothing */ diff --git a/src/inspect.c b/src/inspect.c index c3b88e1..bdb45c3 100644 --- a/src/inspect.c +++ b/src/inspect.c @@ -203,12 +203,14 @@ guestfs__inspect_get_distro (guestfs_h *g, const char *root) case OS_DISTRO_CIRROS: ret = safe_strdup (g, "cirros"); break; case OS_DISTRO_DEBIAN: ret = safe_strdup (g, "debian"); break; case OS_DISTRO_FEDORA: ret = safe_strdup (g, "fedora"); break; + case OS_DISTRO_FREEBSD: ret = safe_strdup (g, "freebsd"); break; case OS_DISTRO_FREEDOS: ret = safe...
2014 Nov 17
1
[PATCH] inspection: deb: Seperate epoch field from version
...@ -482,23 +483,31 @@ list_applications_deb (guestfs_h *g, struct inspect_fs *fs) else if (STRPREFIX (line, "Version: ")) { free (version); free (release); - char *p = strchr (&line[9], '-'); - if (p) { - *p = '\0'; - version = safe_strdup (g, &line[9]); - release = safe_strdup (g, p+1); + char *p1, *p2; + p1 = strchr (&line[9], ':'); + if (p1) { + *p1++ = '\0'; + epoch = guestfs___parse_unsigned_int (g, &line[9]); /* -1 on error */ + } else { + p1 = &lin...
2011 Oct 13
9
[PATCH 1/9] Partially fix --disable-erlang
From: Michael Scherer <misc at zarb.org> Without this, configure will always enable erlang, no matter what argument are passed. Now, we can disable it, even if configure still need the erlang compiler for some obscure reason. --- configure.ac | 10 ++++++---- 1 files changed, 6 insertions(+), 4 deletions(-) diff --git a/configure.ac b/configure.ac index 337a3ed..e0bed2f 100644 ---
2015 Sep 08
1
[PATCH] inspect: recognize the Frugalware distribution
...RUGALWARE: case OS_DISTRO_UNKNOWN: ; /* nothing */ } diff --git a/src/inspect.c b/src/inspect.c index c01888a..7c7ee0c 100644 --- a/src/inspect.c +++ b/src/inspect.c @@ -266,6 +266,7 @@ guestfs_impl_inspect_get_distro (guestfs_h *g, const char *root) case OS_DISTRO_FEDORA: ret = safe_strdup (g, "fedora"); break; case OS_DISTRO_FREEBSD: ret = safe_strdup (g, "freebsd"); break; case OS_DISTRO_FREEDOS: ret = safe_strdup (g, "freedos"); break; + case OS_DISTRO_FRUGALWARE: ret = safe_strdup (g, "frugalware"); break; case OS_DISTRO_GENTOO: r...
2015 Aug 12
2
[PATCH 1/2] inspect: recognize the Alpine Linux distribution
...thing */ } diff --git a/src/inspect.c b/src/inspect.c index abe9087..79f674c 100644 --- a/src/inspect.c +++ b/src/inspect.c @@ -255,6 +255,7 @@ guestfs_impl_inspect_get_distro (guestfs_h *g, const char *root) return NULL; switch (fs->distro) { + case OS_DISTRO_ALPINE_LINUX: ret = safe_strdup (g, "alpinelinux"); break; case OS_DISTRO_ARCHLINUX: ret = safe_strdup (g, "archlinux"); break; case OS_DISTRO_BUILDROOT: ret = safe_strdup (g, "buildroot"); break; case OS_DISTRO_CENTOS: ret = safe_strdup (g, "centos"); break; -- 2.1.0
2016 May 24
3
[PATCH 1/3] inspect: recognize the Void Linux distribution
...Windows, as usual, has to be much more complicated and stupid than diff --git a/src/inspect.c b/src/inspect.c index bd32d8f..29b4f85 100644 --- a/src/inspect.c +++ b/src/inspect.c @@ -291,6 +291,7 @@ guestfs_impl_inspect_get_distro (guestfs_h *g, const char *root) case OS_DISTRO_TTYLINUX: ret = safe_strdup (g, "ttylinux"); break; case OS_DISTRO_WINDOWS: ret = safe_strdup (g, "windows"); break; case OS_DISTRO_UBUNTU: ret = safe_strdup (g, "ubuntu"); break; + case OS_DISTRO_VOID_LINUX: ret = safe_strdup (g, "voidlinux"); break; case OS_DISTRO_UNKNOWN: r...
2015 Aug 12
0
[PATCH 2/2] inspect: support the APK package manager and its format
...nagement = OS_PACKAGE_MANAGEMENT_UNKNOWN; break; diff --git a/src/inspect.c b/src/inspect.c index 79f674c..9332fc4 100644 --- a/src/inspect.c +++ b/src/inspect.c @@ -530,6 +530,7 @@ guestfs_impl_inspect_get_package_format (guestfs_h *g, const char *root) case OS_PACKAGE_FORMAT_EBUILD: ret = safe_strdup (g, "ebuild"); break; case OS_PACKAGE_FORMAT_PISI: ret = safe_strdup (g, "pisi"); break; case OS_PACKAGE_FORMAT_PKGSRC: ret = safe_strdup (g, "pkgsrc"); break; + case OS_PACKAGE_FORMAT_APK: ret = safe_strdup (g, "apk"); break; case OS_PACKAGE_FORMAT...
2014 Mar 12
3
Re: [PATCH v2 03/18] New API parameter: Add discard parameter to guestfs_add_drive_opts.
On Tuesday 11 March 2014 23:13:46 Richard W.M. Jones wrote: > diff --git a/src/drives.c b/src/drives.c > index 2c85b52..68e37f7 100644 > --- a/src/drives.c > +++ b/src/drives.c > @@ -115,7 +115,8 @@ static struct drive * > create_drive_file (guestfs_h *g, const char *path, > bool readonly, const char *format, > const char *iface,
2012 Nov 01
4
[PATCH v2 0/3] New inspect_list_applications2 API
Here's the new API method and update to virt-inspector. I still need to implement app_arch for debian and windows (if applicable), for now they just return empty strings. New in v2: incorporated feedback from v1, also added patch #3 which updates the documentation where it references the deprecated API. Take it or leave it.
2017 Feb 23
2
[PATCH 1/3] inspect: add source and summary to internal add_application
...{ apps->len++; @@ -911,8 +914,8 @@ add_application (guestfs_h *g, struct guestfs_application2_list *apps, /* XXX The next two are not yet implemented for any package * format, but we could easily support them for rpm and deb. */ - apps->val[apps->len-1].app2_source_package = safe_strdup (g, ""); - apps->val[apps->len-1].app2_summary = safe_strdup (g, ""); + apps->val[apps->len-1].app2_source_package = safe_strdup (g, source); + apps->val[apps->len-1].app2_summary = safe_strdup (g, summary); apps->val[apps->len-1].app2_description =...
2017 Feb 24
3
[PATCH v2 1/3] inspect: add source and summary to internal add_application
...{ apps->len++; @@ -911,8 +914,8 @@ add_application (guestfs_h *g, struct guestfs_application2_list *apps, /* XXX The next two are not yet implemented for any package * format, but we could easily support them for rpm and deb. */ - apps->val[apps->len-1].app2_source_package = safe_strdup (g, ""); - apps->val[apps->len-1].app2_summary = safe_strdup (g, ""); + apps->val[apps->len-1].app2_source_package = safe_strdup (g, source); + apps->val[apps->len-1].app2_summary = safe_strdup (g, summary); apps->val[apps->len-1].app2_description =...
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.
2020 Oct 09
2
Re: [PATCH v3 8/8] lib/canonical-name.c: Hide EINVAL error from underlying API call.
...> @@ -53,8 +53,16 @@ guestfs_impl_canonical_device_name (guestfs_h *g, const char *device) > * BitLocker-encrypted volume, so simply return the original > * name in that case. > */ > - if (ret == NULL && guestfs_last_errno (g) == EINVAL) > - ret = safe_strdup (g, device); > + if (ret == NULL) { > + if (guestfs_last_errno (g) == EINVAL) > + ret = safe_strdup (g, device); > + else > + /* Make sure the original error gets pushed through the > + * error handlers. > + */ > + guestfs_in...
2014 Sep 22
1
[PATCH] inspect: basic Minix support
...D: + case OS_TYPE_MINIX: case OS_TYPE_UNKNOWN: ; /* nothing */ } diff --git a/src/inspect.c b/src/inspect.c index 1a9554e..9248b06 100644 --- a/src/inspect.c +++ b/src/inspect.c @@ -118,6 +118,7 @@ guestfs__inspect_get_type (guestfs_h *g, const char *root) case OS_TYPE_FREEBSD: ret = safe_strdup (g, "freebsd"); break; case OS_TYPE_HURD: ret = safe_strdup (g, "hurd"); break; case OS_TYPE_LINUX: ret = safe_strdup (g, "linux"); break; + case OS_TYPE_MINIX: ret = safe_strdup (g, "minix"); break; case OS_TYPE_NETBSD: ret = safe_strdup (g, "...
2012 Nov 01
2
[PATCH 0/2] New inspect_list_applications2 API
Here's the new API method and update to virt-inspector. I still need to implement app_arch for debian and windows (if applicable), for now they just return empty strings.
2016 Mar 07
1
[PATCH] inspect: list applications with APK
...escription ? : ""); + free (name); + free (version); + free (release); + free (arch); + free (url); + free (description); + name = version = release = arch = url = description = NULL; + break; + case 'A': + free (arch); + arch = safe_strdup (g, &line[2]); + break; + case 'P': + free (name); + name = safe_strdup (g, &line[2]); + break; + case 'T': + free (description); + description = safe_strdup (g, &line[2]); + break; + case 'U': + free (url); +...
2012 Oct 22
3
[PATCH 0/2 NOT WORKING] Symbol versioning
John, This was my attempt to add symbol versioning to the library, letting us break ABI without breaking any existing callers. Unfortunately it doesn't work: - the new versioned symbols are marked local in libguestfs.so - the existing symbols should now have @GUESTFS_0.0 versions, but don't The documentation for this stuff is extremely thin, and I've got a bad case of