Fredrik Fornwall
9 years ago
7 changed files with 33 additions and 63 deletions
@ -1,15 +0,0 @@ |
|||||
diff -u -r ../busybox-1.22.1/libbb/change_identity.c ./libbb/change_identity.c
|
|
||||
--- ../busybox-1.22.1/libbb/change_identity.c 2014-01-09 19:15:44.000000000 +0100
|
|
||||
+++ ./libbb/change_identity.c 2014-07-01 09:57:10.000000000 +0200
|
|
||||
@@ -33,9 +33,11 @@
|
|
||||
/* Become the user and group(s) specified by PW. */ |
|
||||
void FAST_FUNC change_identity(const struct passwd *pw) |
|
||||
{ |
|
||||
+#ifndef __ANDROID__
|
|
||||
if (initgroups(pw->pw_name, pw->pw_gid) == -1) |
|
||||
bb_perror_msg_and_die("can't set groups"); |
|
||||
endgrent(); /* helps to close a fd used internally by libc */ |
|
||||
xsetgid(pw->pw_gid); |
|
||||
xsetuid(pw->pw_uid); |
|
||||
+#endif
|
|
||||
} |
|
@ -1,17 +0,0 @@ |
|||||
We disable security, because chroot() does not work with our non-root usage. |
|
||||
|
|
||||
With chdir() it's unsafe as a general network service, |
|
||||
but can be used for bootstrapping on a local network. |
|
||||
|
|
||||
diff -u -r ../busybox-1.23.1/networking/ftpd.c ./networking/ftpd.c
|
|
||||
--- ../busybox-1.23.1/networking/ftpd.c 2015-01-27 03:51:46.000000000 -0500
|
|
||||
+++ ./networking/ftpd.c 2015-02-06 16:38:33.202473045 -0500
|
|
||||
@@ -1230,7 +1230,7 @@
|
|
||||
G.root_fd = xopen("/", O_RDONLY | O_DIRECTORY); |
|
||||
close_on_exec_on(G.root_fd); |
|
||||
#endif |
|
||||
- xchroot(argv[0]);
|
|
||||
+ xchdir(argv[0]);
|
|
||||
} |
|
||||
|
|
||||
/* RFC-959 Section 5.1 |
|
@ -0,0 +1,17 @@ |
|||||
|
diff -u -r ../busybox-1.24.1/libbb/change_identity.c ./libbb/change_identity.c
|
||||
|
--- ../busybox-1.24.1/libbb/change_identity.c 2015-07-12 22:18:47.000000000 -0400
|
||||
|
+++ ./libbb/change_identity.c 2015-10-26 19:29:18.972044695 -0400
|
||||
|
@@ -33,6 +33,7 @@
|
||||
|
/* Become the user and group(s) specified by PW. */ |
||||
|
void FAST_FUNC change_identity(const struct passwd *pw) |
||||
|
{ |
||||
|
+#ifndef __ANDROID__
|
||||
|
int res; |
||||
|
|
||||
|
res = initgroups(pw->pw_name, pw->pw_gid); |
||||
|
@@ -57,4 +58,5 @@
|
||||
|
|
||||
|
xsetgid(pw->pw_gid); |
||||
|
xsetuid(pw->pw_uid); |
||||
|
+#endif
|
||||
|
} |
@ -1,16 +0,0 @@ |
|||||
Android do have dprintf, getline and stpcpy in android-21, |
|
||||
and having custom definitions for them breaks on i686. |
|
||||
|
|
||||
diff -u -r ../busybox-1.22.1/include/platform.h ./include/platform.h
|
|
||||
--- ../busybox-1.22.1/include/platform.h 2014-01-19 21:38:10.000000000 -0500
|
|
||||
+++ ./include/platform.h 2014-12-23 10:43:15.959769041 -0500
|
|
||||
@@ -447,9 +447,6 @@
|
|
||||
#endif |
|
||||
|
|
||||
#if defined(ANDROID) || defined(__ANDROID__) |
|
||||
-# undef HAVE_DPRINTF
|
|
||||
-# undef HAVE_GETLINE
|
|
||||
-# undef HAVE_STPCPY
|
|
||||
# undef HAVE_STRCHRNUL |
|
||||
# undef HAVE_STRVERSCMP |
|
||||
# undef HAVE_UNLOCKED_LINE_OPS |
|
@ -1,12 +0,0 @@ |
|||||
diff -u -r ../busybox-1.22.1/coreutils/uname.c ./coreutils/uname.c
|
|
||||
--- ../busybox-1.22.1/coreutils/uname.c 2014-01-09 19:15:44.000000000 +0100
|
|
||||
+++ ./coreutils/uname.c 2014-07-01 08:21:16.000000000 +0200
|
|
||||
@@ -139,7 +139,7 @@
|
|
||||
#endif |
|
||||
strcpy(uname_info.processor, unknown_str); |
|
||||
strcpy(uname_info.platform, unknown_str); |
|
||||
- strcpy(uname_info.os, "GNU/Linux");
|
|
||||
+ strcpy(uname_info.os, "Android");
|
|
||||
#if 0 |
|
||||
/* Fedora does something like this */ |
|
||||
strcpy(uname_info.processor, uname_info.name.machine); |
|
Loading…
Reference in new issue