commit-inetutils
[Top][All Lists]
Advanced

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

[SCM] GNU Inetutils branch, master, updated. v1.9.4.90-12-g3ce348e


From: Simon Josefsson
Subject: [SCM] GNU Inetutils branch, master, updated. v1.9.4.90-12-g3ce348e
Date: Thu, 28 Jan 2021 09:40:47 -0500 (EST)

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  3ce348e63c3934958a2665ef8289d28a12150948 (commit)
       via  02a379763bf651a09b5cb728c1d6b811dc71d021 (commit)
      from  4c8e569dd0910109163122c9819bbff0cb57378e (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=3ce348e63c3934958a2665ef8289d28a12150948


commit 3ce348e63c3934958a2665ef8289d28a12150948
Author: Simon Josefsson <simon@josefsson.org>
Date:   Thu Jan 28 15:40:40 2021 +0100

    Use error instead of exit.  Add ChangeLog entry for previous commit.

diff --git a/ChangeLog b/ChangeLog
index 64cb57b..c0832d2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
 2021-01-28  Simon Josefsson  <simon@josefsson.org>
 
+       ping, ping6: Fix unchecked setuid return.
+
+       * ping/ping.c (main): Fail if setuid fail.  Trivial patch from
+       Jayakrishna Vadayath <jvadayat@asu.edu>.
+       * ping/ping6.c (main): Likewise.
+
+2021-01-28  Simon Josefsson  <simon@josefsson.org>
+
        * tests/hostname.sh: Use uname as fallback if system lack hostname
        command.  Only require mktemp when running root test.
 
diff --git a/ping/ping.c b/ping/ping.c
index bfaec28..552230e 100644
--- a/ping/ping.c
+++ b/ping/ping.c
@@ -295,7 +295,7 @@ main (int argc, char **argv)
 
   /* Reset root privileges */
   if (setuid (getuid ()) != 0)
-    exit (EXIT_FAILURE);
+    error (EXIT_FAILURE, errno, "setuid");
 
   /* Force line buffering regardless of output device.  */
   setvbuf (stdout, NULL, _IOLBF, 0);
diff --git a/ping/ping6.c b/ping/ping6.c
index f280f75..c2dfa55 100644
--- a/ping/ping6.c
+++ b/ping/ping6.c
@@ -257,7 +257,7 @@ main (int argc, char **argv)
 
   /* Reset root privileges */
   if (setuid (getuid ()) != 0)
-    exit (EXIT_FAILURE);
+    error (EXIT_FAILURE, errno, "setuid");
 
   /* Force line buffering regardless of output device.  */
   setvbuf (stdout, NULL, _IOLBF, 0);

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


commit 02a379763bf651a09b5cb728c1d6b811dc71d021
Author: Jay <jkrshnmenon@gmail.com>
Date:   Tue Jun 2 22:12:13 2020 -0700

    patching unchecked setuid in ping.c and ping6.c
    
    Signed-off-by: Simon Josefsson <simon@josefsson.org>

diff --git a/ping/ping.c b/ping/ping.c
index eb5a7b0..bfaec28 100644
--- a/ping/ping.c
+++ b/ping/ping.c
@@ -294,7 +294,8 @@ main (int argc, char **argv)
   ping_set_sockopt (ping, SO_BROADCAST, (char *) &one, sizeof (one));
 
   /* Reset root privileges */
-  setuid (getuid ());
+  if (setuid (getuid ()) != 0)
+    exit (EXIT_FAILURE);
 
   /* Force line buffering regardless of output device.  */
   setvbuf (stdout, NULL, _IOLBF, 0);
diff --git a/ping/ping6.c b/ping/ping6.c
index e3d49d6..f280f75 100644
--- a/ping/ping6.c
+++ b/ping/ping6.c
@@ -256,7 +256,8 @@ main (int argc, char **argv)
   setsockopt (ping->ping_fd, SOL_SOCKET, SO_BROADCAST, (char *) &one, sizeof 
(one));
 
   /* Reset root privileges */
-  setuid (getuid ());
+  if (setuid (getuid ()) != 0)
+    exit (EXIT_FAILURE);
 
   /* Force line buffering regardless of output device.  */
   setvbuf (stdout, NULL, _IOLBF, 0);

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

Summary of changes:
 ChangeLog    | 8 ++++++++
 ping/ping.c  | 3 ++-
 ping/ping6.c | 3 ++-
 3 files changed, 12 insertions(+), 2 deletions(-)


hooks/post-receive
-- 
GNU Inetutils 



reply via email to

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