|
@@ -1,5 +1,5 @@
|
|
---- a/compr_lzo.c
|
|
|
|
-+++ b/compr_lzo.c
|
|
|
|
|
|
+--- a/jffsX-utils/compr_lzo.c
|
|
|
|
++++ b/jffsX-utils/compr_lzo.c
|
|
@@ -26,7 +26,6 @@
|
|
@@ -26,7 +26,6 @@
|
|
#include <string.h>
|
|
#include <string.h>
|
|
|
|
|
|
@@ -8,8 +8,8 @@
|
|
#include <linux/jffs2.h>
|
|
#include <linux/jffs2.h>
|
|
#include <lzo/lzo1x.h>
|
|
#include <lzo/lzo1x.h>
|
|
#include "compr.h"
|
|
#include "compr.h"
|
|
---- a/compr_zlib.c
|
|
|
|
-+++ b/compr_zlib.c
|
|
|
|
|
|
+--- a/jffsX-utils/compr_zlib.c
|
|
|
|
++++ b/jffsX-utils/compr_zlib.c
|
|
@@ -39,7 +39,6 @@
|
|
@@ -39,7 +39,6 @@
|
|
#include <zlib.h>
|
|
#include <zlib.h>
|
|
#undef crc32
|
|
#undef crc32
|
|
@@ -18,8 +18,8 @@
|
|
#include <linux/jffs2.h>
|
|
#include <linux/jffs2.h>
|
|
#include "common.h"
|
|
#include "common.h"
|
|
#include "compr.h"
|
|
#include "compr.h"
|
|
---- a/rbtree.h
|
|
|
|
-+++ b/rbtree.h
|
|
|
|
|
|
+--- a/jffsX-utils/rbtree.h
|
|
|
|
++++ b/jffsX-utils/rbtree.h
|
|
@@ -94,8 +94,7 @@ static inline struct page * rb_insert_pa
|
|
@@ -94,8 +94,7 @@ static inline struct page * rb_insert_pa
|
|
#ifndef _LINUX_RBTREE_H
|
|
#ifndef _LINUX_RBTREE_H
|
|
#define _LINUX_RBTREE_H
|
|
#define _LINUX_RBTREE_H
|
|
@@ -48,8 +48,8 @@
|
|
|
|
|
|
/* The version of UBI images supported by this implementation */
|
|
/* The version of UBI images supported by this implementation */
|
|
#define UBI_VERSION 1
|
|
#define UBI_VERSION 1
|
|
---- a/mkfs.ubifs/mkfs.ubifs.h
|
|
|
|
-+++ b/mkfs.ubifs/mkfs.ubifs.h
|
|
|
|
|
|
+--- a/ubifs-utils/mkfs.ubifs/mkfs.ubifs.h
|
|
|
|
++++ b/ubifs-utils/mkfs.ubifs/mkfs.ubifs.h
|
|
@@ -32,7 +32,17 @@
|
|
@@ -32,7 +32,17 @@
|
|
#include <endian.h>
|
|
#include <endian.h>
|
|
#include <byteswap.h>
|
|
#include <byteswap.h>
|
|
@@ -68,9 +68,9 @@
|
|
|
|
|
|
#include <getopt.h>
|
|
#include <getopt.h>
|
|
#include <sys/types.h>
|
|
#include <sys/types.h>
|
|
---- a/mkfs.ubifs/mkfs.ubifs.c
|
|
|
|
-+++ b/mkfs.ubifs/mkfs.ubifs.c
|
|
|
|
-@@ -1010,6 +1010,7 @@ static int add_inode_with_data(struct st
|
|
|
|
|
|
+--- a/ubifs-utils/mkfs.ubifs/mkfs.ubifs.c
|
|
|
|
++++ b/ubifs-utils/mkfs.ubifs/mkfs.ubifs.c
|
|
|
|
+@@ -1219,6 +1219,7 @@ static int add_inode(struct stat *st, in
|
|
|
|
|
|
if (c->default_compr != UBIFS_COMPR_NONE)
|
|
if (c->default_compr != UBIFS_COMPR_NONE)
|
|
use_flags |= UBIFS_COMPR_FL;
|
|
use_flags |= UBIFS_COMPR_FL;
|
|
@@ -78,7 +78,7 @@
|
|
if (flags & FS_COMPR_FL)
|
|
if (flags & FS_COMPR_FL)
|
|
use_flags |= UBIFS_COMPR_FL;
|
|
use_flags |= UBIFS_COMPR_FL;
|
|
if (flags & FS_SYNC_FL)
|
|
if (flags & FS_SYNC_FL)
|
|
-@@ -1020,6 +1021,7 @@ static int add_inode_with_data(struct st
|
|
|
|
|
|
+@@ -1229,6 +1230,7 @@ static int add_inode(struct stat *st, in
|
|
use_flags |= UBIFS_APPEND_FL;
|
|
use_flags |= UBIFS_APPEND_FL;
|
|
if (flags & FS_DIRSYNC_FL && S_ISDIR(st->st_mode))
|
|
if (flags & FS_DIRSYNC_FL && S_ISDIR(st->st_mode))
|
|
use_flags |= UBIFS_DIRSYNC_FL;
|
|
use_flags |= UBIFS_DIRSYNC_FL;
|
|
@@ -86,7 +86,7 @@
|
|
|
|
|
|
memset(ino, 0, UBIFS_INO_NODE_SZ);
|
|
memset(ino, 0, UBIFS_INO_NODE_SZ);
|
|
|
|
|
|
-@@ -1089,7 +1091,9 @@ static int add_dir_inode(DIR *dir, ino_t
|
|
|
|
|
|
+@@ -1293,7 +1295,9 @@ static int add_dir_inode(const char *pat
|
|
fd = dirfd(dir);
|
|
fd = dirfd(dir);
|
|
if (fd == -1)
|
|
if (fd == -1)
|
|
return sys_err_msg("dirfd failed");
|
|
return sys_err_msg("dirfd failed");
|
|
@@ -96,20 +96,23 @@
|
|
flags = 0;
|
|
flags = 0;
|
|
}
|
|
}
|
|
|
|
|
|
-@@ -1274,10 +1278,12 @@ static int add_file(const char *path_nam
|
|
|
|
|
|
+@@ -1476,6 +1480,7 @@ static int add_file(const char *path_nam
|
|
key_write(&key, &dn->key);
|
|
key_write(&key, &dn->key);
|
|
dn->size = cpu_to_le32(bytes_read);
|
|
dn->size = cpu_to_le32(bytes_read);
|
|
out_len = NODE_BUFFER_SIZE - UBIFS_DATA_NODE_SZ;
|
|
out_len = NODE_BUFFER_SIZE - UBIFS_DATA_NODE_SZ;
|
|
+#ifndef NO_NATIVE_SUPPORT
|
|
+#ifndef NO_NATIVE_SUPPORT
|
|
if (c->default_compr == UBIFS_COMPR_NONE &&
|
|
if (c->default_compr == UBIFS_COMPR_NONE &&
|
|
(flags & FS_COMPR_FL))
|
|
(flags & FS_COMPR_FL))
|
|
|
|
+ #ifdef WITHOUT_LZO
|
|
|
|
+@@ -1484,6 +1489,7 @@ static int add_file(const char *path_nam
|
|
use_compr = UBIFS_COMPR_LZO;
|
|
use_compr = UBIFS_COMPR_LZO;
|
|
|
|
+ #endif
|
|
else
|
|
else
|
|
+#endif
|
|
+#endif
|
|
use_compr = c->default_compr;
|
|
use_compr = c->default_compr;
|
|
compr_type = compress_data(buf, bytes_read, &dn->data,
|
|
compr_type = compress_data(buf, bytes_read, &dn->data,
|
|
&out_len, use_compr);
|
|
&out_len, use_compr);
|
|
-@@ -1319,7 +1325,9 @@ static int add_non_dir(const char *path_
|
|
|
|
|
|
+@@ -1527,7 +1533,9 @@ static int add_non_dir(const char *path_
|
|
if (fd == -1)
|
|
if (fd == -1)
|
|
return sys_err_msg("failed to open file '%s'",
|
|
return sys_err_msg("failed to open file '%s'",
|
|
path_name);
|
|
path_name);
|
|
@@ -119,9 +122,9 @@
|
|
flags = 0;
|
|
flags = 0;
|
|
if (close(fd) == -1)
|
|
if (close(fd) == -1)
|
|
return sys_err_msg("failed to close file '%s'",
|
|
return sys_err_msg("failed to close file '%s'",
|
|
---- a/mkfs.ubifs/devtable.c
|
|
|
|
-+++ b/mkfs.ubifs/devtable.c
|
|
|
|
-@@ -134,6 +134,7 @@ static int interpret_table_entry(const c
|
|
|
|
|
|
+--- a/ubifs-utils/mkfs.ubifs/devtable.c
|
|
|
|
++++ b/ubifs-utils/mkfs.ubifs/devtable.c
|
|
|
|
+@@ -135,6 +135,7 @@ static int interpret_table_entry(const c
|
|
unsigned int mode = 0755, uid = 0, gid = 0, major = 0, minor = 0;
|
|
unsigned int mode = 0755, uid = 0, gid = 0, major = 0, minor = 0;
|
|
unsigned int start = 0, increment = 0, count = 0;
|
|
unsigned int start = 0, increment = 0, count = 0;
|
|
|
|
|
|
@@ -129,17 +132,19 @@
|
|
if (sscanf(line, "%1023s %c %o %u %u %u %u %u %u %u",
|
|
if (sscanf(line, "%1023s %c %o %u %u %u %u %u %u %u",
|
|
buf, &type, &mode, &uid, &gid, &major, &minor,
|
|
buf, &type, &mode, &uid, &gid, &major, &minor,
|
|
&start, &increment, &count) < 0)
|
|
&start, &increment, &count) < 0)
|
|
-@@ -144,8 +145,8 @@ static int interpret_table_entry(const c
|
|
|
|
|
|
+@@ -145,10 +146,10 @@ static int interpret_table_entry(const c
|
|
buf, type, mode, uid, gid, major, minor, start,
|
|
buf, type, mode, uid, gid, major, minor, start,
|
|
increment, count);
|
|
increment, count);
|
|
|
|
|
|
- len = strnlen(buf, 1024);
|
|
- len = strnlen(buf, 1024);
|
|
-- if (len == 1024)
|
|
|
|
+ len = strlen(buf);
|
|
+ len = strlen(buf);
|
|
|
|
+ if (len == 0)
|
|
|
|
+ return err_msg("empty path");
|
|
|
|
+- if (len == 1024)
|
|
+ if (len == 1023)
|
|
+ if (len == 1023)
|
|
return err_msg("too long path");
|
|
return err_msg("too long path");
|
|
|
|
|
|
- if (!strcmp(buf, "/"))
|
|
|
|
|
|
+ if (buf[0] != '/')
|
|
--- a/include/common.h
|
|
--- a/include/common.h
|
|
+++ b/include/common.h
|
|
+++ b/include/common.h
|
|
@@ -26,7 +26,6 @@
|
|
@@ -26,7 +26,6 @@
|
|
@@ -148,8 +153,8 @@
|
|
#include <errno.h>
|
|
#include <errno.h>
|
|
-#include <features.h>
|
|
-#include <features.h>
|
|
#include <inttypes.h>
|
|
#include <inttypes.h>
|
|
- #include "version.h"
|
|
|
|
-
|
|
|
|
|
|
+ #include <unistd.h>
|
|
|
|
+ #include <sys/sysmacros.h>
|
|
--- a/include/mtd/ubifs-media.h
|
|
--- a/include/mtd/ubifs-media.h
|
|
+++ b/include/mtd/ubifs-media.h
|
|
+++ b/include/mtd/ubifs-media.h
|
|
@@ -33,7 +33,15 @@
|
|
@@ -33,7 +33,15 @@
|