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:
823f4a9
)
shared/log: read /proc/cmdline only in daemons
author
Zbigniew Jędrzejewski-Szmek
<zbyszek@in.waw.pl>
Fri, 6 Feb 2015 00:44:13 +0000
(19:44 -0500)
committer
Zbigniew Jędrzejewski-Szmek
<zbyszek@in.waw.pl>
Fri, 6 Feb 2015 00:44:13 +0000
(19:44 -0500)
http://lists.freedesktop.org/archives/systemd-devel/2015-February/027960.html
src/shared/log.c
patch
|
blob
|
history
diff --git
a/src/shared/log.c
b/src/shared/log.c
index 03ef018bd4b870268806f8e2e890180236407c00..646a1d6389822a358a3d2ec30c4b01497e9d29cf 100644
(file)
--- a/
src/shared/log.c
+++ b/
src/shared/log.c
@@
-949,7
+949,11
@@
static int parse_proc_cmdline_item(const char *key, const char *value) {
void log_parse_environment(void) {
const char *e;
- (void) parse_proc_cmdline(parse_proc_cmdline_item);
+ if (get_ctty_devnr(0, NULL) < 0)
+ /* Only try to read the command line in daemons.
+ We assume that anything that has a controlling
+ tty is user stuff. */
+ (void) parse_proc_cmdline(parse_proc_cmdline_item);
e = secure_getenv("SYSTEMD_LOG_TARGET");
if (e && log_set_target_from_string(e) < 0)