Commit Graph

6646 Commits

Author SHA1 Message Date
Corinna Vinschen 5c8426d50e * shm.cc (shmctl): On IPC_RMID don't unmap views and don't close handle
if the map is still referenced to emulate Linux and BSD behaviour.
2007-11-05 15:25:55 +00:00
Corinna Vinschen 92beb4638f * shm.cc (shmctl): On IPC_RMID also unmap all views on shared mem
as well as connected shm_attached_list entry.
2007-11-05 10:15:31 +00:00
Corinna Vinschen 6eedb2be6d * net.cc (load_ipv6_funcs): Use MAX_PATH instead of CYG_MAX_PATH.
(cygwin_getaddrinfo): Simplify formatting.
	(cygwin_getnameinfo): Ditto.
2007-10-31 16:06:01 +00:00
Corinna Vinschen 15346b6950 * external.cc (get_cygdrive_info): Make inline.
(get_cygdrive_prefixes): Remove.
	(cygwin_internal): Call get_cygdrive_info with NULL flag parameters
	instead of get_cygdrive_prefixes.
	* path.cc (mount_info::get_cygdrive_info): Allow NULL flag parameters.
2007-10-31 13:23:33 +00:00
Corinna Vinschen 101f07b907 * fhandler_disk_file.cc (fhandler_base::fstat_helper): Don't remove
write bits for directories with R/O attribute.
	(fhandler_base::fhaccess): Don't shortcircuit R/O attribute with W_OK
	scenarios for directories.
2007-10-30 12:32:16 +00:00
Corinna Vinschen 09ecdc8504 * cygheap.h (struct cwdstuff): Drop hash member. Drop get_hash,
get_initial, and fixup_after_exec declarations.
	Convert win32 to UNICODE_STRING.
	(cwdstuff::get_drive): Convert win32 path in current codepage.
	(cwdstuff::set): Take native NT path.
	* ntdll.h (struct _TEB): Typedef.
	* path.cc (mount_info::conv_to_posix_path): Add variant taking
	wide char DOS paths.
	(symlink_info::posixify): Simplify concatenating cwd and relative path.
	(hash_path_name): Drop special relative path handling.
	(chdir): Drop special "drive only" handling.  Call cwdstuff::set with
	native path.
	(cwdstuff::get_hash): Remove.
	(windows_system_directory): Remove.
	(_upp): Remove.
	(get_user_proc_parms): Make inline.  Get PEB pointer by calling
	NtCurrentTeb.
	(cwdstuff::init): Simplify.
	(cwdstuff::set): Rework to handle incoming native NT path.  Workaround
	a Vista problem with CWD handle in the user process parameter block.
	(cwdstuff::get): Simplify locking.  Accommodate type change of win32.
	* shared_info.h (mount_info): Add declaration for new conv_to_posix_path
	method.
	* strfuncs.cc (sys_wcstombs): Return correct length of created
	multi-byte string.
2007-10-23 16:26:28 +00:00
Corinna Vinschen 6788155fe2 * fhandler_disk_file.cc (__DIR_mounts::eval_ino): Make fname big enough
to allow multibyte chars.
2007-10-19 12:22:49 +00:00
Corinna Vinschen f3257492c4 * fhandler.cc (fhandler_base::open): Open native symlinks with
FILE_OPEN_REPARSE_POINT flag.  Fix typo in comment.
2007-10-18 12:40:27 +00:00
Corinna Vinschen 5b69737250 * include/sys/param.h (MAXPATHLEN): Define as PATH_MAX. 2007-10-18 10:42:43 +00:00
Corinna Vinschen 6ce2c24121 * fhandler.cc (is_at_eof): Rewrite using NT functions.
(off_current): New static variable.
	(off_append): Ditto.
	(fhandler_base::raw_write): Use NtWriteFile.  Accommodate O_APPEND here.
	(fhandler_base::write): Drop O_APPEND hack.  Use NT functions.
	(fhandler_base::lseek): Rewrite using NT functions.
	* fhandler_disk_file.cc (fhandler_disk_file::fstatvfs): Add space in
	debug output.
	(fhandler_disk_file::ftruncate): Ditto.
	* ntdll.h (STATUS_DISK_FULL): Define.
	(FILE_USE_FILE_POINTER_POSITION): Define.
	(FILE_WRITE_TO_END_OF_FILE): Define.
2007-10-15 08:25:38 +00:00
Corinna Vinschen fc7290fd39 * ntdll.h (STATUS_END_OF_FILE): Define.
* path.cc (symlink_info::check_shortcut): Use NT function to get file
	size.  Reintroduce checking file size before reading it.  Eliminiate
	close_it label.
	(symlink_info::check_sysfile): Check for EOF condition.
2007-10-13 11:06:43 +00:00
Corinna Vinschen 2da0e37519 * path.cc (basename): Return pointer into the path argument itself.
Shrink buf to 4 bytes.  Use buf only for border cases.
	(dirname): Ditto.
2007-10-11 16:26:19 +00:00
Corinna Vinschen 044b62c767 * path.cc (struct symlink_info): Change size of contents member to
be able to keep SYMLINK_MAX sized strings.
	(symlink_worker): Rework for long path names.  When writing windows
	shortcuts, store pathname additionally "hidden" after the actual
	shortcut data to workaround size limitations of the description field.
	(symlink_info::check_shortcut): Drop file name parameter.  Drop max
	file size check.  Use NT functions.  Use appended full path if
	available, description otherwise.  Check symlink string length for
	not exceeding SYMLINK_MAX.  Don't close file here.
	(symlink_info::check_sysfile): Drop file name parameter.  Use NT
	functions.  Check symlink string length for not exceeding SYMLINK_MAX.
	Don't close file here.
	(symlink_info::check_reparse_point): Drop file name parameter.  Drop
	useless length checks.  Allow SYMLINK_MAX length symlink strings.
	Don't close file here.
	(symlink_info::posixify): Allow SYMLINK_MAX length symlink strings.
	(symlink_info::check): Turn around checking for symlink file attributes.
	Use NT functions.  Close symlink file here.
	* include/limits.h (PATH_MAX): Define as 32760.  Change comment.
	(SYMLINK_MAX): Define as PATH_MAX - 1.
2007-10-10 16:54:09 +00:00
Corinna Vinschen 4797f5bca3 * fhandler_socket.cc (fhandler_socket::bind): Open file for deletion,
too.  Don't write to file and especially don't close handle if file
	couldn't be created.  Set delete disposition if writing failed,
	instead of calling unlink_nt.
2007-10-10 16:07:46 +00:00
Chris Sutcliffe 2fb5f81aa5 2007-10-03 Jiri Malak <Jiri.Malak@iol.cz>
* include/rpcndr.h: Missing NdrClientCall2 entry.
        * lib/rpcrt4.def: Ditto.
2007-10-03 23:49:35 +00:00
Chris Sutcliffe b0d00f7a53 2007-10-03 Frank Fesevur <ffes@users.sourceforge.net>
* lib/scnsave.c: Multi-monitor support.
2007-10-03 23:34:14 +00:00
Chris Sutcliffe b980db14b8 2007-10-03 Danny Smith <dannysmith@users.sourceforge.net>
* mingwex/gdtoa/mingw_snprintf.c: fixed warning during compile.
2007-10-03 20:45:58 +00:00
Chris Sutcliffe 08a0c88da5 2007-10-03 Bernd Becker <hugin@users.sourceforge.net>
* include/io.h (__finddata64_t, __wfinddata64_t): changed member 'size'
        from '_fsize_t' to '__int64' to be consistent with the other ...64
        structures and the value set there is 8 bytes not 4.  Add guard for both
        as the are only used by functions available from 6.1 on.

        * include/malloc.h (_HEAP_MAXREQ): Define.
        (_aligned_offset_recalloc): Define.
        (_aligned_recalloc()): Define.

        * include/math.h: fixed a typo in a comment.
        (atanhf): Fixed declaration.

        * include/wchar.h (__wfinddata64_t): changed member 'size' from '_fsize_t'
        to '__int64' to be consistent with the other ...64 structures and the value
        set there is 8 bytes not 4.  Added guard as this function is only used by
        functions available from 6.1 on.

        * include/sys/stat.h: some members of 'stat' were declared with types with
        a prefixed underscore, while the ones without the underscore should have
        been used.  Added guard to '__stat64' as it is only used by functions
        available from 6.1 on.  Added the wide character versions of the
        exec()/spawn() family for completion
        (_stati64): changed the type of the 'st_mode' member from 'unsigned int' to
        '_mode_t'

        * include/sys/timeb.h (timeb, _timb): changed the type of the 'time' member
        from 'long' to 'time_t'
        (__timeb64): moved declaration of structure directly before the declaration
        of the function '_ftime64()', so it is guarded as well

        * include/sys/utime.h (__utimbuf64): moved declaration of structure directly
        before the declaration of the functions using it, so it is guarded as well
2007-10-03 18:55:56 +00:00
Corinna Vinschen b75971ef8a * ntdll.h (struct _FILE_COMPRESSION_INFORMATION): Align with definition
in w32api / MSDN.
	* fhandler_disk_file.cc (fhandler_base::fstat_helper): Accommodate
	change to struct _FILE_COMPRESSION_INFORMATION.
2007-09-27 09:35:06 +00:00
Corinna Vinschen dfbd95d35d * termios.cc (setspeed): Support new baud rates introduced 2007-02-05. 2007-09-26 08:57:35 +00:00
Corinna Vinschen aa7eeef93a * faq-what.xml: Remove paragraph about and link to stoneage old
history.html file.
2007-09-25 17:03:59 +00:00
Danny Smith c67e696c47 Committed as obvious:
2007-09-24  David C. Daeschler <daveregs@rsaisp.com>

	* mingwex/gdtoa/mingw_snprintf.c (x_sprintf): Correct LEN_L typo in 'l'
	case.  Add missing break in 's'/LEN_S case.
2007-09-23 22:23:18 +00:00
Corinna Vinschen 1ceec140c0 * ntdll.h (STATUS_OBJECT_NAME_INVALID): Define. 2007-09-20 15:14:13 +00:00
Corinna Vinschen 4090f565a8 * mmap.cc (fh_disk_file): Delete as global static variable and...
(mmap64): ...define as local pointer to make mmap thread-safe.
	Accommodate throughout.  Only initialize fh_disk_file after file could
	be opened with GENERIC_EXECUTE access.  Call fstat_by_handle instead of
	fstat to avoid overhead.
2007-09-18 15:59:50 +00:00
Corinna Vinschen d81b646dc3 * security.cc (set_file_sd): Open file with FILE_OPEN_FOR_BACKUP_INTENT
too.
2007-09-18 14:36:29 +00:00
Corinna Vinschen 6c8c58e7f4 * path.cc (symlink_info::check): Check for STATUS_OBJECT_NAME_INVALID.
Add comment.
2007-09-18 11:05:44 +00:00
Corinna Vinschen 8e34786463 * fhandler.cc (fhandler_base::open): Partly revert change from
2007-08-24:  Call has_acls to avoid permission problems getting
	a handle to a file on a remote share.  Add comment.
2007-09-17 16:48:14 +00:00
Brian Dessent 1515ce296a * include/cygwin/config.h: Conditionalize inline __getreent()
definition on _COMPILING_NEWLIB.
2007-09-08 10:51:37 +00:00
Brian Dessent 6e08b2f7f8 * include/cygwin/config.h (__getreent): Define inline version. 2007-09-07 00:44:27 +00:00
Brian Dessent 1eb76b8f84 * include/sys/stdio.h (_flockfile): Don't try to lock a FILE
that has the __SSTR flag set.
	(_ftrylockfile): Likewise.
	(_funlockfile): Likewise.
2007-09-06 18:47:44 +00:00
Christopher Faylor 3509dfbbca * configure: Regenerate. 2007-08-31 23:11:04 +00:00
Dave Korn d848b3419f 2007-08-31 Dave Korn <dave.korn@artimi.com>
* mkgroup.c (enum_groups):  Use MAX_PREFERRED_LENGTH in netgroupenum
	call so that it will automatically size returned buffer sufficiently.
2007-08-31 00:39:41 +00:00
Keith Marshall 01cd95204e Make snprintf() and vsnprintf() conform to C99. 2007-08-25 13:49:37 +00:00
Corinna Vinschen 70650b2db4 * syscalls.cc (open): Don't follow symlinks if O_EXCL is given. 2007-08-24 14:55:56 +00:00
Christopher Faylor c60c72d718 * dll.sgml: myprog.ca -> myprog.c 2007-08-24 14:52:39 +00:00
Corinna Vinschen a888c0799c * ntdll.h (STATUS_NO_SUCH_FILE): Define.
* path.cc (get_nt_native_path): Reset upath.Length to 0 on each
	invocation.
	(symlink_info::check): Use NT native functions.
2007-08-23 07:43:24 +00:00
Corinna Vinschen e1e4b104b6 * uinfo.cc (pwdgrp::load): Use NT native functions. 2007-08-21 17:38:27 +00:00
Corinna Vinschen 2e9fe498f2 * fhandler_disk_file.cc (fhandler_base::fstat_helper): Rewrite checking
for executable file magic using a thread safe method and re-enable this
	code.
2007-08-21 15:37:10 +00:00
Corinna Vinschen f5f0ae3e26 * syscalls.cc (unlink_nt): Drop one local FILE_BASIC_INFORMATION struct. 2007-08-21 12:39:53 +00:00
Corinna Vinschen 1b61bf152b * ntdll.h (NtNotifyChangeDirectoryFile): Declare.
(NtQueryAttributesFile): Move to maintain alphabetical order of
	declarations.  Add comment to note that timestamp information returned
	by NtQueryAttributesFile is unreliable.
	* path.h (etc::changed_h): Move here.
	(etc::fn): Change type to OBJECT_ATTRIBUTES.
	(etc::last_modified): Change type to LARGE_INTEGER.
	(etc::init): Take PUNICODE_STRING as second argument.
	* path.cc: Accomodate above changes.
	(etc::test_file_change): Use NT native functions.
	(etc::dir_changed): Ditto.
	* uinfo.cc (pwdgrp::load): Call etc::init with NT native path.
2007-08-21 12:37:40 +00:00
Corinna Vinschen 66e36b7987 * fhandler_disk_file.cc: Change debugging output througout to print
the NT status consistently.  Use UNICODE path information if available.
2007-08-21 12:09:38 +00:00
Corinna Vinschen 891b6e885e * hookapi.cc (ld_preload): Call LoadLibraryW.
* path.h (path_conv::get_wide_win32_path_len): Define.
2007-08-20 15:41:08 +00:00
Corinna Vinschen 876da7fb74 * fhandler.cc (rootdir): Delete.
* winsup.h (rootdir): Drop declaration.
2007-08-20 15:16:27 +00:00
Corinna Vinschen decbb5d387 * path.cc (fillout_mntent): Append backslash to drive-only paths before
calling fs_info::update.
	* path.h (fs_info::clear): Simplify.
	(fs_info::fs_info): Add constructor.
2007-08-19 15:55:06 +00:00
Corinna Vinschen 5b62123cf6 * spawn.cc (spawn_guts): Fix typo in comment. 2007-08-17 20:22:24 +00:00
Corinna Vinschen e0bdf94f32 * autoload.cc (CloseDesktop): Define.
(CreateDesktopA): Define.
	(SetThreadDesktop): Define.
	* spawn.cc (spawn_guts): When starting a process under another user
	account, don't open up permissions on current window station and
	desktop.  Instead, if not in interactive session, create a new per-user
	window station plus default desktop and use that for the child process.
2007-08-17 19:58:57 +00:00
Corinna Vinschen f4c963630e * fhandler_disk_file.cc (fhandler_disk_file::fchmod): Handle S_IFSOCK
mode bit by setting the SYSTEM attribute.
	* fhandler_socket.cc (fhandler_socket::fchmod): Add S_IFSOCK mode bit
	when calling fhandler_disk_file::fchmod.  Don't set attributes here.
2007-08-16 16:59:25 +00:00
Corinna Vinschen 29992bf3da * path.h (path_conv::operator char *): Delete.
(path_conv::operator const char *): Delete.
	* dlfcn.cc: Throughout, replace path_conv::operator char * and
	path_conv::operator const char * by call to path_conv::get_win32
	for easier transition to UNICODE_PATHs.
	* fhandler_socket.cc: Ditto.
	* hookapi.cc: Ditto.
	* path.cc: Ditto.
	* spawn.cc: Ditto.
	* syscalls.cc: Ditto.
	* uinfo.cc: Ditto.
2007-08-16 15:07:42 +00:00
Corinna Vinschen 29fec364c0 * dir.cc (readdir_worker): Convert w32name to PUNICODE_STRING.
* sec_acl.cc (getacl): Convert debug output to print native NT path.
	* security.cc (set_file_attribute): Ditto.
	* syscalls.cc (try_to_bin): Ditto and fix buggy debug statement.
2007-08-16 14:46:23 +00:00
Corinna Vinschen dec9daad4a * ntdll.h (RtlAcquirePebLock): Declare.
(RtlReleasePebLock): Declare.
	* path.cc (cwdstuff::set): Change PEB only while it's locked.
2007-08-16 14:30:53 +00:00