summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/security.cc
Commit message (Collapse)AuthorAgeFilesLines
...
* * sec_helper.cc (get_sids_info): New function.Corinna Vinschen2003-02-051-24/+23
| | | | | | | | | | | * security.cc (extract_nt_dom_user): Simplify with strechr. (get_user_groups): Initialize glen to MAX_SID_LEN. (get_user_local_groups): Ditto. (get_attribute_from_acl): Define ace_sid as cygpsid. (get_nt_attribute): Define owner_sid and group_sid as cygpsid. Call get_sids_info instead of cygsid.get_{u,g}id and is_grp_member. (get_nt_object_attribute): Ditto. (alloc_sd): Define ace_sid as cygpsid.
* * path.cc (symlink): Create security attributes so that only theCorinna Vinschen2003-02-041-4/+0
| | | | | | user can modify the symlink. * security.cc (set_security_attribute): Remove symlink special handling.
* * security.h: Add third argument to set_process_privilege.Corinna Vinschen2003-02-031-3/+14
| | | | | | | | | * autoload.cc: Add OpenThreadToken. * sec_helper.cc (set_process_privilege): Add and use use_thread argument. * security.cc (alloc_sd): Modify call to set_process_privilege. Remember the result in each process. If failed and file owner is not the user, fail.
* * uinfo.cc (pwdgrp::load): Regularize strace output. Add warning forChristopher Faylor2003-01-261-3/+3
| | | | CreateFile failure.
* * sec_acl.cc (search_ace): Use id == -1, instead of < 0, as wildcard.Corinna Vinschen2003-01-121-48/+79
| | | | | | | | | | | | | | | | | (setacl): Start the search for a matching default at the next entry. Invalidate the type of merged entries instead of clearing it. Use well_known_creator for default owner and owning group and do not try to merge non-default and default entries in these cases. (getacl): Recognize well_known_creator for default owner and group. (acl_worker): Improve errno settings and streamline the nontsec case. * security.cc (write_sd): Remove the call to set_process_privilege. (alloc_sd): If the owner changes, call set_process_privilege and return immediately on failure. Change inheritance rules: on new directories add inherit only allow ACEs for creator_owner, creator_group and everyone. Preserve all inheritances through chmod and chown calls. Introduce isownergroup to implement the uid == gid case, to keep the inheritance code simple. Do not initialize owner_sid and group_sid and stop using the variable psd.
* * security.cc (get_nt_attribute): Always return -1 when read_sd()Corinna Vinschen2003-01-091-3/+13
| | | | | | fails. (get_file_attribute): Set permissions to 0 and owner/group to -1 if security descriptor is unreadable.
* * security.cc (get_user_local_groups): Use LookupAccountSid to find theCorinna Vinschen2002-12-141-6/+9
| | | | local equivalent of BUILTIN.
* 2002-12-10 Pierre Humblet <pierre.humblet@ieee.org>Corinna Vinschen2002-12-101-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * pwdgrp.h (pwdgrp_check::pwdgrp_state): Replace by pwdgrp_check::isinitializing (). (pwdgrp_check::isinitializing): Create. * passwd.cc (grab_int): Change type to unsigned, use strtoul and set the pointer content to 0 if the field is invalid. (parse_pwd): Move validity test after getting pw_gid. (read_etc_passwd): Replace "passwd_state <= " by passwd_state::isinitializing (). (internal_getpwuid): Ditto. (internal_getpwnam): Ditto. (getpwent): Ditto. (getpass): Ditto. * grp.cc (parse_grp): Use strtoul for gr_gid and verify the validity. (read_etc_group): Replace "group_state <= " by group_state::isinitializing (). (internal_getgrgid): Ditto. (getgrent32): Ditto. (internal_getgrent): Ditto. 2002-12-10 Pierre Humblet <pierre.humblet@ieee.org> * security.h: Move declarations of internal_getgrent, internal_getpwsid and internal_getgrsid to pwdgrp.h. * pwdgrp.h: Declare internal_getpwsid, internal_getpwnam, internal_getpwuid, internal_getgrsid, internal_getgrgid, internal_getgrnam, internal_getgrent and internal_getgroups. Delete "emulated" from enum pwdgrp_state. (pwdgrp_check::isuninitialized): Create. (pwdgrp_check::pwdgrp_state): Change state to initializing rather than to uninitialized. (pwdgrp_read::gets): Remove trailing CRs. * passwd.cc (grab_string): Don't look for NLs. (grab_int): Ditto. (parse_pwd): Don't look for CRs. Return 0 if entry is too short. (search_for): Delete. (read_etc_passwd): Simplify tests to actually read the file. Set state to loaded before making internal_getpwXX calls. Replace search_for calls by equivalent internal_pwgetXX calls. (internal_getpwsid): Use passwd_state.isuninitialized to decide to call read_etc_passwd. (internal_getpwuid): Create. (internal_getpwnam): Create. (getpwuid32): Simply call internal_getpwuid. (getpwuid_r32): Call internal_getpwuid. (getpwnam): Simply call internal_getpwnam. (getpwnam_r): Call internal_getpwnam. * grp.cc (parse_grp): Don't look for CRs. Adjust blank space. (add_grp_line): Adjust blank space. (class group_lock): Ditto. (read_etc_group): Simplify tests to actually read the file. Set state to loaded before making internal_getgrXX calls. Replace getgrXX calls by equivalent internal calls. (internal_getgrsid): Use group_state.isuninitialized to decide to call read_etc_group. (internal_getgrgid): Create. (internal_getgrnam): Create. (getgroups32): Simply call internal_getgrgid. (getgrnam32): Simply call internal_getgrnam. (internal_getgrent): Call group_state.isuninitialized. (internal_getgroups): Create from the former getgroups32, using two of the four arguments. Set gid to myself->gid and username to cygheap->user.name (). (getgroups32): Simply call internal_getgroup. (getgroups): Call internal_getgroup instead of getgroups32. (setgroups32): Call internal versions of get{pw,gr}XX. * sec_helper.cc: Include pwdgrp.h. (is_grp_member): Call internal versions of get{pw,gr}XX. * security.cc: Include pwdgrp.h. (alloc_sd): Call internal versions of get{pw,gr}XX. * syscalls.cc: Include pwdgrp.h. (seteuid32): Call internal versions of get{pw,gr}XX. (setegid32): Ditto. * uinfo.cc: Include pwdgrp.h. (internal_getlogin): Call internal versions of get{pw,gr}XX. (cygheap_user::ontherange): Ditto. * sec_acl.cc: Include pwdgrp.h. (setacl): Call internal versions of get{pw,gr}XX. (acl_access): Ditto and simplify logic. (aclfromtext): Ditto.
* * security.cc (get_attribute_from_acl): Always test "anti",Corinna Vinschen2002-11-201-70/+82
| | | | | | | | | | | | | | | | | | | just in case an access_denied ACE follows an access_allowed. Handle the case owner_sid == group_sid, with a FIXME. Remove unnecessary tests for non-NULL PSIDs. (alloc_sd): Use existing owner and group sids if {ug}id == -1. Handle case where owner_sid == group_sid. Do not call is_grp_member. Try to preserve canonical ACE order. Remove unnecessary tests for non-NULL PSIDs. Reorganize debug_printf's. (get_initgroups_sidlist): Put well_known_system_sid on left side of ==. (add_access_denied_ace): Only call GetAce if inherit != 0. (add_access_allowed_ace): Ditto. Use appropriate sizeof. * syscalls.cc (chown_worker): Pass {ug}id equal to -1 to alloc_sd, which removes the need to obtain old_{ug}id. (chmod): Remove call to get_file_attribute (), simply pass {ug}id equal to -1 to alloc_sd.
* * sec_helper.cc (cygsid::get_id): If the sid matches a sid stored inChristopher Faylor2002-10-221-9/+12
| | | | | | | cygheap->user, return the uid or gid from myself. * security.cc (alloc_sd): If gid == myself->gid, return the group sid from cygheap->user. Remove the test for uid == original_uid, which is counter-productive.
* Remove \n from calls to strace class printfs throughout.Christopher Faylor2002-09-301-6/+6
|
* * security.cc (allow_ntsec): Default to zero.Christopher Faylor2002-09-301-1/+1
| | | | | * environ.cc (environ_init): Set allow_ntsec to TRUE by default, assuming OS allows it.
* * fhandler.cc (fhandler_base::dup): Don't set handle on failure. Caller hasChristopher Faylor2002-09-221-3/+3
| | | | | | | already taken care of that. * fhandler_console.cc (fhandler_console::open): Initialize handles to NULL. (fhandler_console::close): Ditto. GNUify non-GNU formatted functions calls throughout.
* * cygthread.cc (cygthread::initialized): Avoid copying on fork or some threadsChristopher Faylor2002-09-191-9/+9
| | | | | | | | | | | | | | | | | | | | | | | may not end up in the pool. (cygthread::new): Avoid race when checking for initialized. Add debugging code. * fhandler.cc (fhandler_base::raw_read): Add case for ERROR_INVALID_HANDLE due to Win95 directories. (fhandler_base::open): Handle errors due to Win95 directories. (fhandler_base::close): Add get_nohandle () test. (fhandler_base::set_close_on_exec): Ditto. (fhandler_base::fork_fixup): Ditto. (fhandler_base::lock): Change error code to Posix EINVAL. (fhandler_base::dup): If get_nohandle (), set new value to INVALID_HANDLE_VALUE instead of NULL. * fhandler_disk_file.cc (fhandler_disk_file::fstat): Call fstat_by_name if get_nohandle (). Remove extraneous element from strpbrk. (fhandler_disk_file::open): Remove test for Win95 directory. * fhandler_random.cc (fhandler_dev_random::open): Add set_nohandle (). * fhandler_clipboard.cc (fhandler_dev_clipboard::open): Ditto. * fhandler_zero.cc (fhandler_dev_zero::open): Ditto. (fhandler_dev_zero::close): Delete. * fhandler.h (class fhandler_dev_zero): Ditto.
* * grp.cc (initgroups): Call groups::clear_supp to free theCorinna Vinschen2002-09-111-0/+3
| | | | | | | supplementary group sids that may have been set by setgroups. * security.cc (cygsidlist::free_sids): Also zero the class members. * security.h (groups::clear_supp): New. Rename cygsidlist_unknown to cygsidlist_empty.
* * sec_acl.cc (getacl): Check ace_sid == well_known_world_sidCorinna Vinschen2002-08-261-164/+91
| | | | | | | | | | before owner_sid and group_sid so that well_known_world_sid means "other" even when owner_sid and/or group_sid are Everyone. * security.cc (get_attribute_from_acl): Created from code common to get_nt_attribute() and get_nt_object_attribute(), with same reordering as in getacl() above. (get_nt_attribute): Call get_attribute_from_acl(). (get_nt_object_attribute): Ditto.
* * security.cc (verify_token): Do not reject a token just becauseCorinna Vinschen2002-08-021-2/+5
| | | | | | | | the supplementary group list is missing Everyone or a groupsid equal to usersid, or because the primary group is not in the token, as long as it is equal to the usersid. * syscalls.cc (seteuid32): Use common code for all successful returns. * grp.cc (getgroups32): Never includes Everyone in the output.
* * security.cc: Change some formatting.Corinna Vinschen2002-07-291-193/+276
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * include/cygwin/version.h: Bump API minor version. * cygheap.h (class cygheap_user): Add member groups. * security.h (class cygsidlist): Add members type and maxcount, methods position, addfromgr, alloc_sids and free_sids and operator+= (const PSID psid). Modify contains () to call position () and optimize add () to use maxcount. (class user_groups): Create. Update declarations of verify_token and create_token. * security.cc (cygsidlist::alloc_sids): New. (cygsidlist::free_sids): New. (get_token_group_sidlist): Create from get_group_sidlist. (get_initgroups_sidlist): Create from get_group_sidlist. (get_group_sidlist): Suppress. (get_setgroups_sidlist): Create. (verify_token): Modify arguments. Add setgroups case. (create_token): Modify arguments. Call get_initgroups_sidlist and get_setgroups_sidlist as needed. Set SE_GROUP_LOGON_ID from auth_pos outside of the loop. Rename the various group sid lists consistently. * syscalls.cc (seteuid32): Modify to use cygheap->user.groups. (setegid32): Call cygheap->user.groups.update_pgrp. * grp.cc (setgroups): Create. (setgroups32): Create. * uinfo.cc (internal_getlogin): Initialize and update user.groups.pgsid. * cygwin.din: Add setgroups and setgroups32.
* * security.cc (allow_ntsec): Default to on.Christopher Faylor2002-07-251-2/+2
| | | | (allow_smbntsec): Default to off.
* * security.cc (get_group_sidlist): Create group list from /etc filesCorinna Vinschen2002-07-231-4/+2
| | | | even if DC is available but access fails.
* white spaceChristopher Faylor2002-07-191-8/+8
|
* * security.cc (get_unix_group_sidlist): Create.Corinna Vinschen2002-07-191-49/+39
| | | | | | | | | | | (get_supplementary_group_sidlist): Evolve into get_unix_group_sidlist. (get_user_local_groups): Add check for duplicates. (get_user_primary_group): Suppress. (get_group_sidlist): Silently ignore PDC unavailability. Call get_unix_group_sidlist() before get_user_local_groups(). Remove call to get_supplementary_group_sidlist(). Never call get_user_primary_group() as the passwd group is always included. Add well_known_authenticated_users_sid in only one statement.
* * security.cc (get_group_sidlist): Fix formatting.Corinna Vinschen2002-07-151-3/+5
|
* * security.cc (get_logon_server): Interpret a zero lengthCorinna Vinschen2002-07-021-3/+6
| | | | | | | | domain as the local domain. (get_group_sidlist): Add authenticated users SID to SYSTEM's group list instead of SYSTEM itself. (verify_token): Accept the primary group sid if it equals the token user sid.
* * security.h (DONT_INHERIT): Eliminate definition.Corinna Vinschen2002-07-021-4/+5
| | | | | | | | (INHERIT_ALL): Ditto. (INHERIT_ONLY): Ditto. * sec_acl.cc: Use appropriate defines from accctrl.h instead of the above throughout. * security.cc: Ditto.
* * autoload.cc (GetSecurityInfo): Define new autoload function.Christopher Faylor2002-07-021-0/+169
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (RegQueryInfoKeyA): Ditto. * fhandler.h (fhandler_virtual::fill_filebuf): Change return type to bool. (fhandler_proc::fill_filebuf): Ditto. (fhandler_registry::fill_filebuf): Ditto. (fhandler_process::fill_filebuf): Ditto. (fhandler_registry::value_name): Add new member. (fhandler_registry::close): Add new method. (fhandler_process::p): Remove member. * fhandler_proc.cc (fhandler_proc::open): Add set_nohandle after calling superclass method. Check return value of fill_filebuf. (fhandler_proc::fill_filebuf): Change return type to bool. Add return statement. * fhandler_process.cc (fhandler_process::open): Add set_nohandle after calling superclass method. Remove references to p. Check return value of fill_filebuf. (fhandler_process::fill_filebuf): Change return type to bool. Don't use dereference operator on p. Add return statement. (fhandler_process::format_process_stat): Fix typo. * fhandler_registry.cc: Add static open_key declaration. (fhandler_registry::exists): Assume path is already normalised. Try opening the path as a key in its own right first, before reverting to enumerating subkeys and values of the parent key. (fhandler_registry::fstat): Add additional code to return more relevant information about the registry key/value. (fhandler_registry::readdir): Explicitly set desired access when opening registry key. Remove output of buf from debug_printf format string. (fhandler_registry::open): Use set_io_handle to store registry key handle. Set value_name member. Move code to read a value from the registry to fill_filebuf. Add call to fill_filebuf. (fhandler_registry::close): New method. (fhandler_registry::fill_filebuf): Change return type to bool. Add code to read a value from registry. (fhandler_registry::open_key): Make function static. Use KEY_READ as desired access unless this is the last path component. Check the return value of RegOpenKeyEx for an error instead of hKey. * fhandler_virtual.cc (fhandler_virtual::lseek): Check the return value of fill_filebuf. (fhandler_virtual::open): Remove call to set_nohandle. (fhandler_virtual::fill_filebuf): Change return type to bool. Add return statement. * security.cc (get_nt_object_attribute): New function. (get_object_attribute): New function. * security.h (get_object_attribute): New function declaration.
* white spaceChristopher Faylor2002-07-011-1/+1
|
* * security.cc (extract_nt_dom_user): Check for all buffer overflows.Corinna Vinschen2002-06-301-41/+24
| | | | | | Call LookupAccountSid after trying to get domain & user from passwd. (get_group_sidlist): Obtain the domain and user by calling extract_nt_dom_user instead of LookupAccountSid.
* * security.cc (get_group_sidlist): Add pw argument and use pw->pw_name in callChristopher Faylor2002-06-241-6/+6
| | | | | | | to get_supplementary_group_sidlist. (create_token): Add pw argument and use it in call to get_group_sidlist. * security.h: Add pw argument in declaration of create_token. * syscalls.cc (seteuid32): Add pw argument in call to create_token.
* * security.cc (alloc_sd): Carefully check owner_sid again after tryingCorinna Vinschen2002-06-211-2/+2
| | | | SIDs from cygheap.
* * security.cc (alloc_sd): Remove unnecessary retrieval of owner name.Corinna Vinschen2002-06-211-17/+29
| | | | | | | | Check uid for current user first and use SIDs from cygheap if so. Set errno to EINVAL if user SID isn't retrievable. Just print user SID as debug output. Don't bail out if group SID isn't retrievable. Change debug output appropriately.
* * uinfo.cc (cygheap_user::ontherange): Use env_name for NetUserGetInfo.Christopher Faylor2002-06-211-4/+4
| | | | | | (cygheap_user::env_logsrv): Verify env_domain is valid. * environ.cc: Include child_info.h and keep spenvs[] sorted. (environ_init): Check child_proc_info instead of myself->ppid_handle.
* Use hMainProc where appropriate, throughout.Christopher Faylor2002-06-191-56/+58
| | | | | | | * environ.cc (spenv::retrieve): Add debugging statements. * pinfo.cc (set_myself): Don't call strace.hello if already stracing. * strace.cc (strace): Move NO_COPY keyword so that it will actually take effect.
* * security.cc (get_logon_server): Use strcasematch rather than strcasecmp.Christopher Faylor2002-06-131-5/+5
|
* * Makefile.in: Ensure that -MD gets added to CFLAGS regardless of CFLAGSChristopher Faylor2002-06-111-4/+2
| | | | | | | | | | | | | | command-line setting. * cygwin.din: Export sexec* functions as function which returns ENOSYS (i.e., sexec* is deprecated). * dtable.cc (dtable::vfork_child_dup): Ensure that impersonation is restored even on failure. * exec.cc: Throughout, remove references to sexec* and _spawnve. * pinfo.h: Remove _spawnve declaration. * spawn.cc: Rename _spawnve to spawnve and use throughout. (spawn_guts): Eliminate hToken argument and processing of same. Just perform special actions if impersonating. (spawnve): Rename from _spawnve.
* * sec_helper.cc (lookup_name): Suppress.Corinna Vinschen2002-06-061-11/+8
| | | | | | | | | | | | | | | | | | | | | * security.cc (alloc_sd): Remove logsrv argument. Remove two calls to lookup_name. (set_security_attribute): Remove logsrv argument. Remove logsrv argument in call to alloc_sd. (set_nt_attribute): Remove logsrv argument. Remove logsrv argument in call to set_security_attribute. (set_file_attribute): Remove logsrv argument. Remove logsrv argument in call to set_nt_attribute. (set_file_attribute): Remove logsrv argument. Remove logsrv argument in call to set_file_attribute. * syscalls.cc (chown_worker): Remove logserver argument in call to set_file_attribute. (chmod): Ditto. * shm.cc (shmget): Remove logsrv argument in call to alloc_sd. * uinfo.cc (internal_getlogin): Replace calls to lookup_name by call to LookupAccountName. * security.h: Remove logsrv in declarations of set_file_attribute and alloc_sd. Remove declaration of lookup_name.
* * security.cc (lsa2wchar): Suppressed.Corinna Vinschen2002-06-031-85/+89
| | | | | | | | | | | | | | | | | | | | (get_lsa_srv_inf): Suppressed. (get_logon_server_and_user_domain): Suppressed. (get_logon_server): Essentially new. (get_user_groups): Add "domain" argument. Only lookup the designated server and use "domain" in LookupAccountName. (is_group_member): Simplify the arguments. (get_user_local_groups): Simplify the arguments. Do only a local lookup. Use "BUILTIN" and local domain in LookupAccountName. (get_user_primary_group). Only lookup the designated server. (get_group_sidlist): Remove logonserver argument. Do not lookup any server for the SYSTEM account. (create_token): Delete logonserver and call to get_logon_server. Adjust arguments of get_group_sidlist, see above. * security.h: Delete declaration of get_logon_server_and_user_domain and add declaration of get_logon_server. * uinfo.cc (internal_get_login): Call get_logon_server instead of get_logon_server_and_user_domain.
* Remove unneeded sigproc.h includes throughout.Christopher Faylor2002-06-021-1/+0
| | | | | | | | | | | | | * fhandler.h (fhandler_proc::fill_filebuf): Take a pinfo argument. * fhandler_proc.cc (fhandler_proc::get_proc_fhandler): Simplify search for given pid. (fhandler_proc::readdir): Assume that pid exists if it shows up in the winpid list. * fhandler_process.cc (fhandler_process::open): Simplify search for given pid. Call fill_filebuf with pinfo argument. (fhandler_process::fill_filebuf): Pass pinfo here and assume that it exists. * pinfo.h (pinfo::remember): Define differently if sigproc.h is not included. * dll_init.cc (dll_list::detach): Don't run destructor on exit.
* Change internal uid datatype from __uid16_t to __uid32_tCorinna Vinschen2002-05-291-9/+9
| | | | | | | | | | | | | | | | | | | | throughout. * cygwin.din: Export new symbols getpwuid32, getpwuid_r32, getuid32, geteuid32, setuid32, seteuid32. * passwd.cc (getpwuid32): New function. (getpwuid_r32): Ditto. * syscalls.cc (seteuid32): Ditto. (setuid32): Ditto. * uinfo.cc (getuid32): Ditto. (geteuid32): Ditto. * winsup.h (uid16touid32): New macro, correclt casting from __uid16_t to __uid32_t. (gid16togid32): Ditto fir gids. (getuid32): Declare. (geteuid32): Ditto. (getpwuid32): Ditto. * include/sys/cygwin.h (struct external_pinfo): Add members uid32 and gid32.
* * security.cc (set_security_attribute): Call getegid32() instead ofCorinna Vinschen2002-05-281-1/+1
| | | | | getegid(). * include/cygwin/grp.h: Declare getegid32().
* Change internal gid datatype from __gid16_t to __gid32_tCorinna Vinschen2002-05-281-9/+9
| | | | | | | | | | | | | | | | | | | | | | | throughout. * cygwin.din: Export new symbols chown32, fchown32, getegid32, getgid32, getgrgid32, getgrnam32, getgroups32, initgroups32, lchown32, setgid32, setegid32, getgrent32. * grp.cc (grp32togrp16): New static function. (getgrgid32): New function. (getgrnam32): Ditto. (getgrent32): Ditto. (getgroups32): Change name of internal function from getgroups. (getgroups32): New function. (initgroups32): Ditto. * syscalls.cc (chown32): Ditto. (lchown32): Ditto. (fchown32): Ditto. (setegid32): Ditto. (setgid32): Ditto. * uinfo.cc (getgid32): Ditto. (getegid32): Ditto. * include/cygwin/grp.h: Remove declaration of getgrgid() and getgrnam(). Declare getgrgid32() and getgrnam32() instead. Declare getgid32().
* * autoload.cc (LoadFuncEx): Define via new LoadFuncEx2 macro.Christopher Faylor2002-05-281-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (LoadFuncEx2): Adapted from LoadFuncEx. Provides control of return value for nonexistent function. (NtQueryObject): Declare. (IsDebuggerPresent): Declare via LoadFuncEx2 and always return true if not available. * debug.h (being_debugged): Just rely on IsDebuggerPresent return value. * dtable.cc (handle_to_fn): New function. (dtable::init_std_file_from_handle): Attempt to derive std handle's name via handle_to_fn. (dtable::build_fhandler_from_name): Fill in what we can in path_conv structure when given a handle and path doesn't exist. * fhandler.cc (fhandler_base::open): Don't set the file pointer here. Use pc->exists () to determine if file exists rather than calling GetFileAttributes again. * fhandler.h (fhandler_base::exec_state_isknown): New method. (fhandler_base::fstat_helper): Add extra arguments to declaration. (fhandler_base::fstat_by_handle): Declare new method. (fhandler_base::fstat_by_name): Declare new method. * fhandler_disk_file (num_entries): Make __stdcall. (fhandler_base::fstat_by_handle): Define new method. (fhandler_base::fstat_by_name): Define new method. (fhandler_base:fstat): Call fstat_by_{handle,name} as appropriate. (fhandler_disk_file::fstat_helper): Accept extra arguments for filling out stat structure. Move handle or name specific stuff to new methods above. (fhandler_disk_file::open): Use real_path->exists rather than calling GetFileAttributes again. * ntdll.h (FILE_NAME_INFORMATION): Define new structure. (OBJECT_INFORMATION_CLASS): Partially define new enum. (OBJECT_NAME_INFORMATION): Define new structure. (NtQueryInformationFile): New declaration. (NtQueryObject): New declaration. * path.cc (path_conv::fillin): Define new method. * path.h (path_conv::fillin): Declare new method. (path_conv::drive_thpe): Rename from 'get_drive_type'. (path_conv::volser): Declare new method. (path_conv::volname): Declare new method. (path_conv::root_dir): Declare new method. * syscalls.cc (fstat64): Send real path_conv to fstat as second argument.
* * security.cc (lsa2str): New function.Corinna Vinschen2002-05-271-2/+10
| | | | (get_priv_list): Call lsa2str instead of sys_wcstombs.
* Remove unneeded sync.h, where appropriate, throughout. Remove unneeded heap.h,Christopher Faylor2002-05-251-2/+0
| | | | | | where appropriate, throughout. Remove unneeded exceptions.h, where appropriate, throughout. Remove unneeded perprocess.h, where appropriate, throughout.
* * security.cc (create_token): Call __sec_user() instead ofCorinna Vinschen2002-05-241-4/+5
| | | | | sec_user() to remove dependence on allow_ntsec. Verify that the returned sd is non-null.
* * security.cc (open_local_policy): Initialize lsa toCorinna Vinschen2002-05-211-4/+4
| | | | | | | INVALID_HANDLE_VALUE instead of NULL. (get_logon_server_and_user_domain): Test for INVALID_HANDLE_VALUE instead of NULL. (create_token): Both of the above.
* * fhandler_raw.cc (fhandler_dev_raw::open): Replace set_errno()Corinna Vinschen2002-05-171-13/+10
| | | | | | | | | | by __seterrno_from_win_error(). * security.cc (open_local_policy): Ditto. (get_lsa_srv_inf): Ditto. (get_user_groups): Ditto. (get_user_primary_group): Ditto. (create_token): Ditto. (subauth): Ditto.
* * syscalls.cc (seteuid): Set default dacl in process token.Corinna Vinschen2002-05-161-43/+82
| | | | | | | | | | | | | | | Replace in-line code by call to verify_token(). (setegid): Reverse change from 2002-01-21. Add call to RevertToSelf and set primary group in impersonation token. * security.cc (create_token): Store pgrpsid in token security descriptor, except if it already appears in my_grps. Use sec_acl() in place of get_dacl(). (verify_token): Create from code in seteuid(), with tighter checks. (get_dacl) Deleted. (get_group_sidlist): Add argument to indicate if pgrpsid is already in the groups. * security.h: Define verify_token(). * autoload.cc: Load GetKernelObjectSecurity().
* * security.cc (get_lsa_srv_inf): Prevent extraneous backslashes forCorinna Vinschen2002-04-181-2/+3
| | | | the NT Domain case.
* * autoload.cc (NetGetDCName): Add symbol.Corinna Vinschen2002-03-071-6/+7
| | | | | | | (NetServerEnum): Remove symbol. * security.cc (get_lsa_srv_inf): Call NetGetDCName() instead of NetServerEnum() since it's faster. Don't call it at all if machine is not a domain member.