[gnome-builder] terminal: use getent passwd
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] terminal: use getent passwd
- Date: Mon, 19 Sep 2016 21:43:44 +0000 (UTC)
commit e59a464129d3241b5bf0038500d875282bc15084
Author: Christian Hergert <chergert redhat com>
Date: Mon Sep 19 14:36:21 2016 -0700
terminal: use getent passwd
This is slightly better than using cat /etc/passwd.
plugins/terminal/gb-terminal-view.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/plugins/terminal/gb-terminal-view.c b/plugins/terminal/gb-terminal-view.c
index 6f16a89..9bcd3ce 100644
--- a/plugins/terminal/gb-terminal-view.c
+++ b/plugins/terminal/gb-terminal-view.c
@@ -88,7 +88,7 @@ gb_terminal_view_discover_shell (GCancellable *cancellable,
if (cached_shell != NULL)
return g_strdup (cached_shell);
- command = g_strdup_printf ("sh -c 'cat /etc/passwd | grep ^%s: | cut -f 7 -d :'",
+ command = g_strdup_printf ("sh -c 'getent passwd | grep ^%s: | cut -f 7 -d :'",
g_get_user_name ());
if (!g_shell_parse_argv (command, NULL, &argv, error))
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]