From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2155) id 0DE6E3858C31; Wed, 20 Mar 2024 13:49:47 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0DE6E3858C31 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1710942587; bh=nWDgre6oTTERr/v/MXzKzIQHZirBkEQYeu0MFr3ygig=; h=From:To:Subject:Date:From; b=bLfKPa1YtdvbyRpsWsGwgAEY/TAy8CSsitKO1knVRAOMHSJ59ruRjw73LoRSyFb+2 L+ghd2v92L4Ypt4RpHBZ1Bw8D4StCDTEdOawWCol7zG9ALZFiK9CycsQnaD9L+ZCuM roM+0TRexnxJp1+u/GYi+xeQuBhUfHhdnz3cb4Ho= 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/main] Cygwin: (mostly) drop NT4 and Samba < 3.0 support X-Act-Checkin: newlib-cygwin X-Git-Author: Corinna Vinschen X-Git-Refname: refs/heads/main X-Git-Oldrev: 14970f2645cb89adae5885898052a079fe7f9c10 X-Git-Newrev: 17191696040a59dfbdc092d0ffe938a17039baed Message-Id: <20240320134947.0DE6E3858C31@sourceware.org> Date: Wed, 20 Mar 2024 13:49:47 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dnewlib-cygwin.git;h=3D17191696040= a59dfbdc092d0ffe938a17039baed commit 17191696040a59dfbdc092d0ffe938a17039baed Author: Corinna Vinschen AuthorDate: Wed Mar 20 12:31:12 2024 +0100 Commit: Corinna Vinschen CommitDate: Wed Mar 20 12:31:50 2024 +0100 Cygwin: (mostly) drop NT4 and Samba < 3.0 support =20 Signed-off-by: Corinna Vinschen Diff: --- winsup/cygwin/fhandler/disk_file.cc | 7 +--- winsup/cygwin/fhandler/netdrive.cc | 4 -- winsup/cygwin/release/3.6.0 | 2 + winsup/cygwin/sec/base.cc | 3 +- winsup/cygwin/uinfo.cc | 77 +++++++++++----------------------= ---- 5 files changed, 27 insertions(+), 66 deletions(-) diff --git a/winsup/cygwin/fhandler/disk_file.cc b/winsup/cygwin/fhandler/d= isk_file.cc index 9aadbb539f01..c5b78984d72a 100644 --- a/winsup/cygwin/fhandler/disk_file.cc +++ b/winsup/cygwin/fhandler/disk_file.cc @@ -148,14 +148,9 @@ path_conv::isgood_inode (ino_t ino) const are to be trusted. */ if (ino > UINT32_MAX || !isremote ()) return true; - /* The inode numbers returned from a remote NT4 NTFS are ephemeral - 32 bit numbers. */ - if (fs_is_ntfs ()) - return false; /* Starting with version 3.5.4, Samba returns the real inode numbers, if the file is on the same device as the root of the share (Samba functi= on - get_FileIndex). 32 bit inode numbers returned by older versions (lik= ely - < 3.0) are ephemeral. */ + get_FileIndex). */ if (fs_is_samba () && fs.samba_version () < 0x03050400) return false; /* Otherwise, trust the inode numbers unless proved otherwise. */ diff --git a/winsup/cygwin/fhandler/netdrive.cc b/winsup/cygwin/fhandler/ne= tdrive.cc index 58ab8811b0f8..7c3207139846 100644 --- a/winsup/cygwin/fhandler/netdrive.cc +++ b/winsup/cygwin/fhandler/netdrive.cc @@ -293,10 +293,6 @@ fhandler_netdrive::readdir (DIR *dir, dirent *de) char *rpath =3D tp.c_get (); sys_wcstombs (rpath, NT_MAX_PATH, nro->lpRemoteName); de->d_ino =3D readdir_get_ino (rpath, false); - /* We can't trust remote inode numbers of only 32 bit. That means, - remote NT4 NTFS, as well as shares of Samba version < 3.0. */ - if (de->d_ino <=3D UINT32_MAX) - de->d_ino =3D hash_path_name (0, rpath); } de->d_type =3D DT_DIR; =20 diff --git a/winsup/cygwin/release/3.6.0 b/winsup/cygwin/release/3.6.0 index 20aab2b44dc8..8d9e483803e0 100644 --- a/winsup/cygwin/release/3.6.0 +++ b/winsup/cygwin/release/3.6.0 @@ -19,3 +19,5 @@ What changed: =20 - ps -f now prints the commandline rather than the full path to the executable. + +- Drop support for NT4 and Samba < 3.0. diff --git a/winsup/cygwin/sec/base.cc b/winsup/cygwin/sec/base.cc index 0fc8699bfc9e..d5e39d281aee 100644 --- a/winsup/cygwin/sec/base.cc +++ b/winsup/cygwin/sec/base.cc @@ -310,7 +310,8 @@ get_file_attribute (HANDLE handle, path_conv &pc, share returns STATUS_INVALID_NETWORK_RESPONSE, which in turn is converted to ERROR_BAD_NET_RESP. This potentially occurs when trying to fetch DACLs from a NT4 machine which is not part of the domain of - the requesting machine. */ + the requesting machine. + FIXME: We dropped NT4 support, but are there other scenarios? */ else if (get_errno () !=3D ENOSYS) { if (uidret) diff --git a/winsup/cygwin/uinfo.cc b/winsup/cygwin/uinfo.cc index acbc945e41d9..27dc2892c859 100644 --- a/winsup/cygwin/uinfo.cc +++ b/winsup/cygwin/uinfo.cc @@ -2459,64 +2459,31 @@ pwdgrp::fetch_account_from_windows (fetch_user_arg_= t &arg, cyg_ldap *pldap) /* Skip this when creating group entries and for non-users. */ if (is_group() || acc_type !=3D SidTypeUser) break; - /* On AD machines, use LDAP to fetch domain account infos. */ - if (cygheap->dom.primary_dns_name ()) + /* Fetch primary group from AD and overwrite the one we + just guessed above. */ + if (cldap->fetch_ad_account (sid, false, domain)) { - /* Fetch primary group from AD and overwrite the one we - just guessed above. */ - if (cldap->fetch_ad_account (sid, false, domain)) - { - if ((val =3D cldap->get_account_name ())) - wcscpy (name, val); - if ((id_val =3D cldap->get_primary_gid ()) !=3D ILLEGAL_GID) - gid =3D posix_offset + id_val; - } - home =3D cygheap->pg.get_home (cldap, sid, dom, domain, - name, fully_qualified_name); - shell =3D cygheap->pg.get_shell (cldap, sid, dom, domain, - name, - fully_qualified_name); - gecos =3D cygheap->pg.get_gecos (cldap, sid, dom, domain, - name, fully_qualified_name); - /* Check and, if necessary, add unix<->windows id mapping - on the fly, unless we're called from getpwent. */ - if (!pldap && cldap->is_open ()) - { - id_val =3D cldap->get_unix_uid (); - if (id_val !=3D ILLEGAL_UID - && cygheap->ugid_cache.get_uid (id_val) - =3D=3D ILLEGAL_UID) - cygheap->ugid_cache.add_uid (id_val, uid); - } + if ((val =3D cldap->get_account_name ())) + wcscpy (name, val); + if ((id_val =3D cldap->get_primary_gid ()) !=3D ILLEGAL_GID) + gid =3D posix_offset + id_val; } - /* If primary_dns_name() is empty, we're likely running under an - NT4 domain, so we can't use LDAP. For user accounts fall back - to NetUserGetInfo. This isn't overly fast, but keep in mind - that NT4 domains are mostly replaced by AD these days. */ - else + home =3D cygheap->pg.get_home (cldap, sid, dom, domain, + name, fully_qualified_name); + shell =3D cygheap->pg.get_shell (cldap, sid, dom, domain, + name, + fully_qualified_name); + gecos =3D cygheap->pg.get_gecos (cldap, sid, dom, domain, + name, fully_qualified_name); + /* Check and, if necessary, add unix<->windows id mapping + on the fly, unless we're called from getpwent. */ + if (!pldap && cldap->is_open ()) { - WCHAR server[INTERNET_MAX_HOST_NAME_LENGTH + 3]; - NET_API_STATUS nas; - PUSER_INFO_3 ui; - - if (!get_logon_server (cygheap->dom.primary_flat_name (), - server, DS_IS_FLAT_NAME)) - break; - nas =3D NetUserGetInfo (server, name, 3, (PBYTE *) &ui); - if (nas !=3D NERR_Success) - { - debug_printf ("NetUserGetInfo(%W) %u", name, nas); - break; - } - /* Overwrite name to be sure case is same as in SAM */ - wcscpy (name, ui->usri3_name); - gid =3D posix_offset + ui->usri3_primary_group_id; - home =3D cygheap->pg.get_home (ui, sid, dom, name, - fully_qualified_name); - shell =3D cygheap->pg.get_shell (ui, sid, dom, name, - fully_qualified_name); - gecos =3D cygheap->pg.get_gecos (ui, sid, dom, name, - fully_qualified_name); + id_val =3D cldap->get_unix_uid (); + if (id_val !=3D ILLEGAL_UID + && cygheap->ugid_cache.get_uid (id_val) + =3D=3D ILLEGAL_UID) + cygheap->ugid_cache.add_uid (id_val, uid); } } /* Otherwise check account domain (local SAM).*/