summaryrefslogtreecommitdiffstats
path: root/source/ap/ash/patches/ash-freebsd.patch
diff options
context:
space:
mode:
Diffstat (limited to 'source/ap/ash/patches/ash-freebsd.patch')
-rw-r--r--source/ap/ash/patches/ash-freebsd.patch60
1 files changed, 60 insertions, 0 deletions
diff --git a/source/ap/ash/patches/ash-freebsd.patch b/source/ap/ash/patches/ash-freebsd.patch
new file mode 100644
index 000000000..b0b114470
--- /dev/null
+++ b/source/ap/ash/patches/ash-freebsd.patch
@@ -0,0 +1,60 @@
+diff -ur ash-0.4.0/bltin/echo.c ash-0.4.0+free/bltin/echo.c
+--- ash-0.4.0/bltin/echo.c Tue Apr 24 02:03:56 2001
++++ ash-0.4.0+free/bltin/echo.c Tue Apr 24 01:43:15 2001
+@@ -89,6 +89,7 @@
+ case 'a': c = '\007'; break;
+ case 'b': c = '\b'; break;
+ case 'c': return 0; /* exit */
++ case 'e': c = '\033'; break;
+ case 'f': c = '\f'; break;
+ case 'n': c = '\n'; break;
+ case 'r': c = '\r'; break;
+diff -ur ash-0.4.0/cd.c ash-0.4.0+free/cd.c
+--- ash-0.4.0/cd.c Tue Apr 24 02:03:56 2001
++++ ash-0.4.0+free/cd.c Tue Apr 24 01:43:57 2001
+@@ -244,6 +244,7 @@
+ curdir = NULL;
+ getpwd();
+ setvar("PWD", curdir, VEXPORT|VTEXTFIXED);
++ setvar("OLDPWD", prevdir, VEXPORT|VTEXTFIXED);
+ INTON;
+ return;
+ }
+@@ -275,6 +276,7 @@
+ prevdir = curdir;
+ curdir = savestr(stackblock());
+ setvar("PWD", curdir, VEXPORT|VTEXTFIXED);
++ setvar("OLDPWD", prevdir, VEXPORT|VTEXTFIXED);
+ INTON;
+ }
+
+diff -ur ash-0.4.0/main.c ash-0.4.0+free/main.c
+--- ash-0.4.0/main.c Tue Apr 24 02:03:57 2001
++++ ash-0.4.0+free/main.c Tue Apr 24 02:03:26 2001
+@@ -115,6 +115,9 @@
+ struct stackmark smark;
+ volatile int state;
+ char *shinit;
++ int priviliged;
++
++ priviliged = getuid() != geteuid() || getgid() != getegid();
+
+ #if PROFILE
+ monitor(4, etext, profile_buf, sizeof profile_buf, 50);
+@@ -188,11 +191,14 @@
+ read_profile("/etc/profile");
+ state1:
+ state = 2;
+- read_profile(".profile");
++ if (priviliged == 0)
++ read_profile(".profile");
++ else
++ read_profile("/etc/suid_profile");
+ }
+ state2:
+ state = 3;
+- if (getuid() == geteuid() && getgid() == getegid()) {
++ if (iflag && !priviliged) {
+ if ((shinit = lookupvar("ENV")) != NULL && *shinit != '\0') {
+ state = 3;
+ read_profile(shinit);