Commit Graph

5125 Commits

Author SHA1 Message Date
Corinna Vinschen a1c35b8b65 * syscalls.cc (rename): Fix permission problem with symlinks on NFS.
Rework how NtOpenFile gets called to make it more readable.  Change
	comment.
2011-01-21 13:13:00 +00:00
Corinna Vinschen 2aba945c95 * exec.cc: Include pinfo.h.
* winf.h: Move definitions of _P_PATH_TYPE_EXEC and _P_MODE from here...
	* pinfo.h: ...to here.
	(_P_PATH_TYPE_EXEC): Redefine to be bigger than _P_SYSTEM.
	(_P_MODE): Redefine so as not to mask out _P_SYSTEM.
	* spawn.cc (spawnlp): Add _P_PATH_TYPE_EXEC flag in call to spawnve.
	(spawnlpe): Ditto.
	(spawnvp): Ditto.
2011-01-20 11:09:21 +00:00
Corinna Vinschen 9b68968b21 * spawn.cc (av::fixup): Reenable #! handling for all exec functions.
Return ENOEXEC in !p_type_exec case only for unrecognized files.
	Fix comment formatting.
2011-01-19 14:59:10 +00:00
Corinna Vinschen 1393f63206 * exec.cc (execlp): Add missing _P_PATH_TYPE_EXEC flag in call to
spawnve.
2011-01-19 10:30:39 +00:00
Corinna Vinschen 26b070c0cf * exec.cc: Rearrange functions in alphabetical order.
(_execve): Drop temporary define and drop export alias.
	(execl): Call spawnve.
	(execle): New function.
	(execlp): New function.
	(execv): Call spawnve.
	(execve): Drop converting NULL envp to emtpy envp.
	(execvp): Call spawnve.
	(execvpe): Drop converting NULL envp to emtpy envp.  Call spawnve.
	(fexecve): Call spawnve.
	* spawn.cc (spawnve): Convert NULL envp to emtpy envp.  Remove outdated
	comment.
	(spawnlp): Call spawnve.
	(spawnlpe): Ditto.
	(spawnvp): Ditto.
	(spawnvpe): Fix formatting.
2011-01-19 10:28:39 +00:00
Corinna Vinschen 17133a85de * exec.cc (strccpy): Move function from here...
* strfuncs.cc (strccpy): ...to here.
	* string.h (strccpy): Declare.
	* winsup.h (strccpy): Drop declaration.
2011-01-19 09:41:54 +00:00
Corinna Vinschen 808aae3d13 * errno.cc (errmap): Add error codes for invalid binaries.
* exec.cc (execvp): Call spawnve with _P_PATH_TYPE_EXEC flag
	from here.
	(execvpe): Ditto.
	* spawn.cc (spawn_guts): Filter _P_PATH_TYPE_EXEC from mode and
	store in p_type_exec.  Call av::fixup with addtional p_type_exec
	argument.
	(spawnve): Check for filtered mode.
	(spawnvpe): Add _P_PATH_TYPE_EXEC flag when calling spawnve.
	(av::fixup): Accept additional bool parameter p_type_exec.  Only check
	for script if p_type_exec is true.
	* winf.h (_P_PATH_TYPE_EXEC): Define.
	(_P_MODE): Define.
	(av::fixup): Declare with additional bool parameter.
2011-01-19 09:15:17 +00:00
Corinna Vinschen fc660168bf * fhandler_proc.cc (format_proc_partitions): Fix compiler warning. 2011-01-17 14:31:30 +00:00
Corinna Vinschen be37165114 * path.cc (path_conv::check): Don't follow reparse point symlinks if
PC_SYM_NOFOLLOW_REP flag is set.
	(cygwin_conv_path): Set PC_SYM_NOFOLLOW_REP flag when converting from
	POSIX to Win32.
	* path.h (enum pathconv_arg): Define PC_SYM_NOFOLLOW_REP flag.
2011-01-17 14:19:39 +00:00
Corinna Vinschen 483e9d0022 * fhandler_proc.cc (proc_tab_cmp): Fix typo in comment.
(fhandler_proc::fill_filebuf): Handle return value of 0 from format
	function as error.
	(format_proc_stat): Set errno when returning 0 size.
	(format_proc_partitions): Rewrite method to fetch partition info.
2011-01-17 13:38:06 +00:00
Corinna Vinschen 49d31b4e82 Fix typo, fix copyright 2011-01-13 14:00:00 +00:00
Corinna Vinschen 07c43238cf * fhandler_disk_file.cc (fhandler_base::fstat_helper): Alwasy set
st_size of directories to 0.  Explain why.
2011-01-13 13:50:02 +00:00
Corinna Vinschen c049f0f6ff * posix.sgml: Add madvise to BSD list. 2011-01-12 13:09:31 +00:00
Corinna Vinschen 6147b7f8a3 * cygwin.din (madvise): Export posix_madvise as madvise.
* include/cygwin/version.h: Bump CYGWIN_VERSION_API_MINOR.
	* include/sys/mman.h: Define madvise constants, keep Linux-specific
	constants undefined.
	(madvise): Declare.
2011-01-12 13:01:43 +00:00
Corinna Vinschen 667f187146 * fhandler.h (struct part_t): New type.
(class fhandler_dev_floppy): Convert partitions to part_t pointer.
	Add lock_partition method.
	* fhandler_floppy.cc (fhandler_dev_floppy::lock_partition): New method
	to implement ondemand partition locking.
	(fhandler_dev_floppy::write_file): Call lock_partition from here if
	writing failed due to a potential write restriction on a disk
	partition.
	(fhandler_dev_floppy::open): Don't lock partitions here.
	(fhandler_dev_floppy::close): Keep track of partition handle reference
	count.  Close handles and remove partitions pointer ony if count is 0.
	(fhandler_dev_floppy::dup): Just copy partitions pointer and increment
	reference count.
2011-01-12 09:16:51 +00:00
Corinna Vinschen 95a5c969ab * fhandler.h (MAX_PARTITIONS): New definition.
(class fhandler_dev_floppy): Add partitions array member.  Add close
	method.
	* fhandler_floppy.cc (fhandler_dev_floppy::fhandler_dev_floppy): Zero
	out partitions array.
	(fhandler_dev_floppy::open): Fix "entire disk" condition for call to
	DeviceIoControl (FSCTL_ALLOW_EXTENDED_DASD_IO).
	When opening disks for writing, call DeviceIoControl (FSCTL_LOCK_VOLUME)
	on all affected disk partitions starting with Vista.
	(fhandler_dev_floppy::close): New method.
	(fhandler_dev_floppy::dup): Duplicate handles in partitions, if any.
	* wincap.h (wincaps::has_restricted_raw_disk_access): New element.
	* wincap.cc: Implement above element throughout.
2011-01-11 14:50:45 +00:00
Corinna Vinschen b7d4651e3e * termios.cc (cfgetospeed, cfgetispeed): Constify argument per POSIX.
* include/sys/termios.h (cfgetospeed, cfgetispeed): Declare functions.
	Move macros after declarations and make conditional on !__cplusplus.
2011-01-11 10:09:23 +00:00
Corinna Vinschen cd441f06e2 * cygtls.cc (_cygtls::init_thread): Call _REENT_INIT_PTR. Drop setting
current locale and calling srand48.
2011-01-11 08:05:51 +00:00
Christopher Faylor 8b0be52ba0 * ChangeLog-2010: Create from ChangeLog.
* ChangeLog: Start fresh.
2011-01-03 01:53:19 +00:00
Christopher Faylor 2be50cacae * cygtls.cc: Include stdlib.h.
(_cygtls::init_thread): Seed random number generator on a per-thread basis.
2010-12-29 06:33:30 +00:00
Christopher Faylor c8d1848d07 * include/cygwin/version.h: Bump CYGWIN_VERSION_API_MINOR to 234. 2010-12-27 17:29:25 +00:00
Christopher Faylor 589e430baa cygwin:
* cygwin.din: Export program_invocation_name and
	program_invocation_short_name.
	* dcrt0.cc: Set program_invocation*name to correct values, based on
	argv[0].
	* globals.cc (program_invocation_name): Define.
	(program_invocation_short_name): Ditto
newlib:
	* libc/include/sys/errno.h (program_invocation_name): Declare.
	(program_invocation_short_name): Ditto.
2010-12-26 21:11:38 +00:00
Corinna Vinschen 9296807af3 * security.cc (alloc_sd): Really fix erroneous inheritence entry
duplication now.  Add more comments for clarity.
2010-12-16 10:31:09 +00:00
Corinna Vinschen e445b7c336 * sec_acl.cc (getacl): Ensure that the default acl contains at least
DEF_(USER|GROUP|OTHER)_OBJ entries.
2010-12-15 14:11:03 +00:00
Corinna Vinschen 38042584f3 * security.cc (alloc_sd): Fix erroneous inheritence entry duplication. 2010-12-15 13:56:32 +00:00
Corinna Vinschen e52961c403 * syscalls.cc (check_dir_not_empty): Never count more than 3 directory
entries.
2010-12-12 15:32:45 +00:00
Christopher Faylor f646aeb049 * init.cc (search_for): Put this in shared section or suffer subtle problems
with the tls.
* pinfo.cc (status_exit): Add debug output to report on unexpected exit.
* tls_pbuf.cc (tmp_pathbuf::c_get): Add more details to internal error.
2010-12-12 05:48:29 +00:00
Christopher Faylor 4f26f8486c fix typo 2010-12-09 21:44:22 +00:00
Corinna Vinschen 0dcfb061cf * autoload.cc (RETRY_COUNT): New define.
(std_dll_init): Restructure loop to retry loading a DLL only if
	specific errors occur.  If these errors persist, try to load DLL
	with name only.
2010-12-09 16:50:36 +00:00
Corinna Vinschen 51ecb7d9af * include/strings.h: Remove in favor of equivalent newlib file. 2010-12-08 14:28:18 +00:00
Corinna Vinschen 7695120581 * sec_acl.cc (getacl): Set DEF_CLASS_OBJ permissions to 07 instead
of 0777.
2010-12-08 10:24:20 +00:00
Corinna Vinschen 9de485e8e0 * path.cc (path_conv::check): Don't generate ENOENT for non-existant
CYGDRIVE and NETDRIVE paths.  Add comment.
2010-12-06 13:09:40 +00:00
Corinna Vinschen bdcc0b84ed * net.cc (get_xp_ifs): Fix counting of idx to return stable interface
alias names for interfaces with multiple IPv4 addresses.
2010-12-02 11:39:15 +00:00
Corinna Vinschen 910e31f015 * fhandler_tty.cc (fhandler_tty_slave::dup): Free path_conv strings
to avoid memory leak.  Add comment.
	(fhandler_pty_master::dup): Ditto.
	* path.h (path_conv::free_strings): New method.
2010-11-29 20:51:38 +00:00
Corinna Vinschen 943c59e3e8 * autoload.cc (SendARP): Remove.
* net.cc (get_flags): Set IFF_NOARP flag for PPP and SLIP devices.
	(get_xp_ifs): Unify IFF_BROADCAST setting.  Drop calling SendARP to
	set IFF_NOARP flag.
2010-11-23 15:37:41 +00:00
Corinna Vinschen 5fe7c5e01b * path.cc (symlink_info::check): Don't use FileNetworkOpenInformation
on Netapps.  Relax condition for workaround.  Always request size
	information via FileStandardInformation info class in workaround.
2010-11-23 09:26:16 +00:00
Corinna Vinschen fc0fb0ba13 * mount.cc (NETAPP_IGNORE): Add FILE_PERSISTENT_ACLS.
(FS_IS_NETAPP_DATAONTAP): Drop test for FILE_PERSISTENT_ACLS.
	(fs_info::update): Set filetype to ntfs in remote case, too.  Fix a
	couple of comments.  Add test for Netapps faking to be FAT.

	* mount.h (IMPLEMENT_FS_FLAG): Simplify definition and usage.
2010-11-22 14:19:50 +00:00
Corinna Vinschen 9dda712bd9 * net.cc (get_ipv4fromreg_ipcnt): Fix debug output. Only create debug
output if error is not ERROR_FILE_NOT_FOUND.
	(get_ipv4fromreg): Ditto.
2010-11-22 13:03:00 +00:00
Corinna Vinschen 5c6904b515 * fhandler_tty.cc (fhandler_tty_slave::fchown): Initialize mode to 0. 2010-11-18 18:55:10 +00:00
Corinna Vinschen 8506523421 * posix.sgml: Move llround and llroundf to implemented SUSv4 functions.
* include/cygwin/version.h: Add llround and llroundf to the comment for
	the 233 CYGWIN_VERSION_API_MINOR bump.
2010-11-15 12:44:57 +00:00
Yaakov Selkowitz cc353b9f34 * include/paths.h (_PATH_VARTMP): Define. 2010-11-02 17:38:36 +00:00
Christopher Faylor 49808040c5 * localtime.cc (is_upper): Rename to isupper and include ctype.h to pull in
standard macro.
(lcl_is_set): Define as an enum.
(tzsetwall): Assign lcl_is_set to correct enum values.
(tzset): Ditto.  Copy as much of TZ as will fit to TZ buffer.
2010-10-30 19:22:42 +00:00
Christopher Faylor 3e38e8abf7 * include/cygwin/version.h: Bump CYGWIN_VERSION_API_MINOR to 233. 2010-10-27 14:22:27 +00:00
Christopher Faylor ec515e9e47 Tweak entry. 2010-10-24 19:33:03 +00:00
Christopher Faylor 5160c5f430 * dcrt0.cc (do_exit): Don't set thread termination until all fds have been
closed since an fd may rely on a thread.
* fhandler_tty.cc: Reformat comment.
(fhandler_pty_master::pty_master_thread): Refuse ERROR_PIPE_CONNECTED state as
an error.
* globals.cc (exit_states): Reorder ES_THREADTERM.
* path.cc (find_fast_cwd_pointers): Remove excessively wordy DEBUGGING output.
2010-10-24 18:50:57 +00:00
Christopher Faylor 488ddaced3 * exceptions.cc (try_to_debug): Improve comment.
* fhandler_tty.cc (fhandler_pty_master::fhandler_pty_master): Add a comment.
2010-10-24 15:26:05 +00:00
Christopher Faylor c4f296c2a9 * pinfo.cc (pinfo::exit): Grab a tty lock before setting pgid. 2010-10-23 18:57:43 +00:00
Christopher Faylor 74882a259a * pinfo.cc (pinfo::exit): Reset tty pgrp to zero if no more handles open.
(_pinfo::set_ctty): Remove debugging stuff.
2010-10-23 18:55:01 +00:00
Christopher Faylor 50ed699a2a * fhandler_tty.cc (fhandler_pty_master::open): Remove debugging printf. 2010-10-23 18:11:20 +00:00
Christopher Faylor 4ce975efd3 * fhandler.h (fhandler_termios::tcinit): Make second argument non-optional.
* fhandler_console.cc (fhandler_console::open): Specify second argument to
tcinit.
* fhandler_termios.cc (fhandler_termios::tcinit): Rename second argument.  Set
pgid to 0 if this is a pty master.
(fhandler_termios::tcgetpgrp): Just return value of pgid.  It will be zero if
not initialized.
* fhandler_tty.cc (fhandler_tty_slave::open): Specify second argument to
tcinit.
(fhandler_tty_slave::ioctl): Implement TIOCGPRP/TIOCSPGRP.  Fix switch
indentation.
(fhandler_tty_master::ioctl): Implement TIOCGPRP/TIOCSPGRP.
* include/sys/termios.h (TIOCGPGRP): Define similarly to Linux.
* include/sys/termios.h (TIOCSPGRP): Ditto.
2010-10-23 18:07:08 +00:00