aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2015-06-08 16:38:00 +0000
committerWerner Koch <[email protected]>2015-06-08 17:00:41 +0000
commit8425db6a26bf66dad16dfbc26be9af7d272f31d3 (patch)
treeefcee3449fd5e2cdef8cbf1373859016b26fd2a2
parentscd: do_decipher change for OpenPGPcard v3.0. (diff)
downloadgnupg-8425db6a26bf66dad16dfbc26be9af7d272f31d3.tar.gz
gnupg-8425db6a26bf66dad16dfbc26be9af7d272f31d3.zip
agent: Add command "getinfo std_env_names".
* agent/command.c (cmd_getinfo): Add new sub-command. -- The current output is: > getinfo std_env_names D GPG_TTY D TERM D DISPLAY D XAUTHORITY D XMODIFIERS D GTK_IM_MODULE D QT_IM_MODULE D PINENTRY_USER_DATA OK Note that there is an invisible \x00 at the end of each line.
-rw-r--r--agent/command.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/agent/command.c b/agent/command.c
index f71325d55..82d93e954 100644
--- a/agent/command.c
+++ b/agent/command.c
@@ -2756,6 +2756,7 @@ static const char hlp_getinfo[] =
" ssh_socket_name - Return the name of the ssh socket.\n"
" scd_running - Return OK if the SCdaemon is already running.\n"
" s2k_count - Return the calibrated S2K count.\n"
+ " std_env_names - List the names of the standard environment.\n"
" std_session_env - List the standard session environment.\n"
" std_startup_env - List the standard startup environment.\n"
" cmd_has_option\n"
@@ -2849,6 +2850,21 @@ cmd_getinfo (assuan_context_t ctx, char *line)
{
rc = agent_scd_check_running ()? 0 : gpg_error (GPG_ERR_GENERAL);
}
+ else if (!strcmp (line, "std_env_names"))
+ {
+ int iterator;
+ const char *name;
+
+ iterator = 0;
+ while ((name = session_env_list_stdenvnames (&iterator, NULL)))
+ {
+ rc = assuan_send_data (ctx, name, strlen (name)+1);
+ if (!rc)
+ rc = assuan_send_data (ctx, NULL, 0);
+ if (rc)
+ break;
+ }
+ }
else if (!strcmp (line, "std_session_env")
|| !strcmp (line, "std_startup_env"))
{