Commit Graph

8460 Commits

Author SHA1 Message Date
Corinna Vinschen 9bf2a8a84a * new-features.sgml (ov-new1.7.7): Document change to avoid DLL
hijacking.
2010-08-28 11:36:43 +00:00
Corinna Vinschen 71d8f118da * loadlib.h: New header implementing safe LoadLibrary calls.
Include throughout files using LoadLibrary function.
	* cygcheck.cc (dump_sysinfo): Retrieve kernel32.dll handle via
	GetModuleHandle, rather than using LoadLibrary.
	* cygpath.cc (get_long_name): Ditto.
	(do_sysfolders): Append .dll suffix in LoadLibrary call.
	* ldh.cc (WinMain): Use LoadLibraryExW with DONT_RESOLVE_DLL_REFERENCES
	to avoid loading malicious library code.
	* locale.cc (print_locale_with_codeset): Change way to retrieve
	kernel32.dll path.
2010-08-28 11:22:37 +00:00
Corinna Vinschen 893a8b78fc * autoload.cc (LoadDLLprime): Change dllname storage to string16.
(struct dll_info): Convert name to WCHAR.
	(std_dll_init): Load DLLs with full path to windows system directory.
	Add hint to Microsoft security advisory.
	* dcrt0.cc (init_windows_system_directory): New function.
	(dll_crt0_0): Call init_windows_system_directory first.
	* exceptions.cc (windows_system_directory): Move to globals.cc.
	(windows_system_directory_length): Ditto.
	(events_init): Drop code fetching windows_system_directory.
	* globals.cc (windows_system_directory): New global variable.
	(windows_system_directory_length): Ditto.
	* net.cc (load_ipv6_funcs): Use windows_system_directory rather than
	GetSystemDirectoryW.
	* netdb.cc (open_system_file): Ditto.  Simplify debug output.
2010-08-28 08:51:21 +00:00
Chris Sutcliffe 657f0e4a14 2010-08-26 Chris Sutcliffe <ir0nh34d@users.sf.net>
* include/w32api.h: Increment version to 3.15.
        * Makefile.in: Ditto.
2010-08-27 23:36:30 +00:00
Chris Sutcliffe d27709722c 2010-08-26 Chris Sutcliffe <ir0nh34d@users.sourceforge.net>
* Makefile.in: Update naming convention and compression format (lzma),
        leaving existing naming convention and compression format as is for Cygwin.
2010-08-27 21:11:29 +00:00
Corinna Vinschen 6c43f249ac * new-features.sgml (ov-new1.7.7): Change to describe partial
reversion to pre-1.7.6 behaviour.
	(ov-new1.7.6): Deprecate description of CWD handling.
	* pathnames.sgml (pathnames-win32-api): Rewrite to reflect new CWD
	behaviour.
2010-08-27 18:56:28 +00:00
Corinna Vinschen 1121c57f54 * external.cc (sync_wincwd): Remove.
(cygwin_internal): Drop CW_SYNC_WINCWD case.
	* globals.cc (ro_u_pipedir): New R/O unicode string.
	* ntdll.h (RtlSetCurrentDirectory_U): Declare.
	* path.cc (cwdstuff::set): Improve comments.  Drop setting Win32 CWD to
	\\?\PIPE\ on init.  Keep Win32 CWD in sync, if possible.  Set to
	\\?\PIPE\ otherwise.
	* include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Revert to 230.
	* include/sys/cygwin.h (cygwin_getinfo_types): Remove CW_SYNC_WINCWD.
2010-08-27 17:58:45 +00:00
Corinna Vinschen 1165007539 * fhandler_proc.cc (format_proc_partitions): Improve comment. 2010-08-27 09:08:32 +00:00
Corinna Vinschen 708bbfd08e * cygpath.cc (get_device_name): Prefer the \\.\X: DOS device for
harddisks, if available.
2010-08-26 12:06:27 +00:00
Corinna Vinschen 46059af75c * fhandler_proc.cc (format_proc_partitions): Simplify code and enable
partition layout printing for non-privileged users.
2010-08-26 10:59:13 +00:00
Chris Sutcliffe ec7bb66c7a 2010-08-25 Chris Sutcliffe <ir0nh34d@users.sourceforge.net>
* include/oleacc.h (STATE_SYSTEM_HASPOPUP, STATE_SYSTEM_NORMAL,
        STATE_SYSTEM_PROTECTED): Define.

        Thank you to Marcus von Appen for reporting the issue.
2010-08-26 03:06:09 +00:00
Chris Sutcliffe 465ad88a27 2010-08-25 Chris Sutcliffe <ir0nh34d@users.sourceforge.net>
* include/winuser.h (CF_DIBV5): Define.
        (CF_MAX): Adjust accordingly.

        Thank you to Lenard Lindstrom for reporting the issue.
2010-08-26 02:51:37 +00:00
Chris Sutcliffe 2cb94d2ba4 2010-08-25 Chris Sutcliffe <ir0nh34d@users.sourceforge.net>
* include/sspi.h (QuerySecurityContextToken): Define.
        * lib/secur32.def: Regenerate using gendef on a Win7 machine.

        Thank you to Magnus Hagander for reporting the issue.
2010-08-26 02:42:31 +00:00
Chris Sutcliffe 8ea817cb14 2010-08-25 Ali Sabil <asabil@users.sourceforge.net>
* include/ocidl.h: Define COBJMACROS for IPropertyBag and IPropertyBag2.
2010-08-26 02:13:12 +00:00
Chris Sutcliffe aec4fa1895 2010-08-25 Chris Sutcliffe <ir0nh34d@users.sourceforge.net>
* include/shlwapi (ASSOCDATA): Update definition.

        Thank you to Frederic Deschamps for reporting the issue.
2010-08-26 02:05:58 +00:00
Chris Sutcliffe b898a48b69 2010-08-25 Chris Sutcliffe <ir0nh34d@users.sourceforge.net>
* include/winbase.h (COPY_FILE_OPEN_SOURCE_FOR_WRITE,
        COPY_FILE_ALLOW_DECRYPTED_DESTINATION, COPY_FILE_COPY_SYMLINK,
        COPY_FILE_NO_BUFFERING): Define.

        Thank you to Roland Schwingel for reporting the issue.
2010-08-26 01:57:46 +00:00
Chris Sutcliffe 8d5dd74cdc Add missing thank you notes. 2010-08-25 23:47:17 +00:00
Chris Sutcliffe 4594048d19 2010-08-25 Chris Sutcliffe <ir0nh34d@users.sourceforge.net>
* include/winuser.h (HHOOK): Move definition from here...
        * include/windef.h: ...to here, as per MSDN.
2010-08-25 23:39:29 +00:00
Chris Sutcliffe 0fc2536a69 2010-08-25 Chris Sutcliffe <ir0nh34d@users.sourceforge.net>
* include/winbase.h (GetEnvironmentStrings, GetEnvironmentStringsA): Per
        MSDN, change return type to LPCH.
        (GetEnvironmentStringsW): Per MSDN, change return type to LPWCH.
2010-08-25 23:33:14 +00:00
Corinna Vinschen 2f1832898f * mount.cc (fs_info::update): Fix comments. 2010-08-25 09:20:11 +00:00
Corinna Vinschen df70da7f6c * syscalls.cc (rename): Open file with FILE_READ_ATTRIBUTES. 2010-08-25 08:51:41 +00:00
Chris Sutcliffe 58ae62fd94 2010-08-24 Chris Sutcliffe <ir0nh34d@users.sourceforge.net>
* include/prsht.h (SNDMDG, POSTMSG): Fix typo.
        * include/windowsx.h (SNDMSG): Ditto.
2010-08-25 01:59:51 +00:00
Chris Sutcliffe 5ec52f06c2 2010-08-24 Chris Sutcliffe <ir0nh34d@users.sourceforge.net>
* include/prsht.h (SNDMSG, POSTMSG): Define macros and use throughout.

        Thank you to Ozkan Sezer for reporting the issue.
2010-08-24 23:09:52 +00:00
Chris Sutcliffe fbf44d908a 2010-08-24 Chris Sutcliffe <ir0nh34d@users.sourceforge.net>
* include/windowsx.h (SNDMSG): Define macro and use throughout.

        Thank you to Chris Oldwood for reporting the issue.
2010-08-24 23:03:57 +00:00
Chris Sutcliffe 89a45c6f61 2010-08-24 Chris Sutcliffe <ir0nh34d@users.sourceforge.net>
* include/oleacc.h (AccessibleObjectFromEvent): Correct definition.

        Thank you to Rick Walsh for reporting the issue.
2010-08-24 22:41:36 +00:00
Chris Sutcliffe 6d480dc617 2010-08-24 Chris Sutcliffe <ir0nh34d@users.sourceforge.net>
* include/winbase.h (MoveFileWithProcessA, MoveFileWithProgressW): Define.
2010-08-24 22:35:39 +00:00
Chris Sutcliffe c7a5ff6c03 2010-08-24 Vinky <rabbit_vinky@users.sourceforge.net>
* include/winbase.h (OVERLAPPED): Correct definition.
2010-08-24 22:25:44 +00:00
Chris Sutcliffe b075ce0ecd 2010-08-24 Chris Sutcliffe <ir0nh34d@users.sourceforge.net>
* include/winnt.h (IMAGE_NT_HEADERS32, IMAGE_NT_HEADERS64): Correct
        definition.

        Thank you to Pasi Ruokola for reporting the issue.
2010-08-24 22:20:33 +00:00
Chris Sutcliffe a5791e0e69 2010-08-24 Chris Sutcliffe <ir0nh34d@users.sourceforge.net>
* include/exdisp.h (get_RegisterAsBrowser): Fix typo.

        Thank you to cheznonnon for reporting the issue.
2010-08-24 22:10:28 +00:00
Chris Sutcliffe a3a74aa453 2010-08-24 Chris Sutcliffe <ir0nh34d@users.sourceforge.net>
* lib/ws2_32.def: Regenerate using gendef on a Win7 machine.
2010-08-24 22:05:38 +00:00
Chris Sutcliffe af02b239ea 2010-08-24 Ozkan Sezer <sezero@users.sourceforge.net>
* winnt.h: Fix several SUBLANG ID errors (ref:
        http://msdn.microsoft.com/en-us/library/dd318693(VS.85).aspx).
        (SUBLANG_UI_CUSTOM_DEFAULT): 0x05, not 0x03.
        (SUBLANG_HAUSA_NIGERIA): Bad ID name, correct one is ...
        (SUBLANG_HAUSA_NIGERIA_LATIN): ... this.
        (SUBLANG_INUKTITUT_CANADA_LATIN): 0x02, not 0x01.
        (SUBLANG_IRISH_IRELAND): 0x02, not 0x01.
        (SUBLANG_LAO_LAO_PDR): Bad ID name, correct one is ...
        (SUBLANG_LAO_LAO): ... this.
        (SUBLANG_LOWER_SORBIAN_GERMANY): 0x02, not 0x01.
        (SUBLANG_SAMI_SKOLT_FINLAND): 0x08, not 0x03.
        (SUBLANG_SAMI_INARI_FINLAND): 0x09, not 0x03.
        (SUBLANG_SYRIAC_SYRIA): define as SUBLANG_SYRIAC (what MSDN mentions).
        (SUBLANG_TIGRIGNA_ERITREA): 0x02, not 0x01.
        (SUBLANG_BENGALI_INDIA): 0x01, not 0x00.
        (SUBLANG_BENGALI_BANGLADESH): 0x02, not 0x01.
        (SUBLANG_PUNJABI_INDIA): 0x01, not 0x00.
        (SUBLANG_PUNJABI_PAKISTAN): not defined in MSDN.
        (SUBLANG_ROMANIAN_ROMANIA): 0x01, not 0x00.
        (SUBLANG_ROMANIAN_MOLDOVA): not defined in MSDN.
2010-08-24 21:26:51 +00:00
Chris Sutcliffe 57bcacf206 2010-08-24 LRN <lrn1986@gmail.com>
* include/mmreg.h (MPEGLAYER3WAVEFORMAT, WAVE_FORMAT_UNKNOWN,
        WAVE_FORMAT_PCM, WAVE_FORMAT_ADPCM, WAVE_FORMAT_IEEE_FLOAT,
        WAVE_FORMAT_VSELP, WAVE_FORMAT_IBM_CVSD, WAVE_FORMAT_ALAW,
        WAVE_FORMAT_MULAW, WAVE_FORMAT_OKI_ADPCM, WAVE_FORMAT_DVI_ADPCM,
        WAVE_FORMAT_MEDIASPACE_ADPCM, WAVE_FORMAT_SIERRA_ADPCM,
        WAVE_FORMAT_G723_ADPCM, WAVE_FORMAT_DIGIFIX, WAVE_FORMAT_DIALOGIC_OKI_ADPCM,
        WAVE_FORMAT_MEDIAVISION_ADPCM, WAVE_FORMAT_CU_CODEC,
        WAVE_FORMAT_YAMAHA_ADPCM, WAVE_FORMAT_SONARC,
        WAVE_FORMAT_DSPGROUP_TRUESPEECH, WAVE_FORMAT_ECHOSC1,
        WAVE_FORMAT_AUDIOFILE_AF36, WAVE_FORMAT_APTX, WAVE_FORMAT_AUDIOFILE_AF10,
        WAVE_FORMAT_PROSODY_1612, WAVE_FORMAT_LRC, WAVE_FORMAT_DOLBY_AC2,
        WAVE_FORMAT_GSM610, WAVE_FORMAT_MSNAUDIO, WAVE_FORMAT_ANTEX_ADPCME,
        WAVE_FORMAT_CONTROL_RES_VQLPC, WAVE_FORMAT_DIGIREAL, WAVE_FORMAT_DIGIADPCM,
        WAVE_FORMAT_CONTROL_RES_CR10, WAVE_FORMAT_NMS_VBXADPCM,
        WAVE_FORMAT_ROLAND_RDAC, WAVE_FORMAT_ECHOSC3, WAVE_FORMAT_ROCKWELL_ADPCM,
        WAVE_FORMAT_ROCKWELL_DIGITALK, WAVE_FORMAT_XEBEC, WAVE_FORMAT_G721_ADPCM,
        WAVE_FORMAT_G728_CELP, WAVE_FORMAT_MSG723, WAVE_FORMAT_MPEG,
        WAVE_FORMAT_RT24, WAVE_FORMAT_PAC, WAVE_FORMAT_MPEGLAYER3,
        WAVE_FORMAT_LUCENT_G723, WAVE_FORMAT_CIRRUS, WAVE_FORMAT_ESPCM,
        WAVE_FORMAT_VOXWARE, WAVE_FORMAT_CANOPUS_ATRAC, WAVE_FORMAT_G726_ADPCM,
        WAVE_FORMAT_G722_ADPCM, WAVE_FORMAT_DSAT, WAVE_FORMAT_DSAT_DISPLAY,
        WAVE_FORMAT_VOXWARE_BYTE_ALIGNED, WAVE_FORMAT_VOXWARE_AC8,
        WAVE_FORMAT_VOXWARE_AC10, WAVE_FORMAT_VOXWARE_AC16,
        WAVE_FORMAT_VOXWARE_AC20, WAVE_FORMAT_VOXWARE_RT24,
        WAVE_FORMAT_VOXWARE_RT29, WAVE_FORMAT_VOXWARE_RT29HW,
        WAVE_FORMAT_VOXWARE_VR12, WAVE_FORMAT_VOXWARE_VR18,
        WAVE_FORMAT_VOXWARE_TQ40, WAVE_FORMAT_SOFTSOUND, WAVE_FORMAT_VOXWARE_TQ60,
        WAVE_FORMAT_MSRT24, WAVE_FORMAT_G729A, WAVE_FORMAT_MVI_MV12,
        WAVE_FORMAT_DF_G726, WAVE_FORMAT_DF_GSM610, WAVE_FORMAT_ISIAUDIO,
        WAVE_FORMAT_ONLIVE, WAVE_FORMAT_SBC24, WAVE_FORMAT_DOLBY_AC3_SPDIF,
        WAVE_FORMAT_ZYXEL_ADPCM, WAVE_FORMAT_PHILIPS_LPCBB, WAVE_FORMAT_PACKED,
        WAVE_FORMAT_RHETOREX_ADPCM, WAVE_FORMAT_IRAT, WAVE_FORMAT_VIVO_G723,
        WAVE_FORMAT_VIVO_SIREN, WAVE_FORMAT_DIGITAL_G723,
        WAVE_FORMAT_CREATIVE_ADPCM, WAVE_FORMAT_CREATIVE_FASTSPEECH8,
        WAVE_FORMAT_CREATIVE_FASTSPEECH10, WAVE_FORMAT_QUARTERDECK,
        WAVE_FORMAT_FM_TOWNS_SND, WAVE_FORMAT_BTV_DIGITAL, WAVE_FORMAT_VME_VMPCM,
        WAVE_FORMAT_OLIGSM, WAVE_FORMAT_OLIADPCM, WAVE_FORMAT_OLICELP,
        WAVE_FORMAT_OLISBC, WAVE_FORMAT_OLIOPR, WAVE_FORMAT_LH_CODEC,
        WAVE_FORMAT_NORRIS, WAVE_FORMAT_ISIAUDIO,
        WAVE_FORMAT_SOUNDSPACE_MUSICOMPRESS, WAVE_FORMAT_DVM, WAVE_FORMAT_RAW_AAC1,
        WAVE_FORMAT_MPEG_HEAAC, WAVE_FORMAT_MPEG_ADTS_AAC, WAVE_FORMAT_DRM,
        WAVE_FORMAT_DTS, WAVE_FORMAT_WMAVOICE9, WAVE_FORMAT_WMASPDIF,
        WAVE_FORMAT_WMAUDIO_LOSSLESS, WAVE_FORMAT_WMAUDIO2, WAVE_FORMAT_WMAUDIO3,
        WAVE_FORMAT_MPEG_LOAS, WAVE_FORMAT_RAW_SPORT, WAVE_FORMAT_ESST_AC3,
        WAVE_FORMAT_DTS2): Define.
        * include/msacm.h (HACMDRIVERID, HACMDRIVER, HACMSTREAM, HACMOBJ,
        ACMSTREAMHEADER, WAVEFILTER, acmDriverAddA, acmDriverAddW, acmDriverRemove,
        acmMetrics, acmStreamOpen, acmStreamSize, acmStreamPrepareHeader,
        acmStreamUnprepareHeader, acmStreamReset, acmStreamClose, acmStreamConvert):
        Define.
2010-08-24 19:09:50 +00:00
Corinna Vinschen 48f6c6c664 * include/cygwin/version.h: Fix comment. 2010-08-24 15:25:46 +00:00
Corinna Vinschen 8ae578d6ae * external.cc (cygwin_internal): In CW_CVT_MNT_OPTS case, initialize
flags with *pflags to restore original behaviour.
2010-08-24 15:11:24 +00:00
Chris Sutcliffe bfb9c22649 2010-08-23 LRN <lrn1986@gmail.com>
* include/winbase.h (SYMBOLIC_LINK_FLAG_DIRECTORY, FILE_NAME_NORMALIZED,
        FILE_NAME_OPENED, VOLUME_NAME_DOS, VOLUME_NAME_GUID, VOLUME_NAME_NONE,
        VOLUME_NAME_NT, FILE_BASIC_INFO, FILE_STANDARD_INFO, FILE_NAME_INFO,
        FILE_STREAM_INFO, FILE_COMPRESSION_INFO, FILE_ATTRIBUTE_TAG_INFO,
        FILE_ID_BOTH_DIR_INFO, FILE_REMOTE_PROTOCOL_INFO, FILE_INFO_BY_HANDLE_CLASS,
        GetFileInformationByHandleEx, GetFinalPathNameByHandleA,
        GetFinalPathNameByHandleW): Define.
2010-08-24 00:15:51 +00:00
Corinna Vinschen 16e1c98c1b * ldd.cc (report): Drop long pathname considerations which result in
invalid path, now that this is done in cygwin_conv_path.
2010-08-23 11:04:04 +00:00
Chris Sutcliffe 59ecc5766c 2010-08-22 Chris Sutcliffe <ir0nh34d@users.sourceforge.net>
* lib/CheckConflicts.sh: New file.
2010-08-22 04:03:33 +00:00
Chris Sutcliffe f6ce088fb3 2010-08-21 Chris Sutcliffe <ir0nh34d@users.sourceforge.net>
* lib/kernel32.def (CopyLZFile, GetExpandedNameA, GetExpandedNameW, LZClose,
        LZCopy, LZInit, LZOpenFileA, LZOpenFileW, LZRead, LZSeek, OpenProcessToken,
        OpenThreadToken, RegCloseKey, RegCreateKeyExA, RegCreateKeyExW,
        RegDeleteKeyExA, RegDeleteKeyExW, RegDeleteValueA, RegDeleteValueW,
        RegEnumKeyExA, RegEnumKeyExW, RegEnumValueA, RegEnumValueW, RegFlushKey,
        RegGetKeySecurity, RegLoadKeyA, RegLoadKeyW, RegNotifyChangeKeyValue,
        RegOpenCurrentUser, RegOpenKeyExA, RegOpenKeyExW, RegOpenUserClassesRoot,
        RegQueryInfoKeyA, RegQueryInfoKeyW, RegQueryValueExA, RegQueryValueExW,
        RegRestoreKeyA, RegRestoreKeyW, RegSetKeySecurity, RegSetValueExA,
        RegSetValueW, RegUnLoadKeyA, RegUnLoadKeyW, RtlCaptureStackBackTrace,
        RtlFillMemory, RtlMoveMemory, RtlZeroMemory, SetThreadToken): Remove
        conflicting definition.
        * lib/th32.def: Remove.
        * lib/ntdll.def (RtlUnwind): Remove conflicting definition.
        * lib/version.def (VerLanguageNameA, VerLanguageNameW): Remove conflicting
        definition.
2010-08-22 03:52:59 +00:00
Chris Sutcliffe 387589c4a4 2010-08-21 Chris Sutcliffe <ir0nh34d@users.sourceforge.net>
* lib/kernel32.def (CreateProcessAsUserW): Remove definition.
2010-08-21 19:21:33 +00:00
Corinna Vinschen 43c394deb6 * Makefile.in (DLL_IMPORTS): Link against advapi32.a before kernel32.a. 2010-08-21 18:57:36 +00:00
Christopher Faylor ff7fca61df * cygthread.cc: Update copyright. 2010-08-20 15:28:28 +00:00
Corinna Vinschen a6fc3a61c2 * path.cc (path_conv::check): Close handle in conv_handle if we're
following a symlink.
2010-08-20 14:29:56 +00:00
Corinna Vinschen 74f50846a9 * endian.h (htobe16, htobe32, htobe64, be16toh, be32toh, be64toh,
htole16, htole32, htole64, le16toh, le32toh, le64toh): Define.
2010-08-20 12:18:47 +00:00
Corinna Vinschen a6c83569dc * fhandler_disk_file.cc (readdir_check_reparse_point): Rename from
is_volume_mountpoint.  Return valid d_type value for underlying
	reparse point type.
	(readdir_get_ino): Don't rely on the handle set in pc.check.  Open
	file here if pc.handle() is NULL.
	(fhandler_disk_file::readdir_helper): Try to set a correct d_type value
	more diligent.
	(fhandler_disk_file::readdir): Don't reset dirent_set_d_ino unless
	we're really sure it's due to an untrusted FS.  Simplify usage of
	FileAttributes, which is 0 if buf is NULL, anyway.  Set d_type
	correctly for faked "." and ".." entries.  Improve debug output.
	* path.cc (symlink_info::check): Don't keep handle to volume mount
	point open.  Explain why.
2010-08-20 11:18:58 +00:00
Corinna Vinschen dd442880af * fhandler_disk_file.cc (fhandler_disk_file::fstatvfs): Revert usage
of get_stat_handle () to get_handle ().  Add comment to explain why.
	* syscalls.cc (statvfs): Drop using PC_KEEP_HANDLE.
2010-08-20 08:52:25 +00:00
Chris Sutcliffe fb20493f3d 2010-08-20 Chris Sutcliffe <ir0nh34d@users.sourceforge.net>
* lib/kernel32.def: Regenerate using gendef on a Win7 machine.
2010-08-20 04:14:18 +00:00
Corinna Vinschen e8c4b3427c * include/winnt.h: Define FILE_ATTRIBUTE_VIRTUAL. Change
FILE_ATTRIBUTE_VALID_FLAGS accordingly.
	* include/ddk/winddk.h: Ditto.
2010-08-19 16:08:56 +00:00
Corinna Vinschen f43eed1c08 * new-features.sgml (ov-new1.7.7): New section.
* pathnames.sgml: Throughout, align style of screen elements.
	Throughout, make all emphasis elements bold.
	(pathnames-win32-api): Rewrite section.
2010-08-19 10:35:25 +00:00
Corinna Vinschen e652eb9230 * external.cc (sync_wincwd): New function.
(cygwin_internal): Rename CW_SETCWD to CW_SYNC_WINCWD.  Call
	sync_wincwd from here.
	* include/sys/cygwin.h (cygwin_getinfo_types): Rename CW_SETCWD to
	CW_SYNC_WINCWD.
2010-08-19 10:14:31 +00:00
Chris Sutcliffe 1087b2462f 2010-08-18 Ladislav Michl <ladis@users.sourceforge.net>
* include/winbase.h (SYMBOLIC_LINK_FLAG_DIRECTORY, CreateSymbolicLinkW,
        CreateSymbolicLinkA, CreateSymbolicLink): Define
2010-08-18 23:34:08 +00:00
Christopher Faylor 590ad4793f * external.cc (CW_SETCWD): New option.
* include/cygwin/version.h: Bump api minor to 231.
* include/sys/cygwin.h (CW_SETCWD): Define.
2010-08-18 19:15:37 +00:00
Corinna Vinschen 6a84234cd2 * pathnames.sgml (pathnames-win32-api): Try to use a more clear wording. 2010-08-18 15:28:15 +00:00
Corinna Vinschen ce9898da68 * syscalls.cc (rename): Fix renaming file-based devices. 2010-08-18 15:21:35 +00:00
Corinna Vinschen 75a3b85877 * exceptions.cc (open_stackdumpfile): Don't try to open file if we
have no filesystem based CWD.  Add comment.
	* path.cc (cwdstuff::set): Set CWD handle to NULL if CWD is a virtual
	path.  Simplify matching comment.
2010-08-18 14:22:07 +00:00
Corinna Vinschen d15ed91c04 * fhandler_disk_file.cc (fhandler_base::fstat_helper): Set st_rdev
to correct device number for fs_special devices.
2010-08-18 10:10:14 +00:00
Keith Marshall 0f0a0b7361 Make PATH_MAX consistent with MAX_PATH 2010-08-17 21:18:21 +00:00
Corinna Vinschen adb4e0f3de * include/cygwin/version.h: Bump DLL minor version number to 6. 2010-08-16 13:41:19 +00:00
Corinna Vinschen f5a51f9187 * pipe.cc (fhandler_pipe::open): Duplicate content of opened pipe
fhandler before calling dup method.
2010-08-14 11:16:09 +00:00
Corinna Vinschen 5578c33733 * mount.cc (from_fstab): Fix potentially fatal typo. 2010-08-13 19:10:22 +00:00
Corinna Vinschen a016fed8ba * faq-programming.xml (faq.programming.win32-api): Remove simplicity.
Add note and xrefs to User's Guide chapters explaining restrictions
	using the Win32 API.
	* new-features.sgml (ov-new1.7.6): Add note about Win CWD.
	* overview2.sgml (ov-hi-intro): Add note and xrefs about Win32 API
	restrictions.  Tone down flexibility.
	* pathnames.sgml (pathnames-intro): Add xref to pathnames-win32-api
	section.
	(pathnames-win32-api): New section describing Win32 CWD restriction.
	* setup2.sgml (setup-env-ov): New sub-section.
	(setup-env-win32): Ditto, describing Win32 environment restriction.
2010-08-13 11:52:13 +00:00
Corinna Vinschen 260b80740e * cygheap.h (class cwdstuff): Make drive_length private.
Add "error" member.
	(cwdstuff::get_error): New inline method.
	(cwdstuff::get_error_desc): Declare.
	(cwdstuff::set): Change first parameter to pointer to path_conv.
	* path.cc (chdir): Drop doit.  Align call to cwdstuff::set to
	new arguments.
	(cwdstuff::init): Only call cwdstuff::set if it's not already
	initialized.  Add comment.  Drop third parameter in call to
	cwdstuff::set.
	(cwdstuff::set): Partially rewrite.  Add lots of comments to explain
	everything.  Drop "doit" since it's not used anymore.  Always create
	new handle to CWD if not in a virtual path.  Drop PEB locking when
	reading PEB values in init phase.  Check for accessibility to set
	correct error code.  Drop Vista workaround.  Never write back into PEB.
	Set Win32 CWD to \\?\PIPE\ on init.  Simplify creation of win32 path.
	Set new error member to a meaningful value.
	(cwdstuff::get_error_desc): New method to generate error message
	from cwd error code.
	* spawn.cc (spawn_guts): Call cwdstuff::get_error_desc to create
	more meaningful error message when not being able to start native
	Win32 app due to CWD restrictions.  When starting native Win32 app,
	lock cwd and use in calls to CreateProcessW/CreateProcessAsUserW.
2010-08-13 11:51:54 +00:00
Corinna Vinschen 841003a9b3 * new-features.sgml (ov-new1.7.6): Document "bind" option.
* pathnames.sgml (mount-table): Add "bind" option with example.
2010-08-11 11:12:10 +00:00
Corinna Vinschen 68a178b37c * mount.cc (do_mount): Don't treat "bind" mount as remote mount.
(mount_entries): Drop the "bind" option from output.
	* utils.sgml (mount): Match examples to actual mount output.  Add
	"bind" option and add example.
2010-08-11 11:01:14 +00:00
Corinna Vinschen a5fe426282 * mount.cc (struct opt): Add "bind" option.
(mount_info::from_fstab_line): Handle "bind" option.
	(fillout_mntent): Add "bind" option to mnt_opts.
	(mount): Handle "bind" option.
	* include/sys/mount.h (MOUNT_BIND): New mount flag.
2010-08-11 10:58:06 +00:00
Yaakov Selkowitz ac8050277c * mingw: Use sysroot, if present, for mingw_dir. 2010-08-11 03:01:55 +00:00
Christopher Faylor 92514fd261 * sigproc.cc (init_sig_pipe): Add retry loop. 2010-08-10 16:44:37 +00:00
Christopher Faylor 514fdad34d * cygheap.h (cygheap_fdmanip): Delete fh and use fd index into cygheap->fdtab
throughout.
(cygheap_fdnew): Replace fh by using fd index into cygheap->fdtab throughout.
(cygheap_fdget): Ditto.  (cygheap_fdenum): Ditto.
2010-08-09 16:53:35 +00:00
Yaakov Selkowitz 6d27f82985 * new-features.sgml (ov-new1.7.6): Document POSIX Monotonic Clock. 2010-08-09 16:49:28 +00:00
Yaakov Selkowitz b150f5236b Implement POSIX.1-2004 Monotonic Clock.
* hires.h: Change hires_us to hires_ns, with nanosecond resolution.
(hires_ns::primed_ft): Remove.
(hires_ns::nsecs): New prototype.
(hires_ns::usecs): Rewrite in terms of nsecs.
(hires_ns::resolution): New prototype.
* times.cc: Change hires_us to hires_ns.
(ntod): Declare.
(systime): Remove.
(hires_ns::prime): Increase resolution to nanoseconds.
(hires_ns::nsecs): Rename usecs to nsecs to reflect increased resolution.
Remove justdelta argument.
(hires_ns::resolution): New function.
(clock_gettime): Accept CLOCK_MONOTONIC.
Use EINVAL instead of ENOSYS per POSIX.1-2004.
(clock_getres): Ditto.
(clock_setres): Use EINVAL instead of ENOSYS to conform with other
implementations.
* strace.cc (strace::microseconds): Adjust for hires_ns.
* sysconf.cc (sca): Set _SC_MONOTONIC_CLOCK to _POSIX_MONOTONIC_CLOCK.
* include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump.
2010-08-09 16:47:48 +00:00
Corinna Vinschen 95fe28c61e * new-features.sgml (ov-new1.7.6): Document /proc/filesystems. 2010-08-09 08:20:51 +00:00
Corinna Vinschen a52993d426 * fhandler_proc.cc: Add /proc/filesystems virtual file.
(format_proc_filesystems): New function.
	* mount.cc (fs_names): Move to global scope. Redefine as array
	of { "name", block_device? } structs.
	(fillout_mntent): Use name member of fs_names.
	* mount.h (fs_names): New prototype.
2010-08-09 08:18:30 +00:00
Corinna Vinschen 99006a85e2 * include/dlfcn.h (RTLD_LOCAL): Define. 2010-08-09 07:48:24 +00:00
Corinna Vinschen 5c9d7a42fc * include/sys/dirent.h (d_fileno): Define as d_ino. 2010-08-06 18:55:25 +00:00
Corinna Vinschen 06cc41a63a * path.cc (cygwin_conv_path): Rearrange test for "." in POSIX to
relative DOS path conversion.  Simplify fixing the path.
	In CCP_POSIX_TO_WIN_W conversion, always drop long path prefix if path
	fits into MAX_PATH.  Explain why.
2010-08-04 11:25:13 +00:00
Christopher Faylor 0b6fbd396c * exceptions.cc (_cygtls::interrupt_now): Revert to checking for "spinning"
when choosing to defer signal.
(_cygtls::call_signal_handler): Grab func when we have the lock.
* gendef: Update copyright.
(__sigbe): Simplify slightly.
(_sigdelayed): Grab a lock before manipulating stuff.
(_cygtls::pop): Properly return popped value.
(stabilize_sig_stack): Set incyg when we have the lock.
* sigproc.cc: Update copyright.
2010-08-01 19:10:52 +00:00
Christopher Faylor 4db1bd4040 * cygthread.h (LPVOID_THREAD_START_ROUTINE): Define.
(cygthread::create): Rename from cygthread::cygthread.
(cygthread::cygthread): Define new constructor which accepts
LPVOID_THREAD_START_ROUTINE as the first argument.  Call cygthread::create.
* cygthread.cc (cygthread::create): Rename from cygthread::cygthread.  Use
'arglen' rather than 'n' since 'n' is no longer supplied.
* fhandler_tty.cc (process_input): Define as void/noreturn.
(process_output): Ditto.
(process_ioctl): Ditto.
(fhandler_tty_master::init): Don't "zap_h" cygthreads which are noreturn.  It's
now implied.
2010-07-30 18:04:22 +00:00
Andy Koppe aab56a41cf * setup-net.sgml, faq-setup.xml: Rename setup.exe's "Partial"
view to "Pending"
2010-07-26 22:56:24 +00:00
Keith Marshall 9411deb401 Accept that mingwrt headers are not guaranteed to precede GCC's in the system include search path; (issue reported by Mark Brand). 2010-07-25 20:20:46 +00:00
Chris Sutcliffe e3bef3f7d5 2010-07-22 Chris Sutcliffe <ir0nh34d@users.sourceforge.net>
* lib/kernel32.def(FatalExit): Correct definiton.
2010-07-24 03:01:20 +00:00
Corinna Vinschen cb6bfcff1a * fhandler.cc (fhandler_base::raw_write): Remove STATUS_DISK_FULL
special handling.
2010-07-23 10:08:34 +00:00
Chris Sutcliffe 125c76f59e 2010-07-22 Ozkan Sezer <sezero@users.sourceforge.net>
* include/io.h (_findfirst, _findnext, _findclose, _findfirst32,
        _findnext32, _findfirsti64, _findnexti64, _findfirst32i64, _findfirst64i32,
        _findnext32i64, _findnext64i32, _findnext64, _findfirst, _findnext,
        _findfirsti64, _findnexti64, _findfirst, _findnext, _findfirsti64,
        _findnexti64): Correct definition.
2010-07-23 02:16:28 +00:00
Chris Sutcliffe a1c44c468c 2010-07-22 Chris Sutcliffe <ir0nh34d@users.sourceforge.net>
* include/basetyps.h (REFGUID, REFIID, REFCLSID, REFFMTID): Revert change
        from 2010-07-17 since it breaks several applications.
2010-07-22 10:47:30 +00:00
Chris Sutcliffe a3ee6a48f3 2010-07-21 Chris Sutcliffe <ir0nh34d@users.sourceforge.net>
* lib/kernel32.def: Regenerate using gendef.
2010-07-22 03:10:28 +00:00
Corinna Vinschen 822b654fe0 * dump_setup.cc (tfx_chars): New WCHAR array, copied from Cygwin.
(transform_chars): New function, copied from Cygwin.
	(simple_nt_stat): New function to check file existance using native
	NT function.  Explain why.
	(directory_exists): Call simple_nt_stat.
	(file_exists): Ditto.
2010-07-21 10:30:53 +00:00
Chris Sutcliffe cfdaf5654c 2010-07-20 Ozkan Sezer <sezero@users.sourceforge.net>
* include/commctrl.h (LVIF_GROUPID): Fix definition.

2010-07-20  Michael James  <james.me@gmail.com>

        * include/commctrl.h (LVIF_COLUMNS): Fix definition.
2010-07-20 18:17:52 +00:00
Chris Sutcliffe 2af268382a 2010-07-17 Chris Sutcliffe <ir0nh34d@users.sourceforge.net>
* include/winnt.h (HEAP_MAKE_TAG_FLAGS, VALID_INHERIT_FLAGS): Correct
        definition.
        * include/rpcndr.h (NdrUnMarshConfStringHdr, NdrUnMarshCCtxtHdl,
        NdrMarshSCtxtHdl): Ditto.
        * include/basetyps.h (REFGUID, REFIID, REFCLSID, REFFMTID): Remove macro
        definition in favour of typedef definition.

        Thank you to Yuta Tomino for reporting the issues.
2010-07-20 00:18:31 +00:00
Eric Blake 2693eddb32 Document mkostemp and mkostemps.
* textbinary.sgml (textbin-devel): Document temp file behavior.
(textbin-issue): Use sed rather than cat as an example of a
default-mode application.
* new-features.sgml (ov-new1.7.6): Document mkostemp[s].
2010-07-19 18:25:41 +00:00
Eric Blake 3083fa9447 Add mkostemp and mkostemps.
* mktemp.cc (_gettemp): Add flags argument.  All callers updated.
(mkostemp, mkostemps): New functions.
* cygwin.din (mkostemp, mkostemps): Export.
* posix.sgml: Document them.
* include/cygwin/version.h: Bump version.
2010-07-19 18:22:40 +00:00
Christopher Faylor bee6d43176 * autoload.cc (noload): Use "pushl" rather than "push". 2010-07-18 20:14:51 +00:00
Christopher Faylor 9134e80ac6 * exceptions.cc (_cygtls::interrupt_now): Avoid nonsensical tests which delay
an interrupt.
(setup_handler): Remove unneeded DEBUGGING handling.  Ensure that stack is
locked when we are about to do push/pop to it.  Fix debugging output.
2010-07-18 20:13:26 +00:00
Christopher Faylor 3a7c5515b2 * gendef: Throughout, remove lock from xchgl since it is implied.
(__ZN7_cygtls3popEv): Avoid potential (but probably nonexistent) race when
clearing element after pop.
2010-07-18 20:10:22 +00:00
Corinna Vinschen ac40a19527 * wincap.cc (wincap_7): Set needs_count_in_si_lpres2 to false. 2010-07-15 08:00:52 +00:00
Chris Sutcliffe cc077128d3 2010-07-08 Markus Koenig <basilo@users.sourceforge.net>
* include/gdiplus.h: New file.
        * include/gdiplus/gdiplus.h: New file.
        * include/gdiplus/gdiplusbase.h: New file.
        * include/gdiplus/gdiplusbrush.h: New file.
        * include/gdiplus/gdipluscolor.h: New file.
        * include/gdiplus/gdipluscolormatrix.h: New file.
        * include/gdiplus/gdipluseffects.h: New file.
        * include/gdiplus/gdiplusenums.h: New file.
        * include/gdiplus/gdiplusflat.h: New file.
        * include/gdiplus/gdiplusgpstubs.h: New file.
        * include/gdiplus/gdiplusgraphics.h: New file.
        * include/gdiplus/gdiplusheaders.h: New file.
        * include/gdiplus/gdiplusimageattributes.h: New file.
        * include/gdiplus/gdiplusimagecodec.h: New file.
        * include/gdiplus/gdiplusimaging.h: New file.
        * include/gdiplus/gdiplusimpl.h: New file.
        * include/gdiplus/gdiplusinit.h: New file.
        * include/gdiplus/gdipluslinecaps.h: New file.
        * include/gdiplus/gdiplusmatrix.h: New file.
        * include/gdiplus/gdiplusmem.h: New file.
        * include/gdiplus/gdiplusmetafile.h: New file.
        * include/gdiplus/gdiplusmetaheader.h: New file.
        * include/gdiplus/gdipluspath.h: New file.
        * include/gdiplus/gdipluspen.h: New file.
        * include/gdiplus/gdipluspixelformats.h: New file.
        * include/gdiplus/gdiplusstringformat.h: New file.
        * include/gdiplus/gdiplustypes.h: New file.
        * lib/gdiplus.c: New file containing GDI+ variable definitions
        and GUIDs.
        * lib/gdiplus.def: New file.
        * lib/Makefile.in: Add gdiplus.o to EXTRA_OBJS,
        add gdiplus.c to SOURCES.
        * lib/test.c: Include gdiplus.h.
2010-07-08 23:14:54 +00:00
Corinna Vinschen 975a85f42c * syscalls.cc (unlink_nt): Disable try_to_bin for netapp drives.
Explain why.
2010-07-07 07:53:22 +00:00
Corinna Vinschen c492992f13 Align seekdir and telldir API to POSIX definition.
* Makefile.in (NEW_FUNCTIONS): Remove seekdir and telldir mappings.
	* dir.cc (telldir): Move functionality from telldir64 here.  Use
	long, rather than _off_t.
	(telldir64): Just call telldir.  Only keep for backward compatibility.
	(seekdir): Move functionality from seekdir64 here.  Use long, rather
	than _off_t.
	(seekdir64): Just call seekdir.  Only keep for backward compatibility.
	* fhandler.h: Throughout, change prototypes of seekdir and telldir
	methods to use long, rather than _off64_t.
	* fhandler_disk_file.cc: Change aforementioned methods accordingly.
	* fhandler_netdrive.cc: Ditto.
	* fhandler_registry.cc: Ditto.
	* fhandler_virtual.cc: Ditto.
	* include/sys/dirent.h (struct __DIR): Change __d_position from
	_off_t to long to reflect API change.
	(telldir): Change prototype to use long, rather than off_t.
	(seekdir): Ditto.
2010-07-05 16:59:56 +00:00
Christopher Faylor c8fe6dc446 * ldd.cc: Clean up formatting throughout.
(head): Move earlier.
(saw_file): Ditto.
(print_dlls): Reset head here.  Record seen dll names so they will not
potentially be printed later.
(process_file): Remove clearing of head here.
2010-07-05 16:24:24 +00:00
Corinna Vinschen 96f1582977 * dump_setup.cc (dump_file): Read requested content from setup.rc
file created by newer setup.exe.
2010-07-05 12:28:48 +00:00
Christopher Faylor 6259826eb4 * path.cc (path_conv::check): Move fs-specific settings to a point where we
know that we have filled out the filesystem information.
* path.h (path_conv::path_conv): Use consistent initialization for
constructors.
* include/sys/cygwin.h: Define CW_STRERROR.
* include/cygwin/version.h: Bump CYGWIN_VERSION_API_MINOR to 228.
* include/external.h: Implement CW_STRERROR.
2010-07-04 17:12:27 +00:00
Corinna Vinschen 7ba0a42f55 * net.cc (cygwin_getsockopt): Make sure SO_PEERCRED is only handled
in level SOL_SOCKET.  Workaround a return value regression in Vista
	and later.  Add comment to explain.
2010-07-02 14:36:43 +00:00
Chris Sutcliffe 5eb491d26e 2010-06-28 Rick Rankin <rrankin1424-mingw@yahoo.com>
* include/psapi.h (PROCESS_MEMORY_COUNTERS_EX, PERFORMANCE_INFORMATION,
        GetPerformanceInfo): Define.
        * lib/psapi.def (GetPerformanceInfo): Define.
        * include/wincrypt.h (CryptEnumProvidersA, CryptEnumProvidersW,
        CryptEnumProviders): Define.
2010-06-29 23:17:40 +00:00
Corinna Vinschen 01798d4e59 * utils.sgml (locale): Change stray local cygdrive prefix to Cygwin's
default.
2010-06-29 15:12:52 +00:00
Corinna Vinschen 601fbebdf5 * spawn.cc (spawn_guts): Reinstantiate a FIXME comment. 2010-06-29 10:37:23 +00:00
Corinna Vinschen e7daa3ed75 * exceptions.cc (dump_exception): Use %W instead of %s for printing
progname.
	* fork.cc (frok::parent): Fix typos in debug output.
	* spawn.cc (spawn_guts): Copy wide Win32 filename into _pinfo::progname,
	rather than native NT name.
2010-06-29 10:28:40 +00:00
Christopher Faylor 22d78f100f * fork.cc (frok::parent): Improve error message. 2010-06-28 18:32:12 +00:00
Yaakov Selkowitz 2a904ebacb * Makefile.in: Use "xmlto pdf" instead of docbook2pdf.
Force the dblatex backend, as the default passivetex does not work.
* README: Replace docbook-utils dependency with dblatex.
Update required docbook-xml version.
* faq-programming.xml: Ditto.
2010-06-27 21:32:19 +00:00
Christopher Faylor 8930e4d2c3 * setup-net.sgml: Add a paragraph describing now to avoid unintentional
upgrades.
2010-06-26 16:08:46 +00:00
Corinna Vinschen 30bbc55ee2 * flock.cc (allow_others_to_sync): Use small stack buffer rather
than big temp buffer.  Fix typo in comment.
	(lf_setlock): Revert to using tmp_pathbuf.
	(lf_getlock): Ditto.
2010-06-22 14:53:05 +00:00
Corinna Vinschen c7b24005e6 * sec_acl.cc (setacl): Use the long time unused ACL_DEFAULT_SIZE
instead of a constant value.
	* security.cc (alloc_sd): Ditto.
2010-06-22 09:54:36 +00:00
Christopher Faylor f074bd3aef * tmpbuf.h: New file.
* flock.cc: Include tmpbuf.h for new tmpbuf functionality.
(allow_others_to_sync): Use tmpbuf rather than tmp_pathbuf.  Explain why.
(lf_setlock): For consistency, use tmpbuf rather than tmp_pathbuf.
(lf_getlock): Ditto.
2010-06-21 19:55:12 +00:00
Christopher Faylor 74434376cf * dcrt0.cc (__api_fatal): Temporarily generate a stackdump. 2010-06-21 17:09:33 +00:00
Christopher Faylor 7b8cf7c89a * tls_pbuf.cc (tmp_pathbuf::w_get): Report what's failing when too many buffers
are in use.
2010-06-21 05:30:42 +00:00
Corinna Vinschen 4365c1598b * fhandler_disk_file.cc (fhandler_base::fstat_by_handle): Fetch stat
handle only after checking for NFS.
2010-06-17 10:25:15 +00:00
Corinna Vinschen 342814df29 * fhandler_disk_file.cc (fhandler_base::fstat_by_nfs_ea): Use handle
returned by get_stat_handle.
	(fhandler_base::fstat_helper): Reinstatiate code to re-open the file
	when checking for executability if called via fstat.  Explain why.
2010-06-15 15:10:42 +00:00
Corinna Vinschen 5a0d1edba4 * dtable.cc (dtable::dup_worker): Reset path_conv handle in duplicated
fhandler.
	* fhandler.cc (fhandler_base::fstatvfs): Keep handle in created
	path_conv.
	* fhandler.h (fhandler_base::get_stat_access): New method.
	(fhandler_base::get_stat_handle): New method.
	* fhandler_disk_file.cc (fhandler_base::fstat_by_handle): Use handle
	returned by get_stat_handle.  Only request inode from system if it
	isn't already set in the fhandler, and only for filesystems supporting
	them.
	(fhandler_base::fstat_fs): Use handle returned by get_stat_handle.
	Change the way open_fs is called.  Explain why.
	(fhandler_base::fstat_helper): Use handle returned by get_stat_handle.
	Never use 0 inode number.  Simplify executable recognition by re-using
	get_stat_handle if file could be opened with sufficient rights.
	(fhandler_disk_file::fstatvfs): Use handle returned by get_stat_handle.
	(fhandler_disk_file::facl): Use handle returned by get_stat_handle in
	GETACL and GETACLCNT cases.
	(fhandler_disk_file::link): Use handle returned by get_stat_handle
	instead of opening file here again.  Add comment.
	(readdir_get_ino): Keep handle in created path_conv and drop
	opening file.
	* ntdll.h (wait_pending): New helper function.
	* path.cc (symlink_info::check): Drop unused 'opt' parameter from
	declaration.  Add path_conv_handle argument.
	(path_conv::check): Make sure conv_handle is closed.  Keep
	PC_KEEP_HANDLE flag in pflags_or.  Accommodate call to sym.check to
	new args.
	(path_conv::~path_conv): Close conv_handle.
	(symlink_info::check_shortcut): Don't re-open file here, just use
	incoming handle.  Drop goto's and label out.
	(symlink_info::check_sysfile): Don't re-open file here, just use
	incoming handle.  Keep track of file position to accommodate the fact
	that file has been opened asynchronously in calling function.
	(symlink_info::check_nfs_symlink): Don't re-open file here, just use
	incoming handle.
	(symlink_info::check): Drop unused 'opt' parameter.  Add
	path_conv_handle argument.  Always try to open file with GENERIC_READ
	rights first to allow reading file content w/o having to re-open the
	file.  Drop back to READ_CONTROL | FILE_READ_ATTRIBUTES otherwise.
	Call symlink test functions (except for check_reparse_point) only if
	file could be opened with GENERIC_READ.  Keep file handle open if
	PC_KEEP_HANDLE is set in pflags.
	* path.h (enum pathconv_arg): Add PC_KEEP_HANDLE flag.
	(class path_conv_handle): New class.
	(class path_conv): Add conv_handle member.
	(path_conv::operator =): Duplicate conv_handle.
	(path_conv::handle): New method.
	(path_conv::access): New method.
	(path_conv::reset_conv_handle): New method.
	(path_conv::close_conv_handle): New method.
2010-06-15 12:05:15 +00:00
Corinna Vinschen 51ec3f5c98 * fhandler_disk_file.cc (fhandler_disk_file::fstatvfs): Fix indentation. 2010-06-15 09:58:56 +00:00
Corinna Vinschen 5e3dd23eee * fhandler_disk_file.cc (path_conv::get_ino_by_handle): Convert from
static function to path_conv method.  Accommodate throughout.
	(path_conv::ndisk_links): Unused, comment out.
	* path.h (path_conv::get_ino_by_handle): Declare.
	(path_conv::ndisk_links): Comment out declaration.
2010-06-15 08:51:55 +00:00
Corinna Vinschen d955b6cfd8 * path.cc (path_conv::check): Return with ENOTDIR if component is a
device.
2010-06-14 21:16:41 +00:00
Corinna Vinschen aec297d5d9 * dlfcn.cc (get_full_path_of_dll): Revert patch from 2010-04-29. 2010-06-14 11:10:30 +00:00
Christopher Faylor 75172e03ac * times.cc (gtod): Move to sharable region. 2010-06-12 16:34:26 +00:00
Corinna Vinschen 03c991fed4 * path.cc (symlink_info::check_shortcut): Use ro_u_empty rather than
local UNICODE_STRING object.
	(symlink_info::check_sysfile): Ditto.  Return immediately if NtOpenFile
	failed to avoid closing random handle.  Improve debug output in case
	NtReadFile failed.
2010-06-09 12:32:14 +00:00
Corinna Vinschen b7d3e6d7d2 * path.cc (symlink_info::check): Set h to NULL after closing handle
in udf check.  Remove overagressive bracketing.  Don't set h to NULL
	without closing the handle.  Fix using wrong handle in checking
	file system when using parent directory handle.
2010-06-08 15:25:09 +00:00
Corinna Vinschen 814e854e2c * include/sys/stdio.h: Remove _GNU_SOURCE guard around getline
and getdelim prototypes since they are SUSv4 now.
2010-06-07 09:16:11 +00:00
Corinna Vinschen fad9568b0a * ntdll.h (STATUS_BAD_NETWORK_PATH): Define.
(STATUS_BAD_NETWORK_NAME): Define.
	* path.cc (symlink_info::check): Convert STATUS_BAD_NETWORK_PATH and
	STATUS_BAD_NETWORK_NAME into an immediate ENOENT.
2010-06-02 14:52:34 +00:00
Corinna Vinschen ded1f66c2d * exceptions.cc (open_stackdumpfile): Correctly append .stackdump
suffix.

	* nlsfuncs.cc (rebase_locale_buf): Reorder arguments.  Accommodate
	throughout.  Add pointer to end of buffer and avoid changing pointers
	not pointing into the buffer.
2010-06-01 14:51:47 +00:00
Corinna Vinschen 80a10a3972 * fhandler_netdrive.cc (fhandler_netdrive::exists): Always free WNet
resource if created.
2010-06-01 13:14:37 +00:00
Corinna Vinschen 685e55e254 * cygheap.cc (cygheap_user::set_name): Allow to change the user name
if it only differs by case.
2010-05-31 18:52:02 +00:00
Corinna Vinschen 88addc6476 * fhandler_registry.cc (multi_wcstombs): New function.
(fhandler_registry::fstat): Call multi_wcstombs for strings of type
	REG_MULTI_SZ.
	(fhandler_registry::fill_filebuf): Ditto.
2010-05-26 16:58:44 +00:00
Christopher Faylor fca8f35f11 * hires.h (hires_base::reset): New function.
(hires_us): Specify that hires_base is a public import.
(hires_ms): Ditto.
* times.cc (gtod): Move earlier in file.
(settimeofday): Reset gtod so that base will be subsequently recalculated.
2010-05-26 14:48:17 +00:00
Corinna Vinschen 1ee8d76ca0 * path.cc (symlink_info::check): Don't try to handle remote reparse
points as symlinks.  Explain why.
2010-05-26 14:24:47 +00:00
Corinna Vinschen 16f52c1461 * include/inttypes.h: Change PTR definitions to int to align with the
stdint.h type definitions of intptr_t/uintptr_t.
2010-05-26 13:37:48 +00:00
Corinna Vinschen 403ab0c013 * fhandler.h (class fhandler_pty_master): Add master_thread member.
* fhandler_tty.cc (fhandler_pty_master::close): Properly detach from
	master thread.
	(fhandler_pty_master::setup): Store cygthread pointer of pty master
	control thread in master_thread.  Don't zap thread handle.
2010-05-26 13:10:55 +00:00
Corinna Vinschen a36728eae0 * nlsfuncs.cc (__set_lc_time_from_win): Use LOCALE_SMONTHNAME1
instead of LOCALE_SABBREVMONTHNAME1 in Japanese and Korean
	locales to get abbreviated month names.  Explain why.
2010-05-26 11:36:17 +00:00
Chris Sutcliffe 5f7eee9ec9 2010-04-27 Danny Smith <dannysmith@users.sourceforge.net>
* mingwex/mb_wc_common.h (get_codepage): Revert change of 2006-09-19.
2010-05-19 02:59:46 +00:00
Christopher Faylor d3258e063c * environ.cc (regopt): Change the first argument to wide char string.
(environ_init): Accommodate change to the first argument of regopt.
* exception.cc (open_stackdumpfile): Accommodate change to the type of progname
in _pinfo.
* external.cc (fillout_pinfo): Ditto.
* fhandler_process.cc (format_process_winexename): Ditto.
(format_process_stat): Ditto.
* fork.cc (fork::parent): Ditto.
* pinfo.cc (pinfo_basic::pinfo_basic): Call GetModuleFileNameW instead of
GetModuleFileName.
(pinfo::thisproc): Accommodate change to the type of progname in _pinfo.
(pinfo_init): Ditto.
* pinfo.h (_pinfo): Change the type of progname to a wide char array.
* registry.h (reg_key::get_int): Change the first argument from constant point
to pointer to constant.
(reg_key::get_string): Ditto.  Change the last argument likewise.
* registry.cc (reg_key::get_int): Accommodate change to the declaration.
(reg_key::get_string): Ditto.
* strace.cc (strace::hello): Accommodate change to the type of progname in
_pinfo.
(strace::vsprntf): Ditto.
2010-05-18 14:30:51 +00:00
Christopher Faylor 27f564e9a3 * Makefile.in (DLL_OFILES): Add pseudo-reloc.o.
* dcrt0.cc (child_info_fork::handle_fork): Call _pei386_runtime_relocator here.
(dll_crt0_1): Ditto for non-fork case.
* dll_init.cc (dll::init): Complain more in comment.  Clean up slightly.
(dll_dllcrt0_1): Call _pei386_runtime_relocator when we know we have a
filled-in per_process structure.
* globals.cc (__cygwin_user_data): Accommodate new fields for
_pei386_runtime_relocator.
* pseudo-reloc.cc: New file adapted from old lib/pseudo-reloc.c.  Include
winsup.h directly.  Collapse #ifdef __CYGWIN__ into one block.  Perform minor
whitespace code reformatting.
(__report_error): Use small_printf to output error.
(_pei386_runtime_relocator): Conditionalize for cygwin to take per_process
pointer parameter.
* winsup.h (_pei386_runtime_relocator): Declare.
* include/cygwin/version.h
(CYGWIN_VERSION_PER_PROCESS_API_VERSION_COMBINED): New macro.
(CYGWIN_VERSION_USER_API_VERSION_COMBINED): Use above macro.
(CYGWIN_VERSION_USE_PSEUDO_RELOC_IN_DLL): New macro.
(CYGWIN_VERSION_API_MINOR): Bump to 227.
* include/sys/cygwin.h: Remove obsolete comment.
(per_process::unused2): Shorten.
(per_process::pseudo_reloc_start): New field.
(per_process::pseudo_reloc_end): Ditto.
(per_process::image_base): Ditto.
* lib/_cygwin_crt0_common.cc: Declare pseudo runtime externs needed for
per_process structure.
(_cygwin_crt0_common): Fill in pseudo_reloc runtime constants.
* lib/pseudo-reloc-dummy.c: New file.  Dummy function to satisify ld.
* lib/pseudo-reloc.c: Delete.
2010-05-07 21:25:19 +00:00
Corinna Vinschen 186bcf2a17 * fhandler_tty.cc (fhandler_tty_slave::init): Disable grabbing
process group ownership of tty in case we're being debugged.
2010-05-07 15:03:27 +00:00
Corinna Vinschen 35c0485d2d * path.cc (path_conv::check): Drop setting sym.pflags before calling
mount_info::conv_to_win32_path since the flag value is overwritten by
	mount_info::conv_to_win32_path anyway.
	Set flags for DOS paths before calling symlink_info::check so they can
	be used in that function already.
2010-05-06 10:04:50 +00:00
Christopher Faylor 73bcd49b1f * dll_init.cc (dll_list::alloc): Add debugging assertion. 2010-05-03 16:40:33 +00:00
Corinna Vinschen 2b749986ad * dlfcn.cc (get_full_path_of_dll): Handle non-existent file. 2010-04-29 13:03:30 +00:00
Corinna Vinschen ef3df0bb7d * new-features.sgml (ov-new1.7.6): Add new "dos" and "inode" mount
options.
	* pathnames.sgml (mount-table): Ditto.
	(pathnames-specialchars): Change description order.  Add paragraph
	to explain new behaviour in terms of leading spaces and trailing dots
	and spaces in pathnames.
2010-04-29 10:58:17 +00:00
Corinna Vinschen 3db442e639 * utils.sgml (mount): Add description for "dos" and "ihash" mount
options.
2010-04-29 10:53:31 +00:00
Corinna Vinschen a361b4715f * path.cc: Include sys/cygwin.h if built for mount(1).
(struct opt): Add "dos" and "ihash" options.
	(from_fstab_line): Call cygwin_internal rather than read_flags if
	built for mount(1).
2010-04-29 10:39:35 +00:00
Corinna Vinschen 5b4c992bf6 * mount.cc (struct opt): Add "dos" and "ihash" options.
(fillout_mntent): Ditto.
	* path.cc (path_conv::get_nt_native_path): Use path_conv's
	has_dos_filenames_only method.
	(path_conv::check): Add PATH_IHASH flag if FS has unreliable inode
	numbers.
	(symlink_info::check_shortcut): Or symlink flags to pflags.
	(symlink_info::check_sysfile): Ditto.  Change test accordingly.
	(symlink_info::check_reparse_point): Ditto.
	(symlink_info::check_nfs_symlink): Ditto.
	(symlink_info::check): Check PATH_DOS flag in call to get_nt_native_path
	to utilize mount flag.  Ditto in test for potential restarting.  Set
	PATH_DOS if FS only allows DOS filename rules.
	* path.h (enum path_types): Add PATH_DOS and PATH_IHASH.
	(path_conv::hasgood_inode): Check PATH_IHASH instead of
	fs.hasgood_inode.
	(path_conv::has_dos_filenames_only): New method.
	* include/sys/mount.h (MOUNT_DOS): New mount flag.
	(MOUNT_IHASH): Ditto.
2010-04-29 10:38:05 +00:00
Corinna Vinschen a82a8dcb4e * mount.cc (oopts): Remove entirely.
(usage): Call cygwin_internal (CW_LST_MNT_OPTS) to create list of
	mount options.
	(print_version): Fix copyright date.
	(main): Replace option processing loop with single call to
	cygwin_internal (CW_CVT_MNT_OPTS).
2010-04-29 08:50:23 +00:00
Corinna Vinschen a11a07231b * external.cc (cygwin_internal): Add CW_CVT_MNT_OPTS to allow mount
flag parsing.  Add CW_LST_MNT_OPTS case to allow mount flag listing.
	* mount.cc (fstab_read_flags): Rename from read_flags.  Make externally
	available.  Change input string to char ** to allow returning faulty
	option.  Add flag for avoiding debug output.
	(fstab_list_flags): New function to create list of options.
	* include/sys/cygwin.h (cygwin_getinfo_types): Add CW_CVT_MNT_OPTS and
	CW_LST_MNT_OPTS.
2010-04-29 08:47:44 +00:00
Corinna Vinschen f00bc469e2 * mount.cc (compare_flags): New function.
(read_flags): Replace loop with bsearch.  Simplify error check.
2010-04-28 15:35:52 +00:00
Corinna Vinschen 8f47a15cef * include/cygwin/version.h: Bump API minor version. 2010-04-28 10:20:34 +00:00
Corinna Vinschen c2bedf3aa3 * new-features.sgml (ov-new1.7.6): Add locale wide-char changes. 2010-04-28 10:19:25 +00:00
Corinna Vinschen 22b6e8101e * locale.cc (print_lc_xxx_charset): Remove.
(enum type_t): Change according to the fact that nl_langinfo now returns
	all locale category values.
	(lc_ctype_names): Add new category members.  Redefine for exclusive
	nl_langinfo usage.
	(lc_numeric_names): Ditto.
	(lc_time_names): Ditto.
	(lc_collate_names): Ditto.
	(lc_monetary_names): Ditto.
	(lc_messages_names): Ditto.
	(print_lc): Change switch according to new type_t values.
2010-04-28 10:00:40 +00:00
Corinna Vinschen be764ea806 * cygwin.din (__locale_mb_cur_max): Export.
* nlsfuncs.cc (__getlocaleinfo): Drop conversion to multibyte.
	(__charfromwchar): New function to convert to multibyte.
	(__eval_datetimefmt): Convert to return wchar_t pointer.  Work on
	wide char string.
	(__set_lc_time_from_win): Take additional pointer to "C" category info
	to accommodate C.foo locales.  Rework to fill wide char members in
	category info.
	(__set_lc_ctype_from_win): New function.
	(__set_lc_numeric_from_win): Take additional pointer to "C" category
	info to accommodate C.foo locales.  Rework to fill wide char members
	in category info.
	(__set_lc_monetary_from_win): Ditto.
	(__set_lc_messages_from_win): Ditto.
	(__get_current_collate_codeset): New function, called from nl_langinfo.
	* include/cygwin/config.h (__HAVE_LOCALE_INFO_EXTENDED__): Define.
2010-04-28 10:00:24 +00:00
Christopher Faylor 9b53b52a80 * spawn.cc (find_exec): Use the first detected errno when lookup fails. 2010-04-27 23:06:48 +00:00
Corinna Vinschen 0f6697b373 * include/regex.h: Include _ansi.h to avoid missing out on preprocessor
macros in sys/_types.h.
2010-04-27 15:18:14 +00:00
Corinna Vinschen 002a34fa14 * mount.h (fs_info::inited): New inline method.
* path.cc (path_conv::check): Clear filesystem info if following a
	symlink.  Use new fs_info::inited method to check if FS info is already
	available.
	(symlink_info::check): Drop fs_update_called.  Use fs_info::inited
	method instead.  Streamline test for leading space and trailing dot or
	space.  Add comments.
2010-04-26 13:48:04 +00:00
Corinna Vinschen 8802178fdd * path.h (get_nt_native_path): Add third parameter to declaration and
declare with regparms.
	* path.cc (get_nt_native_path): Add third parameter to allow conversion
	of leading and trailing dots and spaces on filesystems only supporting
	filenames following DOS rules.
	(path_conv::get_nt_native_path): Call get_nt_native_path according to
	fs.has_dos_filenames_only flag.
	(getfileattr): Accommodate new parameter to get_nt_native_path.
	(symlink_info::check): Revamp fs_update_called handling to call
	fs.update only once per call.  Call get_nt_native_path according to
	fs.has_dos_filenames_only flag.  Streamline filesystem dependent code
	not to be called more than once unnecessarily.  Drop code tweaking
	incoming path for broken filesystems only allowing DOS pathnames.
	Rely on changed get_nt_native_path instead.
	* mount.cc (fillout_mntent): Accommodate new parameter to
	get_nt_native_path.
	* strfuncs.cc (tfx_rev_chars): New conversion table with comment.
	(sys_cp_wcstombs): Use tfx_rev_chars rather than tfx_chars.
2010-04-23 11:07:35 +00:00
Corinna Vinschen b12d6d10ad * path.cc (symlink_info::check): Make sure to restart only once. 2010-04-22 17:42:18 +00:00
Corinna Vinschen 6ff06a0726 * mount.cc (GETVOLINFO_VALID_MASK): Drop FILE_SEQUENTIAL_WRITE_ONCE
from mask.  Expand the comment a bit.
	(WIN_FAT_FLAGS): New define.
	(FS_IS_WINDOWS_FAT): New macro.
	(fs_info::update): Handle remote FS faking to be FAT.  Subsume under
	CIFS.  Check for NWFS and has_buggy_basic_info only for remote
	filesystems.  Add check for has_dos_filenames_only.
	* mount.h (class fs_info): Add has_dos_filenames_only status flag.
	Implement accessors.
	* path.cc (symlink_info::check): Rearrange variable definitions to
	clear them up.  Add a restart label to allow a clean restart within
	the method.  Add a check for broken filesystems only allowing DOS
	pathnames in case we encounter a STATUS_OBJECT_NAME_NOT_FOUND status.
	If all checks point to one of that, restart method with tweaked
	incoming path.  Add lengthy comments to explain what we do.
2010-04-22 17:33:28 +00:00
Corinna Vinschen c43e19442c * path.cc (symlink_info::check): Fix a comment. 2010-04-22 09:43:29 +00:00
Corinna Vinschen ebff53b339 * cygserver.sgml: Note the fact that slave tty/pty handle dispersal is
unsed as of Cygwin 1.7.6.
	* new-features.sgml (ov-new1.7.6): New section.  Add tty/pty and
	setrlimit changes.
2010-04-22 09:05:37 +00:00
Corinna Vinschen 05c98e076e * fhandler_termios.cc (tcinit): Remove previously applied change.
Replace with...
	* fhandler_tty.cc (fhandler_tty_slave::init): Become process group
	leader if called from dtable::init_std_file_from_handle.  Add comment
	to explain.
2010-04-21 19:36:40 +00:00
Corinna Vinschen 179bee57db * dtable.cc (dtable::init_std_file_from_handle): Set access mask for
the slave side of ttys explicitely.  Explain why.
2010-04-21 18:44:39 +00:00
Christopher Faylor 27f1db48c7 * path.cc (cygwin_create_path): Free memory on error. 2010-04-20 14:32:29 +00:00
Corinna Vinschen 9e40fe8112 * cygheap.h (struct init_cygheap): Add rlim_core member.
* cygheap.cc (cygheap_init): Initialize rlim_core to RLIM_INFINITY.
	* exceptions.cc (stackdump): Drop extern declaration of rlim_core.
	Refer to cygheap->rlim_core instead.
	(exception::handle): Disable stackdumping if cygheap->rlim_core is 0.
	Don't set WCOREDUMP flag in exit code, if cygheap->rlim_core is 0.
	(sigpacket::process): Ditto.
	* resource.cc (rlim_core): Remove.
	(getrlimit): Fetch RLIMIT_CORE value from cygheap->rlim_core.
	(setrlimit): Store RLIMIT_CORE value in cygheap->rlim_core.
2010-04-20 10:44:52 +00:00
Christopher Faylor 2ac91a1483 * cygerrno.h: Nevermind. 2010-04-20 03:45:27 +00:00
Christopher Faylor c0f1ded4c4 * transport_pipes.cc: Include ntdef.h to accommodate cygerrno.h. 2010-04-20 03:44:38 +00:00
Christopher Faylor e1b57fc2b9 * cygerrno.h: Protect use of NTSTATUS for only when we need it.
* lib/_cygwin_crt0_common.cc: Remove unneeded declarations.
2010-04-20 03:32:37 +00:00
Christopher Faylor 53755c55a7 * lib/_cygwin_crt0_common.cc: Remove unneeded declarations. 2010-04-20 03:30:32 +00:00
Corinna Vinschen b7b55e90e1 * fhandler_tty.cc (fhandler_tty_slave::fch_set_sd): Remove commented out
code.
2010-04-19 20:00:18 +00:00
Corinna Vinschen cc01c77f7e * autoload.cc (GetNamedPipeClientProcessId): Define.
* fhandler.h (fhandler_tty_slave::fch_open_handles): Declare private.
	(fhandler_tty_slave::fch_close_handles): Ditto.
	(fhandler_tty_slave::cygserver_attach_tty): Drop declaration.
	(fhandler_tty_slave::fstat): Declare public.
	(fhandler_tty_slave::fchmod): Declare public.
	(fhandler_tty_slave::fchown): Declare public.
	(class fhandler_pty_master): Add master_ctl handle.
	(fhandler_pty_master::pty_master_thread): Declare public.
	* fhandler_termios.cc (fhandler_termios::tcinit): If the process
	is started from a non-Cygwin process, make it tty process group
	leader.
	* fhandler_tty.cc: Throughout accommodate additional security related
	arguments in calls to functions creating or opening objects.
	(close_maybe): Move to start of file to reuse it
	in other methods.
	(struct pipe_request): Define.
	(struct pipe_reply): Define.
	(fhandler_tty_slave::open): Throughout, try to open synchronization
	objects with MAXIMUM_ALLOWED permissions.  Drop call to cygserver.
	Try to duplicate pipe handles via master_ctl pipe if duplicating
	directly doesn't work.
	(fhandler_tty_slave::cygserver_attach_tty): Remove.
	(fhandler_tty_slave::init): Close unused incoming pipe handle.
	(fhandler_pty_master::close): Send exit message to master control
	thread and close master_ctl handle.
	(fhandler_pty_master::pty_master_thread): New method, implementing the
	master control thread.
	(pty_master_thread): Static helper to start master control thread.
	(fhandler_pty_master::setup): Simplify creating pipe inheritance.
	Make sure we're the one creating the input_available_event.  Add
	comment to explain why.  Create master_ctl pipe and start master
	control thread.  Close master_ctl handle in case of error.
	* security.cc (alloc_sd): Add code to handle tty objects.  Add comments
	to explain what exactly is required.
	(get_object_sd): New function.
	(get_object_attribute): New function.
	(create_object_sd_from_attribute): New function.
	(set_object_sd): New function.
	(set_object_attribute): New function.
	(set_file_attribute): Change attribute type to mode_t.
	* security.h (set_file_attribute): Change attribute type to mode_t.
	(get_object_sd): Declare.
	(get_object_attribute): Declare.
	(create_object_sd_from_attribute): Declare.
	(set_object_sd): Declare.
	(set_object_attribute): Declare.
	* tty.cc (tty::slave_alive): Implement directly instead of via alive.
	(tty::exists): Open mutex handle with READ_CONTROL access.
	(tty::alive): Remove.
	(tty::open_output_mutex): Convert to inline method.
	(tty::open_input_mutex): Ditto.
	(tty::open_mutex): Take additional ACCESS_MASK parameter for the
	mutex open access mask.
	(tty::open_inuse): New method.
	(tty::create_inuse): Take PSECURITY_ATTRIBUTES parameter.  Drop fmt
	name parameter.  Always create TTY_SLAVE_ALIVE event.
	(tty::get_event): Take additional PSECURITY_ATTRIBUTES parameter for
	CreateEvent.
	* tty.h (class tty): Change declarations according to aforementioned
	changes.
	(tty::open_output_mutex): Implement as inline method.
	(tty::open_input_mutex): Ditto.
2010-04-19 19:52:43 +00:00
Corinna Vinschen 02a33ea774 * dtable.cc (dtable::init_std_file_from_handle): Set dev to
valid content for ptys.  Remove setting FILE_CREATE_PIPE_INSTANCE
	in access flags since it's not needed.  Set the access mask for
	kernel objects according to what's returned by NtQueryInformationFile,
	info class FileAccessInformation.
2010-04-19 16:25:11 +00:00
Corinna Vinschen bc8a5a9f66 * syscalls.cc (rename): On STATUS_ACCESS_VIOLATION, retry to open
for DELETE until the STATUS_ACCESS_VIOLATION goes away.  Add comment
	to explain why.
2010-04-19 08:09:51 +00:00
Corinna Vinschen b5efa8990f * sec_helper.cc (get_null_sd): Make static. Use PSECURITY_DESCRIPTOR
instead of SECURITY_DESCRIPTOR *.
	(sec_acl): Fix fomratting.
	* security.h (get_null_sd): Drop declaration.
2010-04-17 15:51:09 +00:00
Corinna Vinschen 7cdcd90ca1 * cygerrno.h (seterrno_from_nt_status): Declare.
(__seterrno_from_nt_status): Call seterrno_from_nt_status.
	* errno.cc (seterrno_from_win_error): Set errno without calling
	set_errno to avoid packing strace output with errno messages.
	(seterrno_from_nt_status): New function to print NT status as well as
	resulting Windows error.
2010-04-16 15:42:29 +00:00
Corinna Vinschen 6b0f100a6d * kernel32.cc (CreateEventW): Create event object with EVENT_ALL_ACCESS
access mask.
	(CreateMutexW): Create mutex object with MUTEX_ALL_ACCESS access mask.
	(CreateSemaphoreW): Create semaphore object with SEMAPHORE_ALL_ACCESS
	access mask.
2010-04-15 17:20:59 +00:00
Corinna Vinschen b873ce0686 * sec_helper.cc (set_cygwin_privileges): Enable SE_DEBUG_PRIVILEGE, if
available.  Add comments.
2010-04-15 17:17:59 +00:00
Corinna Vinschen 0ef4bb7c50 * fhandler_socket.cc (get_inet_addr): Only test the file for being a
socket after opening it.  Retry if opening failed with sharing
	violation.  Explain why we do this.
	(fhandler_socket::bind): Create file with no sharing allowed.
2010-04-13 19:56:30 +00:00
Corinna Vinschen 2bba259eb7 * cygheap.cc (cwcsdup): Fix allocation size to accommodate sizeof WCHAR.
(cwcsdup1): Ditto.
2010-04-13 10:01:34 +00:00
Corinna Vinschen 098f9c6e48 * include/cygwin/version.h: Bump DLL minor version number to 5. 2010-04-12 17:01:01 +00:00
Corinna Vinschen 6b1c332f28 * posix.sgml (std-notes): Improve lseek description. 2010-04-12 15:36:48 +00:00
Corinna Vinschen 42e9cefd71 * fhandler_tty.cc (fhandler_tty_slave::open): Add code to duplicate
handles within a single process to simplify openpty case.
	(fhandler_tty_slave::cygserver_attach_tty): Correctly send Windows PID
	to cygserver, rather than the Cygwin PID.
2010-04-12 13:28:06 +00:00
Christopher Faylor 7092cadf76 * cygwin.dsl: Remove comments. 2010-04-11 22:15:59 +00:00
Corinna Vinschen 5e64c96949 * new-features.sgml (ov-new1.7.5): New section. 2010-04-11 19:38:35 +00:00
Corinna Vinschen 0250709234 * fhandler.h (class dev_console): Add backspace_keycode member.
* fhandler_console.cc (fhandler_console::get_tty_stuff): Initialize
	backspace_keycode with CERASE.
	(fhandler_console::read): Return dev_state->backspace_keycode if the
	backspace key is pressed.
	(fhandler_console::char_command): Implement DECBKM escape sequence.
2010-04-11 19:11:17 +00:00
Christopher Faylor e4f6022e52 * cygwin-api.in.sgml: Update to DocBook SGML 4.5 DTD.
* cygwin-ug-net.in.sgml: Ditto.
* cygwin-ug.in.sgml: Ditto.
* faq-sections.xml: Ditto.
* faq.xml: Ditto.
2010-04-11 17:43:28 +00:00
Christopher Faylor 1d6adee8ed * fhandler_console.cc (fhandler_console::read): Default to sending CERASE
character if termios VERASE field is zero.
(fhandler_console::fixup_after_fork_exec): Avoid a spurious debug message.
2010-04-10 18:05:52 +00:00
Christopher Faylor 3481527cc6 update copyright 2010-04-10 05:47:54 +00:00
Christopher Faylor 89a903b879 * mkvers.sh: Use modern date formats to construct the date. 2010-04-10 05:46:45 +00:00
Corinna Vinschen 1691abe75e * nlsfuncs.cc (__set_lc_time_from_win): Actually set
_time_locale->md_order to the D_MD_ORDER value written to the buffer.
2010-04-09 21:20:21 +00:00
Christopher Faylor 412f3e61d4 * path.cc (path_conv::set_normalized_path): Use crealloc_abort to avoid a
memory leak.
* path.h (path_conv::operator =): Just use cstrdup to allocate normalized_path,
avoiding attempt to free a pointer which is allocated in another pc.
2010-04-09 16:51:08 +00:00
Corinna Vinschen f8fbd1ea58 * include/cygwin/version.h: Bump DLL minor version number to 4. 2010-04-07 08:55:38 +00:00
Corinna Vinschen 385b0add19 * thread.cc (valid_sched_parameters): Declare extern here.
(sched_set_thread_priority): Ditto.
2010-04-06 15:27:34 +00:00
Corinna Vinschen 249ccad30c * include/sched.h: Remove, overruled by newlib file.
* include/sys/sched.h: Ditto.
2010-04-06 15:16:24 +00:00
Christopher Faylor 35297ebe0b * fhandler_fifo.cc (fhandler_fifo::open): Accommodate previous return value
change to setup_overlapped.
2010-04-06 15:09:44 +00:00
Christopher Faylor 1908518227 * fhandler.h (fhandler_base::has_ongoing_io): Declare virtual method.
* select.cc (peek_pipe): Reorganize slightly.  Don't attempt to check a handle
if it has ongoing I/O.
(select_pipe_info::select_pipe_info): Delete definition.
(select_pipe_info::~select_pipe_info): Delete definition.
(thread_pipe): Get rid of WFMO call.  Reorganize loop.
(pipe_cleanup): Remove dependence on destructor.
(thread_serial): Reorganize loop.
* select.h (select_pipe_info): Empty this class since it no longer has any
special requirements (for now).
* syscalls.cc (readv): Remove an unneeded debug printf.
2010-04-02 22:36:44 +00:00
Christopher Faylor 5151c80c8a * fhandler.h (fhandler_base::setup_overlapped): Delete virtual declaration.
(fhandler_base::destroy_overlapped): Ditto.
(fhandler_base_overlapped): Remove now-unneeded friend.
(fhandler_base_overlapped::setup_overlapped): Return int, remove parameter.
(fhandler_base_overlapped::get_overlapped): Return reference.
(fhandler_base_overlapped::fhandler_base_overlapped): Be more assertive about
zeroing everything.
(fhandler_base_overlapped::fixup_after_fork): Declare new function.
(fhandler_base_overlapped::fixup_after_exec): Ditto.
(fhandler_base_overlapped::dup): Ditto.
(fhandler_base_overlapped::close): Ditto.
* fhandler_fifo.cc (fhandler_fifo::dup): Call fhandler_base_overlapped::dup
rather than fhandler_base::dup.
* pipe.cc (fhandler_pipe::dup): Ditto.
(fhandler_pipe::init): Accommodate change in setup_overlapped arguments for
"opened_properly" case.
2010-04-02 18:55:02 +00:00
Christopher Faylor 60efdd0c4c * fhandler_fifo.cc (fhandler_fifo::fhandler_fifo): Properly initialize
overlapped part of this class.
2010-04-02 16:43:27 +00:00
Corinna Vinschen 7c972c6354 * fhandler_tty.cc (fhandler_tty_slave::close): Revert previous change. 2010-04-02 16:16:53 +00:00
Christopher Faylor baa671ea26 fix typo 2010-04-02 16:01:58 +00:00
Christopher Faylor dffe690c84 * select.h (select_pipe_info::add_watch_handle): Delete declaration.
* select.cc (select_pipe_info::add_watch_handle): Delete deinition.
(fhandler_pipe::select_read): Delete call to add_watch_handle.
(fhandler_pipe::select_write): Ditto.
(fhandler_pipe::select_except): Ditto.
2010-04-02 15:50:54 +00:00
Christopher Faylor 1ae0a7c5a6 * dtable.cc (dtable::init_std_file_from_handle): Avoid adding fh to fdtab until
we know that it is good.
* fhandler_tty.cc (fhandler_tty_slave::fhandler_tty_slave): Handle error
conditions more consistently.  Avoid handle leakage on error.
2010-04-02 15:41:27 +00:00
Corinna Vinschen ed32dd8946 * fhandler_tty.cc (fhandler_tty_slave::close): Avoid potential crash
if former open call has been unsuccessful.
2010-04-02 14:11:45 +00:00