git.annexia.org
/
libguestfs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5f76f42
)
In daemon, set PATH, SHELL and LANG environment variables.
author
Richard Jones
<rjones@trick.home.annexia.org>
Fri, 22 May 2009 09:52:43 +0000
(10:52 +0100)
committer
Richard Jones
<rjones@trick.home.annexia.org>
Fri, 22 May 2009 09:52:43 +0000
(10:52 +0100)
daemon/guestfsd.c
patch
|
blob
|
history
diff --git
a/daemon/guestfsd.c
b/daemon/guestfsd.c
index
406c104
..
1d74054
100644
(file)
--- a/
daemon/guestfsd.c
+++ b/
daemon/guestfsd.c
@@
-150,6
+150,14
@@
main (int argc, char *argv[])
if (sigaction (SIGPIPE, &sa, NULL) == -1)
perror ("sigaction SIGPIPE"); /* but try to continue anyway ... */
+ /* Set up a basic environment. After we are called by /init the
+ * environment is essentially empty.
+ * https://bugzilla.redhat.com/show_bug.cgi?id=502074#c5
+ */
+ setenv ("PATH", "/usr/bin:/bin", 1);
+ setenv ("SHELL", "/bin/sh", 1);
+ setenv ("LANG", "C", 1);
+
/* Resolve the hostname. */
memset (&hints, 0, sizeof hints);
hints.ai_socktype = SOCK_STREAM;