• Symlinks with executable extensions (suffixes)

    From [via djgpp@delorie.com]" @21:1/5 to All on Sat Aug 15 18:06:05 2020
    What can I do about DJGPP-symlinks getting accidentally executed (eg.
    by COMMAND.COM) as binary executables because they have .exe or .com extensions? It can easily hang the machine.

    Regards,
    Albert.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From [via djgpp@delorie.com]" @21:1/5 to All on Sat Aug 15 21:41:42 2020
    From: "A. Wik (awik32@gmail.com) [via djgpp@delorie.com]" <djgpp@delorie.com> Date: Sat, 15 Aug 2020 18:06:05 +0000

    What can I do about DJGPP-symlinks getting accidentally executed (eg.
    by COMMAND.COM) as binary executables because they have .exe or .com extensions? It can easily hang the machine.

    Don't create symlinks with those extensions?

    DJGPP already has an alternative mechanism for "links" to its
    executables (via 'stubedit'), which avoids this problem. Would it
    solve the problem to use that alternative for links to executables?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From [via djgpp@delorie.com]" @21:1/5 to djgpp@delorie.com] on Sun Aug 16 08:01:13 2020
    On Sat, 15 Aug 2020 at 18:49, Eli Zaretskii (eliz@gnu.org) [via djgpp@delorie.com] <djgpp@delorie.com> wrote:>
    From: "A. Wik (awik32@gmail.com) [via djgpp@delorie.com]" <djgpp@delorie.com>
    Date: Sat, 15 Aug 2020 18:06:05 +0000

    What can I do about DJGPP-symlinks getting accidentally executed (eg.
    by COMMAND.COM) as binary executables because they have .exe or .com extensions? It can easily hang the machine.

    Don't create symlinks with those extensions?

    I don't do it deliberately. They are created by eg. "make install".

    DJGPP already has an alternative mechanism for "links" to its
    executables (via 'stubedit'), which avoids this problem. Would it
    solve the problem to use that alternative for links to executables?

    Partially. But then "ls" won't list them as links, right?

    -aw

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From [via djgpp@delorie.com]" @21:1/5 to All on Sun Aug 16 17:35:28 2020
    From: "A. Wik (awik32@gmail.com) [via djgpp@delorie.com]" <djgpp@delorie.com> Date: Sun, 16 Aug 2020 08:01:13 +0000

    What can I do about DJGPP-symlinks getting accidentally executed (eg.
    by COMMAND.COM) as binary executables because they have .exe or .com extensions? It can easily hang the machine.

    Don't create symlinks with those extensions?

    I don't do it deliberately. They are created by eg. "make install".

    I guess some porting is required of those Makefiles.

    DJGPP already has an alternative mechanism for "links" to its
    executables (via 'stubedit'), which avoids this problem. Would it
    solve the problem to use that alternative for links to executables?

    Partially. But then "ls" won't list them as links, right?

    It won't, correct.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From [via djgpp@delorie.com]" @21:1/5 to djgpp@delorie.com] on Sun Aug 16 15:12:04 2020
    To: joerg@schily.net (=?UTF-8?Q?J=C3=B6rg_Schilling?=)

    On Sun, 16 Aug 2020 at 14:43, Eli Zaretskii (eliz@gnu.org) [via djgpp@delorie.com] <djgpp@delorie.com> wrote:

    From: "A. Wik (awik32@gmail.com) [via djgpp@delorie.com]" <djgpp@delorie.com>
    Date: Sun, 16 Aug 2020 08:01:13 +0000

    What can I do about DJGPP-symlinks getting accidentally executed (eg. by COMMAND.COM) as binary executables because they have .exe or .com extensions? It can easily hang the machine.

    Don't create symlinks with those extensions?

    I don't do it deliberately. They are created by eg. "make install".

    I guess some porting is required of those Makefiles.

    I will look into that.

    DJGPP already has an alternative mechanism for "links" to its
    executables (via 'stubedit'), which avoids this problem. Would it
    solve the problem to use that alternative for links to executables?

    Partially. But then "ls" won't list them as links, right?

    It won't, correct.

    I actually found that you can create these symlinks *without* an
    executable .extension, but making them point to an executable.
    lrw-r--r-- 1 root dos 510 Aug 16 12:18 delmebsh -> bin/bsh.exe

    "./delmebsh" will work in bash to invoke the executable, but it cannot
    be executed by COMMAND.COM, which is good because the link file won't
    be executed as a binary, but the sacrifice is that these links can't
    be executed *at all* by the DOS shell (which of course is still better
    than hanging the machine). One workaround is to always use bash, or
    to copy the files instead of linking.

    -aw

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From [via djgpp@delorie.com]" @21:1/5 to Joerg Schilling on Mon Aug 17 11:29:26 2020
    Copy: djgpp@delorie.com

    On Mon, 17 Aug 2020 at 11:08, Joerg Schilling <schily@schily.net> wrote:

    Symlinks have been introduced 40 years ago. Today it is hard to live without them. I guess that always using bash is a good idea on DOS.

    It is ironic that one reason I don't always use bash is that I have
    better command-line editing in COMMAND.COM (this is because I use a
    program called CmdEdit). <Home>, <End>, <Delete>, and <Insert> are
    broken in DJGPP bash.

    -aw

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)