mirror of
git://git.gnupg.org/gnupg.git
synced 2025-03-28 22:49:59 +01:00
gpgconf: New option --chuid.
* tools/gpgconf.c (oChUid, opts): New option --chuid. (main): Implement. -- Signed-off-by: Werner Koch <wk@gnupg.org>
This commit is contained in:
parent
8ff00ef0de
commit
d10f45184c
@ -1196,7 +1196,7 @@ pkd:0:1024:B665B1435F4C2 .... FF26ABB:
|
|||||||
*** MANUFACTURER <n> [<string>]
|
*** MANUFACTURER <n> [<string>]
|
||||||
|
|
||||||
This status returns the Manufactorer ID as the unsigned number N.
|
This status returns the Manufactorer ID as the unsigned number N.
|
||||||
For OpenPGP this is weel defined; for other cards this is 0. The
|
For OpenPGP this is well defined; for other cards this is 0. The
|
||||||
name of the manufacturer is also given as <string>; spaces are not
|
name of the manufacturer is also given as <string>; spaces are not
|
||||||
escaped. For PKCS#15 cards <string> is TokenInfo.manufactorerID.
|
escaped. For PKCS#15 cards <string> is TokenInfo.manufactorerID.
|
||||||
|
|
||||||
|
@ -415,6 +415,16 @@ Try to be as quiet as possible.
|
|||||||
|
|
||||||
@include opt-homedir.texi
|
@include opt-homedir.texi
|
||||||
|
|
||||||
|
@item --chuid @var{uid}
|
||||||
|
@opindex chuid
|
||||||
|
Change the current user to @var{uid} which may either be a number or a
|
||||||
|
name. This can be used from the root account to get information on
|
||||||
|
the GnuPG environment of the specified user or to start or kill
|
||||||
|
daemons. If @var{uid} is not the current UID a standard PATH is set
|
||||||
|
and the envvar GNUPGHOME is unset. To override the latter the option
|
||||||
|
@option{--homedir} can be used. This option has currently no effect
|
||||||
|
on Windows.
|
||||||
|
|
||||||
@item -n
|
@item -n
|
||||||
@itemx --dry-run
|
@itemx --dry-run
|
||||||
Do not actually change anything. This is currently only implemented
|
Do not actually change anything. This is currently only implemented
|
||||||
|
@ -51,6 +51,7 @@ enum cmd_and_opt_values
|
|||||||
oBuilddir,
|
oBuilddir,
|
||||||
oStatusFD,
|
oStatusFD,
|
||||||
oShowSocket,
|
oShowSocket,
|
||||||
|
oChUid,
|
||||||
|
|
||||||
aListComponents,
|
aListComponents,
|
||||||
aCheckPrograms,
|
aCheckPrograms,
|
||||||
@ -113,6 +114,7 @@ static gpgrt_opt_t opts[] =
|
|||||||
{ oNull, "null", 0, "@" },
|
{ oNull, "null", 0, "@" },
|
||||||
{ oNoVerbose, "no-verbose", 0, "@"},
|
{ oNoVerbose, "no-verbose", 0, "@"},
|
||||||
ARGPARSE_s_n (oShowSocket, "show-socket", "@"),
|
ARGPARSE_s_n (oShowSocket, "show-socket", "@"),
|
||||||
|
ARGPARSE_s_s (oChUid, "chuid", "@"),
|
||||||
|
|
||||||
ARGPARSE_end(),
|
ARGPARSE_end(),
|
||||||
};
|
};
|
||||||
@ -547,6 +549,7 @@ main (int argc, char **argv)
|
|||||||
enum cmd_and_opt_values cmd = 0;
|
enum cmd_and_opt_values cmd = 0;
|
||||||
estream_t outfp = NULL;
|
estream_t outfp = NULL;
|
||||||
int show_socket = 0;
|
int show_socket = 0;
|
||||||
|
const char *changeuser = NULL;
|
||||||
|
|
||||||
early_system_init ();
|
early_system_init ();
|
||||||
gnupg_reopen_std (GPGCONF_NAME);
|
gnupg_reopen_std (GPGCONF_NAME);
|
||||||
@ -579,6 +582,7 @@ main (int argc, char **argv)
|
|||||||
set_status_fd (translate_sys2libc_fd_int (pargs.r.ret_int, 1));
|
set_status_fd (translate_sys2libc_fd_int (pargs.r.ret_int, 1));
|
||||||
break;
|
break;
|
||||||
case oShowSocket: show_socket = 1; break;
|
case oShowSocket: show_socket = 1; break;
|
||||||
|
case oChUid: changeuser = pargs.r.ret_str; break;
|
||||||
|
|
||||||
case aListDirs:
|
case aListDirs:
|
||||||
case aListComponents:
|
case aListComponents:
|
||||||
@ -620,6 +624,10 @@ main (int argc, char **argv)
|
|||||||
|
|
||||||
fname = argc ? *argv : NULL;
|
fname = argc ? *argv : NULL;
|
||||||
|
|
||||||
|
/* If requested switch to the requested user or die. */
|
||||||
|
if (changeuser && (err = gnupg_chuid (changeuser, 0)))
|
||||||
|
gpgconf_failure (err);
|
||||||
|
|
||||||
/* Set the configuraton directories for use by gpgrt_argparser. We
|
/* Set the configuraton directories for use by gpgrt_argparser. We
|
||||||
* don't have a configuration file for this program but we have code
|
* don't have a configuration file for this program but we have code
|
||||||
* which reads the component's config files. */
|
* which reads the component's config files. */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user