commit-inetutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[SCM] GNU Inetutils branch, master, updated. inetutils-1_8-85-g4d82d1d


From: Alfred M. Szmidt
Subject: [SCM] GNU Inetutils branch, master, updated. inetutils-1_8-85-g4d82d1d
Date: Sun, 27 Mar 2011 21:11:03 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Inetutils ".

The branch, master has been updated
       via  4d82d1d7ae718a2407f14780d3edf0ab3cfc6754 (commit)
       via  c057af1881c69650cbe82817cfa4721462c75924 (commit)
       via  69d5b1e789b7edd8187bc41614606a133813bb57 (commit)
      from  82cafb9b3cd252c63c6d0d5ddf7bd0a087634edf (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit/inetutils.git/commit/?id=4d82d1d7ae718a2407f14780d3edf0ab3cfc6754


commit 4d82d1d7ae718a2407f14780d3edf0ab3cfc6754
Author: Alfred M. Szmidt <address@hidden>
Date:   Sun Mar 27 23:09:23 2011 +0200

    configure.ac: Use AC_CANONICAL_HOST instead of AC_CANONICAL_SYSTEM.

diff --git a/ChangeLog b/ChangeLog
index 72284cf..cc1ee67 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2011-03-27  Mike Frysinger  <address@hidden>
 
+       * configure.ac: Use AC_CANONICAL_HOST instead of AC_CANONICAL_SYSTEM.
+
+2011-03-27  Mike Frysinger  <address@hidden>
+
        * ftpd/server_mode.c: Include <libinetutils.h>.
        (server_mode): Changed prototype to ` int server_mode (const char
        *pidfile, struct sockaddr_in *phis_addr, char *argv[])'.  Handle
diff --git a/configure.ac b/configure.ac
index f87f122..6c52213 100644
--- a/configure.ac
+++ b/configure.ac
@@ -25,7 +25,7 @@ AC_INIT([GNU inetutils], 
m4_esyscmd([build-aux/git-version-gen .tarball-version]
 AC_CONFIG_SRCDIR([src/inetd.c])
 AC_CONFIG_AUX_DIR([build-aux])
 AM_CONFIG_HEADER([config.h:config.hin])
-AC_CANONICAL_SYSTEM # FIXME: Why not just _HOST?
+AC_CANONICAL_HOST
 
 AM_INIT_AUTOMAKE([1.11])
 

http://git.savannah.gnu.org/cgit/inetutils.git/commit/?id=c057af1881c69650cbe82817cfa4721462c75924


commit c057af1881c69650cbe82817cfa4721462c75924
Author: Alfred M. Szmidt <address@hidden>
Date:   Sun Mar 27 23:08:14 2011 +0200

    ftpd: Handle systems without fork().

diff --git a/ChangeLog b/ChangeLog
index 26d8c95..72284cf 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
 2011-03-27  Mike Frysinger  <address@hidden>
 
+       * ftpd/server_mode.c: Include <libinetutils.h>.
+       (server_mode): Changed prototype to ` int server_mode (const char
+       *pidfile, struct sockaddr_in *phis_addr, char *argv[])'.  Handle
+       systems that do not have fork().
+       * ftpd/extern.h (server_mode): Updated prototype.
+       * ftpd/ftpd.c (main): Handle systems that do not have fork().
+
+2011-03-27  Mike Frysinger  <address@hidden>
+
        * libinetutils/libinetutils.h: Include <config.h>.
        (fork_exit, fork): New macros.
        * configure.ac: Check for presence of fork().
diff --git a/ftpd/extern.h b/ftpd/extern.h
index b1580c2..2aaea27 100644
--- a/ftpd/extern.h
+++ b/ftpd/extern.h
@@ -110,7 +110,8 @@ extern char tmpline[];
 extern off_t restart_point;
 
 /* Exported from server_mode.c.  */
-extern int server_mode (const char *pidfile, struct sockaddr_in *phis_addr);
+extern int server_mode (const char *pidfile, struct sockaddr_in *phis_addr,
+                       char *argv[]);
 
 /* Credential for the request.  */
 struct credentials
diff --git a/ftpd/ftpd.c b/ftpd/ftpd.c
index 22500bb..b4bf1c7 100644
--- a/ftpd/ftpd.c
+++ b/ftpd/ftpd.c
@@ -424,8 +424,7 @@ main (int argc, char *argv[], char **envp)
   argp_parse (&argp, argc, argv, 0, &index, NULL);
 
   /* Bail out, wrong usage */
-  argc -= index;
-  if (argc != 0)
+  if (argc - index != 0)
     error (EXIT_FAILURE, 0, "surplus arguments; try `%s --help' for more info",
           program_name);
 
@@ -438,7 +437,19 @@ main (int argc, char *argv[], char **envp)
      fd = accept(). tcpd is check if compile with the support  */
   if (daemon_mode)
     {
-      if (server_mode (pid_file, &his_addr) < 0)
+#ifndef HAVE_FORK
+      /* Shift out the daemon option in subforks  */
+      int i;
+      for (i = 0; i < argc; ++i)
+       if (strcmp (argv[i], "-D") == 0)
+         {
+           int j;
+           for (j = i; j < argc; ++j)
+             argv[j] = argv[j + 1];
+           argv[--argc] = NULL;
+         }
+#endif
+      if (server_mode (pid_file, &his_addr, argv) < 0)
        exit (EXIT_FAILURE);
     }
   else
diff --git a/ftpd/server_mode.c b/ftpd/server_mode.c
index 8e39ffd..89e11a0 100644
--- a/ftpd/server_mode.c
+++ b/ftpd/server_mode.c
@@ -37,6 +37,8 @@
 # include <tcpd.h>
 #endif
 
+#include <libinetutils.h>
+
 static void reapchild (int);
 
 #define DEFPORT 21
@@ -92,7 +94,7 @@ reapchild (int signo ARG_UNUSED)
 }
 
 int
-server_mode (const char *pidfile, struct sockaddr_in *phis_addr)
+server_mode (const char *pidfile, struct sockaddr_in *phis_addr, char *argv[])
 {
   int ctl_sock, fd;
   struct servent *sv;
@@ -176,5 +178,10 @@ server_mode (const char *pidfile, struct sockaddr_in 
*phis_addr)
   if (!check_host ((struct sockaddr *) phis_addr))
     return -1;
 #endif
+
+#ifndef HAVE_FORK
+  _exit (execvp (argv[0], argv));
+#endif
+
   return fd;
 }

http://git.savannah.gnu.org/cgit/inetutils.git/commit/?id=69d5b1e789b7edd8187bc41614606a133813bb57


commit 69d5b1e789b7edd8187bc41614606a133813bb57
Author: Alfred M. Szmidt <address@hidden>
Date:   Sun Mar 27 23:03:28 2011 +0200

    Handle systems that do not have fork().

diff --git a/ChangeLog b/ChangeLog
index 2ffc7e3..26d8c95 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2011-03-27  Mike Frysinger  <address@hidden>
+
+       * libinetutils/libinetutils.h: Include <config.h>.
+       (fork_exit, fork): New macros.
+       * configure.ac: Check for presence of fork().
+
 2011-01-26  Mats Erik Andersson <address@hidden>
 
        * src/traceroute.c (main): Remove test on geteuid().
diff --git a/configure.ac b/configure.ac
index bf524e0..f87f122 100644
--- a/configure.ac
+++ b/configure.ac
@@ -581,7 +581,7 @@ AC_FUNC_MALLOC
 AC_FUNC_REALLOC
 
 AC_CHECK_FUNCS(cfsetspeed cgetent dirfd fchdir flock \
-               fpathconf ftruncate \
+               fork fpathconf ftruncate \
               getcwd getmsg getspnam initgroups initsetproctitle killpg \
                mkstemp ptsname \
                setegid seteuid setpgid \
diff --git a/libinetutils/libinetutils.h b/libinetutils/libinetutils.h
index c05b8a0..8cfe792 100644
--- a/libinetutils/libinetutils.h
+++ b/libinetutils/libinetutils.h
@@ -17,6 +17,8 @@
   You should have received a copy of the GNU General Public License
   along with this program.  If not, see `http://www.gnu.org/licenses/'. */
 
+#include <config.h>
+
 #include "argp-version-etc.h"
 
 void utmp_init (char *line, char *user, char *id);
@@ -32,3 +34,10 @@ extern const char *default_program_authors[];
 #define iu_argp_init(name, authors)                            \
   argp_program_bug_address = "<" PACKAGE_BUGREPORT ">";                \
   argp_version_setup (name, authors);
+
+#ifdef HAVE_FORK
+# define fork_exit(s) exit(s)
+#else
+# define fork() vfork()
+# define fork_exit(s) _exit(s)
+#endif

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog                   |   19 +++++++++++++++++++
 configure.ac                |    4 ++--
 ftpd/extern.h               |    3 ++-
 ftpd/ftpd.c                 |   17 ++++++++++++++---
 ftpd/server_mode.c          |    9 ++++++++-
 libinetutils/libinetutils.h |    9 +++++++++
 6 files changed, 54 insertions(+), 7 deletions(-)


hooks/post-receive
-- 
GNU Inetutils 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]