search for: guestfs_int_make_temp_path

Displaying 20 results from an estimated 21 matches for "guestfs_int_make_temp_path".

2017 Sep 19
0
[PATCH 6/6] lib: Use guestfs_int_make_temp_path in a few more places.
...+74,9 @@ guestfs_int_get_uefi (guestfs_h *g, char **code, char **vars, int *flags) * into the address space read-only as that triggers a different * path inside UEFI. */ - varst = safe_asprintf (g, "%s/vars.fd.%d", g->tmpdir, ++g->unique); + varst = guestfs_int_make_temp_path (g, "vars", "fd"); + if (!varst) + return -1; guestfs_int_cmd_add_arg (copycmd, "cp"); guestfs_int_cmd_add_arg (copycmd, varsfile); guestfs_int_cmd_add_arg (copycmd, varst); diff --git a/lib/command.c b/lib/command.c index bc469de59..70...
2016 Dec 11
0
[PATCH 2/2] lib: use guestfs_int_make_temp_path to generate temporary files
...rtions(+), 33 deletions(-) diff --git a/src/drives.c b/src/drives.c index 1e3b0af..1e04f81 100644 --- a/src/drives.c +++ b/src/drives.c @@ -421,7 +421,8 @@ create_drive_dev_null (guestfs_h *g, data->format = "raw"; } - if (guestfs_int_lazy_make_tmpdir (g) == -1) + tmpfile = guestfs_int_make_temp_path (g, "devnull"); + if (tmpfile == NULL) return NULL; /* Because we create a special file, there is no point forcing qemu @@ -429,8 +430,6 @@ create_drive_dev_null (guestfs_h *g, */ data->readonly = false; - tmpfile = safe_asprintf (g, "%s/devnull%d", g->t...
2016 Dec 11
3
[PATCH 0/2] generic function for temporary path generation
Cosmetic change as suggested in this previous patch: https://www.redhat.com/archives/libguestfs/2016-November/msg00111.html Matteo Cafasso (2): lib: generic function for temporary path generation lib: use guestfs_int_make_temp_path to generate temporary files src/drives.c | 5 ++--- src/file.c | 22 +++++++++------------- src/guestfs-internal.h | 1 + src/journal.c | 4 ++-- src/tmpdirs.c | 17 +++++++++++++++++ src/tsk.c | 17 ++--------------- 6 files changed, 33 ins...
2017 Sep 19
7
[PATCH 0/6] Various clean ups in lib/
Miscellaneous small cleanups in lib/ directory. Rich.
2017 Sep 20
7
[PATCH v2] 0/6] Various clean ups in lib/
v1 -> v2: - Remove the unnecessary calls to guestfs_int_lazy_make_tmpdir in the final patch. Rich.
2017 Sep 20
1
Re: [PATCH 6/6] lib: Use guestfs_int_make_temp_path in a few more places.
...run (struct command *cmd, const char *mode) > if (guestfs_int_lazy_make_tmpdir (cmd->g) == -1) > goto error; > > - cmd->error_file = > - safe_asprintf (cmd->g, "%s/cmderr.%d", cmd->g->tmpdir, ++cmd->g->unique); > + cmd->error_file = guestfs_int_make_temp_path (cmd->g, "cmderr", "txt"); > + if (!cmd->error_file) > + goto error; > errfd = open (cmd->error_file, > O_WRONLY|O_CREAT|O_NOCTTY|O_TRUNC|O_CLOEXEC, 0600); > if (errfd == -1) { > diff --git a/lib/drives.c b/lib/drives.c >...
2020 Aug 12
2
[PATCH v2] appliance: extract UUID from QCOW2 disk image
For the appliance of the QCOW2 format, get the UUID of the disk by reading the first 256k bytes with 'qemu-img dd' command. Then pass the read block to the 'file' command. In case of failure, run the 'file' command again directly. Suggested-by: Denis V. Lunev <den@openvz.org> Signed-off-by: Andrey Shinkevich <andrey.shinkevich@virtuozzo.com> --- v2: 01: The
2020 Aug 13
2
[PATCH v3] appliance: extract UUID from QCOW2 disk image
...e UUID from the appliance disk image. + */ +static char * +get_root_uuid (guestfs_h *g, const char *appliance) +{ + char *uuid = NULL; + int ret; + CLEANUP_UNLINK_FREE char *tmpfile = NULL; + + uuid = get_root_uuid_with_file (g, appliance); + if (uuid) { + return uuid; + } + + tmpfile = guestfs_int_make_temp_path (g, "root", "raw"); + if (!tmpfile) { + error (g, "get_root_uuid: failed to make temporary file"); + return NULL; + } + + ret = run_qemu_img_dd (g, appliance, tmpfile); + if (ret < 0) { + return NULL; + } + + uuid = get_root_uuid_with_file (g, tmpfile...
2020 Aug 13
0
Re: [PATCH v3] appliance: extract UUID from QCOW2 disk image
...t; +get_root_uuid (guestfs_h *g, const char *appliance) > +{ > + char *uuid = NULL; > + int ret; > + CLEANUP_UNLINK_FREE char *tmpfile = NULL; > + > + uuid = get_root_uuid_with_file (g, appliance); > + if (uuid) { > + return uuid; > + } > + > + tmpfile = guestfs_int_make_temp_path (g, "root", "raw"); > + if (!tmpfile) { > + error (g, "get_root_uuid: failed to make temporary file"); > + return NULL; > + } > + > + ret = run_qemu_img_dd (g, appliance, tmpfile); > + if (ret < 0) { > + return NULL; > + } &g...
2017 Apr 06
0
[PATCH v6 6/7] New API: yara_scan
...*, const char *); +static int deserialise_yara_detection_list (guestfs_h *, FILE *, struct guestfs_yara_detection_list *); + +struct guestfs_yara_detection_list * +guestfs_impl_yara_scan (guestfs_h *g, const char *path) +{ + int ret = 0; + CLEANUP_UNLINK_FREE char *tmpfile = NULL; + + tmpfile = guestfs_int_make_temp_path (g, "yara_scan"); + if (tmpfile == NULL) + return NULL; + + ret = guestfs_internal_yara_scan (g, path, tmpfile); + if (ret < 0) + return NULL; + + return parse_yara_detection_file (g, tmpfile); /* caller frees */ +} + +/* Parse the file content and return detections list. +...
2017 Apr 04
0
[PATCH v5 6/7] New API: yara_scan
...*, const char *); +static int deserialise_yara_detection_list (guestfs_h *, FILE *, struct guestfs_yara_detection_list *); + +struct guestfs_yara_detection_list * +guestfs_impl_yara_scan (guestfs_h *g, const char *path) +{ + int ret = 0; + CLEANUP_UNLINK_FREE char *tmpfile = NULL; + + tmpfile = guestfs_int_make_temp_path (g, "yara_scan"); + if (tmpfile == NULL) + return NULL; + + ret = guestfs_internal_yara_scan (g, path, tmpfile); + if (ret < 0) + return NULL; + + return parse_yara_detection_file (g, tmpfile); /* caller frees */ +} + +/* Parse the file content and return detections list. +...
2017 Apr 23
0
[PATCH v7 6/7] New API: yara_scan
..._h *, const char *); +static int deserialise_yara_detection_list (guestfs_h *, FILE *, struct guestfs_yara_detection_list *); + +struct guestfs_yara_detection_list * +guestfs_impl_yara_scan (guestfs_h *g, const char *path) +{ + int r = 0; + CLEANUP_UNLINK_FREE char *tmpfile = NULL; + + tmpfile = guestfs_int_make_temp_path (g, "yara_scan"); + if (tmpfile == NULL) + return NULL; + + r = guestfs_internal_yara_scan (g, path, tmpfile); + if (r == -1) + return NULL; + + return parse_yara_detection_file (g, tmpfile); /* caller frees */ +} + +/* Parse the file content and return detections list. + * Ret...
2017 Apr 23
11
[PATCH v7 0/7] Feature: Yara file scanning
v7: - Fixes according to comments - Rebase on top of 1.37.12 Matteo Cafasso (7): daemon: expose file upload logic appliance: add yara dependency New API: yara_load New API: yara_destroy New API: internal_yara_scan New API: yara_scan yara_scan: added API tests appliance/packagelist.in | 4 + configure.ac | 1 + daemon/Makefile.am
2017 Feb 28
0
ANNOUNCE: libguestfs 1.36 released
...indows_*" APIs. "/dev/pts" is now available inside the appliance, so any tools we run which require a pty will now work (Pino Toscano). Most OCaml warnings have been fixed. There is now a single common function for creating temporary files ("guestfs_int_make_temp_path") (Matteo Cafasso). The $TERM environment variable is now validated before passing it through to the appliance kernel command line. Useless USB and memballoon devices are no longer created in the appliance (Laine Stump). On aarch64 we now use virtio-pci fo...
2017 Apr 06
14
[PATCH v6 0/7] Feature: Yara file scanning
v6: - use new test functions - fix yara_detection struct field names - revert yara_load function to initial version With Pino we were exploring the idea of allowing Users to load multiple rule files with subsequent calls to yara_load API. https://www.redhat.com/archives/libguestfs/2016-November/msg00119.html It turns out impractical due to YARA API limitations. It is possible to load multiple
2016 Dec 18
6
[PATCH v3 0/6] Feature: Yara file scanning
v3: - allow to load multiple rule files - added optional namespace parameter to yara_load - move destructor logic in yara module - use generic file upload logic - use generic temporary path function Matteo Cafasso (6): appliance: add yara dependency New API: yara_load New API: yara_destroy New API: internal_yara_scan New API: yara_scan yara_scan: added API tests
2017 Feb 19
9
[PATCH v3 0/7] Feature: Yara file scanning
Rebase patches on top of 1.35.25. No changes since last series. Matteo Cafasso (7): daemon: expose file upload logic appliance: add yara dependency New API: yara_load New API: yara_destroy New API: internal_yara_scan New API: yara_scan yara_scan: added API tests appliance/packagelist.in | 4 + configure.ac | 1 + daemon/Makefile.am
2017 Apr 25
8
[PATCH v9 0/7] Feature: Yara file scanning
v9: - fixes according to comments Matteo Cafasso (7): daemon: expose file upload logic appliance: add yara dependency New API: yara_load New API: yara_destroy New API: internal_yara_scan New API: yara_scan yara_scan: added API tests appliance/packagelist.in | 4 + configure.ac | 1 + daemon/Makefile.am | 4 +-
2017 Mar 12
8
[PATCH v4 0/7] Feature: Yara file scanning
Rebase patches on top of 1.37.1. No changes since last series. Matteo Cafasso (7): daemon: expose file upload logic appliance: add yara dependency New API: yara_load New API: yara_destroy New API: internal_yara_scan New API: yara_scan yara_scan: added API tests appliance/packagelist.in | 4 + configure.ac | 1 + daemon/Makefile.am
2017 Apr 04
13
[PATCH v5 0/7] Feature: Yara file scanning
v5: - rebase on top of 1.37.9 - add missing actions_yara.* files Matteo Cafasso (7): daemon: expose file upload logic appliance: add yara dependency New API: yara_load New API: yara_destroy New API: internal_yara_scan New API: yara_scan yara_scan: added API tests appliance/packagelist.in | 4 + configure.ac | 1 + daemon/Makefile.am