summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/security.cc
Commit message (Collapse)AuthorAgeFilesLines
* * dcrt0.cc: Add load statements for `GetSidIdentifierAuthority'Corinna Vinschen2000-06-191-7/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | and `RegLoadKeyA'. * registry.cc (get_registry_hive_path): New function. (load_registry_hive): Ditto. * security.cc (convert_sid_to_string_sid): New function. (get_ssid): Renamed to `convert_string_sid_to_sid'. (get_pw_sid): Call `convert_string_sid_to_sid' instead of `get_ssid'. (get_gr_sid): Ditto. (get_admin_sid): Ditto. (get_system_sid): Ditto. (get_creator_owner_sid): Ditto. (get_world_sid): Ditto. * shared.h: New prototypes for `get_registry_hive_path' and `load_registry_hive'. * spawn.cc (spawn_guts): Set child->psid to NULL to force calling `internal_getlogin' from child process in case of changing user context. Call `load_registry_hive' in case of changing user context. (_spawnve): Copy user infos only if user context remains the same. * uinfo.cc: Add load statement for `NetUserGetInfo'. Remove load statement for `NetGetDCName'. (internal_getlogin): Rewrite to speed up process startup and to correct user environment in case user context changes. (uinfo_init): Call internal_getlogin only if myself->psid is NULL, that is user context changes. * winsup.h: Add prototypes for `convert_sid_to_string_sid', `convert_string_sid_to_sid' and `get_pw_sid'.
* * cygwin.din: Define symbols for `cygwin_logon_user' andCorinna Vinschen2000-06-161-0/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `cygwin_set_impersonation_token'. * dcrt0.cc (dll_crt0_1): Eliminate superfluous conditional statements. Add load statements for `ImpersonateLoggedOnUser', `LogonUserA' and `RevertToSelf'. * fork.cc (fork): Care for correct impersonation of parent and child process. * security.cc (cygwin_set_impersonation_token): New function. (cygwin_logon_user): Ditto. shared.h (class pinfo): New members `orig_uid', `orig_gid', `real_uid' nad `real_gid'. spawn.cc (spawn_guts): Care for impersonation when starting child process in a different user context. * syscalls.cc (setgid): Call `setegid' now. Set real_gid. (setuid): Call `seteuid' now. Set real_uid. (seteuid): Functionality moved from setuid to here. Care for correct impersonation. (setegid): Functionality moved from setgid to here. * uinfo.cc (uinfo_init): Initialization of additional pinfo members. (getuid): Return real uid. (getgid): Return real gid. (geteuid): Return effective uid. (getegid): Return effective gid. include/sys/cygwin.h: Add prototypes for `cygwin_logon_user' and `cygwin_set_impersonation_token'. include/cygwin/version.h: Bumb API minor version to 22.
* * dir.cc (writable_directory): Comment out previous code,Corinna Vinschen2000-05-241-6/+11
| | | | | | | | | | return always 1 for now. (mkdir): Call set_file_attribute explicitely with S_IFDIR mode bit. * syscalls.cc (chown_worker): Ditto. (chmod): Ditto. * security.cc (get_nt_attribute): Fix error in debug output. Never set FILE_DELETE_CHILD for files. Construct appropriate inherit attribute according to file type.
* * security.cc (read_sd): Return 1 on success because weCorinna Vinschen2000-05-021-8/+13
| | | | can't rely on the returned SD size from GetFileSecurity.
* * dcrt0.cc: Add dynamic load code for `OemToCharA' from user32.dll.Corinna Vinschen2000-05-021-1/+4
| | | | | * security.cc (read_sd): Call `OemToCharA' to make `GetFileSecurity' happy on filenames with umlauts.
* * fhandler.cc (fhandler_disk_file::open): Check for allow_ntsecCorinna Vinschen2000-04-251-98/+49
| | | | | | | | | | | | | when determining exec flag. * path.cc (symlink_info::check): Remove call to get_file_attribute(). * security.cc (read_sd): Rename, ditto for variables to conform to common naming convention. Use GetFileSecurity() instead of BackupRead() to avoid permission problems when reading ACLs. (write_sd): Same renaming as for read_sd(). (alloc_sd): Change default permissions according to Linux permissions for group and world when write permission is set. * syscalls.cc (stat_worker): Avoid different permission problems when requesting file informations.
* * cygwin.din: Add symbol for `lacl'.Corinna Vinschen2000-04-131-5/+22
| | | | | | | | | * security.cc (ReadSD): Add debug output. (acl_worker): New static function. (acl): Call acl_worker now. (lacl): New function. (facl): Call acl_worker now. * include/cygwin/acl.h: Add prototype for `lacl'.
* * security.cc (set_process_privileges): Removed `static'.Corinna Vinschen2000-03-161-40/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | (get_nt_attribute): Returns uid and gid additionally. Removed call to set_process_privileges(). (get_file_attribute): Returns uid and gid additionally. Don't call ntea if ntsec is ON. (set_nt_attribute): Removed call to set_process_privileges(). Don't call ntea if ntsec is ON. (acl): Removed call to set_process_privileges(). * dcrt0.cc (dll_crt0_1): Calls set_process_privileges() now. * winsup.h: New prototype for set_process_privileges(), changed prototype for get_file_attribute(). * fhandler.cc (get_file_owner): Discarded. (get_file_group): Ditto. (fhandler_disk_file::fstat): Discard calls to get_file_owner() and get_file_group(). * path.cc (path_conv::path_conv): Added debugging output for result of GetVolumeInformation(). (mount_info::conv_to_win32_path): Call backslashify() with pathbuf instead of src_path. * syscalls.cc (chown): Reformatted. (chmod): Replace get_file_owner() and get_file_group() calls by a call to get_file_attribute(). Discard local variable has_acls. Slightly reformatted. (stat_worker): Replaced idiot's (it's me) root dir check by call to rootdir(). Don't call num_entries() on remote drives. Discard local variable has_acls.
* Respond to a multitude of g++ warnings.Christopher Faylor2000-02-211-2/+2
|
* import winsup-2000-02-17 snapshotChristopher Faylor2000-02-171-0/+2084