chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
71ecc85
)
main: unset some bash specific environment variables that might get leaked to us
author
Lennart Poettering
<lennart@poettering.net>
Wed, 11 Apr 2012 11:19:26 +0000
(13:19 +0200)
committer
Lennart Poettering
<lennart@poettering.net>
Wed, 11 Apr 2012 11:20:34 +0000
(13:20 +0200)
https://bugzilla.redhat.com/show_bug.cgi?id=811537
src/main.c
patch
|
blob
|
history
diff --git
a/src/main.c
b/src/main.c
index a0bcbdf06d0dd38c17e6328af5b0dbabc457dbe8..6656cb4ef093bb6499f918bcf7db13d436e9ba48 100644
(file)
--- a/
src/main.c
+++ b/
src/main.c
@@
-1343,6
+1343,12
@@
int main(int argc, char *argv[]) {
unsetenv("HOME");
unsetenv("TERM");
+ /* When we are invoked by a shell, these might be set,
+ * but make little sense to pass on */
+ unsetenv("PWD");
+ unsetenv("SHLVL");
+ unsetenv("_");
+
/* All other variables are left as is, so that clients
* can still read them via /proc/1/environ */
}