Displaying 20 results from an estimated 3000 matches similar to: "[PATCH v2 libguestfs] launch: Implement a safer getumask."
2016 Apr 14
2
[PATCH v3 libguestfs] launch: Implement a safer getumask.
The current implementation of getumask involves writing a file with
mode 0777 and then testing what mode was created by the kernel. This
doesn't work properly if the user set a per-mount umask (or fmask/
dmask).
This alternative method was suggested by Josh Stone. By forking, we
can use the thread-unsafe method (calling umask) and pass the result
back over a pipe.
This change also fixes
2016 Apr 13
3
[PATCH libguestfs] launch: Implement a safer getumask.
The current implementation of getumask involves writing a file with
mode 0777 and then testing what mode was created by the kernel. This
doesn't work properly if the user set a per-mount umask (or fmask/
dmask).
This alternative method was suggested by Josh Stone. By forking, we
can use the thread-unsafe method (calling umask) and pass the result
back over a pipe.
This change also fixes
2016 Apr 13
0
Re: [PATCH libguestfs] launch: Implement a safer getumask.
On 04/13/2016 03:43 PM, Richard W.M. Jones wrote:
> The current implementation of getumask involves writing a file with
> mode 0777 and then testing what mode was created by the kernel. This
> doesn't work properly if the user set a per-mount umask (or fmask/
> dmask).
>
> This alternative method was suggested by Josh Stone. By forking, we
> can use the thread-unsafe
2016 Apr 14
0
Re: [PATCH v3 libguestfs] launch: Implement a safer getumask.
On 04/14/2016 03:59 AM, Richard W.M. Jones wrote:
> The current implementation of getumask involves writing a file with
> mode 0777 and then testing what mode was created by the kernel. This
> doesn't work properly if the user set a per-mount umask (or fmask/
> dmask).
>
> This alternative method was suggested by Josh Stone. By forking, we
> can use the thread-unsafe
2016 May 21
1
[PATCH] umask: Use /proc/<PID>/status to read umask in Linux >= 4.7.
Since Linux 4.7, the process umask is available in /proc/<pid>/status.
See:
https://github.com/torvalds/linux/commit/3e42979e65dace1f9268dd5440e5ab096b8dee59
Use this value if available, else fall back to the existing codepath
for Linux <= 4.6 and other Unix.
---
src/umask.c | 86 +++++++++++++++++++++++++++++++++++++++++++++++++++++++------
1 file changed, 78 insertions(+), 8
2016 Apr 14
0
Re: [PATCH v3 libguestfs] launch: Implement a safer getumask.
On 04/14/2016 07:57 AM, Richard W.M. Jones wrote:
> On Thu, Apr 14, 2016 at 07:38:23AM -0600, Eric Blake wrote:
>>> + /* Read the umask. */
>>> + if (read (fd[0], &mask, sizeof mask) != sizeof mask) {
>>> + perrorf (g, "read");
>>> + close (fd[0]);
>>> + return -1;
>>
>> Oops - this strands a child process. You
2016 Apr 14
3
Re: [PATCH v3 libguestfs] launch: Implement a safer getumask.
On Thu, Apr 14, 2016 at 08:04:39AM -0600, Eric Blake wrote:
> On 04/14/2016 07:57 AM, Richard W.M. Jones wrote:
> > On Thu, Apr 14, 2016 at 07:38:23AM -0600, Eric Blake wrote:
> >>> + /* Read the umask. */
> >>> + if (read (fd[0], &mask, sizeof mask) != sizeof mask) {
> >>> + perrorf (g, "read");
> >>> + close (fd[0]);
2016 Apr 14
2
Re: [PATCH v3 libguestfs] launch: Implement a safer getumask.
On Thu, Apr 14, 2016 at 07:38:23AM -0600, Eric Blake wrote:
> > + /* Read the umask. */
> > + if (read (fd[0], &mask, sizeof mask) != sizeof mask) {
> > + perrorf (g, "read");
> > + close (fd[0]);
> > + return -1;
>
> Oops - this strands a child process. You have to reap the child, even
> if the read() failed.
Bleah that was
2016 Apr 14
0
[PATCH] Add safe wrapper around waitpid which deals with EINTR correctly.
Thanks: Eric Blake.
---
src/Makefile.am | 1 +
src/command.c | 7 ++----
src/guestfs-internal.h | 4 +++
src/launch-direct.c | 11 +++------
src/launch-uml.c | 11 +++------
src/umask.c | 10 ++------
src/wait.c | 67 ++++++++++++++++++++++++++++++++++++++++++++++++++
7 files changed, 84 insertions(+), 27 deletions(-)
create mode 100644
2016 Apr 15
0
Re: [PATCH v3 libguestfs] launch: Implement a safer getumask.
BTW this causes valgrind to fail in a particularly strange way. I
filed a bug upstream with a minimal reproducer. Do you have any
ideas?
https://bugs.kde.org/show_bug.cgi?id=361810
Rich.
--
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-p2v converts physical machines to virtual
2016 Feb 09
2
[PATCH 1/2] tmpdirs: centralize permissions handling
Move to lazy_make_tmpdir the logic for making world-readable (but only
for root) newly-created temporary directories, removing the non-fatal
code doing that in guestfs_impl_launch.
Followup of commit 772f649e595d202bdb67f05aeb62157c1104be89.
---
src/launch.c | 7 -------
src/tmpdirs.c | 30 ++++++++++++------------------
2 files changed, 12 insertions(+), 25 deletions(-)
diff --git
2017 Apr 12
0
[PATCH v6 03/10] mllib: ocaml wrapper for lib/osinfo
Provide osinfo database parsing API in OCaml.
---
lib/osinfo.c | 39 +++++++++++++++++++++
mllib/Makefile.am | 11 ++++--
mllib/osinfo-c.c | 103 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
mllib/osinfo.ml | 26 ++++++++++++++
mllib/osinfo.mli | 31 ++++++++++++++++
5 files changed, 208 insertions(+), 2 deletions(-)
create mode 100644 mllib/osinfo-c.c
create mode 100644
2016 May 12
0
[PATCH 3/4] appliance: Move code for creating supermin appliance directory to tmpdirs.c.
This is largely code motion.
---
src/appliance.c | 40 +++++++-----------------------------
src/guestfs-internal.h | 1 +
src/tmpdirs.c | 55 ++++++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 63 insertions(+), 33 deletions(-)
diff --git a/src/appliance.c b/src/appliance.c
index 2cf6374..d293c2b 100644
--- a/src/appliance.c
+++ b/src/appliance.c
@@ -48,7 +48,7
2016 Jan 29
0
[PATCH 6/6] launch: avoid too long paths for sockets
The API for UNIX sockets limits the path to a static size (usually 104
or 108 characters, NULL included), which is internally represented as
UNIX_PATH_MAX. If the temporary directory set is long enough (e.g.
when running tools as uninstalled, using "run") then these socket paths
get trucated, if not even cause failures when binding the sockets.
Introduce a new internal API to create
2017 Mar 03
2
[PATCH 1/2] Use gnulib set_nonblocking_flag function instead of fcntl.
The previous code:
fcntl (fd, F_SETFL, O_NONBLOCK)
was technically incorrect, because it would have reset any
other flags on the file descriptor.
Thanks: Eric Blake
---
bootstrap | 1 +
daemon/inotify.c | 6 ++++--
lib/conn-socket.c | 21 +++++++++++----------
m4/.gitignore | 9 +++++++++
4 files changed, 25 insertions(+), 12 deletions(-)
diff --git a/bootstrap b/bootstrap
2015 Jul 02
0
[PATCH] Fix various -Wformat problems.
Updating gnulib has caused -Wformat-signedness to be enabled. This
has revealed many problems in C format strings. The fixes here fall
into the following main categories:
- Using %d with an unsigned parameter.
- %x and %o expect an unsigned argument.
- uid_t and gid_t are unsigned on Linux. The safe way to print these
is to cast them to uintmax_t and then print then using the %ju
2015 Jul 02
0
[PATCH v2] Fix various -Wformat problems.
Updating gnulib has caused -Wformat-signedness to be enabled. This
has revealed many problems in C format strings. The fixes here fall
into the following main categories:
- Using %d with an unsigned parameter.
- %x and %o expect an unsigned argument.
- uid_t and gid_t are unsigned on Linux. The safe way to print these
is to cast them to uintmax_t and then print them using the %ju
2017 Mar 07
0
[PATCH v4 3/9] mllib: ocaml wrapper for lib/osinfo
Provide osinfo database parsing API in OCAML.
---
lib/osinfo.c | 13 +++++++
mllib/Makefile.am | 11 ++++--
mllib/osinfo-c.c | 100 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
mllib/osinfo.ml | 26 ++++++++++++++
mllib/osinfo.mli | 31 +++++++++++++++++
5 files changed, 179 insertions(+), 2 deletions(-)
create mode 100644 mllib/osinfo-c.c
create mode 100644
2017 Mar 23
0
[PATCH v5 03/10] mllib: ocaml wrapper for lib/osinfo
Provide osinfo database parsing API in OCAML.
---
lib/osinfo.c | 15 ++++++++
mllib/Makefile.am | 11 ++++--
mllib/osinfo-c.c | 102 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
mllib/osinfo.ml | 26 ++++++++++++++
mllib/osinfo.mli | 31 +++++++++++++++++
5 files changed, 183 insertions(+), 2 deletions(-)
create mode 100644 mllib/osinfo-c.c
create mode 100644
2017 Sep 12
0
[PATCH v2 3/5] lib: qemu: Run QMP ‘query-commands’, ‘query-qmp-schema’ against the qemu binary.
This adds two extra tests using QMP (the QEMU Monitor Protocol). This
allows us to get extra information about the qemu binary beyond what
is available from the version number or ‘qemu -help’.
---
lib/qemu.c | 177 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 175 insertions(+), 2 deletions(-)
diff --git a/lib/qemu.c b/lib/qemu.c
index bdd9947a8..34775041f 100644