diff options
author | Rob Landley <rob@landley.net> | 2006-07-16 08:06:34 +0000 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2006-07-16 08:06:34 +0000 |
commit | afb94ecf2bb6c53ce2a381d6ce45a426243c76d9 (patch) | |
tree | 0390f5cfb0cfd70882175f7e383a30d8cb1527cc /networking/traceroute.c | |
parent | 25c194fd1941a7ba67d68a09fa101bc54a756a14 (diff) | |
download | busybox-w32-afb94ecf2bb6c53ce2a381d6ce45a426243c76d9.tar.gz busybox-w32-afb94ecf2bb6c53ce2a381d6ce45a426243c76d9.tar.bz2 busybox-w32-afb94ecf2bb6c53ce2a381d6ce45a426243c76d9.zip |
Convert setuid/setgid users to xsetuid/xsetgid.
Diffstat (limited to 'networking/traceroute.c')
-rw-r--r-- | networking/traceroute.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/networking/traceroute.c b/networking/traceroute.c index 79f3957a6..c2084fc1e 100644 --- a/networking/traceroute.c +++ b/networking/traceroute.c | |||
@@ -941,7 +941,6 @@ traceroute_main(int argc, char *argv[]) | |||
941 | #endif | 941 | #endif |
942 | u_short off = 0; | 942 | u_short off = 0; |
943 | struct IFADDRLIST *al; | 943 | struct IFADDRLIST *al; |
944 | int uid = getuid(); | ||
945 | char *device = NULL; | 944 | char *device = NULL; |
946 | int max_ttl = 30; | 945 | int max_ttl = 30; |
947 | char *max_ttl_str = NULL; | 946 | char *max_ttl_str = NULL; |
@@ -1010,8 +1009,7 @@ traceroute_main(int argc, char *argv[]) | |||
1010 | * set the ip source address of the outbound | 1009 | * set the ip source address of the outbound |
1011 | * probe (e.g., on a multi-homed host). | 1010 | * probe (e.g., on a multi-homed host). |
1012 | */ | 1011 | */ |
1013 | if (uid) | 1012 | if (getuid()) bb_error_msg_and_die("-s %s: Permission denied", source); |
1014 | bb_error_msg_and_die("-s %s: Permission denied", source); | ||
1015 | } | 1013 | } |
1016 | if(waittime_str) | 1014 | if(waittime_str) |
1017 | waittime = str2val(waittime_str, "wait time", 2, 24 * 60 * 60); | 1015 | waittime = str2val(waittime_str, "wait time", 2, 24 * 60 * 60); |
@@ -1160,8 +1158,8 @@ traceroute_main(int argc, char *argv[]) | |||
1160 | sizeof(on)); | 1158 | sizeof(on)); |
1161 | 1159 | ||
1162 | /* Revert to non-privileged user after opening sockets */ | 1160 | /* Revert to non-privileged user after opening sockets */ |
1163 | setgid(getgid()); | 1161 | xsetgid(getgid()); |
1164 | setuid(uid); | 1162 | xsetuid(getuid()); |
1165 | 1163 | ||
1166 | outip = (struct ip *)xcalloc(1, (unsigned)packlen); | 1164 | outip = (struct ip *)xcalloc(1, (unsigned)packlen); |
1167 | 1165 | ||