search for: need_root

Displaying 20 results from an estimated 32 matches for "need_root".

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-
2017 Apr 20
6
[PATCH 0/5] generator: daemon: Various simplifications to stubs code.
This is a series of simplifications to the stubs code. It's all refactoring, there is no functional change. Rich.
2014 Jan 24
2
[PATCH] fuse: In mount-local-run, test if root filesystem has been mounted (RHBZ#1057504).
...ount the root filesystem libguestfs: error: lstat: lstat_stub: you must call 'mount' first to mount the root filesystem With this commit, the mount-local-run call gives an error. The error is implemented by calling guestfs_exists (g, "/") which has the side effect of running the NEED_ROOT macro in the daemon. (There is no simple equivalent of NEED_ROOT on the library side.) --- src/fuse.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/fuse.c b/src/fuse.c index dd4f139..c22cbba 100644 --- a/src/fuse.c +++ b/src/fuse.c @@ -1028,6 +1028,12 @@ guestfs__mount_local_run (...
2009 Aug 13
7
[PATCHx7] Misc patches
....org/fedora_mingw -------------- next part -------------- >From 9beb53ca567147aa2cd03c8e68b11706bc284713 Mon Sep 17 00:00:00 2001 From: Richard Jones <rjones at trick.home.annexia.org> Date: Thu, 13 Aug 2009 14:37:43 +0100 Subject: [PATCH 1/7] do_equal does not need to explicitly check for NEED_ROOT/ABS_PATH. --- daemon/cmp.c | 4 ---- 1 files changed, 0 insertions(+), 4 deletions(-) diff --git a/daemon/cmp.c b/daemon/cmp.c index 56717c5..2b7e33b 100644 --- a/daemon/cmp.c +++ b/daemon/cmp.c @@ -34,10 +34,6 @@ do_equal (const char *file1, const char *file2) char *err; int r; - NE...
2009 Aug 11
1
[PATCH libguestfs] daemon/ls: make do_ll require root, like all the rest
per IRC discussion, >From a1d982bf49e166341096902fc4c103d4397ce0e3 Mon Sep 17 00:00:00 2001 From: Jim Meyering <meyering at redhat.com> Date: Tue, 11 Aug 2009 13:16:27 +0200 Subject: [PATCH libguestfs] daemon/ls: make do_ll require root, like all the rest * ls.c (do_ll): Do invoke "NEED_ROOT" here, and add a FIXME to provide a "debug ll" command with the semantics we're removing. --- daemon/ls.c | 16 +++++++++------- 1 files changed, 9 insertions(+), 7 deletions(-) diff --git a/daemon/ls.c b/daemon/ls.c index 4d4714e..90db3e3 100644 --- a/daemon/ls.c +++ b/daemo...
2014 Jan 24
0
Re: [PATCH] fuse: In mount-local-run, test if root filesystem has been mounted (RHBZ#1057504).
...estfs: error: lstat: lstat_stub: you > must call 'mount' first to mount the root filesystem > > With this commit, the mount-local-run call gives an error. > > The error is implemented by calling guestfs_exists (g, "/") which has > the side effect of running the NEED_ROOT macro in the daemon. (There > is no simple equivalent of NEED_ROOT on the library side.) > --- > src/fuse.c | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/src/fuse.c b/src/fuse.c > index dd4f139..c22cbba 100644 > --- a/src/fuse.c > +++ b/src/fuse.c >...
2009 Aug 10
2
daemon/ warnings
...index 1b90f2b..8bb8ed2 100644 --- a/daemon/inotify.c +++ b/daemon/inotify.c @@ -33,7 +33,7 @@ static int inotify_fd = -1; static char inotify_buf[64*1024*1024]; /* Event buffer, [0..posn-1] is valid */ -static int inotify_posn = 0; +static size_t inotify_posn = 0; /* Because inotify_init does NEED_ROOT, NEED_INOTIFY implies NEED_ROOT. */ #define NEED_INOTIFY(errcode) \ @@ -184,7 +184,8 @@ do_inotify_read (void) while (space > 0) { struct inotify_event *event; - int n, r; + int r; + size_t n; r = read (inotify_fd, inotify_buf + inotify_posn, sizeof (...
2009 Aug 12
2
[PATCH] If using SELinux, mount /selinux in the appliance
..., *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, sys_ok; /* We need a root filesystem mounted to do this. */ NEED_ROOT (NULL); @@ -57,6 +58,7 @@ do_command (char **argv) sysroot_dev = sysroot_path ("/dev"); sysroot_dev_pts = sysroot_path ("/dev/pts"); sysroot_proc = sysroot_path ("/proc"); + sysroot_selinux = sysroot_path ("/selinux"); sysroot_sys = sysroot_path...
2009 Aug 11
1
[PATCH libguestfs] generator.ml: constify do_mkdtemp
...changed, 11 insertions(+), 24 deletions(-) diff --git a/daemon/dir.c b/daemon/dir.c index ad1c7c9..21ae07e 100644 --- a/daemon/dir.c +++ b/daemon/dir.c @@ -185,31 +185,20 @@ do_is_dir (const char *path) } char * -do_mkdtemp (char *template) +do_mkdtemp (const char *template) { - char *r; - - NEED_ROOT (return NULL); - ABS_PATH (template, return NULL); + char *r = strdup (template); + if (r == NULL) { + reply_with_perror ("strdup"); + return NULL; + } CHROOT_IN; - r = mkdtemp (template); + r = mkdtemp (r); CHROOT_OUT; - if (r == NULL) { + if (r == NULL) reply_...
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
2011 Jan 26
1
Connecting to existing guests / guestfsd
...protocol. At the moment we are fairly free about changing the protocol in ways which are not backwards-compatible. If the daemon is embedded in guests then we couldn't change the protocol freely (at least not without requiring everyone to upgrade). (c) Need to change how the NEED_ROOT macro works so it consults /proc/self/mountinfo instead of using a global flag. This is a sensible change to make anyway since having the global flag has caused us a series of other problems. [See also libguestfs.org/TODO.txt] (d) Need to port the daemon to Windows properly. (e)...
2016 Jan 21
0
[PATCH v3 1/6] daemon: Rename daemon/command.c -> daemon/sh.c.
...rgv) -{ - 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 do this. */ - NEED_ROOT (, return NULL); - - /* Conveniently, argv is already a NULL-terminated argv-style array - * of parameters, so we can pass it straight in to our internal - * commandv. We just have to check the list is non-empty. - */ - if (argv[0] == NULL) { - reply_with_error ("passed an empty li...
2012 Feb 01
1
[PATCH] Clarify the error message when unavailable functions are called (RHBZ#679737).
From: "Richard W.M. Jones" <rjones at redhat.com> Callers are supposed to use the availability API to check for functions that may not be available in particular builds of libguestfs. If they don't do this, currently they tend to get obscure error messages, eg: libguestfs: error: zerofree: /dev/vda1: zerofree: No such file or directory This commit changes the error
2017 Aug 03
0
[PATCH 3/6] daemon: Refine check for Device and Dev_or_Path parameters (RHBZ#1477623).
..._filein) \ do { \ - if (STREQLEN ((path), "/dev/", 5)) \ + if (is_device_parameter ((path))) \ RESOLVE_DEVICE ((path), (path_out), (is_filein)); \ else { \ NEED_ROOT ((is_filein), return); \ @@ -105,7 +100,7 @@ */ #define REQUIRE_ROOT_OR_RESOLVE_MOUNTABLE(string, mountable, is_filein) \ do { \ - if (STRPREFIX ((string), "/dev/") || (string)[0] !=...
2012 Aug 30
2
[PATCH v2] daemon: collect list of called external commands
...v[2+i] = argv[i]; diff --git a/daemon/df.c b/daemon/df.c index 14954d2..e723685 100644 --- a/daemon/df.c +++ b/daemon/df.c @@ -27,6 +27,8 @@ #include "daemon.h" #include "actions.h" +GUESTFSD_EXT_CMD(str_df, df); + char * do_df (void) { @@ -35,7 +37,7 @@ do_df (void) NEED_ROOT (, return NULL); - r = command (&out, &err, "df", NULL); + r = command (&out, &err, str_df, NULL); if (r == -1) { reply_with_error ("%s", err); free (out); @@ -56,7 +58,7 @@ do_df_h (void) NEED_ROOT (, return NULL); - r = command (&ou...
2012 Aug 30
1
[PATCH] collect list of called external commands
...gv[2+i] = argv[i]; diff --git a/daemon/df.c b/daemon/df.c index 14954d2..ad71e05 100644 --- a/daemon/df.c +++ b/daemon/df.c @@ -27,6 +27,8 @@ #include "daemon.h" #include "actions.h" +GUESTFS_EXT_CMD(str_df, df); + char * do_df (void) { @@ -35,7 +37,7 @@ do_df (void) NEED_ROOT (, return NULL); - r = command (&out, &err, "df", NULL); + r = command (&out, &err, str_df, NULL); if (r == -1) { reply_with_error ("%s", err); free (out); @@ -56,7 +58,7 @@ do_df_h (void) NEED_ROOT (, return NULL); - r = command (&ou...
2017 Jul 27
0
[PATCH v2] daemon: Remove GUESTFSD_EXT_CMD.
...i] = argv[i]; diff --git a/daemon/df.c b/daemon/df.c index 80b765f30..1b68a7b55 100644 --- a/daemon/df.c +++ b/daemon/df.c @@ -27,8 +27,6 @@ #include "daemon.h" #include "actions.h" -GUESTFSD_EXT_CMD(str_df, df); - char * do_df (void) { @@ -38,7 +36,7 @@ do_df (void) NEED_ROOT (0, return NULL); - r = command (&out, &err, str_df, NULL); + r = command (&out, &err, "df", NULL); if (r == -1) { reply_with_error ("%s", err); free (out); @@ -57,7 +55,7 @@ do_df_h (void) NEED_ROOT (0, return NULL); - r = command (&...
2017 Jul 24
0
[PATCH 2/2] daemon: Replace GUESTFSD_EXT_CMD with --print-external-commands.
...daemon/df.c index 80b765f30..b6578c6d4 100644 --- a/daemon/df.c +++ b/daemon/df.c @@ -27,7 +27,7 @@ #include "daemon.h" #include "actions.h" -GUESTFSD_EXT_CMD(str_df, df); +DECLARE_EXTERNAL_COMMANDS ("df") char * do_df (void) @@ -38,7 +38,7 @@ do_df (void) NEED_ROOT (0, return NULL); - r = command (&out, &err, str_df, NULL); + r = command (&out, &err, "df", NULL); if (r == -1) { reply_with_error ("%s", err); free (out); @@ -57,7 +57,7 @@ do_df_h (void) NEED_ROOT (0, return NULL); - r = command (&...
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
2013 Aug 24
67
[PATCH 00/67] Proposed patches for libguestfs 1.22.6.
In the kernel and qemu communities it is routine for patches that will be backported to stable branches to be posted for review. I'm proposing we do the same for libguestfs stable branches. All of the attached have been tested with 'make check-release'. Rich.