summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicolas Williams <nico@cryptonector.com>2012-09-24 10:17:53 -0500
committerGreg Hudson <ghudson@mit.edu>2012-10-05 14:23:33 -0400
commit54d4ec82e2a236dc7cfd3f0b52534b14dd51c6a0 (patch)
tree752a11d3bc299a2929e883706ca80d5be0ffb5dd
parent4a50490ed48050e7a6d061553a6b610dc979aa2b (diff)
downloadkrb5-54d4ec82e2a236dc7cfd3f0b52534b14dd51c6a0.tar.gz
krb5-54d4ec82e2a236dc7cfd3f0b52534b14dd51c6a0.tar.xz
krb5-54d4ec82e2a236dc7cfd3f0b52534b14dd51c6a0.zip
Deprecate kpropd -S option
ticket: 7376
-rw-r--r--doc/rst_source/krb_admins/admin_commands/kpropd.rst10
-rw-r--r--src/slave/kpropd.c13
2 files changed, 17 insertions, 6 deletions
diff --git a/doc/rst_source/krb_admins/admin_commands/kpropd.rst b/doc/rst_source/krb_admins/admin_commands/kpropd.rst
index 8f048b5b4..d881a6283 100644
--- a/doc/rst_source/krb_admins/admin_commands/kpropd.rst
+++ b/doc/rst_source/krb_admins/admin_commands/kpropd.rst
@@ -14,7 +14,6 @@ SYNOPSIS
[**-p** *kdb5_util_prog*]
[**-P** *port*]
[**-d**]
-[**-S**]
DESCRIPTION
-----------
@@ -74,11 +73,12 @@ OPTIONS
``/kdb5_util``.
**-S**
- Turn on standalone mode. Normally, kpropd is invoked out of
+ [DEPRECATED] Enable standalone mode. Normally kpropd is invoked by
inetd(8) so it expects a network connection to be passed to it
- from inetd(8). If the **-S** option is specified, kpropd will put
- itself into the background, and wait for connections on port 754
- (or the port specified with the **-P** option if given).
+ from inetd(8). If the **-S** option is specified, or if standard
+ input is not a socket, kpropd will put itself into the background,
+ and wait for connections on port 754 (or the port specified with the
+ **-P** option if given).
**-d**
Turn on debug mode. In this mode, if the **-S** option is
diff --git a/src/slave/kpropd.c b/src/slave/kpropd.c
index a4e47467d..367380ede 100644
--- a/src/slave/kpropd.c
+++ b/src/slave/kpropd.c
@@ -236,10 +236,21 @@ main(argc, argv)
krb5_error_code retval;
kdb_log_context *log_ctx;
int devnull, sock;
+ struct stat st;
setlocale(LC_ALL, "");
PRS(argv);
+ if (fstat(0, &st) == -1) {
+ com_err(progname, errno, _("while checking if stdin is a socket"));
+ exit(1);
+ }
+ /*
+ * Detect whether we're running from inetd; if not then we're in
+ * standalone mode.
+ */
+ standalone = !S_ISSOCK(st.st_mode);
+
log_ctx = kpropd_context->kdblog_context;
signal_wrapper(SIGPIPE, SIG_IGN);
@@ -1143,7 +1154,7 @@ void PRS(argv)
debug++;
break;
case 'S':
- standalone++;
+ /* Standalone mode is now auto-detected; see main(). */
break;
case 'a':
if (*word)