mirror of
git://git.gnupg.org/gnupg.git
synced 2025-05-16 08:33:24 +02:00
* scdaemon.c (main): New option --daemon so that the program is
not accidently started in the background.
This commit is contained in:
parent
bc8364ec4f
commit
ba0de8e956
@ -1,3 +1,8 @@
|
|||||||
|
2002-08-21 Werner Koch <wk@gnupg.org>
|
||||||
|
|
||||||
|
* scdaemon.c (main): New option --daemon so that the program is
|
||||||
|
not accidently started in the background.
|
||||||
|
|
||||||
2002-08-16 Werner Koch <wk@gnupg.org>
|
2002-08-16 Werner Koch <wk@gnupg.org>
|
||||||
|
|
||||||
* scdaemon.c: Include i18n.h.
|
* scdaemon.c: Include i18n.h.
|
||||||
|
@ -66,6 +66,7 @@ enum cmd_and_opt_values
|
|||||||
oNoGrab,
|
oNoGrab,
|
||||||
oLogFile,
|
oLogFile,
|
||||||
oServer,
|
oServer,
|
||||||
|
oDaemon,
|
||||||
oBatch,
|
oBatch,
|
||||||
|
|
||||||
aTest };
|
aTest };
|
||||||
@ -76,7 +77,8 @@ static ARGPARSE_OPTS opts[] = {
|
|||||||
|
|
||||||
{ 301, NULL, 0, N_("@Options:\n ") },
|
{ 301, NULL, 0, N_("@Options:\n ") },
|
||||||
|
|
||||||
{ oServer, "server", 0, N_("run in server mode") },
|
{ oServer, "server", 0, N_("run in server mode (foreground)") },
|
||||||
|
{ oDaemon, "daemon", 0, N_("run in daemon mode (background)") },
|
||||||
{ oVerbose, "verbose", 0, N_("verbose") },
|
{ oVerbose, "verbose", 0, N_("verbose") },
|
||||||
{ oQuiet, "quiet", 0, N_("be somewhat more quiet") },
|
{ oQuiet, "quiet", 0, N_("be somewhat more quiet") },
|
||||||
{ oSh, "sh", 0, N_("sh-style command output") },
|
{ oSh, "sh", 0, N_("sh-style command output") },
|
||||||
@ -222,6 +224,7 @@ main (int argc, char **argv )
|
|||||||
int greeting = 0;
|
int greeting = 0;
|
||||||
int nogreeting = 0;
|
int nogreeting = 0;
|
||||||
int pipe_server = 0;
|
int pipe_server = 0;
|
||||||
|
int is_daemon = 0;
|
||||||
int nodetach = 0;
|
int nodetach = 0;
|
||||||
int csh_style = 0;
|
int csh_style = 0;
|
||||||
char *logfile = NULL;
|
char *logfile = NULL;
|
||||||
@ -237,10 +240,10 @@ main (int argc, char **argv )
|
|||||||
|
|
||||||
/* check that the libraries are suitable. Do it here because
|
/* check that the libraries are suitable. Do it here because
|
||||||
the option parsing may need services of the library */
|
the option parsing may need services of the library */
|
||||||
if (!gcry_check_version ( "1.1.5" ) )
|
if (!gcry_check_version (NEED_LIBGCRYPT_VERSION) )
|
||||||
{
|
{
|
||||||
log_fatal( _("libgcrypt is too old (need %s, have %s)\n"),
|
log_fatal( _("libgcrypt is too old (need %s, have %s)\n"),
|
||||||
"1.1.5", gcry_check_version (NULL) );
|
NEED_LIBGCRYPT_VERSION, gcry_check_version (NULL) );
|
||||||
}
|
}
|
||||||
|
|
||||||
ksba_set_malloc_hooks (gcry_malloc, gcry_realloc, gcry_free);
|
ksba_set_malloc_hooks (gcry_malloc, gcry_realloc, gcry_free);
|
||||||
@ -358,6 +361,7 @@ main (int argc, char **argv )
|
|||||||
case oCsh: csh_style = 1; break;
|
case oCsh: csh_style = 1; break;
|
||||||
case oSh: csh_style = 0; break;
|
case oSh: csh_style = 0; break;
|
||||||
case oServer: pipe_server = 1; break;
|
case oServer: pipe_server = 1; break;
|
||||||
|
case oDaemon: is_daemon = 1; break;
|
||||||
|
|
||||||
default : pargs.err = configfp? 1:2; break;
|
default : pargs.err = configfp? 1:2; break;
|
||||||
}
|
}
|
||||||
@ -415,6 +419,11 @@ main (int argc, char **argv )
|
|||||||
{ /* this is the simple pipe based server */
|
{ /* this is the simple pipe based server */
|
||||||
scd_command_handler (-1);
|
scd_command_handler (-1);
|
||||||
}
|
}
|
||||||
|
else if (!is_daemon)
|
||||||
|
{
|
||||||
|
log_info (_("please use the option `--daemon'"
|
||||||
|
" to run the program in the background\n"));
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{ /* regular server mode */
|
{ /* regular server mode */
|
||||||
int fd;
|
int fd;
|
||||||
@ -425,7 +434,7 @@ main (int argc, char **argv )
|
|||||||
char *p;
|
char *p;
|
||||||
|
|
||||||
/* fixme: if there is already a running gpg-agent we should
|
/* fixme: if there is already a running gpg-agent we should
|
||||||
sahre the same directory - and vice versa */
|
share the same directory - and vice versa */
|
||||||
*socket_name = 0;
|
*socket_name = 0;
|
||||||
snprintf (socket_name, DIM(socket_name)-1,
|
snprintf (socket_name, DIM(socket_name)-1,
|
||||||
"/tmp/gpg-XXXXXX/S.scdaemon");
|
"/tmp/gpg-XXXXXX/S.scdaemon");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user