Haven't found email guidelines on patch submission, so just sending
them attached right now. Those are also available at:
https://github.com/lfelipe/toybox

Best regards,
Luis Strano


-- 
Luís Felipe Strano Moraes
http://www.strano.org
From a0cf52f67ba615b6f937e3dcf6048f29761cbf24 Mon Sep 17 00:00:00 2001
From: Luis Felipe Strano Moraes <[email protected]>
Date: Wed, 21 Jan 2015 17:23:18 -0200
Subject: [PATCH 1/5] bootchartd: Removing wrong free call to non-malloc'ed
 string.

---
 toys/pending/bootchartd.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/toys/pending/bootchartd.c b/toys/pending/bootchartd.c
index 72ade69..b29d4f0 100644
--- a/toys/pending/bootchartd.c
+++ b/toys/pending/bootchartd.c
@@ -294,7 +294,6 @@ void bootchartd_main()
       putenv("PATH=/sbin:/usr/sbin:/bin:/usr/bin");
     start_logging();
     stop_logging(tmp_dir, bchartd_opt == 1 ? toys.optargs[1] : NULL);
-    free(tmp_dir);
     return;
   } 
   waitpid(lgr_pid, NULL, WUNTRACED);
-- 
2.1.0

From 898bc90823a886e23da89b953189826a677b718c Mon Sep 17 00:00:00 2001
From: Luis Felipe Strano Moraes <[email protected]>
Date: Thu, 22 Jan 2015 11:13:48 -0200
Subject: [PATCH 2/5] telnetd: fix failure to build due to missing cast.

---
 toys/pending/telnetd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/toys/pending/telnetd.c b/toys/pending/telnetd.c
index 4198e63..b17452f 100644
--- a/toys/pending/telnetd.c
+++ b/toys/pending/telnetd.c
@@ -121,7 +121,7 @@ static void utmp_entry(void)
     if (utp_ptr->ut_pid == pid && utp_ptr->ut_type >= INIT_PROCESS) break;
   }             
   if (!utp_ptr) entry.ut_type = DEAD_PROCESS;
-  time(&entry.ut_time);  
+  time((time_t *)&entry.ut_time);  
   setutent();   
   pututline(&entry);     
 }
-- 
2.1.0

From 1c0030c78766402e8269a85f38de4e4d058df717 Mon Sep 17 00:00:00 2001
From: Luis Felipe Strano Moraes <[email protected]>
Date: Thu, 22 Jan 2015 13:36:43 -0200
Subject: [PATCH 3/5] mktemp: Removing wrong free call to non-malloc'ed string.

---
 toys/lsb/mktemp.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/toys/lsb/mktemp.c b/toys/lsb/mktemp.c
index c1175fe..e76bff4 100644
--- a/toys/lsb/mktemp.c
+++ b/toys/lsb/mktemp.c
@@ -37,6 +37,7 @@ void mktemp_main(void)
   if (!tmp) {
     if (!TT.tmpdir) TT.tmpdir = "/tmp";
     tmp = "tmp.xxxxxx";
+    xputs("OLA toys.optargs tava vazio");
   }
   if (TT.tmpdir) tmp = xmprintf("%s/%s", TT.tmpdir ? TT.tmpdir : "/tmp",
     *toys.optargs ? *toys.optargs : "tmp.XXXXXX");
@@ -47,6 +48,4 @@ void mktemp_main(void)
         d_flag ? "directory" : "file");
 
   xputs(tmp);
-
-  if (CFG_TOYBOX_FREE && TT.tmpdir) free(tmp);
 }
-- 
2.1.0

From db28a393804381998009cd56ccb9e1fbbb920643 Mon Sep 17 00:00:00 2001
From: Luis Felipe Strano Moraes <[email protected]>
Date: Thu, 22 Jan 2015 13:52:37 -0200
Subject: [PATCH 4/5] nsenter: fixing FTBFS due to conflicting types for
 basename.

---
 toys/pending/nsenter.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/toys/pending/nsenter.c b/toys/pending/nsenter.c
index 33db873..43e754f 100644
--- a/toys/pending/nsenter.c
+++ b/toys/pending/nsenter.c
@@ -30,7 +30,6 @@ config NSENTER
 */
 
 #define FOR_nsenter
-#define _GNU_SOURCE
 #include "toys.h"
 #include <errno.h>
 #include <sched.h>
-- 
2.1.0

From 195e434f3e2defcc3f257505b4ad8a5c4e88a996 Mon Sep 17 00:00:00 2001
From: Luis Felipe Strano Moraes <[email protected]>
Date: Thu, 22 Jan 2015 14:51:31 -0200
Subject: [PATCH 5/5] tcpsvd: exit in case call to setuid/setgid failed.

---
 toys/pending/tcpsvd.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/toys/pending/tcpsvd.c b/toys/pending/tcpsvd.c
index 585ae73..763b3f9 100644
--- a/toys/pending/tcpsvd.c
+++ b/toys/pending/tcpsvd.c
@@ -285,8 +285,8 @@ void tcpsvd_main(void)
   fd = create_bind_sock(toys.optargs[0], (struct sockaddr*)&haddr);
   if(toys.optflags & FLAG_u) {
     get_uidgid(&uid, &gid, TT.user);
-    setuid(uid);
-    setgid(gid);
+    if (setuid(uid) < 0) perror_exit("User change failed");
+    if (setgid(gid) < 0) perror_exit("Group change failed");
   }
 
   if (!TT.udp && (listen(fd, TT.bn) < 0)) perror_exit("Listen failed");
-- 
2.1.0

_______________________________________________
Toybox mailing list
[email protected]
http://lists.landley.net/listinfo.cgi/toybox-landley.net

Reply via email to