Re: Executable shell scripts



Mark Rosenstand wrote:
Douglas McNaught <doug@xxxxxxxxxxxx> wrote:
It needs to be readable as well. What ends up happening is that the
kernel sees the execute bit, looks at the shebang line and then does:

/bin/sh test

Since read permission is off, the shell's open() call fails. It will
work fine if you use 755 as the permissions.

Every Unix I've ever seen works this way. It'd be nice to have
unreadable executable scripts, but no one's ever done it.

According to
http://www.faqs.org/faqs/unix-faq/faq/part4/section-7.html both 4.3BSD
and SunOS have. I can confirm that it works on current BSD's as
well.

The faq you're refering to is 10-12 years old. 4.3BSD isn't relevant to
anyone beyond historians at this point.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/


--
-------------------------------------------------
Joel Jaeggli (joelja@xxxxxxxxxxx)
GPG Key Fingerprint:
5C6E 0104 BAF0 40B0 5BD3 C38B F000 35AB B67F 56B2
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



Relevant Pages

  • Re: [RFC] vfs: cleanup of permission()
    ... in September 2003 from the inode permission() ... the fact that the lookup intent flags happen not to collide ... More majordomo info at http://vger.kernel.org/majordomo-info.html ... Please read the FAQ at http://www.tux.org/lkml/ ...
    (Linux-Kernel)
  • Re: [PATCH] i915: slow acpi_lid_open() causes flickering
    ... Thomas Meyerwrote: ... More majordomo info at http://vger.kernel.org/majordomo-info.html ... Please read the FAQ at http://www.tux.org/lkml/ ... I guess to execute the if statement the ...
    (Linux-Kernel)
  • Re: [PATCH v2 1/2] syslog: distinguish between /proc/kmsg and syscalls
    ...  * syslog function, returning 0 if permission is granted, -ve if not. ... More majordomo info at http://vger.kernel.org/majordomo-info.html ... Please read the FAQ at http://www.tux.org/lkml/ ...
    (Linux-Kernel)
  • Re: [PATCH] ACPI suspend: Blacklist HP xw4600 Workstation for old code ordering
    ... Well, machines that require the "old" ordering are simply broken, because ... execute _PTS. ... More majordomo info at http://vger.kernel.org/majordomo-info.html ... Please read the FAQ at http://www.tux.org/lkml/ ...
    (Linux-Kernel)
  • Re: [PATCH 3/7] SLIM main patch
    ... the file write permission using do_mprotect. ... and there are other fun cases where you can "park" ... More majordomo info at http://vger.kernel.org/majordomo-info.html ... Please read the FAQ at http://www.tux.org/lkml/ ...
    (Linux-Kernel)