search for: do_command

Displaying 20 results from an estimated 48 matches for "do_command".

2013 Aug 18
2
missing mount cmd confuses guestfish
...#39; for help on commands 'man' to read the manual 'quit' to quit the shell ><fs> add-drive /dev/shm/olaf/vdisk-sles11sp2_full_fate310510-disk0 ><fs> launch 100% ??? 00:00 ><fs> sh "cd / ; chroot / ; /bin/pwd" libguestfs: error: sh: do_command: you must call 'mount' first to mount the root filesystem ><fs> mount /dev/sda2 / libguestfs: error: mount: call launch before using this function\n(in guestfish, don't forget to use the 'run' command) ><fs> launch libguestfs: error: you must call guestfs_add_d...
2015 Nov 19
5
[PATCH] daemon: always provide stdin when running chroot commands (RHBZ#1280029)
...4 --- a/daemon/command.c +++ b/daemon/command.c @@ -23,6 +23,8 @@ #include <stdbool.h> #include <string.h> #include <sys/stat.h> +#include <sys/types.h> +#include <fcntl.h> #include "guestfs_protocol.h" #include "daemon.h" @@ -242,7 +244,7 @@ do_command (char *const *argv) { char *out; CLEANUP_FREE char *err = NULL; - int r; + int r, fd, flags; CLEANUP_BIND_STATE struct bind_state bind_state = { .mounted = false }; CLEANUP_RESOLVER_STATE struct resolver_state resolver_state = { .mounted = false }; @@ -259,6 +261,17 @@ do_comman...
2015 Dec 02
3
[PATCH] daemon: improve internal commandrvf
...----------- daemon/daemon.h | 1 + daemon/guestfsd.c | 39 +++++++++++++++++++++++++++++++-------- 3 files changed, 34 insertions(+), 23 deletions(-) diff --git a/daemon/command.c b/daemon/command.c index 27a4d0c..c4efa5b 100644 --- a/daemon/command.c +++ b/daemon/command.c @@ -244,7 +244,7 @@ do_command (char *const *argv) { char *out; CLEANUP_FREE char *err = NULL; - int r, dev_null_fd, flags; + int r, flags; CLEANUP_BIND_STATE struct bind_state bind_state = { .mounted = false }; CLEANUP_RESOLVER_STATE struct resolver_state resolver_state = { .mounted = false }; @@ -261,17 +26...
2013 Aug 22
1
Re: missing mount cmd confuses guestfish
...by accident, with 1.22.5 causes a crash: > > > # guestfish -r -v --network > ><fs> add-drive /work/kvm/images/opensuse12.3/disk0.raw > ><fs> launch > > ><fs> sh "ip a" > guestfsd: main_loop: new request, len 0x30 > guestfsd: error: do_command: you must call 'mount' first to mount the root filesystem > *** glibc detected *** guestfsd: free(): invalid pointer: 0x00007fffd8425ba0 *** > libguestfs: error: sh: do_command: you must call 'mount' first to mount the root filesystem > ><fs> mount /de======= Backt...
2015 Nov 20
0
Re: [PATCH] daemon: always provide stdin when running chroot commands (RHBZ#1280029)
...t; @@ -23,6 +23,8 @@ > #include <stdbool.h> > #include <string.h> > #include <sys/stat.h> > +#include <sys/types.h> > +#include <fcntl.h> > > #include "guestfs_protocol.h" > #include "daemon.h" > @@ -242,7 +244,7 @@ do_command (char *const *argv) > { > char *out; > CLEANUP_FREE char *err = NULL; > - int r; > + int r, fd, flags; > CLEANUP_BIND_STATE struct bind_state bind_state = { .mounted = false }; > CLEANUP_RESOLVER_STATE struct resolver_state resolver_state = > { .mounted =...
2015 Dec 02
0
Re: [PATCH] daemon: improve internal commandrvf
...t; daemon/guestfsd.c | 39 +++++++++++++++++++++++++++++++-------- > 3 files changed, 34 insertions(+), 23 deletions(-) > > diff --git a/daemon/command.c b/daemon/command.c > index 27a4d0c..c4efa5b 100644 > --- a/daemon/command.c > +++ b/daemon/command.c > @@ -244,7 +244,7 @@ do_command (char *const *argv) > { > char *out; > CLEANUP_FREE char *err = NULL; > - int r, dev_null_fd, flags; > + int r, flags; > CLEANUP_BIND_STATE struct bind_state bind_state = { .mounted = false }; > CLEANUP_RESOLVER_STATE struct resolver_state resolver_state = >...
2016 Jan 21
0
[PATCH v3 1/6] daemon: Rename daemon/command.c -> daemon/sh.c.
...esolv_conf_old, - rs->sysroot_etc_resolv_conf) == -1) - perror ("error: could not restore /etc/resolv.conf"); - - free (rs->sysroot_etc_resolv_conf_old); - } - - free (rs->sysroot_etc_resolv_conf); - rs->mounted = false; - } -} - -char * -do_command (char *const *argv) -{ - char *out; - CLEANUP_FREE char *err = NULL; - int r, flags; - CLEANUP_BIND_STATE struct bind_state bind_state = { .mounted = false }; - CLEANUP_RESOLVER_STATE struct resolver_state resolver_state = - { .mounted = false }; - - /* We need a root filesystem mounted to...
2009 Aug 12
2
[PATCH] If using SELinux, mount /selinux in the appliance
...f. The kernel pulls mkinitrd and plymouth which pulls in # all of Python. Sheez. (cd initramfs && find -name '*plymouth*' -print0) | diff --git a/daemon/command.c b/daemon/command.c index 0399255..3261513 100644 --- a/daemon/command.c +++ b/daemon/command.c @@ -31,8 +31,9 @@ do_command (char **argv) { char *out, *err; int r; - char *sysroot_proc, *sysroot_dev, *sysroot_dev_pts, *sysroot_sys; - int proc_ok, dev_ok, dev_pts_ok, sys_ok; + char *sysroot_dev, *sysroot_dev_pts, *sysroot_proc, + *sysroot_selinux, *sysroot_sys; + int dev_ok, dev_pts_ok, proc_ok, selinux_ok,...
2013 Aug 22
0
Re: missing mount cmd confuses guestfish
...stfish (1.20.4 on sles11sp3) Doing the same, by accident, with 1.22.5 causes a crash: # guestfish -r -v --network ><fs> add-drive /work/kvm/images/opensuse12.3/disk0.raw ><fs> launch ><fs> sh "ip a" guestfsd: main_loop: new request, len 0x30 guestfsd: error: do_command: you must call 'mount' first to mount the root filesystem *** glibc detected *** guestfsd: free(): invalid pointer: 0x00007fffd8425ba0 *** libguestfs: error: sh: do_command: you must call 'mount' first to mount the root filesystem ><fs> mount /de======= Backtrace: =========...
2015 Dec 01
2
Re: [PATCH] daemon: always provide stdin when running chroot commands (RHBZ#1280029)
...ows. > I have to confess to ignorance about this project, I only found it after seeing a suspicious commit in dnf. However, your description does not look right. The code seems to assume it is possible to execve binaries in a chroot, which for practical purposes means linux binaries. Further, do_command sets up /etc/resolv.conf for the "guest". My argument is that executing linux binaries in an environment without properly populated /dev is a recipe for trouble and will one day come back with weird failures or improperly constructed images. > > CHROOT_IN/OUT around commandvf are...
2013 Aug 18
3
missing chdir before chroot in guestfsd
daemon.c does just a chroot, without chdir. The result is that pwd does not work correctly (it causes fs/dcache.c:prepend_unreachable() to add the unreachable string). A workaround is to add "cd /" before each sh command. ><fs> mount /dev/sda2 / ><fs> sh "cd / ; chroot / ; /bin/pwd" / ><fs> sh "/bin/pwd" (unreachable)/ ><fs> sh
2020 Jul 19
3
[Bug 1444] New: nftables-0.9.6 crashes on some set notations:
...table=0x55637f6eb3d0, octx=0x55637f6e52c0) at rule.c:1387 #11 0x00007f30cec2f981 in do_list_table (ctx=0x7fff2a98d110, cmd=0x55637f6ec290, table=0x55637f6eb3d0) at rule.c:1770 #12 0x00007f30cec31ce3 in do_list_ruleset (ctx=0x7fff2a98d110, cmd=0x55637f6ec290) at rule.c:2405 #13 0x00007f30cec32289 in do_command_list (ctx=0x7fff2a98d110, cmd=0x55637f6ec290) at rule.c:2527 #14 0x00007f30cec32bc4 in do_command (ctx=0x7fff2a98d110, cmd=0x55637f6ec290) at rule.c:2753 #15 0x00007f30cec6faf5 in nft_netlink (nft=0x55637f6e52a0, cmds=0x7fff2a98d1c0, msgs=0x7fff2a98d1b0, nf_sock=0x55637f6e5f30) at libnftables.c:42...
2019 Sep 15
3
[Bug 1365] New: nft crashes in chain_print_declaration()
...:1295 #5 0x00007fc1b9afc04d in do_list_table (ctx=0x7ffc919cdfe0, cmd=0x561fc75ec500, table=0x561fc75ebdb0) at ../../../nftables/src/rule.c:1645 #6 0x00007fc1b9afe014 in do_list_ruleset (ctx=0x7ffc919cdfe0, cmd=0x561fc75ec500) at ../../../nftables/src/rule.c:2208 #7 0x00007fc1b9afe5bc in do_command_list (ctx=0x7ffc919cdfe0, cmd=0x561fc75ec500) at ../../../nftables/src/rule.c:2330 #8 0x00007fc1b9afef56 in do_command (ctx=0x7ffc919cdfe0, cmd=0x561fc75ec500) at ../../../nftables/src/rule.c:2572 #9 0x00007fc1b9b363e2 in nft_netlink (nft=0x561fc75eb2a0, cmds=0x7ffc919ce090, msgs=0x7ffc91...
2015 Dec 01
1
Re: [PATCH] daemon: always provide stdin when running chroot commands (RHBZ#1280029)
...h_perror ("/dev/null"); > + return NULL; > + } > + I disagree with this (see below). > if (bind_mount (&bind_state) == -1) > return NULL; nit: this leaks the fd on error, but it may not matter much. > if (enable_network) { > @@ -266,8 +279,10 @@ do_command (char *const *argv) > return NULL; > } > nit: same. > + flags = COMMAND_FLAG_CHROOT_COPY_FILE_TO_STDIN | fd; > + > CHROOT_IN; > - r = commandv (&out, &err, (const char * const *) argv); > + r = commandvf (&out, &err, flags, (const char * c...
2007 Jun 13
1
seleniumrc_fu initial test issue
...r/?cmd=getNewBrowserSession&1= %2Afirefox&2=http%3A%2F%2Flocalhost%3A4000 RESULT: E Finished in 0.160018 seconds. 1) Error: test_home(SimpleTest): SeleniumCommandError: /Volumes/Data/Projects/esco/config/../vendor/plugins/seleniumrc_fu/ lib/selenium/version_0_8_1/selenium.rb:156:in `do_command'' /users/lattam/src/lib/ruby/1.8/timeout.rb:56:in `timeout'' /users/lattam/src/lib/ruby/1.8/timeout.rb:76:in `timeout'' --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rai...
2016 Oct 20
2
[Bug 1092] New: nft v0.6 segfault in must_print_eq_op at expression.c:520 during 'nft monitor trace' in netdev filter
...bufsiz = 16777216 buf = <error reading variable buf (value requires 69631 bytes, which is more than max-value-size)> ret = 176 #8 0x00000047a6a09989 in netlink_monitor (monhandler=monhandler at entry=0x3cc19177bd0) at netlink.c:2483 No locals. #9 0x00000047a69f913a in do_command_monitor (cmd=<optimized out>, ctx=0x3cc19177c70) at rule.c:1327 t = <optimized out> s = <optimized out> monhandler = {monitor_flags = 131437, format = 0, ctx = 0x3cc19177c70, loc = 0x47a8a0c4e0, cache_needed = true} #10 do_command (ctx=0x3cc19177c70, cmd=&l...
2020 Feb 07
0
[RFC PATCH v7 41/78] KVM: introspection: add KVMI_VM_CHECK_COMMAND and KVMI_VM_CHECK_EVENT
..._64/kvmi_test.c @@ -201,6 +201,59 @@ static void test_cmd_get_version(void) DEBUG("KVMI version: %u\n", rpl.version); } +static int cmd_check_command(__u16 id) +{ + struct { + struct kvmi_msg_hdr hdr; + struct kvmi_vm_check_command cmd; + } req = {}; + + req.cmd.id = id; + + return do_command(KVMI_VM_CHECK_COMMAND, &req.hdr, sizeof(req), NULL, + 0); +} + +static void test_cmd_check_command(void) +{ + __u16 valid_id = KVMI_GET_VERSION; + __u16 invalid_id = 0xffff; + int r; + + r = cmd_check_command(valid_id); + TEST_ASSERT(r == 0, + "KVMI_VM_CHECK_COMMAND failed, error %...
2020 Jul 21
0
[PATCH v9 42/84] KVM: introspection: add KVMI_VM_CHECK_COMMAND and KVMI_VM_CHECK_EVENT
...%u\n", rpl.version); } +static void cmd_vm_check_command(__u16 id, __u16 padding, int expected_err) +{ + struct { + struct kvmi_msg_hdr hdr; + struct kvmi_vm_check_command cmd; + } req = {}; + int r; + + req.cmd.id = id; + req.cmd.padding1 = padding; + req.cmd.padding2 = padding; + + r = do_command(KVMI_VM_CHECK_COMMAND, &req.hdr, sizeof(req), NULL, 0); + TEST_ASSERT(r == expected_err, + "KVMI_VM_CHECK_COMMAND failed, error %d (%s), expected %d\n", + -r, kvm_strerror(-r), expected_err); +} + +static void test_cmd_vm_check_command(void) +{ + __u16 valid_id = KVMI_GET_VERSION, i...
2009 Aug 17
13
total warning-removal for daemon/
The warnings in daemon were aggravating and risky for development (too easy to miss new ones) so I spent some time last week and today working on removing them. The first patch gets us down to almost no warnings with the original -Wall setting. That was by far the hardest part. Once I'd done that, I enabled nearly all of gcc's warnings via gnulib's warnings and manywarnings modules
2003 Aug 23
1
[Bug 117] register_target() creates circular linked list
https://bugzilla.netfilter.org/cgi-bin/bugzilla/show_bug.cgi?id=117 ------- Additional Comments From laforge@netfilter.org 2003-08-23 22:24 ------- I'm not sure if I understand you correctly. How does register_target create a circular list? initially, iptables_targets == NULL. then you register the first target (t), and you set t->next = iptables_targets (== NULL), and then point