Mailing List Archive

Missing PATH_MAX and MAXPATHLEN on GNU/Hurd
Hello,


on my GNU/Hurd system, running make on rsyslog-8.2108.0 fails, after a
successful configure, because of undefined PATH_MAX and MAXPATHLEN.

GNU/Hurd doesn't use such macros, by design choice, to avoid imposing
arbitrary limits. Also note that POSIX allows those macros, but doesn't
require them.

Additionally, many common uses of PATH_MAX and similar are incorrect:
for example, the Linux kernel does not really enforce a limit on path
lengths, but only on paths to be passed to certain system calls; see
https://insanecoding.blogspot.com/2007/11/pathmax-simply-isnt.html for
example.


Perhaps rsyslog could detect missing PATH_MAX at configure time, but
that's not really a solution; I think the only option is to avoid its
use entirely, resorting to dinamically allocated buffers instead.

I could try that, as there are few instances to replace in rsyslog tree.



Let me know,

Andrea Monaco
_______________________________________________
rsyslog mailing list
https://lists.adiscon.net/mailman/listinfo/rsyslog
http://www.rsyslog.com/professional-services/
What's up with rsyslog? Follow https://twitter.com/rgerhards
NOTE WELL: This is a PUBLIC mailing list, posts are ARCHIVED by a myriad of sites beyond our control. PLEASE UNSUBSCRIBE and DO NOT POST if you DON'T LIKE THAT.
Re: Missing PATH_MAX and MAXPATHLEN on GNU/Hurd [ In reply to ]
Can you let me know where the build fails? We are well aware of the
PATH_MAX issue and have avoided it at most places as well as mitigated
at others. So this looks like it went overlooked. Smells a bit like
imfile, but I would like to know for sure before applying patches.

Thx,
Rainer

El lun, 27 sept 2021 a las 15:34, Andrea Monaco via rsyslog
(<rsyslog@lists.adiscon.com>) escribió:
>
>
> Hello,
>
>
> on my GNU/Hurd system, running make on rsyslog-8.2108.0 fails, after a
> successful configure, because of undefined PATH_MAX and MAXPATHLEN.
>
> GNU/Hurd doesn't use such macros, by design choice, to avoid imposing
> arbitrary limits. Also note that POSIX allows those macros, but doesn't
> require them.
>
> Additionally, many common uses of PATH_MAX and similar are incorrect:
> for example, the Linux kernel does not really enforce a limit on path
> lengths, but only on paths to be passed to certain system calls; see
> https://insanecoding.blogspot.com/2007/11/pathmax-simply-isnt.html for
> example.
>
>
> Perhaps rsyslog could detect missing PATH_MAX at configure time, but
> that's not really a solution; I think the only option is to avoid its
> use entirely, resorting to dinamically allocated buffers instead.
>
> I could try that, as there are few instances to replace in rsyslog tree.
>
>
>
> Let me know,
>
> Andrea Monaco
> _______________________________________________
> rsyslog mailing list
> https://lists.adiscon.net/mailman/listinfo/rsyslog
> http://www.rsyslog.com/professional-services/
> What's up with rsyslog? Follow https://twitter.com/rgerhards
> NOTE WELL: This is a PUBLIC mailing list, posts are ARCHIVED by a myriad of sites beyond our control. PLEASE UNSUBSCRIBE and DO NOT POST if you DON'T LIKE THAT.
_______________________________________________
rsyslog mailing list
https://lists.adiscon.net/mailman/listinfo/rsyslog
http://www.rsyslog.com/professional-services/
What's up with rsyslog? Follow https://twitter.com/rgerhards
NOTE WELL: This is a PUBLIC mailing list, posts are ARCHIVED by a myriad of sites beyond our control. PLEASE UNSUBSCRIBE and DO NOT POST if you DON'T LIKE THAT.
Re: Missing PATH_MAX and MAXPATHLEN on GNU/Hurd [ In reply to ]
> Can you let me know where the build fails?

Sure, here's the relevant part of my make output.


Thanks,
Andrea



Making all in runtime
make[2]: Entering directory '/root/rsyslog-8.2108.0/runtime'
CC librsyslog_la-modules.lo
In file included from syslogd-types.h:29,
from obj-types.h:31,
from debug.h:27,
from rsyslog.h:739,
from modules.c:56:
modules.c: In function 'Load':
modules.c:53:19: error: 'PATH_MAX' undeclared (first use in this function)
53 | # define PATH_MAX MAXPATHLEN
| ^~~~~~~~~~
modules.c:1105:16: note: in expansion of macro 'PATH_MAX'
1105 | uchar pathBuf[PATH_MAX+1];
| ^~~~~~~~
modules.c:53:19: note: each undeclared identifier is reported only once for each function it appears in
53 | # define PATH_MAX MAXPATHLEN
| ^~~~~~~~~~
modules.c:1105:16: note: in expansion of macro 'PATH_MAX'
1105 | uchar pathBuf[PATH_MAX+1];
| ^~~~~~~~
modules.c:1105:8: warning: unused variable 'pathBuf' [-Wunused-variable]
1105 | uchar pathBuf[PATH_MAX+1];
| ^~~~~~~


_______________________________________________
rsyslog mailing list
https://lists.adiscon.net/mailman/listinfo/rsyslog
http://www.rsyslog.com/professional-services/
What's up with rsyslog? Follow https://twitter.com/rgerhards
NOTE WELL: This is a PUBLIC mailing list, posts are ARCHIVED by a myriad of sites beyond our control. PLEASE UNSUBSCRIBE and DO NOT POST if you DON'T LIKE THAT.
Re: Missing PATH_MAX and MAXPATHLEN on GNU/Hurd [ In reply to ]
I would appreciate if you could apply the patch from

https://github.com/rsyslog/rsyslog/pull/4701

and let me know the outcome.

Thx,
Rainer

El mar, 28 sept 2021 a las 17:53, Andrea Monaco
(<andrea.monaco@autistici.org>) escribió:
>
>
> > Can you let me know where the build fails?
>
> Sure, here's the relevant part of my make output.
>
>
> Thanks,
> Andrea
>
>
>
> Making all in runtime
> make[2]: Entering directory '/root/rsyslog-8.2108.0/runtime'
> CC librsyslog_la-modules.lo
> In file included from syslogd-types.h:29,
> from obj-types.h:31,
> from debug.h:27,
> from rsyslog.h:739,
> from modules.c:56:
> modules.c: In function 'Load':
> modules.c:53:19: error: 'PATH_MAX' undeclared (first use in this function)
> 53 | # define PATH_MAX MAXPATHLEN
> | ^~~~~~~~~~
> modules.c:1105:16: note: in expansion of macro 'PATH_MAX'
> 1105 | uchar pathBuf[PATH_MAX+1];
> | ^~~~~~~~
> modules.c:53:19: note: each undeclared identifier is reported only once for each function it appears in
> 53 | # define PATH_MAX MAXPATHLEN
> | ^~~~~~~~~~
> modules.c:1105:16: note: in expansion of macro 'PATH_MAX'
> 1105 | uchar pathBuf[PATH_MAX+1];
> | ^~~~~~~~
> modules.c:1105:8: warning: unused variable 'pathBuf' [-Wunused-variable]
> 1105 | uchar pathBuf[PATH_MAX+1];
> | ^~~~~~~
>
>
_______________________________________________
rsyslog mailing list
https://lists.adiscon.net/mailman/listinfo/rsyslog
http://www.rsyslog.com/professional-services/
What's up with rsyslog? Follow https://twitter.com/rgerhards
NOTE WELL: This is a PUBLIC mailing list, posts are ARCHIVED by a myriad of sites beyond our control. PLEASE UNSUBSCRIBE and DO NOT POST if you DON'T LIKE THAT.
Re: Missing PATH_MAX and MAXPATHLEN on GNU/Hurd [ In reply to ]
> I would appreciate if you could apply the patch from
> https://github.com/rsyslog/rsyslog/pull/4701 and let me know the
> outcome.


Now it builds, installs and runs.



Thanks,

Andrea
_______________________________________________
rsyslog mailing list
https://lists.adiscon.net/mailman/listinfo/rsyslog
http://www.rsyslog.com/professional-services/
What's up with rsyslog? Follow https://twitter.com/rgerhards
NOTE WELL: This is a PUBLIC mailing list, posts are ARCHIVED by a myriad of sites beyond our control. PLEASE UNSUBSCRIBE and DO NOT POST if you DON'T LIKE THAT.