Skip to contentSkip to conversation

busybox: add patches for vi and modutils

PATCH New Gustavo Zacarias 2 participants 2 messages Jan 15, 2015 – Jan 16, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 busybox: add patches for vi and modutils

---
 package/busybox/0003-vi.patch       |  54 ++++++++++
 package/busybox/0004-modprobe.patch | 208 ++++++++++++++++++++++++++++++++++++
 2 files changed, 262 insertions(+)
 create mode 100644 package/busybox/0003-vi.patch
 create mode 100644 package/busybox/0004-modprobe.patch
package/busybox/0003-vi.patch new file +54 -0
new file mode 100644
index 0000000..be5457f
@@ -0,0 +1,54 @@
+Upstream http://busybox.net/downloads/fixes-1.23.0/busybox-1.23.0-vi.patch
+post-release hotfix patch for vi crash when called without a filename.
+
+Signed-off-by: Gustavo Zacarias <[email protected]>
+
+--- busybox-1.23.0/editors/vi.c
++++ busybox-1.23.0-vi/editors/vi.c
+@@ -542,9 +542,6 @@ static void cookmode(void);	// return to
+ static int mysleep(int);
+ static int readit(void);	// read (maybe cursor) key from stdin
+ static int get_one_char(void);	// read 1 char from stdin
+-#if !ENABLE_FEATURE_VI_READONLY
+-#define file_insert(fn, p, update_ro_status) file_insert(fn, p)
+-#endif
+ // file_insert might reallocate text[]!
+ static int file_insert(const char *, char *, int);
+ static int file_write(char *, char *, char *);
+@@ -1325,7 +1322,7 @@ static void colon(char *buf)
+ 			q = next_line(q);
+ 		{ // dance around potentially-reallocated text[]
+ 			uintptr_t ofs = q - text;
+-			size = file_insert(fn, q, /*update_ro:*/ 0);
++			size = file_insert(fn, q, 0);
+ 			q = text + ofs;
+ 		}
+ 		if (size < 0)
+@@ -2905,7 +2902,7 @@ static char *get_input_line(const char *
+ }
+ 
+ // might reallocate text[]!
+-static int file_insert(const char *fn, char *p, int update_ro_status)
++static int file_insert(const char *fn, char *p, int initial)
+ {
+ 	int cnt = -1;
+ 	int fd, size;
+@@ -2918,7 +2915,8 @@ static int file_insert(const char *fn, c
+ 
+ 	fd = open(fn, O_RDONLY);
+ 	if (fd < 0) {
+-		status_line_bold_errno(fn);
++		if (!initial)
++			status_line_bold_errno(fn);
+ 		return cnt;
+ 	}
+ 
+@@ -2946,7 +2944,7 @@ static int file_insert(const char *fn, c
+ 	close(fd);
+ 
+ #if ENABLE_FEATURE_VI_READONLY
+-	if (update_ro_status
++	if (initial
+ 	 && ((access(fn, W_OK) < 0) ||
+ 		/* root will always have access()
+ 		 * so we check fileperms too */
package/busybox/0004-modprobe.patch new file +208 -0

208 lines not on this page · raw message

Signature · 1 line
2.0.5
#1 lore raw

PATCH 1/1 busybox: add patches for vi and modutils

Dear Gustavo Zacarias,

Quoted 7 lines · Gustavo Zacarias
---
 package/busybox/0003-vi.patch       |  54 ++++++++++
 package/busybox/0004-modprobe.patch | 208 ++++++++++++++++++++++++++++++++++++
 2 files changed, 262 insertions(+)
 create mode 100644 package/busybox/0003-vi.patch
 create mode 100644 package/busybox/0004-modprobe.patch

Applied, thanks.

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com