summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin
Commit message (Collapse)AuthorAgeFilesLines
* * dtable.cc (dtable::build_fhandler_from_name): Just pass posix path along toChristopher Faylor2002-05-2410-55/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | | | set_name via return_and_clear_normalized_path. (dtable::build_fhandler): New method with const char * argument. (dtable::reset_unix_path_name): Eliminate. (dtable::dup_worker): Use correct build_fhandler method. * mmap.cc (mmap_record::alloc_fh): Ditto. * dtable.h (dtable::build_fhandler): New method. (dtable::reset_unix_path_name): Eliminate. * fhandler.cc (fhandler_base::set_name): Assume that unix_name has already been cmalloced. (fhandler_base::reset_unix_path_name): Eliminate. (fhandler_base::~fhandler_base): Coercion for cfree. * fhandler.h (fhandler_base::unix_path_name): Make const char *. (fhandler_base::win32_path_name): Ditto. (fhandler_base::reset_unix_path_name): Eliminate. * fhandler_disk_file.cc (fhandler_cygdrive::set_drives): Accommodate const char *ness of win32_path_name. * fhandler_socket.cc (fhandler_socket::fstat): Accommodate new set_name requirements. * path.cc (path_conv::return_and_clear_normalized_path): New method. (path_conv::clear_normalized_path): Eliminate. (path_conv::~path_conv): Ditto. (path_conv::check): Accommodate new build_fhandler method. * path.h (path_conv::~path_conv): Eliminate. (path_conv::clear_normalized_path): Ditto. (path_conv::return_and_clear_normalized_path): Declare new method.
* * path.cc (path_conv::check): Make sure any trailing path component is part ofChristopher Faylor2002-05-232-1/+10
| | | | potential normalized posix path.
* * smallprint.c (__small_vsprintf): Implement '%o' after all these years.Christopher Faylor2002-05-232-0/+8
|
* * fhandler.h (fhandler_virtual::exists): Eliminate path argument.Christopher Faylor2002-05-228-24/+40
| | | | | | | | | | | | | | (fhandler_proc::exists): Ditto. (fhandler_registry::exists): Ditto. (fhandler_process::exists): Ditto. * fhandler_proc.cc (fhandler_proc::exists): Ditto. Use built-in name. * fhandler_process.cc (fhandler_process::exists): Ditto. (fstat): Ditto. * fhandler_registry.cc (fhandler_registry::exists): Ditto. (fhandler_registry::fstat): Ditto. * fhandler_virtual.cc (fhandler_virtual::opendir): Ditto. * path.cc (path_conv::check): Ditto. Add debugging. * syscalls.cc (dup): Always call dup2 for error handling.
* * include/cygwin/types.h: Revert previous patch.Corinna Vinschen2002-05-222-2/+4
|
* * include/cygwin/types.h: Define pthread stuff only if _POSIX_THREADSCorinna Vinschen2002-05-222-0/+7
| | | | is defined.
* * security.cc (open_local_policy): Initialize lsa toCorinna Vinschen2002-05-212-4/+12
| | | | | | | 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_disk_file.cc (fhandler_disk_file::fstat): Make handling of nlinkChristopher Faylor2002-05-182-4/+8
| | | | consistent for remote files.
* * path.cc (path_conv::check): Always set executable bit for executableChristopher Faylor2002-05-184-3/+10
| | | | extension.
* remove white spaceChristopher Faylor2002-05-181-2/+2
|
* * fhandler.cc (fhandler_base::lseek): Avoid calling SetFilePointer with highChristopher Faylor2002-05-172-2/+16
| | | | | order part of 64 bit address on OS's which do not support that kind of operation. Otherwise Windows 95 will become confused.
* * fhandler_raw.cc (fhandler_dev_raw::open): Replace set_errno()Corinna Vinschen2002-05-173-15/+22
| | | | | | | | | | 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.
* * times.cc (utimes): Use FILE_WRITE_ATTRIBUTES even on 9x/Me whenCorinna Vinschen2002-05-174-16/+9
| | | | | | opening file for writing timestamp. * wincap.cc: Remove flag has_specific_access_rights. * wincap.h: Ditto.
* * syscalls.cc (seteuid): Set default dacl in process token.Corinna Vinschen2002-05-165-74/+140
| | | | | | | | | | | | | | | 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().
* * cygwin.din: Add strlcat and strlcpy.Christopher Faylor2002-05-133-1/+11
| | | | * include/cygwin/version.h: Increment API minor version number.
* * shared.cc (__sec_user): Split into sec_acl() and call orig_sid().Corinna Vinschen2002-05-133-42/+44
| | | | | (sec_acl): Create from part of __sec_user(), except creator/owner. * security.h: Define sec_acl() and MAX_DACL_LEN.
* * fhandler_disk_file.cc (fhandler_disk_file::open): Avoid using O_DIROPEN whenChristopher Faylor2002-05-122-4/+14
| | | | OS doesn't support it. Return proper errno in that case.
* fix entryChristopher Faylor2002-05-121-3/+3
|
* * syscalls.cc (_read): Change error to EBADF if attempt to write to aChristopher Faylor2002-05-122-0/+13
| | | | non-writable fd.
* * fhandler.h (executable_states): For now, make dont_care_if_executableChristopher Faylor2002-05-125-60/+80
| | | | | | | | | | equivalent to not_executable. * sys/mount.h: Define MOUNT_NOTEXEC. * path.h (fs_info): New class. (path_conv): Move fs-specific fields to new 'fs' structure. (path_conv::update_fs_info): Move to fs_info and rename to just 'update'. * path.cc (fs_info::update): Ditto. Return 'true' if successful. (fillout_mntent): Add ',noexec' to list of reported options.
* * fhandler_virtual.cc (fhandler_virtual::close): Quiet a compiler warning.Christopher Faylor2002-05-122-1/+6
|
* fix formattingChristopher Faylor2002-05-122-12/+17
|
* fix commentChristopher Faylor2002-05-121-1/+1
|
* * autoload.cc: Add dynamic load statements for 'ZwQueryInformationProcess' andChristopher Faylor2002-05-1210-73/+1001
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 'ZwQueryVirtualMemory'. * fhandler.h: Change type of bufalloc and filesize members of fhandler_virtual from int to size_t. Change type of position member from __off32_t to __off64_t. Add new fileid member to fhandler_virtual class. Make seekdir take an __off64_t argument. Make lseek take an __off64_t argument. Add fill_filebuf method to fhandler_virtual. Add fill_filebuf method to fhandler_proc. Add fill_filebuf method to fhandler_registry. Add fill_filebuf method to fhandler_process. Add saved_pid and saved_p members to fhandler_process. * fhandler_proc.cc (proc_listing_array): Add 'loadavg', 'meminfo', and 'stat'. (proc_fhandlers array): Ditto. (fhandler_proc::open): Use fill_filebuf to flesh out the file contents. (fhandler_proc::fill_filebuf): New method. (fhandler_proc::format_proc_meminfo): Ditto. (fhandler_proc::format_proc_stat): Ditto. (fhandler_proc::format_proc_uptime): Ditto. * fhandler_process.cc (process_listing): Add 'stat' and 'statm'. (fhandler_process::fstat): Find the _pinfo structure for the process named in the filename. Return ENOENT if the process is no longer around. Set the gid and uid fields of the stat structure. (fhandler_process::open): Store pid and pointer to _pinfo structure in saved_pid and saved_p respectively. Use fill_filebuf to flesh out file contents. (fhandler_proc::fill_filebuf): New method. (format_process_stat): New function. (format_process_status): Ditto. (format_process_statm): Ditto. (get_process_state): Ditto. (get_mem_values): Ditto. * fhandler_registry.cc (fhandler_registry::seekdir): Change argument type from __off32_t to __off64_t. (fhandler_registry::fill_filebuf): New method. * fhandler_virtual.cc (fhandler_virtual::seekdir): Change argument type from __off32_t to __off64_t. (fhandler_virtual::lseek): Ditto. (fhandler_virtual::fill_filebuf): New method. (fhandler_virtual::fhandler_virtual): Initialise fileid to -1. * wincap.cc: Set flag has_process_io_counters appropriately. * wincap.h: Add flag has_process_io_counters.
* * syscalls.cc (_write): Change error to EBADF if attempt to write to aChristopher Faylor2002-05-092-0/+8
| | | | non-writable fd.
* * cygheap.h (class cygheap_user): Add member `orig_psid'.Corinna Vinschen2002-05-083-1/+19
| | | | | Add method `orig_sid()'. * cygheap.cc (cygheap_user::set_sid): Maintain orig_psid.
* * localtime.cc (tzsetwall): Use wildabbr if generated timezone nameCorinna Vinschen2002-05-072-7/+12
| | | | length < 3.
* * spawn.cc (spawn_guts): Move call to set_process_privilege()Corinna Vinschen2002-05-064-11/+13
| | | | | | to load_registry_hive(). * registry.cc (load_registry_hive): ditto. * fork.cc (fork_parent): Call sec_user_nih() only once.
* * path.h (path_conv::path_conv): Initialise normalized_path to NULL.Christopher Faylor2002-05-042-1/+5
|
* .Christopher Faylor2002-05-041-0/+10
|
* * net.cc (getdomainname): Change second argument of getdomainname to size_t.Christopher Faylor2002-05-047-65/+167
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * fhandler_proc.cc (proc_listing): Add '.' and '..' to directory listing. (fhandler_proc::open): Change use of mode to flags. If the file does not exist already, fail with EROFS if O_CREAT flag is set. Change EROFS error to EACCES error when writing to a file. Use cmalloc to allocate memory for filebuf. (fhandler_proc::close): Use cfree to free filebuf. (fhandler_proc::get_proc_fhandler): Properly detect attempts to access unknown subdir. * fhandler_process.cc (process_listing): Add '.' and '..' to directory listing. (fhandler_process::open): Use cmalloc to allocate memory for filebuf. (fhandler_process::close): Use cfree to free filebuf. * fhandler_registry.cc (registry_listing): Add . and '..' to directory listing. (fhandler_registry::open): Move check for open for writing before open_key. Use cmalloc to allocate memory for filebuf. (fhandler_registry::close): Use cfree to free filebuf. (fhandler_registry::telldir): Use lower 16 bits of __d_position as position in directory. (fhandler_registry::seekdir): Ditto. * fhandler_virtual.cc (fhandler_virtual::write): Change EROFS error to EACCES error. (fhandler_virtual::open): Set the NOHANDLE flag. (fhandler_virtual::dup): Add call to fhandler_base::dup. Allocate child's filebuf using cmalloc. Copy filebuf from parent to child. (fhandler_virtual::close): Use cfree to free filebuf. (fhandler_virtual::~fhandler_virtual): Ditto. (from Chris Faylor <cgf@redhat.com>). (fhandler_registry::readdir): Add support for '.' and '..' files in subdirectories of /proc/registry. * path.cc (path_conv::check): Do not return ENOENT if a file is not found in /proc.
* * fhandler_proc.cc (fhandler_proc::fstat): Use fhandler name rather thanChristopher Faylor2002-05-038-24/+53
| | | | | | | | | | | | | | | | | | path_conv name. (fhandler_proc::open): Ditto. * fhandler_process.cc (fhandler_process::fstat): Use fhandler name rather than path_conv name. (fhandler_process::open): Ditto. * fhandler_registry.cc (fhandler_registry::fstat): Use fhandler name rather than path_conv name. (fhandler_registry::open): Ditto. * path.cc (path_conv::check): Don't copy posix path when virtual. (mount_info::conv_to_win32_path): Don't zero string when isproc. Just derive normal windows path. * path.h (path_conv::clear_normalized_path): Declare new method. * path.cc (path_conv::clear_normalized_path): Define new method. * dtable.cc (build_fhandler_from_name): Clear normalized path when finished to conserve space.
* * fhandler_proc.cc (fhandler_proc::fstat): Prime with information fromChristopher Faylor2002-05-022-6/+13
| | | | | fhandler_base::fstat. Use defines rather than constants for permission settings.
* * path.cc (hash_path_name): Improve hash function strength.Corinna Vinschen2002-05-022-3/+6
|
* missed a conflict indicatorRobert Collins2002-05-021-1/+0
|
* 2002-05-02 Robert Collins <rbtcollins@hotmail.com>Robert Collins2002-05-022-5/+14
| | | | | | * thread.cc (__pthread_cond_dowait): Fix a race on signalling from a thread woken by the same condition variable it's signalling on. Thanks to Michael Beach for the report and test case.
* add new filesChristopher Faylor2002-05-024-0/+1325
|
* add commentChristopher Faylor2002-05-021-0/+1
|
* * path.h (pathconv_arg): Add PC_POSIX.Christopher Faylor2002-05-0211-64/+240
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | (path_conv): Add normalized_path field. * path.cc (path_conv::~path_conv): New destructor. (path_conv::check): Set normalized_path, where appropriate. * dtable.cc (build_fhandler_from_name): Use normalized path from path_conv. * syscalls.cc (chroot): Ditto. * cygheap.h: Remove path_prefix_p declaration. Christopher Faylor <cgf@redhat.com> (minor fixups) * Makefile.in: Add fhandler_proc.o, fhandler_registry.o, fhandler_process.o and fhandler_virtual.o. * dtable.cc (dtable::build_fhandler): Add entries for FH_PROC, FH_REGISTRY and FH_PROCESS. Set unix_name to the normalized posix path. * fhandler.h: Add constants for FH_PROC, FH_REGISTRY and FH_PROCESS. Add class declarations for fhandler_virtual, fhandler_proc, fhandler_registry and fhandler_virtual. Update fhandler_union accordingly. * fhandler_proc.cc: New file. Add implementation for fhandler_proc. * fhandler_virtual.cc: New file. Add implementation for fhandler_virtual. * fhandler_process.cc: New file. Add implementation for fhandler_process. * fhandler_registry.cc: New file. Add implementation for fhandler_registry. * path.cc: Add isproc and isvirtual_dev macros. * path.cc (path_conv::check): Add check for virtual devices. * path.cc (mount_info::conv_to_win32_path): Convert paths in /proc to empty Win32 paths. * path.cc (chdir): Replace check for FH_CYGDRIVE with more generic isvirtual_dev macro. Force setting of posix path for virtual fhandlers. * path.h: Add externally visible path_prefix_p and normalized_posix_path prototypes.
* * include/cygwin/types.h: Include <sys/sysmacros.h>.Christopher Faylor2002-05-012-0/+6
|
* revert patchChristopher Faylor2002-04-193-14/+0
|
* 2002-04-16 Thomas Pfaff <tpfaff@gmx.net>Robert Collins2002-04-193-0/+14
| | | | | | * dll_init.h (per_process::dtors_run): New member. * dll_init.cc (per_module::run_dtors): Run dtors only once. (dll::init): Initialize dtors_run flag.
* * security.cc (get_lsa_srv_inf): Prevent extraneous backslashes forCorinna Vinschen2002-04-182-2/+8
| | | | the NT Domain case.
* remove obsolete comment.Christopher Faylor2002-04-151-3/+0
|
* * net.cc (cygwin_accept): Set socket type for accepted socket.Corinna Vinschen2002-04-123-8/+40
| | | | | | | | | | | | | (socketpair): Set socket type for both sockets. From Egor Duda <deo@logos-m.ru>: * fhandler.h (class fhandler_socket): New member to store socket type. (fhandler_socket::get_socket_type): Access it. (fhandler_socket::set_socket_type): Ditto. * net.cc (cygwin_socket): Store socket type. (cygwin_connect): Disable security checks for connectionless sockets. (cygwin_accept): Ditto.
* * cygwin.din: Add strptime.Christopher Faylor2002-04-093-1/+9
| | | | * include/cygwin/version.h: Increment API version number.
* * fork.cc (fork_child): Call fixup_mmaps_after_fork() somewhat earlier.Corinna Vinschen2002-04-092-3/+7
|
* * fhandler.cc (fhandler_base::open): Set read-only bit inCorinna Vinschen2002-04-092-6/+15
| | | | file_attributes when adequate.
* new description for old api.Christopher Faylor2002-04-041-0/+13
|
* * times.cc (gettimeofday): Fix typo in previous patch.Christopher Faylor2002-03-282-2/+6
|