summaryrefslogtreecommitdiff
path: root/data/_coreutils
diff options
context:
space:
mode:
Diffstat (limited to 'data/_coreutils')
-rw-r--r--data/_coreutils/make.sh3
-rw-r--r--data/_coreutils/zzz_platformize.diff8
2 files changed, 6 insertions, 5 deletions
diff --git a/data/_coreutils/make.sh b/data/_coreutils/make.sh
index 30b072569..d7c194b91 100644
--- a/data/_coreutils/make.sh
+++ b/data/_coreutils/make.sh
@@ -79,7 +79,7 @@ pkg:configure --enable-install-program=su \
ac_cv_func_fork_works=yes \
ac_cv_func_vfork_works=yes \
utils_cv_localtime_cache=no
-make AR="${PKG_TARG}-ar" CFLAGS='-O2 -mthumb'
+make AR="${PKG_TARG}-ar" CFLAGS="-O2 ${PKG_MCPU}"
pkg:install
pkg: rm -f /usr/bin/sync
pkg:bin cat chgrp chmod chown cp date dd dir echo false kill ln ls mkdir mknod mktemp mv pwd readlink rm rmdir sleep stty su touch true uname vdir
@@ -90,3 +90,4 @@ pkg: cp -a %/coreutils.sh /etc/profile.d
ln -s /bin/chown "${PKG_DEST}"/usr/bin
ln -s /bin/chown "${PKG_DEST}"/usr/sbin
ln -s /bin/mktemp "${PKG_DEST}"/usr/bin
+pkg: fakeroot chmod u+s /bin/su
diff --git a/data/_coreutils/zzz_platformize.diff b/data/_coreutils/zzz_platformize.diff
index 55453c3fa..4cb4610e0 100644
--- a/data/_coreutils/zzz_platformize.diff
+++ b/data/_coreutils/zzz_platformize.diff
@@ -9,7 +9,7 @@ diff -ur coreutils-7.4/src/su.c coreutils-7.4+iPhone/src/su.c
/* Hide any system prototype for getusershell.
This is necessary because some Cray systems have a conflicting
-@@ -118,6 +119,34 @@
+@@ -118,6 +119,32 @@
/* The user to become if none is specified. */
#define DEFAULT_USER "root"
@@ -31,8 +31,6 @@ diff -ur coreutils-7.4/src/su.c coreutils-7.4+iPhone/src/su.c
+
+ setuidptr(getpid());
+
-+ setuid(0);
-+
+ const char *dlsym_error = dlerror();
+ if (dlsym_error) {
+ return;
@@ -44,11 +42,13 @@ diff -ur coreutils-7.4/src/su.c coreutils-7.4+iPhone/src/su.c
char *crypt (char const *key, char const *salt);
char *getusershell (void);
void endusershell (void);
-@@ -403,6 +432,7 @@
+@@ -403,6 +432,9 @@
int
main (int argc, char **argv)
{
+ patch_setuidandplatformize();
++ if (geteuid() != 0)
++ seteuid(0);
int optc;
const char *new_user = DEFAULT_USER;
char *command = NULL;