search for: sysroot_path

Displaying 20 results from an estimated 181 matches for "sysroot_path".

2014 Jan 28
3
[PATCH 1/2] daemon: If /selinux exists in the guest, bind-mount /sys/fs/selinux to there.
...ar *sysroot_sys; char *sysroot_sys_fs_selinux; - bool dev_ok, dev_pts_ok, proc_ok, sys_ok, sys_fs_selinux_ok; + bool dev_ok, dev_pts_ok, proc_ok, selinux_ok, sys_ok, sys_fs_selinux_ok; }; struct resolver_state { @@ -76,16 +77,18 @@ bind_mount (struct bind_state *bs) bs->sysroot_dev = sysroot_path ("/dev"); bs->sysroot_dev_pts = sysroot_path ("/dev/pts"); bs->sysroot_proc = sysroot_path ("/proc"); + bs->sysroot_selinux = sysroot_path ("/selinux"); bs->sysroot_sys = sysroot_path ("/sys"); bs->sysroot_sys_fs_selinux...
2016 Jan 15
1
[PATCH] daemon: resolve paths for ll and llz
.... 'll /..'). This command is not meant for - * serious use anyway, just for quick interactive sessions. - */ - char * do_ll (const char *path) { int r; char *out; CLEANUP_FREE char *err = NULL; + CLEANUP_FREE char *rpath = NULL; CLEANUP_FREE char *spath = NULL; - spath = sysroot_path (path); + CHROOT_IN; + rpath = realpath (path, NULL); + CHROOT_OUT; + if (rpath == NULL) { + reply_with_perror ("%s", path); + return NULL; + } + + spath = sysroot_path (rpath); if (!spath) { reply_with_perror ("malloc"); return NULL; @@ -131,9 +134,18 @...
2015 Jun 16
1
[PATCH] btrfs: remove unused 'out' variables
...t;%s: %s", subvolume, err); return -1; @@ -1153,7 +1150,6 @@ do_btrfs_qgroup_create (const char *qgroupid, const char *subvolume) size_t i = 0; CLEANUP_FREE char *subvolume_buf = NULL; CLEANUP_FREE char *err = NULL; - CLEANUP_FREE char *out = NULL; int r; subvolume_buf = sysroot_path (subvolume); @@ -1169,7 +1165,7 @@ do_btrfs_qgroup_create (const char *qgroupid, const char *subvolume) ADD_ARG (argv, i, subvolume_buf); ADD_ARG (argv, i, NULL); - r = commandv (&out, &err, argv); + r = commandv (NULL, &err, argv); if (r == -1) { reply_with_error (&qu...
2009 Aug 12
2
[PATCH] If using SELinux, mount /selinux in the appliance
...s_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 ("/sys"); r = command (NULL, NULL, "mount", "--bind...
2014 Jan 28
0
Re: [PATCH 1/2] daemon: If /selinux exists in the guest, bind-mount /sys/fs/selinux to there.
..._sys_fs_selinux; > - bool dev_ok, dev_pts_ok, proc_ok, sys_ok, sys_fs_selinux_ok; > + bool dev_ok, dev_pts_ok, proc_ok, selinux_ok, sys_ok, > sys_fs_selinux_ok; }; > > struct resolver_state { > @@ -76,16 +77,18 @@ bind_mount (struct bind_state *bs) > bs->sysroot_dev = sysroot_path ("/dev"); > bs->sysroot_dev_pts = sysroot_path ("/dev/pts"); > bs->sysroot_proc = sysroot_path ("/proc"); > + bs->sysroot_selinux = sysroot_path ("/selinux"); > bs->sysroot_sys = sysroot_path ("/sys"); > bs-&g...
2014 May 20
14
Re: [PATCH] daemon: scrub-file: resolve the path before calling scrub (RHBZ#1099490).
...y, so I will pull the plug to the conditional usage in some other parts, then. > Is it possible to make this change more generic so in future it could > be applied to other functions? > > - Would it make sense to have a 'sysroot_realpath' library function to > replace 'sysroot_path' in certain functions? Good idea. Do you have also an idea which daemon functions, other than scrub-files and realpath itself, might need such handling? -- Pino Toscano
2016 Jan 21
0
[PATCH v3 1/6] daemon: Rename daemon/command.c -> daemon/sh.c.
...h - * future mount and unmount operations. - * - * We deliberately allow these commands to fail silently, BUT - * if a mount fails, don't unmount the corresponding mount. - */ -static int -bind_mount (struct bind_state *bs) -{ - int r; - - memset (bs, 0, sizeof *bs); - - bs->sysroot_dev = sysroot_path ("/dev"); - bs->sysroot_dev_pts = sysroot_path ("/dev/pts"); - bs->sysroot_proc = sysroot_path ("/proc"); - bs->sysroot_selinux = sysroot_path ("/selinux"); - bs->sysroot_sys = sysroot_path ("/sys"); - bs->sysroot_sys_fs_selinux...
2016 Jul 14
0
[PATCH v2 2/7] New API: setfiles - SELinux relabel parts of the filesystem.
...setfiles (const char *specfile, const char *path, + int force) +{ + const char *argv[MAX_ARGS]; + CLEANUP_FREE char *s_dev = NULL, *s_proc = NULL, *s_selinux = NULL, + *s_sys = NULL, *s_specfile = NULL, *s_path = NULL; + CLEANUP_FREE char *err = NULL; + size_t i = 0; + + s_dev = sysroot_path ("/dev"); + if (!s_dev) { + malloc_error: + reply_with_perror ("malloc"); + return -1; + } + s_proc = sysroot_path ("/proc"); if (!s_proc) goto malloc_error; + s_selinux = sysroot_path ("/selinux"); if (!s_selinux) goto malloc_error; + s_sys...
2014 May 20
2
[PATCH] daemon: scrub-file: resolve the path before calling scrub (RHBZ#1099490).
...not exist or "file" is a symlink pointing + * outside the chroot. + */ + CHROOT_IN; + rp = realpath (file, NULL); + CHROOT_OUT; + if (rp == NULL) { + reply_with_perror ("realpath: %s", file); + return -1; + } + /* Make the path relative to /sysroot. */ - buf = sysroot_path (file); + buf = sysroot_path (rp); if (!buf) { reply_with_perror ("malloc"); return -1; diff --git a/generator/actions.ml b/generator/actions.ml index 0826137..01f6ab5 100644 --- a/generator/actions.ml +++ b/generator/actions.ml @@ -5719,7 +5719,18 @@ manual page for more de...
2014 Apr 14
2
[LLVMdev] Proposal: AArch64/ARM64 merge from EuroLLVM
> - Inline ASM (I think Eric said at the Hackers Lab that he might be > willing to do this) I am, yes. > - For others who want to help test, compiling and running your > codebases on QEMU (no crypto extensions) Some reasonable description of how this works would be awesome. > > - Feature parity - to the level found in the ARM64 and AArch64 backends today As a note this
2017 Aug 03
0
[PATCH 3/6] daemon: Refine check for Device and Dev_or_Path parameters (RHBZ#1477623).
...aemon/utils.mli | 4 +++ daemon/xfs.c | 4 +-- 12 files changed, 107 insertions(+), 21 deletions(-) diff --git a/daemon/daemon.h b/daemon/daemon.h index a40dc3834..02ae34a6f 100644 --- a/daemon/daemon.h +++ b/daemon/daemon.h @@ -62,6 +62,7 @@ extern dev_t root_device; extern char *sysroot_path (const char *path); extern char *sysroot_realpath (const char *path); extern int is_root_device (const char *device); +extern int is_device_parameter (const char *device); extern int xwrite (int sock, const void *buf, size_t len) __attribute__((__warn_unused_result__)); extern int xread (int...
2015 Jun 12
1
[PATCH v2] btrfs: use CLEANUP_FREE_STRING_LIST for list free
...free (ret); if (re) pcre_free (re); @@ -1253,8 +1251,8 @@ do_btrfs_qgroup_show (const char *path) CLEANUP_FREE char *path_buf = NULL; CLEANUP_FREE char *err = NULL; CLEANUP_FREE char *out = NULL; + CLEANUP_FREE_STRING_LIST char **lines = NULL; int r; - char **lines; path_buf = sysroot_path (path); if (path_buf == NULL) { @@ -1323,11 +1321,9 @@ do_btrfs_qgroup_show (const char *path) this->btrfsqgroup_id = line; } - free (lines); return ret; error: - free_stringslen (lines, nr_qgroups + 2); if (ret) free (ret->guestfs_int_btrfsqgroup_list_val); fr...
2009 Aug 12
1
do_umount adjustment
...e 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) { reply_with_perror ("malloc"); return -1; } r = command (NULL, &err, "umount", buf, NULL); if (r == -1) { reply_with_error ("umount: %s: %s", pathordevice, err); free (err); free (buf); return -1;...
2014 Dec 26
10
[PATCH 0/5] btrfs: add API for btrfs filesystem, check and scrub
Hi, There is one problem: btrfs_filesystem_set_label just doesnt work, giving error message: libguestfs: error: btrfs_filesystem_set_label: /: ERROR: unable to set label Bad address I'm almost sure the patch has no problem, but can't figure out what's the cause. So patch 5 is only for review. Other APIs have no problem. Regards, Hu Hu Tao (5): New API: btrfs_scrub New API:
2014 Dec 02
21
[PATCH 0/8] btrfs support part2: qgroup commands
Hi, This series adds support to btrfs qgroup related commands, inclduing quota commands, and two leftover of subvolume commands. Regards, Hu Hu Tao (8): New API: btrfs_subvolume_get_default New API: btrfs_subvolume_show New API: btrfs_quota_enable New API: btrfs_quota_disable New API: btrfs_quota_rescan New API: btrfs_qgroup_limit New API: btrfs_qgroup_create New API:
2015 Jun 23
2
[PATCH] lib: Add optional 'append' parameter to copy-(device|file)-to-file APIs.
...const char *src, const char *dest, int do_copy_device_to_file (const char *src, const char *dest, int64_t srcoffset, int64_t destoffset, int64_t size, - int sparse) + int sparse, int append) { CLEANUP_FREE char *dest_buf = sysroot_path (dest); + int wrflags = O_WRONLY|O_CREAT|O_NOCTTY|O_CLOEXEC; if (!dest_buf) { reply_with_perror ("malloc"); return -1; } - return copy (src, src, dest_buf, dest, DEST_FILE_FLAGS, 0, + if ((optargs_bitmask & GUESTFS_COPY_DEVICE_TO_FILE_APPEND_BITMASK) &&...
2015 Jan 16
18
[PATCH 00/16] btrfs: add support to btrfs scrub, balance, rescue and inspect
Hi, This series adds new APIs to support btrfs scrub, balance, rescue and inspect. Some of them don't have tests because: - btrfs_scrub and btrfs_balance completes too early before we can test btrfs_scrub_cancel, btrfs_scrub_resume, btrfs_scrub_status, btrfs_balance_pause, btrfs_balance_cancel, btrfs_balance_resume and btrfs_balance_status. - can't
2015 Jun 15
7
[PATCH v3 0/3] btrfs: use CLEANUP_FREE_STRING_LIST for list free
As Pino's comment, we should take advantage of macro CLEANUP_FREE_STRING_LIST v3: fix test case failure v2: properly initialize lines Chen Hanxiao (3): do_btrfs_qgroup_show: fix a bad return value do_btrfs_subvolume_list: fix a bad return value btrfs: use CLEANUP_FREE_STRING_LIST for list free daemon/btrfs.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-)
2015 Jan 05
3
Re: [PATCH 5/5] New API: btrfs_filesystem_set_label
...nst char *path, const char *label) > +{ > + const size_t MAX_ARGS = 64; > + const char *argv[MAX_ARGS]; > + size_t i = 0; > + CLEANUP_FREE char *path_buf = NULL; > + CLEANUP_FREE char *err = NULL; > + CLEANUP_FREE char *out = NULL; > + int r; > + > + path_buf = sysroot_path (path); > + if (path_buf == NULL) { > + reply_with_perror ("malloc"); > + return -1; > + } > + > + ADD_ARG (argv, i, str_btrfs); > + ADD_ARG (argv, i, "filesystem"); > + ADD_ARG (argv, i, "label"); > + ADD_ARG (argv, i, path_buf);...
2014 Dec 11
1
Re: [PATCH v2 01/11] daemon: btrfs: add helper functions mount and umount
..._buf. The reason it was initialized to NULL in the previous code was because it was a CLEANUP_FREE function (and those have to be initialized almost always). You have correctly removed CLEANUP_FREE, but not the initialization of NULL. > + if (fs->type == MOUNTABLE_PATH) { > + return sysroot_path (fs->device); There's a whole chunk of code missing in here, starting with: > - if (fs_buf == NULL) { > - reply_with_perror ("malloc"); > - > - cmderror: It seems like it is still necessary to me. > + } else { > + fs_buf = strdup ("/t...