path: root/include
diff options
authorGravatar Denis Vlasenko <vda.linux@googlemail.com>2007-01-14 01:29:06 +0000
committerGravatar Denis Vlasenko <vda.linux@googlemail.com>2007-01-14 01:29:06 +0000
commit7a431b3715299854fb423ec00d5fafc0e2c7f07b (patch)
tree4e90c9d364485ef13c2e429ab22b9b925d50ea04 /include
parent150f402b36197d822f8a7dd835231cd67b77e959 (diff)
By popular request reinstate fakeidentd's standalone mode.
Since this is also needed for other applets like telnetd, introduce generic driver for such things. It even supports inetd-wait ('linger') mode, when inetd hands out listen socket to child and waits to it to die, instead of handing out accepted socket and continuing listening itself (nowait mode). Code growth ~200 bytes. NB: our inetd doesn't support wait mode yet (or mabe it is buggy).
Diffstat (limited to 'include')
2 files changed, 10 insertions, 14 deletions
diff --git a/include/libbb.h b/include/libbb.h
index 4060498b8..c191dc2a0 100644
--- a/include/libbb.h
+++ b/include/libbb.h
@@ -278,6 +278,8 @@ extern int wait4pid(int pid);
extern void xsetgid(gid_t gid);
extern void xsetuid(uid_t uid);
extern void xdaemon(int nochdir, int noclose);
+/* More clever/thorough xdaemon */
+extern void bb_sanitize_stdio(int daemonize);
extern void xchdir(const char *path);
extern void xsetenv(const char *key, const char *value);
extern int xopen(const char *pathname, int flags);
diff --git a/include/usage.h b/include/usage.h
index 0275df3f0..2b51fad72 100644
--- a/include/usage.h
+++ b/include/usage.h
@@ -826,22 +826,16 @@
"\\( and \\) or null; if \\( and \\) are not used, they return the number\n" \
"of characters matched or 0."
-#if 0 /* bloaty */
#define fakeidentd_trivial_usage \
- "[-b ip] [STRING]"
+ "[-fiw] [-b ADDR] [STRING]"
#define fakeidentd_full_usage \
- "Return a set string to auth requests" \
- "\n\nOptions:\n" \
- " -b Bind to ip address\n" \
- " STRING The ident answer string (default is nobody)"
-#else /* inetd-only */
-#define fakeidentd_trivial_usage \
- "[username]"
-#define fakeidentd_full_usage \
- "Return a (faked) ident response.\n" \
- "This applet is meant to run from inetd.\n" \
- "Optional argument is the username to return (default is 'nobody')."
+ "Provide fake ident (auth) service" \
+ "\n\nOptions:" \
+ "\n -f Run in foreground" \
+ "\n -i Inetd mode" \
+ "\n -w Inetd 'wait' mode" \
+ "\n -b ADDR Bind to specified address" \
+ "\n STRING Ident answer string (default is 'nobody')"
#define false_trivial_usage \