* dcrt0.cc (dll_crt0_1): Add a symbol denoting return from call to main().
* exceptions.cc (stack_info::walk): Stop walking the stack when we hit
_cygwin_exit_return rather than just blindly stopping when PC becomes zero.
* fhandler_disk_file.cc (fhandler_base::fstat_by_name): Check for
file systems incapable of handling FileIdBothDirectoryInformation
correctly.
(fhandler_disk_file::opendir): Ditto.
* path.cc (fs_info::update): Always clear at the start.
Rearrange to make certain tests only on non-Samba, non-NFS remote
drives.
Add test for file systems known to be incapable of handling
FileIdBothDirectoryInformation correctly. Right now that's just
"UNIXFS".
* path.h (struct fs_info): Add has_buggy_fileid_dirinfo flag and
accessor methods.
(class path_conv): Add has_buggy_fileid_dirinfo method.
* dcrt0.cc (dll_crt0_0): Remove calling malloc_init and
user_shared_initialize_1 from here.
(dll_crt0_1): Remove dynamically_loaded check. Just call malloc_init and
user_shared_initialize unconditionally.
* shared.cc (user_shared_create): Rename from user_shared_initialize.
(user_shared_initialize): Rename from user_shared_initialize_1. Move complete
user_shared content initialization code here from user_shared_create.
* syscalls.cc (seteuid32): Remove call to user_shared_initialize_1. That is
implied by the "true" argument to user_shared_create().
* mount.cc (mount_info::init): Add location where we're looking for fstab to
temporary message.
* lib/cygwin_crt0.c (cygwin_crt0): Simplify by eliminating accommodations for
ancient cygwin DLLs.
* lib/crt0.h: Include <windows.h> directly since it is needed.
* shared_info.h (shared_destroy): Declare.
* shared.cc (shared_destroy): Define new function to destroy shared memory
regions.
* init.cc (dll_entry): Call shared_destroy when dll detaches from the process.
* fhandler_socket.cc (fhandler_socket::send_internal): Send never more
then 64K bytes at once. For blocking sockets, loop until entire data
has been sent or an error occurs.
(fhandler_socket::sendto): Drop code which sends on 64K bytes.
(fhandler_socket::sendmsg): Ditto.
* dcrt0.cc (dll_crt0_0): Call malloc_init and user_shared_initialize_1
here in case we're dynamically loaded. Explain why.
(dll_crt0_1): Call user_shared_initialize_1 from here.
* mount.cc (is_native_path): New inline function testing for native
and long Win32 path prefix.
(is_unc_share): Remove long WIn32 path prefix test.
(mount_info::create_root_entry): Use PATH_MAX buffer.
(mount_info::init): Ditto.
(mount_info::add_item): Test for is_native_path as well.
* path.cc (normalize_win32_path): Simplify native path prefix code.
* shared.cc (user_shared_initialize_1): New function taking user
shared initialization code relying on malloc and cygtls.
(user_shared_initialize): Move mountinfo initialization to
user_shared_initialize_1.
* shared_info.h (user_shared_initialize_1): Declare.
* syscalls.cc (seteuid32): Call user_shared_initialize_1 after user
changed.
* shared.cc (user_shared_initialize): Fetch potentially changed Cygwin
username from /etc/passwd before loading mount table.
(shared_info::init_installation_root): New function fetching Cygwin's
installation root dir and storing as native NT path in global shared
memory.
(shared_info::initialize): Call init_installation_root exactly once at
first startup.
* shared_info.h (SHARED_INFO_CB): Accommodate change to shared_info.
(CURR_SHARED_MAGIC): Ditto.
(class shared_info): Add installation_root member.
(shared_info::init_installation_root): Declare.
* grp.cc (pwdgrp::read_group): Call pwdgrp::load with native WCHAR path.
* passwd.cc (pwdgrp::read_passwd): Ditto. Avoid recursion.
(etc::init): Take POBJECT_ATTRIBUTES instead of path_conv.
* path.h (etc::init): Change prototype accordingly.
* pwdgrp.h (class pwdgrp): Store path as UNICODE_STRING/PWCHAR instead
of as path_conv.
(pwdgrp::load): Accommodate prototype.
* uinfo.cc (pwdgrp::load): Change argument type from char to wchar_t.
Create native NT path here instead of calling path_conv.
* mount.cc (find_root_from_cygwin_dll): Drop in favor of global
initializaion in shared_info.
(mount_info::init): Fetch native NT root dir from cygwin_shared.
(mount_info::from_fstab): Expect native NT path and use native NT
functions to access file. Convert username part in user fstab path
according to special char transformation rules.
* path.cc (tfx_chars): Convert slash to backslash.
(transform_chars): Implement for path given as PWCHAR.
(transform_chars): PUNICODE_STRING version calls PWCHAR version.
Remove useless commented code.
* mkgroup.c (enum_groups): Create full qualified groupname using
domain or servername, depending on printing domain or machine accounts.
* mkpasswd.c (enum_users): Ditto for users.
* Makefile.in (cygcheck.exe): Link against ntdll.
* bloda.cc: Use statically linked functions throughout.
* cygpath.cc: Drop 9x considerations.
* mkgroup.c: Revamp. Redefine -l and -d options to take optional
machine and domain parameters. Redefine -c to work always, using
token information. Add -L, -D, -C to create unique groupnames in
domain\group syntax. Add -S option to define domain\group separator
char. Ignore -u and -s options.
* mkpasswd.c: Revamp. Redefine -l and -d options to take optional
machine and domain parameters. Redefine -c to work always, using
token information. Add -L, -D, -C to create unique usernames in
domain\user syntax. Add -S option to define domain\user separator
char. Ignore -g and -s options. Prefer to take homedir from $HOME
over $HOMEDRIVE/$HOMEPATH.
* path.cc (oopts): Add "acl", "noacl", "posix=0" and "posix=1" options.
(getmntent): Accomodate throughout.
* ps.cc: Fix copyright dates.
* utils.sgml: Fix text for mkgroup and mkpasswd.
Jeff Johnston [Mon, 21 Jul 2008 21:28:34 +0000 (21:28 +0000)]
2008-07-21 Jeff Johnston <jjohnstn@redhat.com>
* libc/ctype/ctype_.c: Add new pointer __ctype_ptr__ which is one
less than the old __ctype_ptr.
* libc/ctype/isalnum.c: Use __ctype_ptr__.
* libc/ctype/isalpha.c: Ditto.
* libc/ctype/iscntrl.c: Ditto.
* libc/ctype/isdigit.c: Ditto.
* libc/ctype/islower.c: Ditto.
* libc/ctype/isprint.c: Ditto.
* libc/ctype/ispunct.c: Ditto.
* libc/ctype/isspace.c: Ditto.
* libc/ctype/isupper.c: Ditto.
* libc/ctype/isxdigit.c: Ditto.
* libc/include/ctype.h: Change ctype macros to use new __ctype_ptr__
and add declaration of __ctype_ptr__. Remove older ctype table pointers
from here even though they can still work.
* autoload.cc (WNetGetProviderNameA): Define.
(WNetGetResourceParentA): Remove.
* fhandler_netdrive.cc (struct net_hdls): New structure to keep
WNet handles. Stored in dir->__handle throughout.
(thread_netdrive): Rewrite to enumerate all servers in all accessible
domains and workgroups.
(fhandler_netdrive::readdir): Simplify toplevel code. Lowercase all
server names in toplevel.
(fhandler_netdrive::rewinddir): Close all WNet handles and free
net_hdls structure.
* fhandler.cc (fhandler_base::open): Rename x to fh. On Samba, always
create file with NULL security descriptor and set the permissions
afterwards. Explain why.
Add case-sensitivity.
Unconditionally handle mount points case-sensitive.
Unconditionally handle virtual paths case-sensitive.
Unconditionally handle registry paths case-insensitive.
Otherwise, accommodate case-sensitivity of given path throughout.
* cygheap.cc (cygheap_root::set): Get additional caseinsensitive
parameter and store it.
* cygheap.h (struct cygheap_root_mount_info): Add member
caseinsensitive.
* dlfcn.cc (get_full_path_of_dll): Drop PC_NOFULL parameter from call
to path_conv::check.
* environ.cc (pcheck_case): Remove.
(check_case_init): Remove.
(known): Drop "check_case" option.
* exceptions.cc (open_stackdumpfile): Add comment.
* fhandler.cc (fhandler_base::get_default_fmode): Call pathmatch
instead of strcasematch.
* fhandler_disk_file.cc: Accommodate case-sensitivity of given path
throughout.
(__DIR_mounts::check_mount): Unconditionally check virtual paths
case-sensitive.
(fhandler_disk_file::link): Drop case clash handling.
(fhandler_disk_file::open): Ditto.
(fhandler_disk_file::readdir_helper): Drop managed mount code.
* mount.cc: Remove managed mount code and datastructures.
(struct opt): Remove "managed" option. Add "posix=0" and "posix=1"
options.
(fillout_mntent): Remove "managed" output. Add "posix" output.
* path.cc (struct symlink_info): Remove case_clash member and
case_check method.
(pcheck_case): Remove.
(path_prefix_p): Take additional bool parameter "caseinsensitive".
(pathnmatch): Ditto.
(pathmatch): Ditto.
(mkrelpath): Ditto.
(fs_info::update): Set caseinsensitive flag according to file system
name and FILE_CASE_SENSITIVE_SEARCH flag. Add comment.
(tfx_chars_managed): Remove.
(transform_chars): Drop "managed" parameter. Always use tfx_chars.
(get_nt_native_path): Drop "managed" parameter. Make sure drive letters
are always upper case.
(getfileattr): Change second parameter to denote caseinsensitivity.
(path_conv::check): Initialize caseinsensitive to OBJ_CASE_INSENSITIVE.
Set caseinsensitive according to global obcaseinsensitive flag, file
system case sensitivity and MOUNT_NOPOSIX mount flag.
Drop case_clash and all the related code.
(symlink_worker): Drop case clash handling.
(symlink_info::set): Drop setting case_clash.
(symlink_info::case_check): Remove.
(cwdstuff::set): Add comment.
(etc::init): Take path_conv instead of PUNICODE_STRING as parameter to
allow case sensitivity.
* path.h (enum pathconv_arg): Drop PC_SYM_IGNORE.
(enum case_checking): Remove.
(enum path_types): Drop PATH_ENC, add PATH_NOPOSIX flag.
(struct fs_info): Add caseinsensitive flag and accessor methods.
(class path_conv): Add caseinsensitive member and define
objcaseinsensitive method. Drop case_clash member and isencoded method.
(pathmatch): Change prototype according to above change.
(pathnmatch): Ditto.
(path_prefix_p): Ditto.
(get_nt_native_path): Ditto.
(class etc): Ditto.
(fnunmunge): Remove prototype.
* shared.cc (shared_info::init_obcaseinsensitive): Initialize
obcaseinsensitive flag from obcaseinsensitive registry value.
(shared_info::initialize): Call init_obcaseinsensitive here by the
first process creating the shared memory.
* shared_info.h (mount_item::fnmunge): Remove.
(shared_info::obcaseinsensitive): Rename from obcaseinsensitivity.
(shared_info::init_obcaseinsensitive): Declare.
* syscalls.cc (try_to_bin): Add comment.
* include/sys/mount.h (MOUNT_ENC): Remove flag.
(MOUNT_NOPOSIX): Add flag.
* fhandler_tape.cc (mtinfo::initialize): Remove synchronization stuff.
Just initialize drive data.
* mtinfo.h (MTINFO_MAGIC): Remove.
(MTINFO_VERSION): Remove.
(class mtinfo): Remove magic and version members.
* shared.cc (shared_info::initialize): Move call to
get_session_parent_dir so that the dir creation is only called once.
Move call to mt.initialize so that it's called only by the first
process creating the shared memory.
* shared_info.h (SHARED_INFO_CB): Accommodate change to shared_info.
(CURR_SHARED_MAGIC): Ditto.
(class shared_info): Add obcaseinsensitivity member.
* cyglsa.c: Include ntddk.h again, but only if __MINGW32__ is defined.
* cyglsa64.dll: Regenerate.
* make-64bit-version-with-visual-c.bat: Fix comment.
* autoload.cc (GetExtendedTcpTable): Define.
* fhandler_socket.cc (address_in_use): Take const struct sockaddr
pointer as argument. Implement additional AF_INET6 table check.
(fhandler_socket::bind): Drop AF_INET test before calling
address_in_use.
* net.cc (ipv4_getnameinfo): Return EAI_FAMILY instead of 1 if
called with unsupported af_family.
* cyglsa.c: Don't include ntddk.h.
(RtlInitEmptyUnicodeString): Use Visual-C compatible "__inline" instead
of "inline".
(uni_alloc): Change second argument to USHORT.
(printf): Move definition of ap to make Visual-C++ happy.
(LsaApLogonUserEx): Compute size of datastructure returned to
LSA on 64 bit systems correctly to avoid heap corruption.
* cyglsa64.dll: Regenerate.
* make-64bit-version-with-visual-c.bat: Accommodate newer Microsoft
toolchains. Add more comment.
* mslsa.def: Export LsaApLogonUserEx instead of LsaApLogonUser.
Jie Zhang [Fri, 11 Jul 2008 19:24:39 +0000 (19:24 +0000)]
bfd/
* elf.c (_bfd_elf_map_sections_to_segments): Don't put
executable sections into the same segment with other
read only sections if --sep-code.
* elf32-bfin.c (elf32_bfin_code_in_l1): New variable.
(elf32_bfin_data_in_l1): New variable.
(elf32_bfin_final_write_processing): New.
(elf32_bfin_special_sections[]): New.
(elf_backend_final_write_processing): Define.
(elf_backend_special_sections): Define.
binutils/
* readelf.c (get_machine_flags): Deal with Blackfin specific
flags.
* cyglsa.c (LsaApLogonUserEx): Accommodate the fact that authinf->domain
and authinf->username are now of type WCHAR. Change sam_username and
sam_u size to be deifned in terms of MAX_DOMAIN_NAME_LEN instead of
INTERNET_MAX_HOST_NAME_LENGTH.
Change length for domain buffers from INTERNET_MAX_HOST_NAME_LENGTH to
MAX_DOMAIN_NAME_LEN throughout.
* cyglsa.h (CYG_LSA_MAGIC): New value.
(cyglsa_t): Define username and domain as WCHAR arrays.
* errno.cc (errmap): Add mapping for ERROR_NONE_MAPPED.
* sec_auth.cc: Drop 'w' prefix from WCHAR string variable names where
appropriate.
(extract_nt_dom_user): Prefer resolving by SID before resolving by
domain\name pair.
(cygwin_logon_user): Don't print cleartext password in debug output.
Change comment.
(get_user_groups): Revert calls to LookupAccountNameW to use NULL
server instead of explicit server name, according to MSDN.
(get_user_local_groups): Ditto.
(get_server_groups): Fetch domain and user name from usersid per
LookupAccountSidW instead of calling extract_nt_dom_user.
(lsaauth): Fetch domain and user name from usersid per LookupAccountSidW
instead of calling extract_nt_dom_user.
* sec_helper.cc (cygpriv): Convert to wchar_t pointer array.
(privilege_luid): Convert first parameter to PWCHAR.
(privilege_name): Return wchar_t pointer.
(set_privileges): Accommodate debug output.
* security.h (privilege_luid): Change prototype accordingly.
* cyglsa.h (SECURITY_STRING): Define.
(enum _SECPKG_NAME_TYPE): Define.
(struct _SECPKG_CALL_INFO): Define.
(struct _LSA_SECPKG_FUNCS): Extend to full size. Define unused
functions lazily.
(cygprf_t): Define.
* sec_auth.cc (lsaauth): Use actual primary group if no admins group.
Add (disabled) code to fetch token from profil data.
* mkgroup.c: Use statically linked functions throughout, except for
DsGetDcNameW. Reformat. Convert to use WCHAR for names throughout.
Use defines instead of constants throughout.
(MAX_SID_LEN): Define.
(load_netapi): Just load DsGetDcNameW pointer.
(psx_dir): Remove.
(uni2ansi): Remove.
(enum_local_users): Take server name and use in Net... call.
(DBGSID): Define datastructure.
(MAX_BUILTIN_SIDS): Define.
(builtin_sid_list): Define global sid list.
(builtin_sid_cnt): Define counter for global sid list.
(enum_local_groups): Take server name and use in Net... and Lookup...
calls. Take offset argument. Use MAX_PREFERRED_LENGTH in call to
NetLocalGroupEnum. Check for duplicate builtin groups.
(enum_users): Take server name and use in Net... call.
(usage): Change text slightly.
(print_version): Fix copyright.
(main): Call enum_local_groups for domains as well.
* mkpasswd.c: Use statically linked functions throughout, except for
DsGetDcNameW. Reformat. Convert to use WCHAR for names throughout.
Use defines instead of constants throughout.
(MAX_SID_LEN): Define.
(load_netapi): Just load DsGetDcNameW pointer.
(uni2ansi): Use wcstombs.
(current_user): Replace "unused_by_nt/2000/xp" by
just "unused".
(enum_users): Ditto.
(print_version): Fix copyright.
* autoload.cc (DsGetDcNameW): Replace DsGetDcNameA.
* dcrt0.cc (child_info_spawn::handle_spawn): Drop artificial
supplementary group list from calling setgroups in parent.
* grp.cc (internal_getgroups): Drop 9x-only code. Reformat.
* sec_auth.cc (get_logon_server): Do everything in WCHAR only.
(get_user_groups): Ditto. Use wlogonserver in LookupAccountNameW
calls, too.
(is_group_member): Get logon server as first argument and use in call
to NetLocalGroupGetMembers.
(get_user_local_groups): Get logon server as first argument and use in
calls to NetLocalGroupEnum and LookupAccountNameW. Revamp to work
more correctly in domain environments.
(get_server_groups): Accommodate aforementioned changed function calls.
* security.h (get_logon_server): Change prototype accordingly.
* uinfo.cc (cygheap_user::env_logsrv): Accommodate changed
get_logon_server call.
* fhandler_socket.cc (fhandler_socket::bind): Don't run explicit
local socket test in SO_REUSEADDR case on systems supporting
enhanced socket security. Explain why. Only call address_in_use
for AF_INET sockets.
* net.cc (cygwin_setsockopt): Don't call setsockopt to set SO_REUSEADDR
on systems supporting enhanced socket security. Add comment.
* wincap.h (wincaps::has_enhanced_socket_security): New element.
* wincap.cc: Implement above element throughout.