summaryrefslogtreecommitdiffhomepage
path: root/patches/sash-3.8_pre.local.patch
blob: e11301c56ef072089e64dca8b10a12fd9354e0b5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
diff -ru sash-3.8.orig/Makefile sash-3.8/Makefile
--- sash-3.8.orig/Makefile	2014-03-05 09:56:53.000000000 +0000
+++ sash-3.8/Makefile	2022-01-01 12:37:34.553415100 +0000
@@ -19,17 +19,17 @@
 #
 
 HAVE_GZIP		= 1
-HAVE_LINUX_ATTR		= 1
-HAVE_LINUX_CHROOT	= 1
-HAVE_LINUX_LOSETUP	= 1
-HAVE_LINUX_PIVOT	= 1
-HAVE_LINUX_MOUNT	= 1
+HAVE_LINUX_ATTR		= 0
+HAVE_LINUX_CHROOT	= 0
+HAVE_LINUX_LOSETUP	= 0
+HAVE_LINUX_PIVOT	= 0
+HAVE_LINUX_MOUNT	= 0
 HAVE_BSD_MOUNT		= 0
 MOUNT_TYPE		= '"ext3"'
 
 OPT = -O3
 
-CFLAGS = $(OPT) -Wall -Wmissing-prototypes \
+CFLAGS ?= $(OPT) -Wall -Wmissing-prototypes \
 	-DHAVE_GZIP=$(HAVE_GZIP) \
 	-DHAVE_LINUX_ATTR=$(HAVE_LINUX_ATTR) \
  	-DHAVE_LINUX_CHROOT=$(HAVE_LINUX_CHROOT) \
@@ -39,11 +39,11 @@
 	-DHAVE_BSD_MOUNT=$(HAVE_BSD_MOUNT) \
 	-DMOUNT_TYPE=$(MOUNT_TYPE)
 
-LDFLAGS = -static
+LDFLAGS ?= 
 LIBS = -lz
 
 
-DESTDIR =
+DESTDIR ?=
 BINDIR = /bin
 MANDIR = /usr/man
 
@@ -54,7 +54,6 @@
 
 sash:	$(OBJS)
 	$(CC) $(LDFLAGS) -o sash $(OBJS) $(LIBS)
-	strip sash
 
 clean:
 	rm -f $(OBJS) sash
diff -ru sash-3.8.orig/cmd_ls.c sash-3.8/cmd_ls.c
--- sash-3.8.orig/cmd_ls.c	2014-03-07 13:22:12.000000000 +0000
+++ sash-3.8/cmd_ls.c	2022-01-01 12:28:01.965328000 +0000
@@ -418,7 +418,7 @@
 			if (pwd)
 				strcpy(userName, pwd->pw_name);
 			else
-				sprintf(userName, "%d", statBuf->st_uid);
+				sprintf(userName, "%ld", statBuf->st_uid);
 
 			userId = statBuf->st_uid;
 			userIdKnown = TRUE;
@@ -437,7 +437,7 @@
 			if (grp)
 				strcpy(groupName, grp->gr_name);
 			else
-				sprintf(groupName, "%d", statBuf->st_gid);
+				sprintf(groupName, "%ld", statBuf->st_gid);
 
 			groupId = statBuf->st_gid;
 			groupIdKnown = TRUE;
diff -ru sash-3.8.orig/cmds.c sash-3.8/cmds.c
--- sash-3.8.orig/cmds.c	2014-03-07 13:06:29.000000000 +0000
+++ sash-3.8/cmds.c	2022-01-01 12:33:17.337692200 +0000
@@ -10,7 +10,9 @@
 
 #include <sys/types.h>
 #include <sys/stat.h>
+#ifdef HAVE_SYS_MOUNT
 #include <sys/mount.h>
+#endif
 #include <signal.h>
 #include <pwd.h>
 #include <grp.h>
@@ -21,6 +23,7 @@
 #include <linux/fs.h>
 #endif
 
+#ifdef __linux__
 /* Need to tell loop.h what the actual dev_t type is. */
 #undef dev_t
 #if defined(__alpha) || (defined(__sparc__) && defined(__arch64__))
@@ -31,7 +34,7 @@
 #include <linux/loop.h>
 #undef dev_t
 #define dev_t dev_t
-
+#endif
 
 int
 do_echo(int argc, const char ** argv)
@@ -657,6 +660,7 @@
 }
 
 
+#ifndef __midipix__
 int
 do_mount(int argc, const char ** argv)
 {
@@ -846,7 +850,7 @@
 #endif
 	return 0;
 }
-
+#endif
 
 int
 do_cmp(int argc, const char ** argv)
diff -ru sash-3.8.orig/sash.c sash-3.8/sash.c
--- sash-3.8.orig/sash.c	2014-03-07 13:18:42.000000000 +0000
+++ sash-3.8/sash.c	2022-01-01 12:32:11.834448200 +0000
@@ -107,7 +107,7 @@
 		"srcName ... destName"
 	},
 
-#ifdef	HAVE_LINUX_CHROOT
+#if	HAVE_LINUX_CHROOT
 	{
 		"-chroot",	do_chroot,	2,	2,
 		"change root file system",
@@ -189,7 +189,7 @@
 		"[-sig] pid ..."
 	},
 
-#ifdef	HAVE_LINUX_LOSETUP
+#if	HAVE_LINUX_LOSETUP
 	{
 		"-losetup",	do_losetup,	3,	3,
 		"Associate a loopback device with a file",
@@ -235,6 +235,7 @@
 		"fileName ..."
 	},
 
+#ifndef __midipix__
 	{
 		"-mount",	do_mount,	3,	INFINITE_ARGS,
 		"Mount or remount a filesystem on a directory",
@@ -246,6 +247,7 @@
 		"[-t type] devName dirName"
 #endif
 	},
+#endif
 
 	{
 		"-mv",		do_mv,		3,	INFINITE_ARGS,
@@ -253,7 +255,7 @@
 		"srcName ... destName"
 	},
 
-#ifdef	HAVE_LINUX_PIVOT
+#if	HAVE_LINUX_PIVOT
 	{
 		"-pivot_root",	do_pivot_root,	3,	3,
 		"pivot the root file system",
@@ -339,6 +341,7 @@
 		"[mask]"
 	},
 
+#ifndef __midipix__
 	{
 #if	HAVE_BSD_MOUNT
 		"-umount",	do_umount,	2,	3,
@@ -350,6 +353,7 @@
 		"fileName"
 #endif
 	},
+#endif
 
 	{
 		"unalias",	do_unalias,	2,	2,
diff -ru sash-3.8.orig/sash.h sash-3.8/sash.h
--- sash-3.8.orig/sash.h	2014-03-07 13:46:49.000000000 +0000
+++ sash-3.8/sash.h	2022-01-01 12:31:48.133317800 +0000
@@ -88,8 +88,10 @@
 extern	int	do_dd(int argc, const char ** argv);
 extern	int	do_tar(int argc, const char ** argv);
 extern	int	do_ar(int argc, const char ** argv);
+#ifndef __midipix__
 extern	int	do_mount(int argc, const char ** argv);
 extern	int	do_umount(int argc, const char ** argv);
+#endif
 extern	int	do_setenv(int argc, const char ** argv);
 extern	int	do_pwd(int argc, const char ** argv);
 extern	int	do_echo(int argc, const char ** argv);