dash.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* shell: dash - large file support
@ 2015-07-24 18:50 Aleksandar Ristovski
  2015-07-26 19:21 ` Jilles Tjoelker
  0 siblings, 1 reply; 3+ messages in thread
From: Aleksandar Ristovski @ 2015-07-24 18:50 UTC (permalink / raw)
  To: dash

Hello,

For builds that build 32-bit dash, configure misses to setup large
file support resulting in issues with large files.

For example:
...dp/dash-0.5.8/build$ ls -l /tmp/largefile.sh
-rw-rw-r-- 1 aristovski aristovski 3794653588 Jul 24 14:12 /tmp/largefile.sh
...dp/dash-0.5.8/build$ ./src/dash /tmp/largefile.sh
./src/dash: 0: Can't open /tmp/largefile.sh


Where dash was configured (on a 64-bit platform) like so:

...dp/dash-0.5.8/build$ CFLAGS=-m32 ../configure && make -j8


Now, if I make the change in configure.ac and reconfigure the project,
I get proper operation:

...0.5.8.patched/build$ ./src/dash /tmp/largefile.sh
Running...
...


(the actual working of the 'largefile.sh' is removed for brevity)


Thank you,

Aleksandar Ristovski


Patch:


--- dash-0.5.8/configure.ac     2014-09-28 04:19:32.000000000 -0400
+++ dash-0.5.8.patched/configure.ac     2015-07-24 14:41:05.855055430 -0400
@@ -4,6 +4,9 @@ AC_CONFIG_SRCDIR([src/main.c])

 AC_CONFIG_HEADERS(config.h)

+dnl On 32-bit builds, check for large file support
+AC_SYS_LARGEFILE
+
 dnl Checks for programs.
 AC_PROG_CC
 AC_GNU_SOURCE

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: shell: dash - large file support
  2015-07-24 18:50 shell: dash - large file support Aleksandar Ristovski
@ 2015-07-26 19:21 ` Jilles Tjoelker
  2015-07-28  2:25   ` Herbert Xu
  0 siblings, 1 reply; 3+ messages in thread
From: Jilles Tjoelker @ 2015-07-26 19:21 UTC (permalink / raw)
  To: Aleksandar Ristovski; +Cc: dash

On Fri, Jul 24, 2015 at 02:50:48PM -0400, Aleksandar Ristovski wrote:
> For builds that build 32-bit dash, configure misses to setup large
> file support resulting in issues with large files.

> For example:
> ...dp/dash-0.5.8/build$ ls -l /tmp/largefile.sh
> -rw-rw-r-- 1 aristovski aristovski 3794653588 Jul 24 14:12 /tmp/largefile.sh
> ...dp/dash-0.5.8/build$ ./src/dash /tmp/largefile.sh
> ./src/dash: 0: Can't open /tmp/largefile.sh

> Where dash was configured (on a 64-bit platform) like so:

> ...dp/dash-0.5.8/build$ CFLAGS=-m32 ../configure && make -j8

> Now, if I make the change in configure.ac and reconfigure the project,
> I get proper operation:

> ...0.5.8.patched/build$ ./src/dash /tmp/largefile.sh
> Running...
> ...

> (the actual working of the 'largefile.sh' is removed for brevity)

> Patch:

> --- dash-0.5.8/configure.ac     2014-09-28 04:19:32.000000000 -0400
> +++ dash-0.5.8.patched/configure.ac     2015-07-24 14:41:05.855055430 -0400
> @@ -4,6 +4,9 @@ AC_CONFIG_SRCDIR([src/main.c])
> 
>  AC_CONFIG_HEADERS(config.h)
> 
> +dnl On 32-bit builds, check for large file support
> +AC_SYS_LARGEFILE
> +
>  dnl Checks for programs.
>  AC_PROG_CC
>  AC_GNU_SOURCE

If I were the maintainer, I would use AC_SYS_LARGEFILE and remove all
complexity related to using largefile interfaces in some situations and
non-largefile interfaces in other situations.

However, the maintainer seems to prefer using largefile interfaces only
when needed, apparently to reduce the size of the binary. In the case of
large shell scripts, this is POSIXly correct (see XCU 1.5 Considerations
for Utilities in Support of Files of Arbitrary Size).

However, using a non-largefile stat() or lstat() is always wrong, since
the inode number may not fit in a non-largefile ino_t. This happens in
various cases: test -ef/-nt/-ot, finding a dot script (. special
builtin) and some related to the current directory.

On another note, test -nt/-ot should really compare the nanoseconds
parts as well.

-- 
Jilles Tjoelker

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: shell: dash - large file support
  2015-07-26 19:21 ` Jilles Tjoelker
@ 2015-07-28  2:25   ` Herbert Xu
  0 siblings, 0 replies; 3+ messages in thread
From: Herbert Xu @ 2015-07-28  2:25 UTC (permalink / raw)
  To: Jilles Tjoelker; +Cc: aleksandar.ristovski, dash

Jilles Tjoelker <jilles@stack.nl> wrote:
>
> However, using a non-largefile stat() or lstat() is always wrong, since
> the inode number may not fit in a non-largefile ino_t. This happens in
> various cases: test -ef/-nt/-ot, finding a dot script (. special
> builtin) and some related to the current directory.
> 
> On another note, test -nt/-ot should really compare the nanoseconds
> parts as well.

Please send patches for these issues.

Thanks,
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-07-28  2:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-24 18:50 shell: dash - large file support Aleksandar Ristovski
2015-07-26 19:21 ` Jilles Tjoelker
2015-07-28  2:25   ` Herbert Xu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).