Mark Mentovai | 11 Jul 2008 23:20
Picon

Mac OS X support patch

Hi, Herbert and friends.  I've created a small patch that allows dash
to be built on Mac OS X.  I'm contributing it here with the hope that
it's suitable for inclusion in dash.

The changes in this patch are:

- __attribute__((__alias__())) is not supported, add an autoconf check
- open64 is not present although the stat64 family is, separate the
  autoconf checks
- A syntax error had slipped into a non-glibc codepath
- mkbuiltins had a nonportable mktemp invocation for the case where
  tempfile is not availalble

Nothing in this patch is actually Mac OS X-specific, so it might aid
portability to other platforms as well.

Mark
Attachment (dash.macosx.patch): application/octet-stream, 4062 bytes
H. Peter Anvin | 12 Jul 2008 05:20
Favicon

Re: Mac OS X support patch

Mark Mentovai wrote:
> - open64 is not present although the stat64 family is, separate the
>   autoconf checks

This seems like the Wrong Thing anyway; the right thing should be to add 
whatever option (like -D_FILE_OFFSET_BITS=64 on Linux) to do 
*everything* using the full-sized offsets.

	-hpa
--
To unsubscribe from this list: send the line "unsubscribe dash" in
the body of a message to majordomo <at> vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Mark Mentovai | 12 Jul 2008 16:51
Picon

Re: Mac OS X support patch

H. Peter Anvin wrote:
> Mark Mentovai wrote:
>> - open64 is not present although the stat64 family is, separate the
>>  autoconf checks
>
> This seems like the Wrong Thing anyway; the right thing should be to add
> whatever option (like -D_FILE_OFFSET_BITS=64 on Linux) to do *everything*
> using the full-sized offsets.

autoconf provides AC_SYS_LARGEFILE for this, but I don't think it
should be part of this patch.  Does dash have a bug tracker where this
can be filed?

Mark
--
To unsubscribe from this list: send the line "unsubscribe dash" in
the body of a message to majordomo <at> vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Herbert Xu | 13 Jul 2008 03:07
Picon
Picon

Re: Mac OS X support patch

H. Peter Anvin <hpa <at> zytor.com> wrote:
> Mark Mentovai wrote:
>> - open64 is not present although the stat64 family is, separate the
>>   autoconf checks
> 
> This seems like the Wrong Thing anyway; the right thing should be to add 
> whatever option (like -D_FILE_OFFSET_BITS=64 on Linux) to do 
> *everything* using the full-sized offsets.

Actually there is a reason for this.  Not all open(2) calls in
dash need large file support.  For example, doing it on a shell
script or /dev/null makes no sense.  Only those dealing with user
files (redirections) need large file support.

So that's we need to differentiate between open(2) calls on user
files as opposed to those for dash itself.

Cheers,
--

-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert <at> gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
--
To unsubscribe from this list: send the line "unsubscribe dash" in
the body of a message to majordomo <at> vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

H. Peter Anvin | 13 Jul 2008 03:26
Favicon

Re: Mac OS X support patch

Herbert Xu wrote:
> H. Peter Anvin <hpa <at> zytor.com> wrote:
>> Mark Mentovai wrote:
>>> - open64 is not present although the stat64 family is, separate the
>>>   autoconf checks
>> This seems like the Wrong Thing anyway; the right thing should be to add 
>> whatever option (like -D_FILE_OFFSET_BITS=64 on Linux) to do 
>> *everything* using the full-sized offsets.
> 
> Actually there is a reason for this.  Not all open(2) calls in
> dash need large file support.  For example, doing it on a shell
> script or /dev/null makes no sense.  Only those dealing with user
> files (redirections) need large file support.
> 
> So that's we need to differentiate between open(2) calls on user
> files as opposed to those for dash itself.
> 

I'm not sure that that makes sense, however.  Unless you're hauling a 
*lot* of off_t's around the code, the incremental complexity is hardly 
worth it.

The *only* reason for the legacy 32-bit off_t mode is because it is an 
ABI change, it is necessary to prevent application/library interface 
breakage.

FWIW, klibc doesn't even implement the LFS64 APIs, nor does it implement 
the legacy 32-bit off_t mode in any way.

	-hpa
(Continue reading)

Rocky Bernstein | 13 Jul 2008 03:43
Picon
Gravatar

restricted dash shell?

I notice dash doesn't seem to have a --restricted option like bash or
come as a restricted shell like ksh (rksh).

Thought and comments?
--
To unsubscribe from this list: send the line "unsubscribe dash" in
the body of a message to majordomo <at> vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Herbert Xu | 13 Jul 2008 04:53
Picon
Picon

Re: Mac OS X support patch

On Sat, Jul 12, 2008 at 06:26:11PM -0700, H. Peter Anvin wrote:
>
> I'm not sure that that makes sense, however.  Unless you're hauling a 
> *lot* of off_t's around the code, the incremental complexity is hardly 
> worth it.

Either way it's pretty insignificant.  Yes the decrease in code
size isn't great but then the increase in complexity isn't large
either.  FWIW the decreases all come from stat on directories
and scripts.

> FWIW, klibc doesn't even implement the LFS64 APIs, nor does it implement 
> the legacy 32-bit off_t mode in any way.

That's already handled by autoconf.

Cheers,
--

-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert <at> gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
--
To unsubscribe from this list: send the line "unsubscribe dash" in
the body of a message to majordomo <at> vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Herbert Xu | 13 Jul 2008 13:22
Picon
Picon

Re: [pape <at> smarden.org: Bug#455828: dash: 4-argument test "test \( ! -e \)" yields an error]

On Mon, Mar 03, 2008 at 12:07:45PM +0000, Gerrit Pape wrote:
> forwarded 455828 upstream
> quit
> 
> Hi Herbert, please see http://bugs.debian.org/455828 and below.  I agree
> that this is a bug in dash, sorry, I can't suggest a patch.

I've fixed as below.

Cheers,
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert <at> gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
--
commit 4df1e776cd079357f877f0d491a80a234f670452
Author: Herbert Xu <herbert <at> gondor.apana.org.au>
Date:   Sun Jul 13 19:20:10 2008 +0800

    [BUILTIN] Fixed 3,4-argument cases for test per POSIX

    ----- Forwarded message from Gerrit Pape <pape <at> smarden.org> -----

    Subject: Bug#455828: dash: 4-argument test "test \( ! -e \)" yields an error
    Date: Fri, 28 Dec 2007 08:53:29 +0000
    From: Gerrit Pape <pape <at> smarden.org>
    To: Vincent Lefevre <vincent <at> vinc17.org>, 455828 <at> bugs.debian.org

    On Thu, Dec 27, 2007 at 06:23:20PM +0100, Vincent Lefevre wrote:
(Continue reading)

Herbert Xu | 13 Jul 2008 13:24
Picon
Picon

Re: Mac OS X support patch

Mark Mentovai <mmentovai <at> gmail.com> wrote:
> 
> autoconf provides AC_SYS_LARGEFILE for this, but I don't think it
> should be part of this patch.  Does dash have a bug tracker where this
> can be filed?

Please use the Debian BTS for this.  See http://bugs.debian.org/.

Thanks,
--

-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert <at> gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
--
To unsubscribe from this list: send the line "unsubscribe dash" in
the body of a message to majordomo <at> vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Herbert Xu | 13 Jul 2008 13:26
Picon
Picon

Re: restricted dash shell?

Rocky Bernstein <rocky.bernstein <at> gmail.com> wrote:
> I notice dash doesn't seem to have a --restricted option like bash or
> come as a restricted shell like ksh (rksh).
> 
> Thought and comments?

POSIX rationale says:

	The options associated with a restricted shell (command name rsh
	and the -r option) were excluded because the standard developers
	considered that the implied level of security could not be
	achieved and they did not want to raise false expectations.

Cheers,
--

-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert <at> gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
--
To unsubscribe from this list: send the line "unsubscribe dash" in
the body of a message to majordomo <at> vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Gmane