From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2155) id 4D73E385D0FC; Fri, 28 Oct 2022 10:49:35 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4D73E385D0FC DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1666954175; bh=KWw2PLKlBDctb7OXbTe+iPTgQfEuixco2Y58gP3tzcE=; h=From:To:Subject:Date:From; b=sOFavHU6W1CM2RDEPKqNJR6aDg/gwQoqLPVEkLs8r3GdoFgr+XUDGqQY6QJSu+lte GK64dSSz14YXJjCTT+Oz13qgKUD4PADo5/jV3eRnzSrDfK61nI+bXgRlL6rzu6SbPM DIWEjiXNCmhCoJBxScirwR/dLN/zs0pKvMM3rvxs= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Corinna Vinschen To: cygwin-cvs@sourceware.org Subject: [newlib-cygwin] Cygwin: stop handling files with .com suffix like .exe files X-Act-Checkin: newlib-cygwin X-Git-Author: Corinna Vinschen X-Git-Refname: refs/heads/master X-Git-Oldrev: 213b53ed355712b97d361a273a87f1162b8b7aab X-Git-Newrev: 339bb6e932f4aef047dc6aa1a1894eec8b37063c Message-Id: <20221028104935.4D73E385D0FC@sourceware.org> Date: Fri, 28 Oct 2022 10:49:35 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dnewlib-cygwin.git;h=3D339bb6e932f= 4aef047dc6aa1a1894eec8b37063c commit 339bb6e932f4aef047dc6aa1a1894eec8b37063c Author: Corinna Vinschen Date: Fri Oct 28 12:42:51 2022 +0200 Cygwin: stop handling files with .com suffix like .exe files =20 .com is a remnant from the past. There are only five executables left: =20 chcp.com format.com mode.com more.com tree.com =20 Calling them on the command line already requires to use the suffix anyway. So drop useless .com test from the execve test for scripts (they are handled earlier in the same function as executables) and do not handle them like .exe suffixes in other functions. =20 Signed-off-by: Corinna Vinschen Diff: --- winsup/cygwin/fhandler/disk_file.cc | 3 +-- winsup/cygwin/globals.cc | 1 - winsup/cygwin/release/3.4.0 | 3 +++ winsup/cygwin/spawn.cc | 3 --- winsup/cygwin/syscalls.cc | 1 - 5 files changed, 4 insertions(+), 7 deletions(-) diff --git a/winsup/cygwin/fhandler/disk_file.cc b/winsup/cygwin/fhandler/d= isk_file.cc index 62c18e5e4..6eb466e9c 100644 --- a/winsup/cygwin/fhandler/disk_file.cc +++ b/winsup/cygwin/fhandler/disk_file.cc @@ -518,8 +518,7 @@ fhandler_base::fstat_helper (struct stat *buf) PUNICODE_STRING path =3D pc.get_nt_native_path (); =20 if (RtlEqualUnicodePathSuffix (path, &ro_u_exe, TRUE) - || RtlEqualUnicodePathSuffix (path, &ro_u_lnk, TRUE) - || RtlEqualUnicodePathSuffix (path, &ro_u_com, TRUE)) + || RtlEqualUnicodePathSuffix (path, &ro_u_lnk, TRUE)) pc.set_exec (); } /* No known suffix, check file header. This catches binaries and diff --git a/winsup/cygwin/globals.cc b/winsup/cygwin/globals.cc index e909d0f8f..aef4a687d 100644 --- a/winsup/cygwin/globals.cc +++ b/winsup/cygwin/globals.cc @@ -120,7 +120,6 @@ const int __collate_load_error =3D 0; extern UNICODE_STRING _RDATA ro_u_empty =3D _ROU (L""); extern UNICODE_STRING _RDATA ro_u_lnk =3D _ROU (L".lnk"); extern UNICODE_STRING _RDATA ro_u_exe =3D _ROU (L".exe"); - extern UNICODE_STRING _RDATA ro_u_com =3D _ROU (L".com"); extern UNICODE_STRING _RDATA ro_u_scr =3D _ROU (L".scr"); extern UNICODE_STRING _RDATA ro_u_sys =3D _ROU (L".sys"); extern UNICODE_STRING _RDATA ro_u_proc =3D _ROU (L"proc"); diff --git a/winsup/cygwin/release/3.4.0 b/winsup/cygwin/release/3.4.0 index e3b3072b4..a5e9a8ae3 100644 --- a/winsup/cygwin/release/3.4.0 +++ b/winsup/cygwin/release/3.4.0 @@ -5,6 +5,9 @@ What's new: =20 - Drop support for 32 bit Windows and WOW64. =20 +- Remove any special handling for the .com filename suffix. It has to + be used always explicitely. + - Add code to handle setrlimit(RLIMIT_AS). =20 - Add code to handle signal masks in /proc//status. diff --git a/winsup/cygwin/spawn.cc b/winsup/cygwin/spawn.cc index f0ae73999..01225afe2 100644 --- a/winsup/cygwin/spawn.cc +++ b/winsup/cygwin/spawn.cc @@ -34,7 +34,6 @@ static const suffix_info exe_suffixes[] =3D { suffix_info ("", 1), suffix_info (".exe", 1), - suffix_info (".com"), suffix_info (NULL) }; =20 @@ -1366,8 +1365,6 @@ av::setup (const char *prog_arg, path_conv& real_path= , const char *ext, set_errno (ENOEXEC); return -1; } - if (ascii_strcasematch (ext, ".com")) - break; pgm =3D (char *) "/bin/sh"; arg1 =3D NULL; } diff --git a/winsup/cygwin/syscalls.cc b/winsup/cygwin/syscalls.cc index 1338853df..fff8af009 100644 --- a/winsup/cygwin/syscalls.cc +++ b/winsup/cygwin/syscalls.cc @@ -2097,7 +2097,6 @@ nt_path_has_executable_suffix (PUNICODE_STRING upath) { static const PUNICODE_STRING blessed_executable_suffixes[] =3D { - &ro_u_com, &ro_u_exe, &ro_u_scr, &ro_u_sys,