[Pkg-shadow-devel] Bug#750480: Bug#750480: shadow: FTBFS on hurd-i386
Svante Signell
svante.signell at gmail.com
Tue Jun 10 15:30:34 UTC 2014
On Tue, 2014-06-10 at 06:54 +0200, Christian PERRIER wrote:
> Quoting Svante Signell (svante.signell at gmail.com):
> > Source: shadow
> > Version: 4.2-2
> > Severity: important
> > Tags: patch
> > User: debian-hurd at lists.debian.org
> > Usertags: hurd
> >
> > Hi,
> >
> > Currently shadow fails to build from source and is flagged as
> > out-of-date. This is due to a usage of PATH_MAX, which is not defined
> > on GNU/Hurd. The attached patch solves this problem by allocating a
> > fixed number of 32 bytes for the string proc_dir_name in files
> > src/procuidmap.c and src/procgidmap.c. (In fact only 18 bytes are
> > needed)
>
> Hello Svante,
>
> Thanks for your contribution and the proposed patch.
>
> Disclaimer: I'm anything but a C programmer;..:-)
>
> Is really hardcoding this value the best solution?
>
> > Index: shadow-4.2/src/newuidmap.c
> > ===================================================================
> > --- shadow-4.2.orig/src/newuidmap.c
> > +++ shadow-4.2/src/newuidmap.c
> > @@ -94,7 +94,7 @@ void usage(void)
> > */
> > int main(int argc, char **argv)
> > {
> > - char proc_dir_name[PATH_MAX];
> > + char proc_dir_name[32];
>
> .../...
>
> Wouldn't it be better to leave PATH_MAX for all architectures but Hurd
> and just hardcode the value for Hurd : I mean something like using
> "#ifdef" statements (as you see, I'm only giving the rough idea : I'm
> not sure how to do this cleanly myself).
PATH_MAX is not recommended to use, see e.g.
http://insanecoding.blogspot.se/2007/11/pathmax-simply-isnt.html
so using PATH_MAX for all architectures but Hurd is not recommended,
Attached is my first proposed solution to the debian-hurd mailing list.
This solution does not use PATH_MAX at all, but I was recommended to use
a fixed value instead since the format is /proc/%u/ so the size is
limited. (max field length for an unsigned integer is 10)
This patch (or the previous one) should preferably be forwarded upstream
for review.
Thanks!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 466_path_max_old
Type: text/x-patch
Size: 1361 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pkg-shadow-devel/attachments/20140610/d8126630/attachment.bin>
More information about the Pkg-shadow-devel
mailing list