Richard W.M. Jones
2017-Dec-18 10:50 UTC
[Libguestfs] [PATCH] tmpdirs: Blame systemd because su is broken.
--- lib/tmpdirs.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/tmpdirs.c b/lib/tmpdirs.c index 605bf90fb..bda3ee694 100644 --- a/lib/tmpdirs.c +++ b/lib/tmpdirs.c @@ -24,6 +24,7 @@ #include <stdio.h> #include <stdlib.h> +#include <errno.h> #include <sys/types.h> #include <sys/stat.h> #include <libintl.h> @@ -185,7 +186,12 @@ lazy_make_tmpdir (guestfs_h *g, char *(*getdir) (guestfs_h *g), char **dest) CLEANUP_FREE char *tmpdir = getdir (g); char *tmppath = safe_asprintf (g, "%s/libguestfsXXXXXX", tmpdir); if (mkdtemp (tmppath) == NULL) { - perrorf (g, _("%s: cannot create temporary directory"), tmppath); + int bad_systemd = errno == EACCES && STRPREFIX (tmpdir, "/run/user/"); + + if (!bad_systemd) + perrorf (g, _("%s: cannot create temporary directory"), tmppath); + else + error (g, _("%s: cannot create temporary directory. You may be hitting systemd bug https://bugzilla.redhat.com/967509"), tmppath); free (tmppath); return -1; } -- 2.13.2
Maybe Matching Threads
- [PATCH] tmpdirs: Make the ‘su broken’ error message actionable.
- [PATCH 2/3] lib: extract lazy tmpdir creation helper
- [PATCH 1/2] tmpdirs: centralize permissions handling
- [PATCH 2/4] src/tmpdirs.c: Add internal documentation.
- [PATCH 3/3] New API: get-sockdir