dot.mkshrc robustness

Bug #1441853 reported by Thorsten Glaser
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
mksh
Fix Released
High
Unassigned

Bug Description

Make dot.mkshrc (and prt.mkshrc) robust:

• work with “set -e” and “set -u”, often used in Debian

• not suck with “set -x”, well not much

• work with read-only filesystem, in particular no $TMPDIR (pointed out by Natureshadow)
  ‣ especially relevant for Android /system/etc/mkshrc

It's already mostly alias-proof and function-proof¹, thankfully.

This is especially relevant for both being /bin/sh (or /system/bin/sh ofc) and root's login shell, hence importance High where it'd otherwise be Medium.

① Assuming the user is not stupid and defines shell functions named “return”, “typeset”, “command”, etc. – i.e. POSIX builtins and specials plus the ksh “typeset” one.

Revision history for this message
Elliott Hughes (enh-9) wrote : Re: [Bug 1441853] [NEW] dot.mkshrc robustness

On Wed, Apr 8, 2015 at 2:07 PM, Thorsten Glaser
<email address hidden> wrote:
> Public bug reported:
>
> Make dot.mkshrc (and prt.mkshrc) robust:
>
> • work with “set -e” and “set -u”, often used in Debian
>
> • not suck with “set -x”, well not much
>
> • work with read-only filesystem, in particular no $TMPDIR (pointed out by Natureshadow)
> ‣ especially relevant for Android /system/etc/mkshrc

(we set TMPDIR to /data/local/tmp nowadays.)

> It's already mostly alias-proof and function-proof¹, thankfully.
>
> This is especially relevant for both being /bin/sh (or /system/bin/sh
> ofc) and root's login shell, hence importance High where it'd otherwise
> be Medium.
>
> ① Assuming the user is not stupid and defines shell functions named
> “return”, “typeset”, “command”, etc. – i.e. POSIX builtins and specials
> plus the ksh “typeset” one.
>
> ** Affects: mksh
> Importance: High
> Status: Triaged

Revision history for this message
Thorsten Glaser (mirabilos) wrote :

Elliott Hughes dixit:

>> ‣ especially relevant for Android /system/etc/mkshrc
>
>(we set TMPDIR to /data/local/tmp nowadays.)

Ah ok, good. Who can write there?

Still a good idea to make the rc files so robust that
the shell can at least come up cleanly… ;)

bye,
//mirabilos
--
(gnutls can also be used, but if you are compiling lynx for your own use,
there is no reason to consider using that package)
 -- Thomas E. Dickey on the Lynx mailing list, about OpenSSL

Revision history for this message
Elliott Hughes (enh-9) wrote :

On Wed, Apr 8, 2015 at 4:54 PM, Thorsten Glaser
<email address hidden> wrote:
> Elliott Hughes dixit:
>
>>> ‣ especially relevant for Android /system/etc/mkshrc
>>
>>(we set TMPDIR to /data/local/tmp nowadays.)
>
> Ah ok, good. Who can write there?

the shell user.

> Still a good idea to make the rc files so robust that
> the shell can at least come up cleanly… ;)

indeed.

Revision history for this message
Thorsten Glaser (mirabilos) wrote :

• nothing to be done for prt.mkshrc (OBS home:mirabile/mksh)
• nothing to be done for prt.mkshrc (DEB wtf-mksh)
  ‣ DEB mksh not checked
• not much to be done for dot.mkshrc
  ‣ everything done that needed doing

That leaves us with:
• fix Android mkshrc
  – quote colon arguments
  – validate TMPDIR=/data/local/tmp DWIW
  – review
• check prt.mkshrc in Debian vanilla

Both of these are not tasks inside mksh itself, but I'll track them here too.

Changed in mksh:
status: Triaged → In Progress
Revision history for this message
Thorsten Glaser (mirabilos) wrote :

OBS and DEB wtf-mksh done, this lets Debian-vanilla (currently frozen) and Android remain

Revision history for this message
Thorsten Glaser (mirabilos) wrote :

Fixed everywhere but in Android, which to contribute to I don't have the resources (i.e. a VM on which it can actually built) any more due to their… interesting… build environment.

Changed in mksh:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.