On Mon, Jan 30, 2017 at 09:30:08PM +0100, Uwe Kleine-König wrote:
> This fixes a failure when genext2fs tries to create a symlink where the target
> has a length of exactly 60 bytes.
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koe...@pengutronix.de>

Thanks, applied,

Michael

> ---
>  ...x-inode-based-symlink-string-length-limit.patch | 39 
> ++++++++++++++++++++++
>  patches/genext2fs-1.4.1/series                     |  4 +++
>  2 files changed, 43 insertions(+)
>  create mode 100644 
> patches/genext2fs-1.4.1/0001-fix-inode-based-symlink-string-length-limit.patch
>  create mode 100644 patches/genext2fs-1.4.1/series
> 
> diff --git 
> a/patches/genext2fs-1.4.1/0001-fix-inode-based-symlink-string-length-limit.patch
>  
> b/patches/genext2fs-1.4.1/0001-fix-inode-based-symlink-string-length-limit.patch
> new file mode 100644
> index 000000000000..9a8182c0c9df
> --- /dev/null
> +++ 
> b/patches/genext2fs-1.4.1/0001-fix-inode-based-symlink-string-length-limit.patch
> @@ -0,0 +1,39 @@
> +From: Alexander Stohr <alexander.st...@gmx.de>
> +Date: Sat, 31 Mar 2012 14:33:02 +0000
> +Subject: [PATCH] fix inode based symlink string length limit
> +
> +Origin: 
> http://genext2fs.cvs.sourceforge.net/viewvc/genext2fs/genext2fs/genext2fs.c?r1=1.95&r2=1.96
> +[ukl: I'm annoyed because this patch is more complicated than necessary.
> +Just doing s/>/>=/ in the 2nd line after the 2nd hunk has the same
> +effect as the 2nd hunk without code duplication and dead code]
> +---
> + genext2fs.c | 7 ++++++-
> + 1 file changed, 6 insertions(+), 1 deletion(-)
> +
> +diff --git a/genext2fs.c b/genext2fs.c
> +index 3087479511c4..bdc8aefc1fac 100644
> +--- a/genext2fs.c
> ++++ b/genext2fs.c
> +@@ -1415,9 +1415,10 @@ mklink_fs(filesystem *fs, uint32 parent_nod, const 
> char *name, size_t size, uint
> +     uint32 nod = mknod_fs(fs, parent_nod, name, FM_IFLNK | FM_IRWXU | 
> FM_IRWXG | FM_IRWXO, uid, gid, 0, 0, ctime, mtime);
> +     extend_blk(fs, nod, 0, - (int)get_nod(fs, nod)->i_blocks / INOBLK);
> +     get_nod(fs, nod)->i_size = size;
> +-    if(size <= 4 * (EXT2_TIND_BLOCK+1))
> ++    if(size < 4 * (EXT2_TIND_BLOCK+1))
> +     {
> +             strncpy((char*)get_nod(fs, nod)->i_block, (char*)b, size);
> ++            ((char*)get_nod(fs, nod)->i_block)[size+1] = '\0';
> +             return nod;
> +     }
> +     extend_blk(fs, nod, b, rndup(size, BLOCKSIZE) / BLOCKSIZE);
> +@@ -1643,6 +1644,10 @@ add2fs_from_dir(filesystem *fs, uint32 this_nod, int 
> squash_uids, int squash_per
> +                     switch(st.st_mode & S_IFMT)
> +                     {
> +                             case S_IFLNK:
> ++                                    if((st.st_mode & S_IFMT) == S_IFREG || 
> st.st_size >= 4 * (EXT2_TIND_BLOCK+1))
> ++                                            stats->nblocks += (st.st_size + 
> BLOCKSIZE - 1) / BLOCKSIZE;
> ++                                    stats->ninodes++;
> ++                                    break;
> +                             case S_IFREG:
> +                                     if((st.st_mode & S_IFMT) == S_IFREG || 
> st.st_size > 4 * (EXT2_TIND_BLOCK+1))
> +                                             stats->nblocks += (st.st_size + 
> BLOCKSIZE - 1) / BLOCKSIZE;
> diff --git a/patches/genext2fs-1.4.1/series b/patches/genext2fs-1.4.1/series
> new file mode 100644
> index 000000000000..03d224b752ef
> --- /dev/null
> +++ b/patches/genext2fs-1.4.1/series
> @@ -0,0 +1,4 @@
> +# generated by git-ptx-patches
> +#tag:base --start-number 1
> +0001-fix-inode-based-symlink-string-length-limit.patch
> +# 09c5ef697ea11b2119735d1468222726  - git-ptx-patches magic
> -- 
> 2.11.0
> 
> 
> _______________________________________________
> ptxdist mailing list
> ptxdist@pengutronix.de

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

Reply via email to