search for: require_root_or_resolve_device

Displaying 15 results from an estimated 15 matches for "require_root_or_resolve_device".

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.
2009 Aug 12
1
do_umount adjustment
Here's one final (I hope) question without a complete patch. Given that I already ensure that stubs.c invokes REQUIRE_ROOT_OR_RESOLVE_DEVICE just before calling do_umount, does this new version of do_umount look ok? /* Again, use the external /bin/umount program, so that /etc/mtab * is kept updated. */ int do_umount (const char *pathordevice) { int r; char *err; char *buf = sysroot_path (pathordevice); if (buf == NULL) {...
2009 Aug 12
1
factorization would be nice
...goto done);\n" n; | Device n -> pr " char *%s = args.%s;\n" n n; pr " RESOLVE_DEVICE (%s, goto done);" n; | Dev_or_Path n -> pr " char *%s = args.%s;\n" n n; pr " REQUIRE_ROOT_OR_RESOLVE_DEVICE (%s, goto done);" n; | String n -> pr " char *%s = args.%s;\n" n n | OptString n -> pr " %s = args.%s ? *args.%s : NULL;\n" n n n | StringList n -> pr " %s = realloc (args.%s.%s_val,\n" n n n;...
2017 Aug 03
0
[PATCH 3/6] daemon: Refine check for Device and Dev_or_Path parameters (RHBZ#1477623).
...\ (path_out) = device_name_translation ((path)); \ if ((path_out) == NULL) { \ const int err = errno; \ @@ -86,7 +81,7 @@ */ #define REQUIRE_ROOT_OR_RESOLVE_DEVICE(path,path_out,is_filein) \ do { \ - if (STREQLEN ((path), "/dev/", 5)) \ + if (is_device_parameter ((path))) \ RESOLVE_DEVICE ((path), (path_out), (is_filein)); \ else {...
2012 Jul 23
3
[PATCH V2 1/4] mount: add a macro to resolve path or device
...13 ++----------- 2 files changed, 18 insertions(+), 11 deletions(-) diff --git a/daemon/daemon.h b/daemon/daemon.h index 85eec45..f7d0c75 100644 --- a/daemon/daemon.h +++ b/daemon/daemon.h @@ -336,6 +336,22 @@ is_zero (const char *buffer, size_t size) } \ } while (0) +/* Same as REQUIRE_ROOT_OR_RESOLVE_DEVICE but this strdup's the result. */ +#define STRDUP_RESOLVE_DEVICE_OR_PATH(path,buf,cancel_stmt,fail_stmt) \ + do { \ + int is_dev; \ + is_dev = STREQLEN (path, "/...
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-
2012 Jul 21
5
[PATCH 1/5] mount: add a macro to resolve path or device
Add a macro DUP_RESOLVE_DEVICE_OR_PATH to resolve path or device. Signed-off-by: Wanlong Gao <gaowanlong at cn.fujitsu.com> --- daemon/daemon.h | 18 ++++++++++++++++++ daemon/mount.c | 13 ++----------- po/POTFILES | 8 ++++++++ 3 files changed, 28 insertions(+), 11 deletions(-) diff --git a/daemon/daemon.h b/daemon/daemon.h index 85eec45..39cc3f3 100644 --- a/daemon/daemon.h +++
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 Feb 07
12
[PATCH 01/12] generator: Add new Mountable argument type
This type is initially identical to Device. --- generator/bindtests.ml | 2 +- generator/c.ml | 7 +++++-- generator/csharp.ml | 6 ++++-- generator/daemon.ml | 4 ++-- generator/erlang.ml | 6 +++--- generator/fish.ml | 8 ++++---- generator/gobject.ml | 11 ++++++----- generator/haskell.ml | 11 +++++++---- generator/java.ml | 10 +++++-----
2013 Jan 24
3
[REVIEW ONLY] Mountable patches
These 3 patches implement support for APIs which must accept a mountable, but don't update apis which must return mountables. Matt
2009 Nov 09
1
use STREQ(a,b), not strcmp(a,b) == 0
...| 2 +- test-tool/test-tool.c | 2 +- 13 files changed, 21 insertions(+), 21 deletions(-) diff --git a/daemon/daemon.h b/daemon/daemon.h index 1cdb480..ac68479 100644 --- a/daemon/daemon.h +++ b/daemon/daemon.h @@ -184,7 +184,7 @@ extern void reply (xdrproc_t xdrp, char *ret); */ #define REQUIRE_ROOT_OR_RESOLVE_DEVICE(path,fail_stmt) \ do { \ - if (strncmp ((path), "/dev/", 5) == 0) \ + if (STREQLEN ((path), "/dev/", 5)) \ RESOLVE_DEVICE ((path), fail_stmt); \ else { \ NEED_ROOT (fail_stmt); \ diff --git a/daemon/devsparts.c b/daemon/...
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.
2017 Aug 03
9
[PATCH 0/6] tests: Fix handling of device API parameters (RHBZ#1477623).
https://bugzilla.redhat.com/show_bug.cgi?id=1477623 The first two patches are cleanups. The third patch changes the way that we handle Device and Dev_or_Path parameters so that a parameter marked as such can really only contain a block device name (and not, for instance, a chardev). Using a chardev here caused hangs in the API. The next two patches fix API usage to conform to this new stricter
2017 Apr 21
0
[PATCH 1/2] generator: Simplify the handling of string parameters.
...rgs.%s, %s, %b);\n" n n is_filein; - | Mountable n -> + | String (Mountable, n) -> pr " RESOLVE_MOUNTABLE (args.%s, %s, %b);\n" n n is_filein; - | Dev_or_Path n -> + | String (Dev_or_Path, n) -> pr " REQUIRE_ROOT_OR_RESOLVE_DEVICE (args.%s, %s, %b);\n" n n is_filein; - | Mountable_or_Path n -> + | String (Mountable_or_Path, n) -> pr " REQUIRE_ROOT_OR_RESOLVE_MOUNTABLE (args.%s, %s, %b);\n" n n is_filein; - | String n | Key n | G...
2017 Apr 21
4
[PATCH 0/2] generator: Simplify the handling of string parameters.
Very large but mechanical change to the generator. Rich.