~ubuntu-branches/ubuntu/natty/openbsd-inetd/natty

« back to all changes in this revision

Viewing changes to debian/patches/nodaemon

  • Committer: Bazaar Package Importer
  • Author(s): Marco d'Itri
  • Date: 2008-12-15 02:00:52 UTC
  • mfrom: (4.1.1 intrepid)
  • Revision ID: james.westby@ubuntu.com-20081215020052-gwpkva043fq6nb1s
Tags: 0.20080125-2
* Added dh_md5sums to debian/rules, since apparently people nowadays
  believe again that it is a good idea. (Closes: #484483)
* Fixed the init script to povide "openbsd-inetd" instead of "inetd".
  (Closes: #507119)
* Updated patches misc_portability and setproctitle with some missing
  prototypes.
* Updated patch misc_portability with missing arguments to two syslog(3)
  calls.
* Updated patch libwrap to fix a possibly uninitialized variable.
  The last three fixes are courtesy of Denis Zaitsev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
--- a/inetd.8
 
2
+++ b/inetd.8
 
3
@@ -39,6 +39,7 @@
 
4
 .Nm inetd
 
5
 .Op Fl d
 
6
 .Op Fl E
 
7
+.Op Fl i
 
8
 .Op Fl l
 
9
 .Op Fl R Ar rate
 
10
 .Op Ar configuration file
 
11
@@ -71,6 +72,8 @@ from laundering the environment.  Withou
 
12
 potentially harmful environent variables, including
 
13
 .Pa PATH ,
 
14
 will be removed and not inherited by services.
 
15
+.It Fl d
 
16
+Makes the program not daemonize itself.
 
17
 .It Fl l
 
18
 Turns on libwrap connection logging and access control.
 
19
 Internal services cannot be wrapped.  When enabled,
 
20
--- a/inetd.c
 
21
+++ b/inetd.c
 
22
@@ -340,6 +340,7 @@ main(int argc, char *argv[], char *envp[
 
23
        fd_set *fdsrp = NULL;
 
24
        int readablen = 0, ch;
 
25
        int keepenv = 0;
 
26
+       int nodaemon = 0;
 
27
        struct servtab *sep;
 
28
        extern char *optarg;
 
29
        extern int optind;
 
30
@@ -349,7 +350,7 @@ main(int argc, char *argv[], char *envp[
 
31
 
 
32
        initsetproctitle(argc, argv, envp);
 
33
 
 
34
-       while ((ch = getopt(argc, argv, "dElR:")) != -1)
 
35
+       while ((ch = getopt(argc, argv, "dEilR:")) != -1)
 
36
                switch (ch) {
 
37
                case 'd':
 
38
                        debug = 1;
 
39
@@ -357,6 +358,9 @@ main(int argc, char *argv[], char *envp[
 
40
                case 'E':
 
41
                        keepenv = 1;
 
42
                        break;
 
43
+               case 'i':
 
44
+                       nodaemon = 1;
 
45
+                       break;
 
46
                case 'l':
 
47
 #ifdef LIBWRAP
 
48
                        lflag = 1;
 
49
@@ -383,7 +387,7 @@ main(int argc, char *argv[], char *envp[
 
50
                case '?':
 
51
                default:
 
52
                        fprintf(stderr,
 
53
-                           "usage: %s [-dEl] [-R rate] [configuration file]\n",
 
54
+                           "usage: %s [-dEil] [-R rate] [configuration file]\n",
 
55
                            progname);
 
56
                        exit(1);
 
57
                }
 
58
@@ -412,6 +416,7 @@ main(int argc, char *argv[], char *envp[
 
59
 
 
60
        umask(022);
 
61
        if (debug == 0) {
 
62
+               if (nodaemon == 0)
 
63
                daemon(0, 0);
 
64
 #ifdef HAVE_SETLOGIN
 
65
                if (uid == 0)