]> git.pld-linux.org Git - packages/ash.git/blame - ash-freebsd.patch
- fixed for uclibc
[packages/ash.git] / ash-freebsd.patch
CommitLineData
cf7098dd
MM
1diff -ur ash-0.4.0/bltin/echo.c ash-0.4.0+free/bltin/echo.c
2--- ash-0.4.0/bltin/echo.c Tue Apr 24 02:03:56 2001
3+++ ash-0.4.0+free/bltin/echo.c Tue Apr 24 01:43:15 2001
4@@ -89,6 +89,7 @@
5 case 'a': c = '\007'; break;
6 case 'b': c = '\b'; break;
7 case 'c': return 0; /* exit */
8+ case 'e': c = '\033'; break;
9 case 'f': c = '\f'; break;
10 case 'n': c = '\n'; break;
11 case 'r': c = '\r'; break;
12diff -ur ash-0.4.0/cd.c ash-0.4.0+free/cd.c
13--- ash-0.4.0/cd.c Tue Apr 24 02:03:56 2001
14+++ ash-0.4.0+free/cd.c Tue Apr 24 01:43:57 2001
15@@ -244,6 +244,7 @@
16 curdir = NULL;
17 getpwd();
18 setvar("PWD", curdir, VEXPORT|VTEXTFIXED);
19+ setvar("OLDPWD", prevdir, VEXPORT|VTEXTFIXED);
20 INTON;
21 return;
22 }
23@@ -275,6 +276,7 @@
24 prevdir = curdir;
25 curdir = savestr(stackblock());
26 setvar("PWD", curdir, VEXPORT|VTEXTFIXED);
27+ setvar("OLDPWD", prevdir, VEXPORT|VTEXTFIXED);
28 INTON;
29 }
30
31diff -ur ash-0.4.0/main.c ash-0.4.0+free/main.c
32--- ash-0.4.0/main.c Tue Apr 24 02:03:57 2001
33+++ ash-0.4.0+free/main.c Tue Apr 24 02:03:26 2001
34@@ -115,6 +115,9 @@
35 struct stackmark smark;
36 volatile int state;
37 char *shinit;
38+ int priviliged;
39+
40+ priviliged = getuid() != geteuid() || getgid() != getegid();
41
42 #if PROFILE
43 monitor(4, etext, profile_buf, sizeof profile_buf, 50);
44@@ -188,11 +191,14 @@
45 read_profile("/etc/profile");
46 state1:
47 state = 2;
48- read_profile(".profile");
49+ if (priviliged == 0)
50+ read_profile(".profile");
51+ else
52+ read_profile("/etc/suid_profile");
53 }
54 state2:
55 state = 3;
56- if (getuid() == geteuid() && getgid() == getegid()) {
57+ if (iflag && !priviliged) {
58 if ((shinit = lookupvar("ENV")) != NULL && *shinit != '\0') {
59 state = 3;
60 read_profile(shinit);
This page took 0.056557 seconds and 4 git commands to generate.