Displaying 20 results from an estimated 61 matches for "send_file_write".
2016 Aug 25
0
[PATCH v2 2/6] daemon: refactor tsk code
...X_CHUNK_SIZE, XDR_ENCODE);
+
+ ret = xdr_guestfs_int_tsk_dirent (&xdr, &dirent);
+ if (ret == 0) {
+ perror ("xdr_guestfs_int_tsk_dirent");
+ return -1;
+ }
+
+ len = xdr_getpos (&xdr);
+
+ xdr_destroy (&xdr);
+
+ /* Send serialised tsk_dirent out. */
+ return send_file_write (buf, len);
}
/* Inspect fsfile to identify its type. */
@@ -221,39 +253,6 @@ file_metadata (TSK_FS_META *fsmeta, guestfs_int_tsk_dirent *dirent)
}
}
-/* Serialise dirent into XDR stream and send it to the appliance.
- * Return 0 on success, -1 on error.
- */
-static int
-send_dirent_info...
2016 Mar 29
0
[PATCH 1/2] rename icat API to download_inode
...@ -85,30 +85,37 @@ file_out (const char *cmd)
* this there is no opportunity in the protocol to send any error
* message back. Instead we can only cancel the transfer.
*/
- reply (NULL, NULL);
+ reply(NULL, NULL);
+
+ while ((r = fread(buffer, 1, sizeof buffer, fp)) > 0)
+ if (send_file_write(buffer, r) < 0) {
+ pclose(fp);
- while ((r = fread (buffer, 1, sizeof buffer, fp)) > 0) {
- if (send_file_write (buffer, r) < 0) {
- pclose (fp);
return -1;
}
- }
- if (ferror (fp)) {
- fprintf (stderr, "fread: %m");
- send_file_end (1); /* C...
2016 Feb 21
2
[PATCH] added ntfscat_i api
...we must send the reply message, before the file contents. After
+ * this there is no opportunity in the protocol to send any error
+ * message back. Instead we can only cancel the transfer.
+ */
+ reply (NULL, NULL);
+
+ while ((r = fread (buffer, 1, sizeof buffer, fp)) > 0) {
+ if (send_file_write (buffer, r) < 0) {
+ pclose (fp);
+ return -1;
+ }
+ }
+
+ if (ferror (fp)) {
+ fprintf (stderr, "fread: %ld: %m\n", inode);
+ send_file_end (1); /* Cancel. */
+ pclose (fp);
+ return -1;
+ }
+
+ if (pclose (fp) != 0) {
+ fprintf (stderr, "pclose:...
2016 Mar 29
2
[PATCH] renamed daemon/tsk.c to daemon/sleuthkit.c
...we must send the reply message, before the file contents. After
+ * this there is no opportunity in the protocol to send any error
+ * message back. Instead we can only cancel the transfer.
+ */
+ reply (NULL, NULL);
+
+ while ((r = fread (buffer, 1, sizeof buffer, fp)) > 0) {
+ if (send_file_write (buffer, r) < 0) {
+ pclose (fp);
+ return -1;
+ }
+ }
+
+ if (ferror (fp)) {
+ fprintf (stderr, "fread: %m");
+ send_file_end (1); /* Cancel. */
+ pclose (fp);
+ return -1;
+ }
+
+ if (pclose (fp) != 0) {
+ fprintf (stderr, "pclose: %m");
+...
2016 Feb 22
2
Re: [PATCH] added ntfscat_i api
...r
>> + * this there is no opportunity in the protocol to send any error
>> + * message back. Instead we can only cancel the transfer.
>> + */
>> + reply (NULL, NULL);
>> +
>> + while ((r = fread (buffer, 1, sizeof buffer, fp)) > 0) {
>> + if (send_file_write (buffer, r) < 0) {
>> + pclose (fp);
>> + return -1;
>> + }
>> + }
>> +
>> + if (ferror (fp)) {
>> + fprintf (stderr, "fread: %ld: %m\n", inode);
>> + send_file_end (1); /* Cancel. */
>> + pclose (fp);
>&...
2016 Mar 29
3
[PATCH 0/2] rename icat API as download_inode
"icat" name comes from the employed command line tool which might be replaced later on with a different implementation.
The command name is a bit confusing because it's similar to "cat" but act as "donwload". Therefore I am renaming it with a more clear name.
At the same time I cleaned up a bit the code and improved it's readability and code comments.
This
2016 Mar 30
4
[PATCH 0/3] rename icat API into download_inode
The command name is a bit confusing because it's similar to "cat" but act as "donwload". Therefore I am renaming it with a more clear name.
At the same go I cleaned up a bit the code following the standards and improved the API documentation.
This patch is ready for review.
Code available at:
https://github.com/noxdafox/libguestfs/tree/download_inode
Matteo Cafasso (3):
2016 Nov 22
2
Re: [PATCH v2 4/6] New API: internal_yara_scan
...ection);
> + if (ret == 0) {
> + perror ("xdr_guestfs_int_yara_detection");
> + return -1;
> + }
> +
> + len = xdr_getpos (&xdr);
> +
> + xdr_destroy (&xdr);
> +
> + /* Send serialised tsk_detection out. */
Typo in comment.
> + return send_file_write (buf, len);
> +}
> +
> /* Clean up yara handle on daemon exit. */
> void yara_finalize (void) __attribute__((destructor));
> void
> diff --git a/generator/actions.ml b/generator/actions.ml
> index 152c651..d9006f2 100644
> --- a/generator/actions.ml
> +++ b/generator/a...
2014 Nov 27
0
[PATCH] remove commented-out debug code
...c
@@ -164,7 +164,6 @@ do_internal_journal_get (void)
sd_journal_restart_data (j);
while ((r = sd_journal_enumerate_data (j, &data, &len)) > 0) {
- //fprintf (stderr, "data[%zu] = %.*s\n", len, (int) len, (char*) data);
len_be = htobe64 ((uint64_t) len);
if (send_file_write (&len_be, sizeof (len_be)) < 0)
return -1;
--
1.9.3
2016 Mar 07
2
[PATCH v2] Use less stack.
...and is not a directory (RHBZ#908322). */
buf = sysroot_path (file);
@@ -146,7 +152,7 @@ do_base64_out (const char *file)
*/
reply (NULL, NULL);
- while ((r = fread (buffer, 1, sizeof buffer, fp)) > 0) {
+ while ((r = fread (buffer, 1, GUESTFS_MAX_CHUNK_SIZE, fp)) > 0) {
if (send_file_write (buffer, r) < 0) {
pclose (fp);
return -1;
diff --git a/daemon/btrfs.c b/daemon/btrfs.c
index 3155a74..e027fb9 100644
--- a/daemon/btrfs.c
+++ b/daemon/btrfs.c
@@ -94,6 +94,11 @@ btrfs_set_label (const char *device, const char *label)
return 0;
}
+#if defined(__GNUC__) &&...
2016 Feb 22
0
Re: [PATCH] added ntfscat_i api
...ore the file contents. After
> + * this there is no opportunity in the protocol to send any error
> + * message back. Instead we can only cancel the transfer.
> + */
> + reply (NULL, NULL);
> +
> + while ((r = fread (buffer, 1, sizeof buffer, fp)) > 0) {
> + if (send_file_write (buffer, r) < 0) {
> + pclose (fp);
> + return -1;
> + }
> + }
> +
> + if (ferror (fp)) {
> + fprintf (stderr, "fread: %ld: %m\n", inode);
> + send_file_end (1); /* Cancel. */
> + pclose (fp);
> + return -1;
> + }
> +
>...
2012 Mar 13
2
[PATCH 0/2] 'int' to 'size_t' changes
These two patches are probably not completely independent, but
separating them is a lot of work.
With *both* patches applied, all the tests and extra-tests pass.
That's no guarantee however that there isn't a mistake, so I don't
think this patch is a candidate for the 1.16 branch, until it's had a
lot more testing in development.
Rich.
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 Mar 07
0
[PATCH 2/3] added icat API to retrieve deleted or inaccessible files
...we must send the reply message, before the file contents. After
+ * this there is no opportunity in the protocol to send any error
+ * message back. Instead we can only cancel the transfer.
+ */
+ reply (NULL, NULL);
+
+ while ((r = fread (buffer, 1, sizeof buffer, fp)) > 0) {
+ if (send_file_write (buffer, r) < 0) {
+ pclose (fp);
+ return -1;
+ }
+ }
+
+ if (ferror (fp)) {
+ fprintf (stderr, "fread: %m");
+ send_file_end (1); /* Cancel. */
+ pclose (fp);
+ return -1;
+ }
+
+ if (pclose (fp) != 0) {
+ fprintf (stderr, "pclose: %m");
+...
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 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 06
8
[PATCH 0/5] Use less stack.
Various changes/fixes to use smaller stack frames.
Rich.
2016 Feb 22
0
Re: [PATCH] added ntfscat_i api
...ere is no opportunity in the protocol to send any error
> >>+ * message back. Instead we can only cancel the transfer.
> >>+ */
> >>+ reply (NULL, NULL);
> >>+
> >>+ while ((r = fread (buffer, 1, sizeof buffer, fp)) > 0) {
> >>+ if (send_file_write (buffer, r) < 0) {
> >>+ pclose (fp);
> >>+ return -1;
> >>+ }
> >>+ }
> >>+
> >>+ if (ferror (fp)) {
> >>+ fprintf (stderr, "fread: %ld: %m\n", inode);
> >>+ send_file_end (1); /* Cancel. */...
2016 Nov 22
0
Re: [PATCH v2 4/6] New API: internal_yara_scan
...error ("xdr_guestfs_int_yara_detection");
>> + return -1;
>> + }
>> +
>> + len = xdr_getpos (&xdr);
>> +
>> + xdr_destroy (&xdr);
>> +
>> + /* Send serialised tsk_detection out. */
> Typo in comment.
>
>> + return send_file_write (buf, len);
>> +}
>> +
>> /* Clean up yara handle on daemon exit. */
>> void yara_finalize (void) __attribute__((destructor));
>> void
>> diff --git a/generator/actions.ml b/generator/actions.ml
>> index 152c651..d9006f2 100644
>> --- a/generato...
2016 Nov 09
0
[PATCH v2 4/6] New API: internal_yara_scan
...XDR_ENCODE);
+
+ ret = xdr_guestfs_int_yara_detection (&xdr, &detection);
+ if (ret == 0) {
+ perror ("xdr_guestfs_int_yara_detection");
+ return -1;
+ }
+
+ len = xdr_getpos (&xdr);
+
+ xdr_destroy (&xdr);
+
+ /* Send serialised tsk_detection out. */
+ return send_file_write (buf, len);
+}
+
/* Clean up yara handle on daemon exit. */
void yara_finalize (void) __attribute__((destructor));
void
diff --git a/generator/actions.ml b/generator/actions.ml
index 152c651..d9006f2 100644
--- a/generator/actions.ml
+++ b/generator/actions.ml
@@ -13280,6 +13280,16 @@ Previously...