[lxc-devel] [lxc/lxc] 2d22b2: usernsexec: init log fd

2018-03-12 Thread GitHub
  Branch: refs/heads/master
  Home:   https://github.com/lxc/lxc
  Commit: 2d22b22dd4840e141916e64c697e0a43c7b93c8c
  https://github.com/lxc/lxc/commit/2d22b22dd4840e141916e64c697e0a43c7b93c8c
  Author: Tycho Andersen 
  Date:   2018-03-12 (Mon, 12 Mar 2018)

  Changed paths:
M src/lxc/cmd/lxc_usernsexec.c

  Log Message:
  ---
  usernsexec: init log fd

lxc-usernsexec uses some functions (e.g. lxc_map_ids()), which are part of
the lxc library and thus use the WARN etc. macros to emit log messages.
However, it doesn't initialize the log in any way, so these messages go
into the ether.

lxc-usernsexec currently has no log parameters, so let's just log these to
stderr. Someone can do something fancier later if they want.

Signed-off-by: Tycho Andersen 


  Commit: e3bc3b864567be3f2979521c8a329b0977134829
  https://github.com/lxc/lxc/commit/e3bc3b864567be3f2979521c8a329b0977134829
  Author: Serge Hallyn 
  Date:   2018-03-12 (Mon, 12 Mar 2018)

  Changed paths:
M src/lxc/cmd/lxc_usernsexec.c

  Log Message:
  ---
  Merge pull request #2211 from tych0/usernsexec-init-log

usernsexec: init log fd


Compare: https://github.com/lxc/lxc/compare/f392f4edf322...e3bc3b864567___
lxc-devel mailing list
lxc-devel@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-devel


[lxc-devel] [lxc/master] usernsexec: init log fd

2018-03-12 Thread tych0 on Github
The following pull request was submitted through Github.
It can be accessed and reviewed at: https://github.com/lxc/lxc/pull/2211

This e-mail was sent by the LXC bot, direct replies will not reach the author
unless they happen to be subscribed to this list.

=== Description (from pull-request) ===
lxc-usernsexec uses some functions (e.g. lxc_map_ids()), which are part of
the lxc library and thus use the WARN etc. macros to emit log messages.
However, it doesn't initialize the log in any way, so these messages go
into the ether.

lxc-usernsexec currently has no log parameters, so let's just log these to
stderr. Someone can do something fancier later if they want.

Signed-off-by: Tycho Andersen 
From 2d22b22dd4840e141916e64c697e0a43c7b93c8c Mon Sep 17 00:00:00 2001
From: Tycho Andersen 
Date: Mon, 12 Mar 2018 09:39:37 -0600
Subject: [PATCH] usernsexec: init log fd

lxc-usernsexec uses some functions (e.g. lxc_map_ids()), which are part of
the lxc library and thus use the WARN etc. macros to emit log messages.
However, it doesn't initialize the log in any way, so these messages go
into the ether.

lxc-usernsexec currently has no log parameters, so let's just log these to
stderr. Someone can do something fancier later if they want.

Signed-off-by: Tycho Andersen 
---
 src/lxc/cmd/lxc_usernsexec.c | 4 
 1 file changed, 4 insertions(+)

diff --git a/src/lxc/cmd/lxc_usernsexec.c b/src/lxc/cmd/lxc_usernsexec.c
index 766bd72e6..725796270 100644
--- a/src/lxc/cmd/lxc_usernsexec.c
+++ b/src/lxc/cmd/lxc_usernsexec.c
@@ -53,6 +53,8 @@
 #define MS_SLAVE (1 << 19)
 #endif
 
+extern int lxc_log_fd;
+
 int unshare(int flags);
 
 static void usage(const char *name)
@@ -274,6 +276,8 @@ int main(int argc, char *argv[])
int pipe1[2],  /* child tells parent it has unshared */
pipe2[2];  /* parent tells child it is mapped and may proceed */
 
+   lxc_log_fd = STDERR_FILENO;
+
memset(ttyname0, '\0', sizeof(ttyname0));
memset(ttyname1, '\0', sizeof(ttyname1));
memset(ttyname2, '\0', sizeof(ttyname2));
___
lxc-devel mailing list
lxc-devel@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-devel