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-200-g2c22913


From: Mats Erik Andersson
Subject: [SCM] GNU Inetutils branch, master, updated. inetutils-1_8-200-g2c22913
Date: Mon, 19 Dec 2011 21:22:48 +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  2c229134277513cdd826a843a7b65fa021b77b4a (commit)
      from  b1c19ecb2408659f68b5cae8eaa1c6c938d35112 (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=2c229134277513cdd826a843a7b65fa021b77b4a


commit 2c229134277513cdd826a843a7b65fa021b77b4a
Author: Mats Erik Andersson <address@hidden>
Date:   Mon Dec 19 22:20:34 2011 +0100

    rcp,rshd: Missing EUID check; minor corrections.

diff --git a/ChangeLog b/ChangeLog
index 27b948c..36562f5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2011-12-19  Mats Erik Andersson <address@hidden>
+
+       * src/rcp.c (main) [!KERBEROS]: Exit at non-zero geteuid().
+       (toremote): After setting IPTOS_THROUGHPUT, print warning
+       only for ERRNO not equal to ENOPROTOOPT.
+       (tolocal): Likewise.
+       * src/rshd.c (doit): Remove misplaced syslog message.
+       Improve comments on port usage.
+
 2011-12-13  Alfred M. Szmidt  <address@hidden>
 
        Require automake 1.11.1.
diff --git a/src/rcp.c b/src/rcp.c
index a89ed91..b4801b4 100644
--- a/src/rcp.c
+++ b/src/rcp.c
@@ -309,6 +309,12 @@ main (int argc, char *argv[])
   if (argc > 2)
     targetshouldbedirectory = 1;
 
+#ifndef KERBEROS
+  /* We must be setuid root.  */
+  if (geteuid ())
+    error (EXIT_FAILURE, 0, "must be setuid root.");
+#endif
+
   /* Command to be executed on remote system using "rsh". */
 #ifdef KERBEROS
   rc = asprintf (&command, "rcp%s%s%s%s", iamrecursive ? " -r" : "",
@@ -427,7 +433,8 @@ toremote (char *targ, int argc, char *argv[])
              tos = IPTOS_THROUGHPUT;
              if (setsockopt (rem, IPPROTO_IP, IP_TOS,
                              (char *) &tos, sizeof (int)) < 0)
-               error (0, errno, "TOS (ignored)");
+               if (errno != ENOPROTOOPT)
+                 error (0, errno, "TOS (ignored)");
 #endif
              if (response () < 0)
                exit (EXIT_FAILURE);
@@ -496,7 +503,8 @@ tolocal (int argc, char *argv[])
       tos = IPTOS_THROUGHPUT;
       if (setsockopt (rem, IPPROTO_IP, IP_TOS, (char *) &tos, sizeof (int)) <
          0)
-       error (0, errno, "TOS (ignored)");
+       if (errno != ENOPROTOOPT)
+         error (0, errno, "TOS (ignored)");
 #endif
       sink (1, argv + argc - 1);
       seteuid (0);
diff --git a/src/rshd.c b/src/rshd.c
index aae3cf7..f57e576 100644
--- a/src/rshd.c
+++ b/src/rshd.c
@@ -414,12 +414,12 @@ doit (int sockfd, struct sockaddr_in *fromp)
   alarm (0);
   if (port != 0)
     {
-      /* If the secondary port# is nonzero, the we have to
+      /* If the secondary port# is non-zero, then we have to
        * connect to that port (which the client has already
        * created and is listening on).  The secondary port#
-       * that the client tells us to connect to has to also be
+       * that the client tells us to connect to has also to be
        * a reserved port#.  Also, our end of this secondary
-       * connection has to also have a reserved TCP port bond
+       * connection has also to have a reserved TCP port bound
        * to it, plus.
        */
       int lport = IPPORT_RESERVED - 1;
@@ -437,13 +437,11 @@ doit (int sockfd, struct sockaddr_in *fromp)
            syslog (LOG_ERR, "2nd port not reserved\n");
            exit (EXIT_FAILURE);
          }
-      /* Use the fromp structure taht we already have.
+      /* Use the fromp structure that we already have available.
        * The 32-bit Internet address is obviously that of the
-       * client's, just change the port# to the one specified
-       * by the clent as the secondary port.
+       * client; just change the port# to the one specified
+       * as secondary port by the client.
        */
-      syslog (LOG_ERR, "2nd port not reserved %d\n", port);
-
       fromp->sin_port = htons (port);
       if (connect (s, (struct sockaddr *) fromp, sizeof (*fromp)) < 0)
        {

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

Summary of changes:
 ChangeLog  |    9 +++++++++
 src/rcp.c  |   12 ++++++++++--
 src/rshd.c |   14 ++++++--------
 3 files changed, 25 insertions(+), 10 deletions(-)


hooks/post-receive
-- 
GNU Inetutils 



reply via email to

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