patchThe GNU Bourne-Again SHell - Patches: patch #10446, add exec builtin flag to avoid...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

patch #10446: add exec builtin flag to avoid interpreting command as a script

Submitter:  Ivan Trubach <tie>
Submitted:  Sat 30 Mar 2024 02:17:10 AM UTC
   
 
Category:  None Priority:  5 - Normal
Status:  Postponed Privacy:  Public
Assigned to:  None Open/Closed:  Open

Mon 08 Apr 2024 01:19:26 PM UTC, comment #4: 

Thanks for the patch. I'll consider this for a future bash version.

Chet Ramey <chet>
Group administrator
Wed 03 Apr 2024 08:35:22 AM UTC, comment #3: 

Shell option sounds reasonable, I’ve uploaded the v2 patch that adds noshellexec option (except for documentation files, I’m not sure where to start with).

Ivan Trubach <tie>
Mon 01 Apr 2024 03:02:33 PM UTC, comment #2: 

I don't think this approach is the right one. Since `exec' replaces the shell with the given program, this patch captures very few use cases.

If someone wants this behavior, won't they want it all the time? Isn't a better approach to make this dependent on a shell option?

Chet Ramey <chet>
Group administrator
Sat 30 Mar 2024 02:19:52 AM UTC, comment #1: 

FWIW: “-f” as in “fail fast”, not “force”.

Ivan Trubach <tie>
Sat 30 Mar 2024 02:17:10 AM UTC, original submission:  

This is a second attempt at the issue from https://savannah.gnu.org/patch/index.php?10445

Adds exec -f flag to avoid interpreting command as shell script on exec
failure.

POSIX standard specifies that, if exec system call fails ”due to an
error equivalent to the [ENOEXEC] error, the shell shall execute a
command equivalent to having a shell invoked with the command name as
its first operand”. The flag allows to avoid this behavior, making exec
builtin equivalent to the system call.

In addition to that, the second patch in the series includes a minor fix
for a potential out-of-bounds string access—though it’s likely not
reachable in practice.

Ivan Trubach <tie>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attached Files
file #55916:  v2-0001-add-noshellexec-shell-option.patch added by tie (8KiB - application/octet-stream - Shell option sounds reasonable, I’ve uploaded the v2 patch that adds noshellexec option (except for documentation files, I’m not sure where to start with).)
file #55917:  v2-0002-fix-potential-out-of-bounds-access-for-hash-bang-.patch added by tie (1KiB - application/octet-stream - Shell option sounds reasonable, I’ve uploaded the v2 patch that adds noshellexec option (except for documentation files, I’m not sure where to start with).)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by chet (Posted a comment)
  • -email is unavailable- added by tie (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2024-04-08 chet StatusNeed Info Postponed
    2024-04-03 tie Attached File- Added v2-0001-add-noshellexec-shell-option.patch, #55916
        Attached File- Added v2-0002-fix-potential-out-of-bounds-access-for-hash-bang-.patch, #55917
    2024-04-01 chet StatusNone Need Info
    2024-03-30 tie Attached File- Added 0001-add-exec-builtin-flag-to-avoid-interpreting-command-.patch, #55902
        Attached File- Added 0002-fix-potential-out-of-bounds-access-for-hash-bang-lin.patch, #55903

    Back to the top

    Powered by Savane 3.13-caa5.
    Corresponding source code