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>
Wed, 24 Apr 2019 23:30:47 +0000 (19:30 -0400)
commita42089bd2788e4eeb14527c53d9d620fc33141df
tree1f3719d258c64824e6552190160a3ea10c690057
parent9e315de8b7ae99a4918373802e90c001142784a3
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.026726 seconds and 4 git commands to generate.