search for: do_file

Displaying 20 results from an estimated 29 matches for "do_file".

Did you mean: io_file
2009 Aug 07
1
[PATCH] daemon/file.c: remove duplicate absolute-path check
minor clean-up: >From cac2ce53aec6d3aaca83e4bbc3551d452c29c0b2 Mon Sep 17 00:00:00 2001 From: Jim Meyering <meyering at redhat.com> Date: Fri, 7 Aug 2009 20:07:03 +0200 Subject: [PATCH] daemon/file.c: remove duplicate absolute-path check * daemon/file.c (do_file): Remove redundant use of ABS_PATH. It's redundant because the preceding line invokes NEED_ROOT_OR_IS_DEVICE, which also invokes ABS_PATH. --- daemon/file.c | 1 - 1 files changed, 0 insertions(+), 1 deletions(-) diff --git a/daemon/file.c b/daemon/file.c index 63d8dd2..cd477e5 100644 ---...
2015 Jul 26
2
[PATCH] ssh-agent: Add support to load additional certificates
...he user must confirm each use of the key\n"); + out: + free(comment); + sshkey_free(cert); + + return ret; +} + +static int add_file(int agent_fd, const char *filename, int key_only) { struct sshkey *private, *cert; @@ -445,13 +488,16 @@ lock_agent(int agent_fd, int lock) } static int -do_file(int agent_fd, int deleting, int key_only, char *file) +do_file(int agent_fd, int deleting, int key_only, int cert_only, char *file) { if (deleting) { if (delete_file(agent_fd, file, key_only) == -1) return -1; } else { - if (add_file(agent_fd, file, key_only) == -1) + if (cert_only) {...
2017 Jul 14
0
[PATCH 03/27] daemon: Reimplement ‘file’ API in OCaml.
..._file, file); GUESTFSD_EXT_CMD(str_zcat, zcat); GUESTFSD_EXT_CMD(str_bzcat, bzcat); @@ -449,85 +448,6 @@ do_pwrite_device (const char *device, const char *content, size_t size, return pwrite_fd (fd, content, size, offset, device, 1); } -/* This runs the 'file' command. */ -char * -do_file (const char *path) -{ - CLEANUP_FREE char *buf = NULL; - const char *display_path = path; - const int is_dev = STRPREFIX (path, "/dev/"); - struct stat statbuf; - - if (!is_dev) { - buf = sysroot_path (path); - if (!buf) { - reply_with_perror ("malloc"); - r...
2016 Mar 07
0
Re: [PATCH v2] Use less stack.
On Monday 07 March 2016 11:18:32 Richard W.M. Jones wrote: > GCC has two warnings related to large stack frames. We were already > using the -Wframe-larger-than warning, but this reduces the threshold > from 10000 to 5000 bytes. > > However that warning only covers the static part of frames (not > alloca). So this change also enables -Wstack-usage=10000 which covers > both
2016 Dec 28
2
certificates keys on pkcs11 devices
Hi, I have not found any way to use a Certificate with ssh-agent when my Key is stored on a pkcs11 device. I can add my key with ssh-add -s /usr/local/lib/opensc-pkcs11.so but ssh-add -s /usr/local/lib/opensc-pkcs11.so ~/.ssh/mykey-cert.pub does not add the certificate to my agent. As far as I undestand, in ssh-add.c line 580 if (pkcs11provider != NULL) { if (update_card(agent_fd,
2017 Oct 26
3
[RFC 0/2] add engine based keys
Engine keys are private key files which are only understood by openssl external engines. ?The problem is they can't be loaded with the usual openssl methods, they have to be loaded via ENGINE_load_private_key(). ?Because they're files, they fit well into openssh pub/private file structure, so they're not very appropriately handled by the pkcs11 interface because it assumes the private
2009 Aug 12
23
[PATCH 0/23] factor and const-correctness
This started as a simple warning-elimination change. I'll get back to that series shortly ;-) It turned into a factorization and constification exercise during which I got a taste of ocaml. Thanks to Rich Jones for help with a few snippets in generator.ml. The overall result is that many previously-manually-maintained bits from daemon/*.c functions are now hoisted into the automatically-
2016 Mar 07
2
[PATCH v2] Use less stack.
GCC has two warnings related to large stack frames. We were already using the -Wframe-larger-than warning, but this reduces the threshold from 10000 to 5000 bytes. However that warning only covers the static part of frames (not alloca). So this change also enables -Wstack-usage=10000 which covers both the static and dynamic usage (alloca and variable length arrays). Multiple changes are made
2017 Jun 03
3
[PATCH 0/3]: daemon: Reimplement ‘file’ API in OCaml.
This patch series is just FYI at the moment. However it does pass the tests. The daemon is a self-contained program. We don't need to write it all in C. Writing parts of it in OCaml would make it simpler and less error-prone. In particular if the daemon was written in a more sane programming language then we could move the inspection code to run entirely inside the appliance, which would
2009 Nov 09
1
use STREQ(a,b), not strcmp(a,b) == 0
...*/ - if (strncmp (p, "tune2fs ", 8) == 0) { + if (STREQLEN (p, "tune2fs ", 8)) { p = strchr (p, '\n'); if (p) p++; else { diff --git a/daemon/file.c b/daemon/file.c index 7854ade..62de116 100644 --- a/daemon/file.c +++ b/daemon/file.c @@ -430,7 +430,7 @@ do_file (const char *path) char *buf; int len; - if (strncmp (path, "/dev/", 5) == 0) + if (STREQLEN (path, "/dev/", 5)) buf = (char *) path; else { buf = sysroot_path (path); diff --git a/daemon/guestfsd.c b/daemon/guestfsd.c index 61a6236..5789fed 100644 --- a/da...
2010 Aug 31
13
[PATCH v2] Add progress bars
This is an updated and extended version of the original patch: https://www.redhat.com/archives/libguestfs/2010-August/msg00163.html This adds OCaml and Perl bindings (both tested), support for progress bars in virt-resize, and adds progress notifications to a number of the simpler commands. Still to do is to add progress messages to more commands. There are still a few commands which would be
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 Mar 06
8
[PATCH 0/5] Use less stack.
Various changes/fixes to use smaller stack frames. Rich.
2012 Aug 30
2
[PATCH v2] daemon: collect list of called external commands
...85 100644 --- a/daemon/file.c +++ b/daemon/file.c @@ -29,6 +29,10 @@ #include "daemon.h" #include "actions.h" +GUESTFSD_EXT_CMD(str_file, file); +GUESTFSD_EXT_CMD(str_zcat, zcat); +GUESTFSD_EXT_CMD(str_bzcat, bzcat); + int do_touch (const char *path) { @@ -473,7 +477,7 @@ do_file (const char *path) const char *flags = is_dev ? "-zbsL" : "-zb"; char *out, *err; - int r = command (&out, &err, "file", flags, path, NULL); + int r = command (&out, &err, str_file, flags, path, NULL); free (buf); if (r == -1) { @@ -50...
2012 Aug 30
1
[PATCH] collect list of called external commands
...86bec 100644 --- a/daemon/file.c +++ b/daemon/file.c @@ -29,6 +29,10 @@ #include "daemon.h" #include "actions.h" +GUESTFS_EXT_CMD(str_file, file); +GUESTFS_EXT_CMD(str_zcat, zcat); +GUESTFS_EXT_CMD(str_bzcat, bzcat); + int do_touch (const char *path) { @@ -473,7 +477,7 @@ do_file (const char *path) const char *flags = is_dev ? "-zbsL" : "-zb"; char *out, *err; - int r = command (&out, &err, "file", flags, path, NULL); + int r = command (&out, &err, str_file, flags, path, NULL); free (buf); if (r == -1) { @@ -50...
2017 Jul 27
0
[PATCH v2] daemon: Remove GUESTFSD_EXT_CMD.
...100644 --- a/daemon/file.c +++ b/daemon/file.c @@ -30,10 +30,6 @@ #include "actions.h" #include "optgroups.h" -GUESTFSD_EXT_CMD(str_file, file); -GUESTFSD_EXT_CMD(str_zcat, zcat); -GUESTFSD_EXT_CMD(str_bzcat, bzcat); - int do_touch (const char *path) { @@ -505,7 +501,7 @@ do_file (const char *path) char *out; CLEANUP_FREE char *err = NULL; - int r = command (&out, &err, str_file, flags, path, NULL); + int r = command (&out, &err, "file", flags, path, NULL); if (r == -1) { free (out); @@ -539,9 +535,9 @@ do_zfile (const char *met...
2017 Jul 24
0
[PATCH 2/2] daemon: Replace GUESTFSD_EXT_CMD with --print-external-commands.
...t;actions.h" #include "optgroups.h" -GUESTFSD_EXT_CMD(str_file, file); -GUESTFSD_EXT_CMD(str_zcat, zcat); -GUESTFSD_EXT_CMD(str_bzcat, bzcat); +DECLARE_EXTERNAL_COMMANDS ("file", "zcat", "bzcat") int do_touch (const char *path) @@ -505,7 +503,7 @@ do_file (const char *path) char *out; CLEANUP_FREE char *err = NULL; - int r = command (&out, &err, str_file, flags, path, NULL); + int r = command (&out, &err, "file", flags, path, NULL); if (r == -1) { free (out); @@ -539,9 +537,9 @@ do_zfile (const char *met...
2017 Jun 03
12
[PATCH v2 00/12] Allow APIs to be implemented in OCaml.
Version 1 was here: https://www.redhat.com/archives/libguestfs/2017-June/msg00003.html This patch series reimplements a few more APIs in OCaml, including some very important core APIs like ?list_filesystems? and ?mount?. All the tests pass after this. The selection of APIs that I have moved may look a little random, but in fact they are all APIs consumed by the inspection code (and some more
2017 Jul 27
3
[PATCH v2] daemon: Remove GUESTFSD_EXT_CMD.
This is a simpler patch that removes GUESTFSD_EXT_CMD completely.
2017 Jul 24
6
[PATCH 0/2] daemon: Replace GUESTFSD_EXT_CMD with --print-external-commands.
Replace GUESTFSD_EXT_CMD with a command line option ‘./guestfsd --print-external-commands’