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 <[email protected]>
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  <[email protected]>
 
+       ping, ping6: Fix unchecked setuid return.
+
+       * ping/ping.c (main): Fail if setuid fail.  Trivial patch from
+       Jayakrishna Vadayath <[email protected]>.
+       * ping/ping6.c (main): Likewise.
+
+2021-01-28  Simon Josefsson  <[email protected]>
+
        * 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 <[email protected]>
Date:   Tue Jun 2 22:12:13 2020 -0700

    patching unchecked setuid in ping.c and ping6.c
    
    Signed-off-by: Simon Josefsson <[email protected]>

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 

_______________________________________________
Commit-inetutils mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/commit-inetutils

Reply via email to