Displaying 20 results from an estimated 69 matches for "guestfs_max_chunk_size".
2016 Mar 07
2
[PATCH v2] Use less stack.
...systems", NULL);
if (r == -1 || r >= 2) {
diff --git a/daemon/base64.c b/daemon/base64.c
index 35a5d2f..3f7a630 100644
--- a/daemon/base64.c
+++ b/daemon/base64.c
@@ -106,7 +106,13 @@ do_base64_out (const char *file)
int r;
FILE *fp;
CLEANUP_FREE char *cmd = NULL;
- char buffer[GUESTFS_MAX_CHUNK_SIZE];
+ CLEANUP_FREE char *buffer = NULL;
+
+ buffer = malloc (GUESTFS_MAX_CHUNK_SIZE);
+ if (buffer == NULL) {
+ reply_with_perror ("malloc");
+ return -1;
+ }
/* Check the filename exists and is not a directory (RHBZ#908322). */
buf = sysroot_path (file);
@@ -146,7 +152,7...
2016 Mar 06
8
[PATCH 0/5] Use less stack.
Various changes/fixes to use smaller stack frames.
Rich.
2016 Aug 25
0
[PATCH v2 2/6] daemon: refactor tsk code
...fname;
@@ -134,10 +149,27 @@ fswalk_callback (TSK_FS_FILE *fsfile, const char *path, void *data)
file_metadata (fsfile->meta, &dirent);
- ret = send_dirent_info (&dirent);
- ret = (ret == 0) ? TSK_WALK_CONT : TSK_WALK_ERROR;
+ /* Serialize tsk_dirent struct. */
+ buf = malloc (GUESTFS_MAX_CHUNK_SIZE);
+ if (buf == NULL) {
+ perror ("malloc");
+ return -1;
+ }
- return ret;
+ xdrmem_create (&xdr, buf, GUESTFS_MAX_CHUNK_SIZE, XDR_ENCODE);
+
+ ret = xdr_guestfs_int_tsk_dirent (&xdr, &dirent);
+ if (ret == 0) {
+ perror ("xdr_guestfs_int_tsk_dirent"...
2016 Nov 22
2
Re: [PATCH v2 4/6] New API: internal_yara_scan
...is not used here -- I suggest passing --enable-werror to
autogen.sh or configure, so any compiler warning is turned to error.
> +
> + detection.name = (char *) name;
> + detection.rule = (char *) rule->identifier;
> +
> + /* Serialize detection struct. */
> + buf = malloc (GUESTFS_MAX_CHUNK_SIZE);
> + if (buf == NULL) {
> + perror ("malloc");
> + return -1;
> + }
> +
> + xdrmem_create (&xdr, buf, GUESTFS_MAX_CHUNK_SIZE, XDR_ENCODE);
> +
> + ret = xdr_guestfs_int_yara_detection (&xdr, &detection);
> + if (ret == 0) {
> + perr...
2016 Mar 29
0
[PATCH 1/2] rename icat API to download_inode
...ppliance.
+ * Return 0 on success, -1 on error.
+ */
+static int send_command_output(const char *cmd)
{
int r;
FILE *fp;
CLEANUP_FREE char *buffer = NULL;
if (verbose)
- fprintf (stderr, "%s\n", cmd);
+ fprintf(stderr, "%s\n", cmd);
+
+ if (!(buffer = malloc(GUESTFS_MAX_CHUNK_SIZE))) {
+ reply_with_perror("malloc");
- buffer = malloc (GUESTFS_MAX_CHUNK_SIZE);
- if (buffer == NULL) {
- reply_with_perror ("malloc");
return -1;
}
- fp = popen (cmd, "r");
- if (fp == NULL) {
- reply_with_perror ("%s", cmd);
+ if (!(...
2016 Aug 26
6
[PATCH v3 0/6] New API: find_inode
v3:
- coding style fixes
- comment entry_is_dot logic
Matteo Cafasso (6):
filesystem_walk: fixed root inode listing
daemon: refactor tsk code
lib: rename tsk internal function
New API: internal_find_inode
New API: find_inode
find_inode: added API tests
daemon/tsk.c | 157 ++++++++++++++++++++++++++++++-------------
generator/actions.ml | 21 ++++++
2016 Aug 26
6
[PATCH v4 0/6] New API: find_inode
v4:
- refactor entry_is_dot
My apologies for the duplicated submission but I did not read the next e-mail.
The tsk_fs_dir_walk API will list all the entries including '.' and '..'
in a similar manner as for 'ls -a'.
This means our callback will be called for the following entries:
. <-- the Root entry
etc/.
etc/.. <-- again the Root entry
etc/systemd/.
2016 Feb 21
2
[PATCH] added ntfscat_i api
...ex 568899e..58f62fa 100644
--- a/daemon/ntfs.c
+++ b/daemon/ntfs.c
@@ -266,3 +266,65 @@ do_ntfsfix (const char *device, int clearbadsectors)
return 0;
}
+
+int
+do_ntfscat_i (const mountable_t *mountable, int64_t inode)
+{
+ int r;
+ FILE *fp;
+ CLEANUP_FREE char *cmd = NULL;
+ char buffer[GUESTFS_MAX_CHUNK_SIZE];
+
+ /* Inode must be greater than 0 */
+ if (inode < 0) {
+ reply_with_error("Inode must be greater than 0");
+ return -1;
+ }
+
+ /* Construct the command. */
+ if (asprintf_nowarn (&cmd, "ntfscat -i %ld %s",
+ inode, mountable->devi...
2016 Sep 16
7
[PATCH v6 0/6] New API - find_inode
This series should be ready for merge
v6:
- rebase on master
- changes according to last comments
Matteo Cafasso (6):
filesystem_walk: fixed root inode listing
daemon: refactor tsk code
lib: rename tsk internal function
New API: internal_find_inode
New API: find_inode
find_inode: added API tests
daemon/tsk.c | 155 ++++++++++++++++++++++++++++++-------------
2016 Mar 07
1
Re: [PATCH 1/2] added icat and fls0 APIs
On Sun, Mar 06, 2016 at 05:42:25PM +0200, Matteo Cafasso wrote:
> +static int
> +file_out (const char *cmd)
> +{
> + int r;
> + FILE *fp;
> + char buffer[GUESTFS_MAX_CHUNK_SIZE];
Soon libguestfs will prevent you from using large stack allocations.
This is easy to fix. See:
https://www.redhat.com/archives/libguestfs/2016-March/msg00052.html
> diff --git a/generator/actions.ml b/generator/actions.ml
> index 287d7f5..ff6aa3f 100644
> --- a/generator/actions.ml
&g...
2016 Nov 22
0
Re: [PATCH v2 4/6] New API: internal_yara_scan
...sing --enable-werror to
> autogen.sh or configure, so any compiler warning is turned to error.
>
>> +
>> + detection.name = (char *) name;
>> + detection.rule = (char *) rule->identifier;
>> +
>> + /* Serialize detection struct. */
>> + buf = malloc (GUESTFS_MAX_CHUNK_SIZE);
>> + if (buf == NULL) {
>> + perror ("malloc");
>> + return -1;
>> + }
>> +
>> + xdrmem_create (&xdr, buf, GUESTFS_MAX_CHUNK_SIZE, XDR_ENCODE);
>> +
>> + ret = xdr_guestfs_int_yara_detection (&xdr, &detection);
>&g...
2016 Nov 09
0
[PATCH v2 4/6] New API: internal_yara_scan
...LE *rule)
+{
+ XDR xdr;
+ int ret = 0;
+ size_t len = 0;
+ struct guestfs_int_yara_detection detection;
+ CLEANUP_FREE char *buf = NULL, *fname = NULL;
+
+ detection.name = (char *) name;
+ detection.rule = (char *) rule->identifier;
+
+ /* Serialize detection struct. */
+ buf = malloc (GUESTFS_MAX_CHUNK_SIZE);
+ if (buf == NULL) {
+ perror ("malloc");
+ return -1;
+ }
+
+ xdrmem_create (&xdr, buf, GUESTFS_MAX_CHUNK_SIZE, XDR_ENCODE);
+
+ ret = xdr_guestfs_int_yara_detection (&xdr, &detection);
+ if (ret == 0) {
+ perror ("xdr_guestfs_int_yara_detection");
+...
2016 Mar 29
0
[PATCH 1/2] added filesystem_walk0 API
...quot;%s%s", path, name);
+
+ return buf;
+}
+
+/* Serialise node_info into XDR stream and send it to the appliance.
+ * Return 0 on success, -1 on error.
+ */
+static int inode_out(guestfs_int_tsk_node *node_info)
+{
+ XDR xdr;
+ size_t len;
+ CLEANUP_FREE char *buf;
+
+ if ((buf = malloc(GUESTFS_MAX_CHUNK_SIZE)) == NULL) {
+ reply_with_perror ("malloc");
+ return -1;
+ }
+
+ /* Serialise tsk_node struct. */
+ len = strlen(node_info->tsk_name) + 1;
+
+ xdrmem_create(&xdr, buf, GUESTFS_MAX_CHUNK_SIZE, XDR_ENCODE);
+ if (!xdr_u_long(&xdr, &len))
+ return -1;
+ if (!xd...
2017 Apr 24
0
[PATCH v8 6/8] New API: internal_yara_scan
..., YR_RULE *rule)
+{
+ XDR xdr;
+ int r = 0;
+ size_t len = 0;
+ CLEANUP_FREE char *buf = NULL;
+ struct guestfs_int_yara_detection detection;
+
+ detection.yara_name = (char *) name;
+ detection.yara_rule = (char *) rule->identifier;
+
+ /* Serialize detection struct. */
+ buf = malloc (GUESTFS_MAX_CHUNK_SIZE);
+ if (buf == NULL) {
+ perror ("malloc");
+ return -1;
+ }
+
+ xdrmem_create (&xdr, buf, GUESTFS_MAX_CHUNK_SIZE, XDR_ENCODE);
+
+ r = xdr_guestfs_int_yara_detection (&xdr, &detection);
+ if (r == 0) {
+ perror ("xdr_guestfs_int_yara_detection");
+...
2017 Apr 06
0
[PATCH v6 5/7] New API: internal_yara_scan
...YR_RULE *rule)
+{
+ XDR xdr;
+ int ret = 0;
+ size_t len = 0;
+ CLEANUP_FREE char *buf = NULL;
+ struct guestfs_int_yara_detection detection;
+
+ detection.yara_name = (char *) name;
+ detection.yara_rule = (char *) rule->identifier;
+
+ /* Serialize detection struct. */
+ buf = malloc (GUESTFS_MAX_CHUNK_SIZE);
+ if (buf == NULL) {
+ perror ("malloc");
+ return -1;
+ }
+
+ xdrmem_create (&xdr, buf, GUESTFS_MAX_CHUNK_SIZE, XDR_ENCODE);
+
+ ret = xdr_guestfs_int_yara_detection (&xdr, &detection);
+ if (ret == 0) {
+ perror ("xdr_guestfs_int_yara_detection");
+...
2017 Apr 04
0
[PATCH v5 5/7] New API: internal_yara_scan
...ar *name, YR_RULE *rule)
+{
+ XDR xdr;
+ int ret = 0;
+ size_t len = 0;
+ CLEANUP_FREE char *buf = NULL;
+ struct guestfs_int_yara_detection detection;
+
+ detection.name = (char *) name;
+ detection.rule = (char *) rule->identifier;
+
+ /* Serialize detection struct. */
+ buf = malloc (GUESTFS_MAX_CHUNK_SIZE);
+ if (buf == NULL) {
+ perror ("malloc");
+ return -1;
+ }
+
+ xdrmem_create (&xdr, buf, GUESTFS_MAX_CHUNK_SIZE, XDR_ENCODE);
+
+ ret = xdr_guestfs_int_yara_detection (&xdr, &detection);
+ if (ret == 0) {
+ perror ("xdr_guestfs_int_yara_detection");
+...
2016 Aug 25
10
[PATCH v2 0/6] New API: find_inode
v2:
- refactor logic to reduce code duplication
- better functions naming
Matteo Cafasso (6):
filesystem_walk: fixed root inode listing
daemon: refactor tsk code
lib: rename tsk internal function
New API: internal_find_inode
New API: find_inode
find_inode: added API tests
daemon/tsk.c | 156 ++++++++++++++++++++++++++++++-------------
generator/actions.ml
2016 Sep 15
9
[PATCH v5 0/6] New API - find_inode
v5:
- small doc fix: filesystem_walk claimed '.' and '..' entries were
not reported but Root is now reported as '.'
- bump to 1.35.6
Matteo Cafasso (6):
filesystem_walk: fixed root inode listing
daemon: refactor tsk code
lib: rename tsk internal function
New API: internal_find_inode
New API: find_inode
find_inode: added API tests
daemon/tsk.c
2017 Feb 14
0
[PATCH 09/10] New API: mksquashfs
...mpfile = strdup ("/var/tmp/squashfs.XXXXXX");
+ if (tmpfile == NULL) {
+ reply_with_perror ("strdup");
+ return -1;
+ }
+
+ fd = mkstemp (tmpfile);
+ if (fd == -1) {
+ reply_with_perror ("mkstemp");
+ return -1;
+ }
+ close (fd);
+
+ buffer = malloc (GUESTFS_MAX_CHUNK_SIZE);
+ if (buffer == NULL) {
+ reply_with_perror ("malloc/buffer");
+ return -1;
+ }
+
+ ADD_ARG (argv, i, str_mksquashfs);
+ ADD_ARG (argv, i, buf);
+ ADD_ARG (argv, i, tmpfile);
+ ADD_ARG (argv, i, "-noappend");
+ ADD_ARG (argv, i, "-root-becomes");
+ ADD_...
2016 Mar 29
5
[PATCH 0/2] added filesystem_walk0 low level API
The filesystem_walk0 API parses the FS internals of a partition and returns a list of all the files and directories contained within. It list deleted files and directories as well.
For each node, it reports its relative path, its inode and its allocation status.
The output is serialised in XDR format and written to the given file.
The command is similar to The Sleuth Kit "fls -rp