[0/5] Fix multiple realpath issues

Message ID 20201224151701.1751008-1-adhemerval.zanella@linaro.org
Headers
Series Fix multiple realpath issues |

Message

Adhemerval Zanella Netto Dec. 24, 2020, 3:16 p.m. UTC
  This is an updated version of my previous set to fix multiple realpath
implementation issues [1].

For this version I used the most recent gnulib version to sync, since
it constains multiple issues and it fixes glibc BZ #10635, BZ #26592,
and BZ #26241.  However, the gnulib version shows some regressions
on stdlib/tst-canon.c which I fixed on last patch (which also fixes
glibc BZ #24970).

This idea is to either apply this whole set or work with gnulib to
fix the glibc regression on their side and sync a fully working
implementation back to glibc.

[1] https://patchwork.sourceware.org/project/glibc/list/?series=1062

*** BLURB HERE ***

Adhemerval Zanella (5):
  stdlib: Sync canonicalize with gnulib [BZ #10635] [BZ #26592] [BZ
    #26241]
  Import idx.h from gnulib
  Import filename.h from gnulib
  stdlib: Add testcase fro BZ #26241
  stdlib: Remove lstat usage from realpath [BZ #24970]

 include/filename.h                            | 110 +++++
 include/idx.h                                 | 113 +++++
 include/scratch_buffer.h                      |  21 +
 stdlib/Makefile                               |   3 +-
 stdlib/canonicalize.c                         | 467 ++++++++++++------
 stdlib/tst-canon-bz26341.c                    | 108 ++++
 support/support_set_small_thread_stack_size.c |  12 +-
 support/xthread.h                             |   2 +
 8 files changed, 676 insertions(+), 160 deletions(-)
 create mode 100644 include/filename.h
 create mode 100644 include/idx.h
 create mode 100644 stdlib/tst-canon-bz26341.c
  

Comments

Paul Eggert Dec. 24, 2020, 10:53 p.m. UTC | #1
Thanks, this looks good. Also, the following "[PATCH 3/5] Import 
filename.h from gnulib" looks good. I merged both changes into Gnulib here:

http://git.savannah.gnu.org/cgit/gnulib.git/commit/?id=1013adf6bf48627f84a9043cf2631ff13d2a452f
  
Florian Weimer Dec. 25, 2020, 8:34 p.m. UTC | #2
* Adhemerval Zanella via Libc-alpha:

> diff --git a/include/idx.h b/include/idx.h
> new file mode 100644
> index 0000000000..ad7d31a2bc
> --- /dev/null
> +++ b/include/idx.h
> @@ -0,0 +1,113 @@
> +/* A type for indices and sizes.
> +
> +   Copyright (C) 2020 Free Software Foundation, Inc.
> +
> +   This program is free software; you can redistribute it and/or modify
> +   it under the terms of the GNU General Public License as published by
> +   the Free Software Foundation; either version 2, or (at your option)
> +   any later version.
> +
> +   This program is distributed in the hope that it will be useful,
> +   but WITHOUT ANY WARRANTY; without even the implied warranty of
> +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> +   GNU General Public License for more details.
> +
> +   You should have received a copy of the GNU General Public License
> +   along with this program; if not, see <https://www.gnu.org/licenses/>.  */

This file is linked into the library itself, so we can only accept
something that is under a compatible license (probably LGPLv2 or later).
  
Bruno Haible Dec. 25, 2020, 9:38 p.m. UTC | #3
Florian Weimer wrote:
> > diff --git a/include/idx.h b/include/idx.h
> > new file mode 100644
> > index 0000000000..ad7d31a2bc
> > --- /dev/null
> > +++ b/include/idx.h
> > @@ -0,0 +1,113 @@
> > +/* A type for indices and sizes.
> > +
> > +   Copyright (C) 2020 Free Software Foundation, Inc.
> > +
> > +   This program is free software; you can redistribute it and/or modify
> > +   it under the terms of the GNU General Public License as published by
> > +   the Free Software Foundation; either version 2, or (at your option)
> > +   any later version.
> > +
> > +   This program is distributed in the hope that it will be useful,
> > +   but WITHOUT ANY WARRANTY; without even the implied warranty of
> > +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> > +   GNU General Public License for more details.
> > +
> > +   You should have received a copy of the GNU General Public License
> > +   along with this program; if not, see <https://www.gnu.org/licenses/>.  */
> 
> This file is linked into the library itself, so we can only accept
> something that is under a compatible license (probably LGPLv2 or later).

The file is actually under LGPLv2+ [1][2]. You can replace the license
header with an LGPLv2+ header.

Bruno

[1] https://www.gnu.org/software/gnulib/manual/html_node/Gnulib-licensing.html
[2] https://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=blob_plain;f=modules/idx
  
Paul Eggert Dec. 26, 2020, 1:29 a.m. UTC | #4
On 12/25/20 12:34 PM, Florian Weimer wrote:
> This file is linked into the library itself, so we can only accept
> something that is under a compatible license (probably LGPLv2 or later).

I installed the attached patch to the Gnulib copy of idx.h to do that. 
This uses the same wording as what's in glibc's scratch_buffer.h.
  
Joseph Myers Dec. 31, 2020, 11:12 p.m. UTC | #5
On Thu, 24 Dec 2020, Adhemerval Zanella via Libc-alpha wrote:

> +   Copyright (C) 2020 Free Software Foundation, Inc.
> +
> +   This program is free software; you can redistribute it and/or modify
> +   it under the terms of the GNU General Public License as published by
> +   the Free Software Foundation; either version 2, or (at your option)
> +   any later version.

Anything used in glibc libraries should be LGPLv2.1+, not GPL.
  
Paul Eggert Jan. 1, 2021, 3:24 a.m. UTC | #6
On 12/31/20 3:12 PM, Joseph Myers wrote:
> Anything used in glibc libraries should be LGPLv2.1+, not GPL.

That was fixed in the most recently-published version of the patch:

https://sourceware.org/pipermail/libc-alpha/2020-December/121178.html