Add mkdirat utils and runas wrappers
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 17 Apr 2019 20:55:27 +0000 (16:55 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 18 Apr 2019 21:26:28 +0000 (17:26 -0400)
commit18710679a8ac57fda5dbd26cf16bb180dce9e286
treeb76f57ead98a4af0fb9de42ba7b7a225b83240c2
parent61159eeb808d6691ec7d9e7c4e84c2057c2d27f2
Add mkdirat utils and runas wrappers

The lttng_directory_handle allows its user to keep a handle to
a directory and to create subdirectories relative to it.

On platforms implementing POSIX.2008, a directory file descriptor
is used to maintain a handle to an existing directory and used
in conjunction with mkdirat() to create subdirectories.

Derelict platforms (such as Solaris 10) use an alternative
implementation which carries the location of the root directory
and builds subdirectory paths on creation.

The existing mkdir utils are re-implemented using this new
interface (using the special AT_FDCWD file descriptor value, when
applicable) to limit code duplication.

The implementation of the directory handle and its users is
automatically selected based on the presence of the dirfd() function,
but can also be explicitly chosen using the --enable/disable-dirfd
configuration option.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
configure.ac
src/common/Makefile.am
src/common/compat/Makefile.am
src/common/compat/directory-handle.c [new file with mode: 0644]
src/common/compat/directory-handle.h [new file with mode: 0644]
src/common/credentials.h [new file with mode: 0644]
src/common/runas.c
src/common/runas.h
src/common/utils.c
src/common/utils.h
This page took 0.025913 seconds and 4 git commands to generate.