summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/syscalls.cc
Commit message (Collapse)AuthorAgeFilesLines
...
* * syscalls.cc (seteuid): Initialize pi.token before callingCorinna Vinschen2000-06-281-0/+5
| | | | | | | | internal_getlogin(). * uinfo.cc (internal_getlogin): Use impersonation token instead of process token in case of active impersonation. Add some comments. (uinfo_init): Initializing myself->token and myself->impersonated before calling internal_getlogin(). Add some comments.
* * cygwin.din: Define symbols for `cygwin_logon_user' andCorinna Vinschen2000-06-161-26/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `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-0/+7
| | | | | | | | | | 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.
* * syscalls.cc (_cygwin_istext_for_stdio): New, for newlibDJ Delorie2000-05-231-1/+47
| | | | | * include/cygwin/version.h: Bump API number for detect old programs using old getc/putc macros
* * dir.cc (rmdir): Care for misleading error messagesCorinna Vinschen2000-05-221-1/+2
| | | | | | | when trying to remove a directory on a samba share. Eliminate superfluous else branch. * syscalls.cc (_rename): Additional check for ERROR_FILE_EXISTS if MoveFile fails.
* * syscalls.cc (setmode): change mode of any matching FILE* also.DJ Delorie2000-05-191-0/+22
|
* * path.cc (mount_info::cygdrive_posix_path): Don't add trailing slash ifChristopher Faylor2000-05-171-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | referring to something like c:\. * dcrt0.cc (dll_crt0_1): Move uinfo initialization prior to sig_send initialization to give signal thread a chance to finish. * debug.cc (WFSO): Move to sigproc.cc (WFMO): Ditto. * exceptions.cc (interruptible): Allocate slightly more space for directory just for paranoia's sake. (call_handler): Eliminate nonmain argument. Determine if main thread has set a frame pointer and use it if so. (sig_handle): Eliminate nonmain argument. * net.cc: Record frame information in appropriate routines throughout. * select.cc (select): Ditto. * sigproc.cc: Use sigthread structure to record mainthread id throughout. (sig_send): Record frame information for signal handler. (wait_sig): Reflect argument change in sig_handle. (WFSO): Move here and record frame information for signal handler. (WFMO): Ditto. * sigproc.h: Implement new "sigthread" class. Implement "sigframe" class for manipulating signal frame info. * thread.cc (__pthread_kill): Use standard _kill() function rather than calling sig_send directly. * winsup.h: Eliminate ebp element from signal_dispatch class.
* 2000-05-06 Mumit Khan <khan@xraylith.wisc.edu>Mumit Khan2000-05-061-3/+3
| | | | | * include/wchar.h (wcscmp, wcslen): Fix prototypes. * syscalls.cc (wcslen, wcscmp): Adjust.
* * configure.in: Use -gstabs+ as compile debug option. This seems to promoteChristopher Faylor2000-05-041-18/+28
| | | | | | | | | | | better handling of symbols. * configure: Regenerate. * delqueue.cc (delqueue_list::process_queue): Allow ERROR_ACCESS_DENIED to indicate that a file is being shared under Windows 95. * syscalls.cc (_unlink): Use full path name. Take special action for Windows 95. Assume that an ERROR_ACCESS_DENIED indicates a sharing violation unless it's on a remote drive. Punt if there is an ERROR_ACCESS_DENIED on a remote drive.
* * errno.cc (errmap): Map ERROR_BAD_NETPATH to new errno ENOSHARE.Corinna Vinschen2000-05-031-1/+2
| | | | | | (_sys_errlist): Add entry for ENOSHARE. (strerror): Add case for ENOSHARE. * syscalls.cc (stat_worker): Check for errno ENOSHARE.
* * syscalls.cc (stat_worker): Previous patch could succeedCorinna Vinschen2000-04-261-5/+6
| | | | in stating a non-existant file.
* * syscalls.cc (stat_worker): Previous patch failed to statCorinna Vinschen2000-04-251-17/+13
| | | | each drives root dir on 9X.
* * fhandler.cc (fhandler_disk_file::open): Check for allow_ntsecCorinna Vinschen2000-04-251-39/+56
| | | | | | | | | | | | | 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.
* * syscalls.cc (_link): Check new link path for trailing dot.Corinna Vinschen2000-04-201-7/+9
|
* * syscalls.cc (setuid): Allow switching user context afterCorinna Vinschen2000-04-191-12/+50
| | | | | | | successful call to ImpersonateLogedOnUser (NT only). (setgid): Ditto. (seteuid): Call setuid. (setegid): Call setgid.
* * syscalls.cc (_rename): Try MoveFile() at first beforeDJ Delorie2000-04-191-25/+27
| | | | MoveFileEx(..., MOVEFILE_REPLACE_EXISTING).
* * init.cc (dll_entry): Use better check for determining when to set threadChristopher Faylor2000-04-161-2/+5
| | | | | | specific stuff. * syscalls.cc (_unlink): Continue with chmod'ing file even if DELETE_ON_CLOSE succeeds, if file still exists.
* * dcrt0.cc (insert_file): Avoid freeing previously allocated argument list.Christopher Faylor2000-04-131-1/+1
| | | | | | | | | | * path.cc (symlink_info::check): Rename from symlink_check_one. Use new symlink_info struct for communication. (path_conv::path_conv): Use symlink_info structure for communication with symlink_info::check. Fix typo which resulted in symbolic links always being resolved. (readlink): Use stat_suffixes array when resolving a link. * syscalls.cc (stat_suffixes): Make global.
* * newlib/libc/include/sys/unistd.h: Add prototypes forCorinna Vinschen2000-04-021-17/+60
| | | | | | | | | | | | | | fchmod, fchown, lchown. * winsup/cygwin/syscalls.cc (chown_worker): Use previous uid/gid if new uid/gid is -1. New static function with chown functionality. (chown): Call chown_worker with SYMLINK_FOLLOW. (fchown): New function. Call chown_worker with SYMLINK_FOLLOW. (lchown): New function. Call chown_worker with SYMLINK_IGNORE. * cygwin.din: Add symbols for fchown, lchown. * path.cc (symlink): Call `set_file_attribute()' and `SetFileAttributeA()' instead of `chmod()' to set uid/gid correct.
* * Makefile.in: Use default rules when compiling cygrun.o.Christopher Faylor2000-03-281-1/+2
| | | | | | | | * dcrt0.cc (host_dependent_constants::init): Limit non-NT platforms to 32K chunks when copying regions during a fork. * path.cc (symlink_check_one): Add temporary debugging output. Simplify PATH_EXEC test. * syscalls.cc (stat_suffixes): Null terminate this list.
* * path.cc (symlink_check_one): Recognize symlink settings from the mount table.Christopher Faylor2000-03-261-20/+9
| | | | | | | * path.h: Make PATH_SYMLINK an alias for MOUNT_SYMLINK. * syscalls.cc (stat_worker): Use extension search mechanism in path_conv to look for .exe rather than trying to special case it here. * mount.h: Make MOUNT_SYMLINK a real option.
* * syscalls.cc (stat_worker): Set st_nlink to 1 on remote drives.Corinna Vinschen2000-03-191-2/+4
|
* * delqueue.cc (delqueue_list::queue_file): Add some debugging.Christopher Faylor2000-03-181-19/+38
| | | | | | * path.h (class path_conv): Add a char * operator for the most common case. * syscalls.cc (_unlink): Rewrite to use FILE_FLAG_DELETE_ON_CLOSE when possible (i.e., on NT).
* * security.cc (set_process_privileges): Removed `static'.Corinna Vinschen2000-03-161-24/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | (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.
* * environ.cc: Eliminate oldstack CYGWIN option.Christopher Faylor2000-03-091-15/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * exceptions.cc (sfta): Eliminate obsolete function. (sgmb): Eliminate obsolete function. (class stack_info): Remove MS method for walking the stack. (stack_info::init): Just initialize required fields. (stack_info::brute_force): Rename to stack_info::walk. (handle_exceptions): Pass derived frame pointer to sig_send. (interrupt_setup): Clear saved frame pointer here. (interrupt_on_return): thestack is no longer a pointer. (call_handler): Accept a flag to indicate when a signal was sent from other than the main thread. Use saved frame pointer for determining where to place signal handler call. (sig_handle): Accept "nonmain" argument. Pass it to call_handler. * fhandler_tty.cc (fhandler_tty_common::__acquire_output_mutex): Change debugging output slightly. * (fhandler_tty_common::__release_output_mutex): Ditto. (fhandler_tty_slave::read): Fix a comment, remove a goto. * sigproc.cc (sig_send): Accept an optional frame pointer argument for use when suspending the main process. sigcomplete_main is an autoreset event now. Save frame pointer for non-main operation. (wait_sig): Make sigcomplete_main an autoreset event. Eliminate NOSIGQUEUE. Pass rc to sig_handle to signify if this was a nonmain process. * sigproc.h: Reflect change to sig_send argument. * syscalls.cc (swab): Eliminate swab function since it is now available in newlib. * winsup.h (signal_dispatch): Change CONTEXT cx to DWORD ebp.
* *** empty log message ***Christopher Faylor2000-02-241-1/+1
|
* * syscalls.c (_read): Clear errno before doing any read operation.Christopher Faylor2000-02-241-0/+1
|
* Respond to more g++ warnings relating to initializing structures.Christopher Faylor2000-02-231-5/+5
|
* Respond to a multitude of g++ warnings.Christopher Faylor2000-02-211-5/+5
|
* import winsup-2000-02-17 snapshotChristopher Faylor2000-02-171-0/+1939