summaryrefslogtreecommitdiffstats
path: root/scd
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2002-08-21 10:19:12 +0200
committerWerner Koch <wk@gnupg.org>2002-08-21 10:19:12 +0200
commitba0de8e95688bdb6ac825aae711905622717a01b (patch)
treee58ca2aa5f21c36dc1ac1eb6e47c81be40b301e1 /scd
parent* vasprintf.c: Hack to handle NULL for %s. (diff)
downloadgnupg2-ba0de8e95688bdb6ac825aae711905622717a01b.tar.xz
gnupg2-ba0de8e95688bdb6ac825aae711905622717a01b.zip
* scdaemon.c (main): New option --daemon so that the program is
not accidently started in the background.
Diffstat (limited to 'scd')
-rw-r--r--scd/ChangeLog5
-rw-r--r--scd/scdaemon.c17
2 files changed, 18 insertions, 4 deletions
diff --git a/scd/ChangeLog b/scd/ChangeLog
index da3cdb42a..a55c51d53 100644
--- a/scd/ChangeLog
+++ b/scd/ChangeLog
@@ -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>
* scdaemon.c: Include i18n.h.
diff --git a/scd/scdaemon.c b/scd/scdaemon.c
index 6001faf5c..bc4a1e140 100644
--- a/scd/scdaemon.c
+++ b/scd/scdaemon.c
@@ -66,6 +66,7 @@ enum cmd_and_opt_values
oNoGrab,
oLogFile,
oServer,
+ oDaemon,
oBatch,
aTest };
@@ -76,7 +77,8 @@ static ARGPARSE_OPTS opts[] = {
{ 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") },
{ oQuiet, "quiet", 0, N_("be somewhat more quiet") },
{ oSh, "sh", 0, N_("sh-style command output") },
@@ -222,6 +224,7 @@ main (int argc, char **argv )
int greeting = 0;
int nogreeting = 0;
int pipe_server = 0;
+ int is_daemon = 0;
int nodetach = 0;
int csh_style = 0;
char *logfile = NULL;
@@ -237,10 +240,10 @@ main (int argc, char **argv )
/* check that the libraries are suitable. Do it here because
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"),
- "1.1.5", gcry_check_version (NULL) );
+ NEED_LIBGCRYPT_VERSION, gcry_check_version (NULL) );
}
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 oSh: csh_style = 0; break;
case oServer: pipe_server = 1; break;
+ case oDaemon: is_daemon = 1; break;
default : pargs.err = configfp? 1:2; break;
}
@@ -415,6 +419,11 @@ main (int argc, char **argv )
{ /* this is the simple pipe based server */
scd_command_handler (-1);
}
+ else if (!is_daemon)
+ {
+ log_info (_("please use the option `--daemon'"
+ " to run the program in the background\n"));
+ }
else
{ /* regular server mode */
int fd;
@@ -425,7 +434,7 @@ main (int argc, char **argv )
char *p;
/* 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;
snprintf (socket_name, DIM(socket_name)-1,
"/tmp/gpg-XXXXXX/S.scdaemon");