Displaying 7 results from an estimated 7 matches for "jaburek".
2016 May 21
1
[PATCH] umask: Use /proc/<PID>/status to read umask in Linux >= 4.7.
...quot;getumask(3)"
+ * call.
+ *
+ * We use C<Umask> from F</proc/I<PID>/status> for Linux E<ge> 4.7.
+ * For older Linux and other Unix, this file implements an expensive
+ * but thread-safe way to get the current process's umask.
+ *
+ * Thanks to: Josh Stone, Jiri Jaburek, Eric Blake.
*/
#include <config.h>
#include <stdio.h>
#include <stdlib.h>
+#include <stdbool.h>
#include <unistd.h>
#include <fcntl.h>
#include <errno.h>
@@ -35,21 +45,81 @@
#include "guestfs.h"
#include "guestfs-internal.h&quo...
2016 Apr 13
3
[PATCH libguestfs] launch: Implement a safer getumask.
...ggested 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 another problem: mode_t is unsigned, so cannot
be used to return an error indication (ie. -1). Return a plain int
instead.
Thanks: Josh Stone, Jiri Jaburek, Eric Blake.
---
src/Makefile.am | 1 +
src/guestfs-internal.h | 3 ++
src/launch.c | 41 ++----------------
src/umask.c | 112 +++++++++++++++++++++++++++++++++++++++++++++++++
4 files changed, 120 insertions(+), 37 deletions(-)
create mode 100644 src/umask.c
di...
2016 Apr 13
0
Re: [PATCH libguestfs] launch: Implement a safer getumask.
...gt; can use the thread-unsafe method (calling umask) and pass the result
> back over a pipe.
>
> This change also fixes another problem: mode_t is unsigned, so cannot
> be used to return an error indication (ie. -1). Return a plain int
> instead.
>
> Thanks: Josh Stone, Jiri Jaburek, Eric Blake.
> ---
> +/**
> + * glibc documents, but does not actually implement, a L<getumask(3)>
> + * call.
> + *
> + * This function implements an expensive, but thread-safe way to get
> + * the current process's umask.
> + *
> + * Returns the current proce...
2016 Apr 14
2
[PATCH v3 libguestfs] launch: Implement a safer getumask.
...ggested 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 another problem: mode_t is unsigned, so cannot
be used to return an error indication (ie. -1). Return a plain int
instead.
Thanks: Josh Stone, Jiri Jaburek, Eric Blake.
---
docs/C_SOURCE_FILES | 1 +
po/POTFILES | 1 +
src/Makefile.am | 1 +
src/guestfs-internal.h | 3 ++
src/launch.c | 41 ++----------------
src/umask.c | 110 +++++++++++++++++++++++++++++++++++++++++++++++++
6 files changed, 120 in...
2016 Apr 13
1
[PATCH v2 libguestfs] launch: Implement a safer getumask.
...ggested 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 another problem: mode_t is unsigned, so cannot
be used to return an error indication (ie. -1). Return a plain int
instead.
Thanks: Josh Stone, Jiri Jaburek, Eric Blake.
---
src/Makefile.am | 1 +
src/guestfs-internal.h | 3 ++
src/launch.c | 41 ++--------------
src/umask.c | 128 +++++++++++++++++++++++++++++++++++++++++++++++++
4 files changed, 136 insertions(+), 37 deletions(-)
create mode 100644 src/umask.c
diff...
2016 Apr 14
0
Re: [PATCH v3 libguestfs] launch: Implement a safer getumask.
...gt; can use the thread-unsafe method (calling umask) and pass the result
> back over a pipe.
>
> This change also fixes another problem: mode_t is unsigned, so cannot
> be used to return an error indication (ie. -1). Return a plain int
> instead.
>
> Thanks: Josh Stone, Jiri Jaburek, Eric Blake.
> ---
> +guestfs_int_getumask (guestfs_h *g)
> +{
> + if (pid == 0) {
> + /* The child process must ONLY call async-safe functions. */
> + close (fd[0]);
> +
> + /* umask can't fail. */
> + mask = umask (0);
> +
> + if (write (fd[1...
2016 Aug 08
0
ANNOUNCE: libguestfs 1.34 released
...al page.
A safe "getumask" function has been added. For recent Linux kernels
this uses the newly added "Umask" field in /proc/self/status. For
older Linux and other Unix, this uses a thread-safe technique involving
fork(2) (thanks: Josh Stone, Jiri Jaburek, Eric Blake).
Safe posix_fadvise(2) wrappers have been added, and more hints have
been added to the code which may make a minor difference to
performance.
A safe wrapper around waitpid(2) has been added which handles "INTR"
properly.
"podw...