CVSROOT:        /cvs/src
Module name:    src
Changes by:     cori...@sourceware.org  2014-02-09 19:44:56

Modified files:
        winsup/cygwin  : ChangeLog Makefile.in autoload.cc cygheap.h 
                         cygtls.h fhandler_disk_file.cc 
                         fhandler_process.cc fhandler_procsysvipc.cc 
                         fhandler_registry.cc grp.cc passwd.cc path.cc 
                         path.h pinfo.cc pwdgrp.h sec_acl.cc sec_auth.cc 
                         sec_helper.cc security.cc security.h 
                         setlsapwd.cc shared.cc syscalls.cc tlsoffsets.h 
                         tlsoffsets64.h uinfo.cc winsup.h 
Added files:
        winsup/cygwin  : ldap.cc ldap.h 

Log message:
        Introduce reading passwd/group entries from SAM/AD.  Introduce
        /etc/nsswitch.conf file to configure it.
        * Makefile.in (DLL_OFILES): Add ldap.o.
        * autoload.cc: Import ldap functions from wldap32.dll.
        (DsEnumerateDomainTrustsW): Import.
        (NetGroupGetInfo): Import.
        * cygheap.h (class cygheap_domain_info): New class to keep global
        domain info.
        (class cygheap_pwdgrp): New class to keep passwd/group caches and
        configuration info from /etc/nssswitch.conf.
        (struct init_cygheap): Add cygheap_domain_info member "dom" and
        cygheap_pwdgrp member "pg".
        * cygtls.h (struct _local_storage): Remove unused member "res".
        Rearrange slightly, Add members pwbuf and grbuf to implement non-caching
        passwd/group fetching from SAM/AD.  Make pw_pos and pw_pos unsigned.
        * fhandler_disk_file.cc (fhandler_base::fstat_by_nfs_ea): Add RFC 2307
        uid/gid mapping.
        * fhandler_process.cc: Drop including pwdgrp.h.
        * fhandler_procsysvipc.cc: Ditto.
        * fhandler_registry.cc (fhandler_registry::fstat): Set key uid/gid
        to ILLEGAL_UID/ILLEGAL_GID rather than UNKNOWN_UID/UNKNOWN_GID.
        * grp.cc (group_buf): Drop.
        (gr): Drop.
        (pwdgrp::parse_group): Fill pg_grp.
        (pwdgrp::read_group): Remove.
        (pwdgrp::init_grp): New method.
        (pwdgrp::prep_tls_grbuf): New method.
        (pwdgrp::find_group): New methods.
        (internal_getgrsid): Convert to call new pwdgrp methods.
        (internal_getgrnam): Ditto.
        (internal_getgrgid): Ditto.
        (getgrgid_r): Drop 2nd parameter from internal_getgrgid call.
        (getgrgid32): Ditto.
        (getgrnam_r): Ditto for internal_getgrnam.
        (getgrnam32): Ditto.
        (getgrent32): Convert to call new pwdgrp methods.
        (internal_getgrent): Remove.
        (internal_getgroups): Simplify, especially drop calls to
        internal_getgrent.
        * ldap.cc: New file implementing cyg_ldap class for LDAP access to AD
        and RFC 2307 server.
        * ldap.h: New header, declaring cyg_ldap class.
        * passwd.cc (passwd_buf): Drop.
        (pr): Drop.
        (pwdgrp::parse_passwd): Fill pg_pwd.
        (pwdgrp::read_passwd): Remove.
        (pwdgrp::init_pwd): New method.
        (pwdgrp::prep_tls_pwbuf): New method.
        (find_user): New methods.
        (internal_getpwsid): Convert to call new pwdgrp methods.
        (internal_getpwnam): Ditto.
        (internal_getpwuid): Ditto.
        (getpwuid32): Drop 2nd parameter from internal_getpwuid call.
        (getpwuid_r): Ditto.
        (getpwnam): Ditto for internal_getpwnam.
        (getpwnam_r): Ditto.
        (getpwent): Convert to call new pwdgrp methods.
        * path.cc (class etc): Remove all methods.
        * path.h (class etc): Drop.
        * pinfo.cc (pinfo_basic::pinfo_basic): Set gid to ILLEGAL_GID rather
        than UNKNOWN_GID.
        (pinfo_init): Ditto.
        * pwdgrp.h (internal_getpwnam): Drop 2nd parameter from declaration.
        (internal_getpwuid): Ditto.
        (internal_getgrgid): Ditto.
        (internal_getgrnam): Ditto.
        (internal_getgrent): Drop declaration.
        (enum fetch_user_arg_type_t): New type.
        (struct fetch_user_arg_t): New type.
        (struct pg_pwd): New type.
        (struct pg_grp): New type.
        (class pwdgrp): Rework to provide functions for file and db requests
        and caching.
        (class ugid_cache_t): New class to provide RFC 2307 uid map caching.
        (ugid_cache): Declare.
        * sec_acl.cc: Drop including pwdgrp.h.
        * sec_auth.cc: Drop including dsgetdc.h and pwdgrp.h.
        (get_logon_server): Convert third parameter to ULONG flags argument
        to allow arbitrary flags values in DsGetDcNameW call and change calls
        to this function throughout.  Use cached account domain name rather
        than calling GetComputerNameW.
        (get_unix_group_sidlist): Remove.
        (get_server_groups): Drop call to get_unix_group_sidlist.
        (verify_token): Rework token group check without calling
        internal_getgrent.
        * sec_helper.cc (cygpsid::pstring): New methods, like string() but
        return pointer to end of string.
        (cygsid::getfromstr): Add wide character implementation.
        (get_sids_info): Add RFC 2307 uid/gid mapping for Samba shares.
        * security.cc: Drop including pwdgrp.h.
        * security.h (DEFAULT_UID): Remove.
        (UNKNOWN_UID): Remove.
        (UNKNOWN_GID): Remove.
        (uinfo_init): Move here from winsup.h.
        (ILLEGAL_UID): Ditto.
        (ILLEGAL_GID): Ditto.
        (UNIX_POSIX_OFFSET): Define.  Add lengthy comment.
        (UNIX_POSIX_MASK): Ditto.
        (MAP_UNIX_TO_CYGWIN_ID): Ditto.
        (ILLEGAL_UID16): Move here from winsup.h.
        (ILLEGAL_GID16): Ditto.
        (uid16touid32): Ditto.
        (gid16togid32): Ditto.
        (sid_id_auth): New convenience macro for SID component access.
        (sid_sub_auth_count): Ditto.
        (sid_sub_auth): Ditto.
        (sid_sub_auth_rid): Ditto.
        (cygpsid::pstring): Declare.
        (cygsid::getfromstr): Declare wide character variant.
        (cygsid::operator=): Ditto.
        (cygsid::operator*=): Ditto.
        (get_logon_server): Change declaration according to source code.
        * setlsapwd.cc (setlsapwd): Drop 2nd parameter from internal_getpwnam
        call.
        * shared.cc (memory_init): Call cygheap->pg.init in first process.
        * syscalls.cc: Drop including pwdgrp.h.
        * tlsoffsets.h: Regenerate.
        * tlsoffsets64.h: Ditto.
        * uinfo.cc (internal_getlogin): Drop gratuitious internal_getpwuid
        call.  Fix debug output.  Overwrite user gid in border case of a
        missing passwd file while a group file exists.
        (pwdgrp::add_line): Allocate memory on cygheap.
        (pwdgrp::load): Remove.
        (ugid_cache): Define.
        (cygheap_pwdgrp::init): New method.
        (cygheap_pwdgrp::nss_init_line): New method.
        (cygheap_pwdgrp::_nss_init): New method.
        (cygheap_domain_info::init): New method.
        (logon_sid): Define.
        (get_logon_sid): New function.
        (pwdgrp::add_account_post_fetch): New method.
        (pwdgrp::add_account_from_file): New methods.
        (pwdgrp::add_account_from_windows): New methods.
        (pwdgrp::check_file): New method.
        (pwdgrp::fetch_account_from_line): New method.
        (pwdgrp::fetch_account_from_file): New method.
        (pwdgrp::fetch_account_from_windows): New method.
        * winsup.h: Move aforementioned macros and declarations to security.h.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/src/winsup/cygwin/ldap.cc.diff?cvsroot=src&r1=NONE&r2=1.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/winsup/cygwin/ldap.h.diff?cvsroot=src&r1=NONE&r2=1.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/winsup/cygwin/ChangeLog.diff?cvsroot=src&r1=1.6317&r2=1.6318
http://sourceware.org/cgi-bin/cvsweb.cgi/src/winsup/cygwin/Makefile.in.diff?cvsroot=src&r1=1.271&r2=1.272
http://sourceware.org/cgi-bin/cvsweb.cgi/src/winsup/cygwin/autoload.cc.diff?cvsroot=src&r1=1.222&r2=1.223
http://sourceware.org/cgi-bin/cvsweb.cgi/src/winsup/cygwin/cygheap.h.diff?cvsroot=src&r1=1.166&r2=1.167
http://sourceware.org/cgi-bin/cvsweb.cgi/src/winsup/cygwin/cygtls.h.diff?cvsroot=src&r1=1.92&r2=1.93
http://sourceware.org/cgi-bin/cvsweb.cgi/src/winsup/cygwin/fhandler_disk_file.cc.diff?cvsroot=src&r1=1.394&r2=1.395
http://sourceware.org/cgi-bin/cvsweb.cgi/src/winsup/cygwin/fhandler_process.cc.diff?cvsroot=src&r1=1.124&r2=1.125
http://sourceware.org/cgi-bin/cvsweb.cgi/src/winsup/cygwin/fhandler_procsysvipc.cc.diff?cvsroot=src&r1=1.7&r2=1.8
http://sourceware.org/cgi-bin/cvsweb.cgi/src/winsup/cygwin/fhandler_registry.cc.diff?cvsroot=src&r1=1.80&r2=1.81
http://sourceware.org/cgi-bin/cvsweb.cgi/src/winsup/cygwin/grp.cc.diff?cvsroot=src&r1=1.122&r2=1.123
http://sourceware.org/cgi-bin/cvsweb.cgi/src/winsup/cygwin/passwd.cc.diff?cvsroot=src&r1=1.96&r2=1.97
http://sourceware.org/cgi-bin/cvsweb.cgi/src/winsup/cygwin/path.cc.diff?cvsroot=src&r1=1.688&r2=1.689
http://sourceware.org/cgi-bin/cvsweb.cgi/src/winsup/cygwin/path.h.diff?cvsroot=src&r1=1.181&r2=1.182
http://sourceware.org/cgi-bin/cvsweb.cgi/src/winsup/cygwin/pinfo.cc.diff?cvsroot=src&r1=1.328&r2=1.329
http://sourceware.org/cgi-bin/cvsweb.cgi/src/winsup/cygwin/pwdgrp.h.diff?cvsroot=src&r1=1.30&r2=1.31
http://sourceware.org/cgi-bin/cvsweb.cgi/src/winsup/cygwin/sec_acl.cc.diff?cvsroot=src&r1=1.75&r2=1.76
http://sourceware.org/cgi-bin/cvsweb.cgi/src/winsup/cygwin/sec_auth.cc.diff?cvsroot=src&r1=1.49&r2=1.50
http://sourceware.org/cgi-bin/cvsweb.cgi/src/winsup/cygwin/sec_helper.cc.diff?cvsroot=src&r1=1.103&r2=1.104
http://sourceware.org/cgi-bin/cvsweb.cgi/src/winsup/cygwin/security.cc.diff?cvsroot=src&r1=1.265&r2=1.266
http://sourceware.org/cgi-bin/cvsweb.cgi/src/winsup/cygwin/security.h.diff?cvsroot=src&r1=1.125&r2=1.126
http://sourceware.org/cgi-bin/cvsweb.cgi/src/winsup/cygwin/setlsapwd.cc.diff?cvsroot=src&r1=1.6&r2=1.7
http://sourceware.org/cgi-bin/cvsweb.cgi/src/winsup/cygwin/shared.cc.diff?cvsroot=src&r1=1.161&r2=1.162
http://sourceware.org/cgi-bin/cvsweb.cgi/src/winsup/cygwin/syscalls.cc.diff?cvsroot=src&r1=1.659&r2=1.660
http://sourceware.org/cgi-bin/cvsweb.cgi/src/winsup/cygwin/tlsoffsets.h.diff?cvsroot=src&r1=1.53&r2=1.54
http://sourceware.org/cgi-bin/cvsweb.cgi/src/winsup/cygwin/tlsoffsets64.h.diff?cvsroot=src&r1=1.2&r2=1.3
http://sourceware.org/cgi-bin/cvsweb.cgi/src/winsup/cygwin/uinfo.cc.diff?cvsroot=src&r1=1.191&r2=1.192
http://sourceware.org/cgi-bin/cvsweb.cgi/src/winsup/cygwin/winsup.h.diff?cvsroot=src&r1=1.254&r2=1.255

Reply via email to