1 2008-12-31 Christopher Faylor <me+cygwin@cgf.cx>
3 * include/cygwin/version.h: Bump CYGWIN_VERSION_API_MINOR to 191.
5 2008-12-31 Christopher Faylor <me+cygwin@cgf.cx>
7 * glob_pattern_p.cc: New file.
8 * Makefile.in (DLL_OFILES): Add glob_pattern_p.o.
9 * glob.h: Add declaration for glob_pattern_p.
11 * pinfo.cc (pinfo::thisproc): Remove __stdcall attribute.
13 2008-12-30 Christopher Faylor <me+cygwin@cgf.cx>
15 * include/bits/wordsize.h: New linux-compatibility header.
17 2008-12-30 Christopher Faylor <me+cygwin@cgf.cx>
19 * exceptions.cc (try_to_debug): Avoid creating a huge buffer on the
22 2008-12-25 Christopher Faylor <me+cygwin@cgf.cx>
24 * mount.cc: Change comment.
25 (smb_extended_info): Move here from path.cc.
26 (fs_info::update): Ditto.
27 (mount_info::create_root_entry): Delay conversion to slashes and use
28 passed in buffer to figure out fs type.
29 * path.cc (smb_extended_info): Move.
30 (fs_info::update): Ditto.
31 * mount.h: New file. Move mount information here.
32 * path.h: (fs_info::update): Move.
33 * shared_info.h (mount_item): Ditto.
35 2008-12-24 Christopher Faylor <me+cygwin@cgf.cx>
37 * path.cc (symlink_info::check_shortcut): Ensure that symlink handle is
38 closed on successful return.
40 2008-12-23 Christopher Faylor <me+cygwin@cgf.cx>
42 * fhandler.h (fhandler_base_setup_overlapped): Add new argument.
43 (fhandler_base::get_overlapped_buffer): Declare new function.
44 (fhandler_base::set_overlapped): Ditto.
45 (fhandler_pipe::overlapped): New variable.
46 (fhandler_pipe::get_overlapped): Rework to return contents of
48 (fhandler_pipe::set_overlapped): Set overlapped variable based on
50 (fhandler_fifo::get_overlapped_buffer): Return pointer to io_status.
51 * fhandler.cc (handler_base::setup_overlapped): Set to overlapped
52 pointer to NULL if new doit parameter is false. Otherwise set up
53 overlapped event as usual.
54 (fhandler_base::wait_overlapped): Return inres if this isn't an
56 (fhandler_base::read_overlapped): Remove inappropriate asserts.
57 * pipe.cc (fhandler_pipe::fhandler_pipe): Zero overlapped element.
58 (struct pipesync): Delete.
59 (getov_result): Ditto.
60 (pipe_handler): Ditto.
61 (pipesync::pipesync): Ditto.
62 (fhandler_pipe::init): Don't set up pipesync thread. Just pass
63 opened_properly flag along to overlapped setup.
65 2008-12-22 Christopher Faylor <me+cygwin@cgf.cx>
67 * pipe.cc (getov_result): Minor cleanup.
69 2008-12-20 Christopher Faylor <me+cygwin@cgf.cx>
71 * pipe.cc (getov_result): Add parameters to facilitate better EOF
73 (pipe_handler): Pass extra arguments to getov_result.
75 2008-12-20 Christopher Faylor <me+cygwin@cgf.cx>
77 * fhandler.cc (fhandler_base::wait_overlapped): Reorganize to eliminate
78 gotos and to hopefully eliminate one race when a signal is detected or
79 there is a WFMO error.
81 2008-12-20 Christopher Faylor <me+cygwin@cgf.cx>
83 * pinfo.h (pinfo::thisproc): Declare. Rename from set_myself.
84 * pinfo.cc (pinfo::thisproc): Define. Rename from set_myself. Set
85 procinfo to NULL to avoid confusing subsequent init.
86 (pinfo_init): Accommodate set_myself -> pinfo::thisproc rename.
87 * dcrt0.cc (child_info_fork::handle_fork): Ditto.
88 (child_info_spawn::handle_spawn): Ditto.
90 2008-12-20 Corinna Vinschen <corinna@vinschen.de>
92 * pwdgrp.h (pwdgrp::refresh): Fix indentation.
93 * uinfo.cc (pwdgrp::load): Open file synchronized to avoid truncated
94 read. Drop local variable off.
96 2008-12-19 Christopher Faylor <me+cygwin@cgf.cx>
98 * pinfo.cc (pinfo_basic): New class.
99 (pinfo_basic::pinfo_basic): Define constructor for new class.
100 (myself): Initialize from myself_initial.
101 (set_myself): Set pid and progname from already myself_initial.
102 * strace.cc (strace::strace): Split apart strace::hello. Send
103 notification to strace as early as possible.
104 (strace::hello): Just send clause which describes the current process.
105 This can now be preceded by early initialization strace output.
106 * include/sys/strace.h (strace::strace): Declare new constructor.
108 2008-12-19 Christian Franke <franke@computer.org>
110 * fhandler_registry.cc (perf_data_files): New table.
111 (PERF_DATA_FILE_COUNT): New constant.
112 (fhandler_registry::exists): Add check for HKEY_PERFORMANCE_DATA
114 (fhandler_registry::fstat): For HKEY_PERFORMANCE_DATA, return
116 (fhandler_registry::readdir): For HKEY_PERFORMANCE_DATA, list
117 names from perf_data_files only.
118 (fhandler_registry::fill_filebuf): Use larger buffer to speed up
119 access to HKEY_PERFORMANCE_DATA values. Remove check for possible
120 subkey. Add RegCloseKey ().
121 (open_key): Replace goto by break, remove label. Do not try to
122 open subkey of HKEY_PERFORMANCE_DATA. Add missing RegCloseKey ()
123 after open subkey error.
125 2008-12-19 Corinna Vinschen <corinna@vinschen.de>
127 * path.cc (path_conv::check): Handle incoming DOS paths non-POSIXy,
128 always case-insensitive, always ignoring ACLs.
130 2008-12-18 Corinna Vinschen <corinna@vinschen.de>
132 * fhandler_disk_file.cc: Set 4th parameter of NtQueryDirectoryFile to
134 (fhandler_disk_file::facl): Fix a condition so that fstat_by_handle
136 (fhandler_disk_file::readdir): Don't print debug message on a simple
137 STATUS_NO_MORE_FILES status code.
139 2008-12-18 Corinna Vinschen <corinna@vinschen.de>
141 * path.cc (symlin_info::check): Set 4th parameter of
142 NtQueryDirectoryFile to NULL instead of 0 since it's a pointer.
143 Simplify label and break from loop handling in symlink evaluation
144 conditional expression. Drop a now useless break statement. Fix
145 behaviour when searching for `foo' and then finding a `foo.lnk'
146 which is no shortcut.
148 2008-12-16 Christian Franke <franke@computer.org>
150 * fhandler_registry.cc (DEFAULT_VALUE_NAME): Remove constant.
151 (encode_regname): Encode empty (default) name to "@".
152 Encode "@" to "%40". Change error return to -1.
153 (decode_regname): Decode "@" to empty name. Decode "%40" to "@".
154 (fhandler_registry::exists): Skip check for keys if name is empty.
155 Remove check for DEFAULT_VALUE_NAME, now handled by decode_regname ().
156 (fhandler_registry::readdir): Remove check for empty name, now
157 handled by encode_regname ().
158 (fhandler_registry::open): Remove check for DEFAULT_VALUE_NAME.
159 (fhandler_registry::open_key): Fail with ENOENT if key name is empty.
161 2008-12-15 Corinna Vinschen <corinna@vinschen.de>
163 * syscalls.cc (gen_full_path_at): Use isabspath instead of isdirsep
164 to recognize absolute path.
166 2008-12-15 Corinna Vinschen <corinna@vinschen.de>
168 * sec_auth.cc (open_local_policy): Set lsa handle to
169 INVALID_HANDLE_VALUE when LsaOpenPolicy fails. Explain why.
171 2008-12-15 Corinna Vinschen <corinna@vinschen.de>
173 * setlsapwd.cc (setlsapwd): Simplify code. Only try to call cygserver
174 if opening local policy fails. Don't treat removing non-existant
175 private data as error.
177 2008-12-15 Corinna Vinschen <corinna@vinschen.de>
179 * setlsapwd.cc (setlsapwd): Explicitely erase password buffer content
182 2008-12-15 Corinna Vinschen <corinna@vinschen.de>
184 * fhandler_registry.cc (fhandler_registry::exists): Handle EACCES.
185 (fhandler_registry::open): Ditto.
187 2008-12-15 Corinna Vinschen <corinna@vinschen.de>
189 * cygwin.din: Export fgetwc, fgetws, fputwc, fputws, fwide, getwc,
190 getwchar, putwc, putwchar, ungetwc.
191 * posix.sgml: Move above functions (add missing) into "implemented
193 * include/cygwin/version.h: Bump api minor number.
195 2008-12-15 Corinna Vinschen <corinna@vinschen.de>
197 * fhandler.h (class fhandler_registry): Declare dup method.
198 * fhandler_registry.cc (fhandler_registry::exists): Fix missing
200 (fhandler_registry::dup): New method.
202 2008-12-14 Christopher Faylor <me+cygwin@cgf.cx>
204 * fhandler_disk_file.cc (readdir_get_ino): Don't complain about MS-DOS
205 paths since the function could be fed one by an internal call.
207 2008-12-13 Christopher Faylor <me+cygwin@cgf.cx>
209 * cygheap.cc (cygheap_user::~cygheap_user): Remove unneeded if 0'ed
212 * fhandler_registry.cc (fhandler_registry::exists): Recode goto as
213 if/else to avoid a gcc4 compiler warning.
214 (fhandler_registry::open): Ditto. Use one goto rather than two.
216 * gentls_offsets: Fix compiler warning in generated output.
217 * tlsoffsets.h: Regenerate.
219 * mount.cc (fillout_mntent): slashify native paths returned via
222 2008-12-08 Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
224 * resolv.h: #include <netinet/in.h> for sockaddr_in typedef.
226 2008-12-07 Christian Franke <franke@computer.org>
228 * fhandler_registry.cc (encode_regname): Add Parameter add_val.
229 Append "%val" if add_val is set.
230 (decode_regname): Remove trailing "%val". Change returncode accordingly.
231 (__DIR_hash): New class.
233 (key_exists): New function.
234 (fhandler_registry::exists): Remove encode of registry name before path
235 compare, decode file part of path instead. Skip checks for keys if
236 trailing "%val" detected.
237 (fhandler_registry::fstat): Change check of return value of
239 (fhandler_registry::readdir): Allocate __DIR_hash. Record key names in
240 hash table. Append "%val" if key with same name exists. Fix error
241 handling of encode_regname (). Set dirent.d_type.
242 (fhandler_registry::closedir): Delete __DIR_hash.
243 (fhandler_registry::open): Don't open key if trailing "%val" detected
244 by decode_regname ().
247 2008-12-03 Pierre A. Humblet <Pierre.Humblet@ieee.org>
249 * libc/minires.c (open_sock): Set non blocking and close on exec.
250 (res_ninit): Set id pseudo-randomly.
251 (res_nsend): Do not set close on exec. Initialize server from id.
252 Flush socket. Tighten rules for answer acceptance.
253 (res_nmkquery): Update id using current data.
255 2008-12-02 Corinna Vinschen <corinna@vinschen.de>
257 * fhandler_registry.cc (must_encode): Fix condition changed for testing.
259 2008-12-01 Christian Franke <franke@computer.org>
261 * fhandler_registry.cc (must_encode): New function.
262 (encode_regname): Ditto.
263 (decode_regname): Ditto.
264 (fhandler_registry::exists): Encode name before path compare.
265 (fhandler_registry::fstat): Pass decoded name to win32 registry call.
266 (fhandler_registry::readdir): Return encoded name to user.
267 (fhandler_registry::open): Store decoded name into value_name.
268 (open_key): Pass decoded name to win32 registry call
270 2008-11-28 Christopher Faylor <me+cygwin@cgf.cx>
272 * exceptions.c (sigpacket::process): Set tls on return since it is
273 assumed to be set to a valid value by the caller.
275 2008-11-28 Christopher Faylor <me+cygwin@cgf.cx>
277 * include/cygwin/version.h: Bump api minor number to 189 to flag the
278 implementation of dirent.d_type.
280 2008-11-28 Christopher Faylor <me+cygwin@cgf.cx>
282 * exceptions.cc (sigpacket::process): Rework previous change. tls
283 could still become NULL.
285 2008-11-28 Christian Franke <franke@computer.org>
287 * dir.cc (readdir_worker): Initialize dirent.d_type and __d_unused1.
288 * fhandler_disk_file.cc (fhandler_disk_file::readdir_helper):
289 Set dirent.d_type based on FILE_ATTRIBUTE_*.
290 * include/sys/dirent.h: Define _DIRENT_HAVE_D_TYPE (enables DT_*
292 (struct dirent): Add d_type. Adjust __d_unused1 size to preserve layout.
294 2008-11-27 Christopher Faylor <me+cygwin@cgf.cx>
296 * exceptions.cc (sigpacket::process): Make sure that 'tls' is never
299 2008-11-26 Christopher Faylor <me+cygwin@cgf.cx>
301 Remove unneeded whitespace throughout.
303 * fhandler_fifo.cc (fhandler_fifo::open): Rework to cause errno to be
304 set to ENXIO when opening a fifo write/nonblocking.
306 * environ.cc (ucreqenv): Rename to ucenv. Move code from old ucenv
307 here and conditionalize it on create_upcaseenv.
309 (environ_init): Fix compiler warning by moving create_upcaseenv test to
310 ucenv. Don't bother checking for child_proc_info when calling ucenv
311 since it is assumed to be NULL at the point where the function is
314 * path.cc (symlink_worker): Turn off MS-DOS path warnings when dealing
315 with devices since the device handler passes in a translated MS-DOS
318 * sec_auth.cc (lsaprivkeyauth): Avoid variable initialization which
319 causes a compiler error.
321 * fhandler_netdrive.cc: Update copyright.
323 2008-11-26 Corinna Vinschen <corinna@vinschen.de>
325 * Makefile.in (DLL_OFILES): Add setlsapwd.o.
326 * cygserver.h (CYGWIN_SERVER_VERSION_API): Bump.
327 (request_code_t): Define CYGSERVER_REQUEST_SETPWD request type.
328 * cygserver_msg.h (client_request_msg::retval): Use default value of -1
329 for retval if msglen is 0.
330 * cygserver_sem.h (client_request_sem::retval): Ditto.
331 * cygserver_shm.h (client_request_shm::retval): Ditto.
332 * cygserver_setpwd.h: New file.
333 * external.cc (cygwin_internal): Implement new CW_SET_PRIV_KEY type.
334 * sec_auth.cc (open_local_policy): Make externally available.
335 Get ACCESS_MASK as argument.
336 (create_token): Accommodate change to open_local_policy.
338 (lsaprivkeyauth): New function fetching token by retrieving
339 password stored in Cygwin or Interix LSA private data area and
340 calling LogonUser with it.
341 * security.h (lsaprivkeyauth): Declare.
342 (open_local_policy): Declare.
343 * setlsapwd.cc: New file implementing setting LSA private data password
344 using LsaStorePrivateData or by calling cygserver if available.
345 * syscalls.cc (seteuid32): Add workaround to get the original token
346 when switching back to the original privileged user, even if
347 setgroups group list is still active. Add long comment to explain why.
348 Call lsaprivkeyauth first, only if that fails call lsaauth or
350 * include/cygwin/version.h: Bump API minor number.
351 * include/sys/cygwin.h (cygwin_getinfo_types): Add CW_SET_PRIV_KEY.
353 2008-11-21 Corinna Vinschen <corinna@vinschen.de>
355 * fhandler_floppy.cc (fhandler_dev_floppy::raw_read): Drop
356 initialization of bytes_to_read. Set bytes_to_read to len in
357 non-buffered case. Call read_bytes correctly with bytes_to_read
360 2008-11-21 Corinna Vinschen <corinna@vinschen.de>
362 * mmap.cc (MapView): Add NT status to debug output.
364 2008-11-11 Corinna Vinschen <corinna@vinschen.de>
366 * autoload.cc (GetSystemDEPPolicy): Define.
367 (GetProcessDEPPolicy): Ditto.
368 (SetProcessDEPPolicy): Ditto.
369 * dcrt0.cc (disable_dep): New static function.
370 (dll_crt0_0): Call disable_dep on platforms requiring it. Add longish
371 comment to explain the circumstances.
372 * wincap.h (wincaps::ts_has_dep_problem): New element.
373 * wincap.cc: Implement above element throughout.
374 (wincapc::init): Set ts_has_dep_problem to true on 2008 Terminal
376 * winsup.h (WINVER): Set to 0x0601.
378 2008-11-11 Corinna Vinschen <corinna@vinschen.de>
380 * mount.cc (mount_info::cygdrive_win32_path): Always upper case
381 DOS drive letter to accommodate case sensitivity.
382 (cygdrive_getmntent): Ditto.
383 * path.cc (path_conv::check): Invalidate wide_path after making path
386 2008-11-11 Corinna Vinschen <corinna@vinschen.de>
388 * environ.cc (create_upcaseenv): New static variable.
389 (renv_arr): New static array to keep track of environment variables
390 which have to be always uppercased.
393 (ucreqenv): New function to uppercase only the environment variables
395 (parse_thing): Add "upcaseenv" setting.
396 (environ_init): Parse $CYGWIN before doing anything else. Call
397 ucreqenv instead of ucenv if CYGWIN=noupcaseenv is set.
399 2008-11-10 Christopher Faylor <me+cygwin@cgf.cx>
401 * path.cc (normalize_win32_path): Don't add a trailing '\' if the cwd
402 returns a path with a trailing '\'.
404 2008-11-07 Christopher Faylor <me+cygwin@cgf.cx>
406 * pthread.cc (pthread_mutex::_unlock): Avoid unlocking a mutex if the
407 recursion_counter is already 0.
408 (pthread_mutex::_destroy): Don't consider a mutex busy if its
409 recursion_counter == 0.
410 (pthread_mutex::_fixup_after_fork): Set recursion_counter to 0 to flag
411 that we've just forked. Don't reset the owner of this mutex since the
412 forkee may think it still owns the mutex. Reinstate initialization of
415 * fhandler_floppy.cc (fhandler_dev_floppy::raw_read): Initialize a
416 variable to bypass a C++ warning.
418 2008-11-05 Corinna Vinschen <corinna@vinschen.de>
420 * environ.cc (environ_init): Avoid evaluating $CYGWIN twice.
422 2008-10-23 Corinna Vinschen <corinna@vinschen.de>
424 * wincap.cc (all wincaps): Store in .cygwin_dll_common section same as
425 wincap. Add comment to explain why.
427 2008-10-22 Corinna Vinschen <corinna@vinschen.de>
429 * autoload.cc (GetSystemWindowsDirectoryW): Define.
430 * kernel32.cc (GetWindowsDirectoryW): Implement to abstract from
431 running under Terminal Services or not.
432 (GetWindowsDirectoryA): Ditto.
434 2008-10-21 Corinna Vinschen <corinna@vinschen.de>
436 * passwd.cc (pwdgrp::read_passwd): Check if we're called within
437 user_shared initialization and ignore myself, if so. Reformat
438 conditional expression.
440 2008-10-20 Corinna Vinschen <corinna@vinschen.de>
442 * ntdll.h (NtSetAttributesFile): New inline function.
443 * fhandler_disk_file.cc (fhandler_disk_file::fchmod): Use
445 * path.cc (symlink_worker): Ditto.
446 * syscalls.cc (unlink_nt): Ditto.
447 (rename): Omit FILE_SHARE_DELETE when opening files on Samba. Add
448 comment to explain why.
450 2008-10-17 Corinna Vinschen <corinna@vinschen.de>
452 * dtable.cc (dtable::get_debugger_info): Call SetStdHandle
453 for the newly opened handle. Explain why.
454 (dtable::stdio_init): Don't duplicate standard error handle
455 when stderr has already been created under debugger control.
457 2008-10-13 Corinna Vinschen <corinna@vinschen.de>
459 * sec_acl.cc (setacl): Align standard owner and group permissions
460 with alloc_sd. Strip FILE_READ_ATTRIBUTES fromn setting
461 FILE_GENERIC_EXECUTE permissions same as in alloc_sd.
462 * security.cc (alloc_sd): Reformat expression. Strip EA permission
463 bits from owner_deny and group_deny computation.
465 2008-10-09 Corinna Vinschen <corinna@vinschen.de>
467 * fhandler_disk_file.cc (fhandler_base::fstat_helper): Check
468 for executable suffixes here in case we're on a file system
469 not supporting permission.
470 * path.cc (path_conv::check): Drop check for executable suffixes.
472 2008-10-09 Corinna Vinschen <corinna@vinschen.de>
474 * fhandler_floppy.cc (fhandler_dev_floppy::raw_read): Keep track of
475 current position in non-buffered case, too.
477 2008-10-09 Corinna Vinschen <corinna@vinschen.de>
479 * grp.cc (pwdgrp::read_group): Generate more speaking group name
480 if passwd gid exists under different gid in /etc/group.
482 2008-10-09 Corinna Vinschen <corinna@vinschen.de>
484 * path.cc (path_conv::is_binary): Always check for GetBinaryType.
485 * syscalls.cc (rename): Fix test for just changing case of name on
486 case insensitive filesystems.
488 2008-10-09 Corinna Vinschen <corinna@vinschen.de>
490 * path.cc (symlink_info::check_shortcut): Don't check for executability
492 (symlink_info::check_sysfile): Ditto.
494 2008-10-08 Corinna Vinschen <corinna@vinschen.de>
496 * path.cc (path_conv::check): Only assume executability by suffix
497 on file systems not supporting permissions.
499 2008-10-07 Christopher Faylor <me+cygwin@cgf.cx>
501 * pthread.cc (pthread_create): Very minor formatting change.
502 * timer.cc (timer_thread): Ensure that any created thread defaults to
505 2008-10-06 Christopher Faylor <me+cygwin@cgf.cx>
507 * cygtls.h (_cygtls::initialized): Remove bogus stack check which would
508 crash when checking the current thread from the current thread.
509 * tlsoffsets.h: Regenerate.
511 2008-10-05 Christopher Faylor <me+cygwin@cgf.cx>
513 * dcrt0.cc (dll_crt0_0): Don't initialize signals early when
515 (dll_crt0_1): Wait until this phase to initialize signals when
518 2008-09-29 Christopher Faylor <me+cygwin@cgf.cx>
520 * thread.cc (pthread_mutex::_fixup_after_fork): Reinstate DEBUGGING
523 2008-09-29 Christopher Faylor <me+cygwin@cgf.cx>
525 * thread.cc (pthread_mutex::_fixup_after_fork): Just reset lock to
526 pristine state after fork. Don't recreate a mutex since it may not
529 2008-09-29 Corinna Vinschen <corinna@vinschen.de>
531 * flock.cc (inode_t::get_all_locks_list): Fix typo.
532 * posix.sgml: Add cfmakeraw to list of implemented BSD functions.
534 2008-09-19 Eric Blake <ebb9@byu.net>
536 * errno.cc (_sys_errlist): Add ECANCELED, ENOTRECOVERABLE,
539 2008-09-15 Christopher Faylor <me+cygwin@cgf.cx>
541 * cygtls.h (unionent): Move from net.cc.
542 (unionent::struct_type): Move enum here.
543 (_local_storage::hostent_buf): Define as unionent.
544 (_local_storage::protoent_buf): Ditto.
545 (_local_storage::servent_buf): Ditto.
546 * net.cc (unionent): Move to cygtls.h.
547 (struct_type): Ditto.
548 (dup_ent): Define one function per {host,proto,serv}ent type.
549 (cygwin_getprotobyname): Simplify dup_ent call. Removed now-unneeded
550 return type coercion.
551 (cygwin_getprotobynumber): Ditto.
552 (cygwin_getservbyname): Ditto.
553 (cygwin_getservbyport): Ditto.
554 (cygwin_gethostbyname): Ditto.
555 (cygwin_gethostbyaddr): Ditto.
556 tlsoffsets.h: Regenerate.
558 2008-09-12 Christopher Faylor <me+cygwin@cgf.cx>
560 * Makefile.in: Add -c option which is now removed from COMPILE_C*.
561 * cygwin.din (cfmakeraw): Export.
562 * termios.cc (cfmakeraw): Implement.
563 * include/sys/termios.h (cfmakeraw): Declare.
564 * include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump.
566 2008-09-11 Christopher Faylor <me+cygwin@cgf.cx>
568 * cygwin.din (sys_sigabbrev): Add this here.
569 * dcrt0.cc (__argc,__argv,_check_for_executable): Remove dllexport
570 decoration since it is already handled in cygwin.din.
571 * errno.cc (_sys_errlist): Ditto.
572 * strsig.cc (sys_sigabbrev): Ditto.
573 * include/cygwin/signal.h: Protect use of dllimport when
575 * libc/getopt.c: Revert previous changes. Define __INSIDE_CYGWIN__.
577 2008-09-11 Christopher Faylor <me+cygwin@cgf.cx>
579 * localtime.cc (increment_overflow): Mark as non-inline to prevent
580 compiler from complaining about the very thing we're trying to test.
581 * ntea.cc (read_ea): Reorganize to avoid a new compiler warning/error.
582 * sched.cc (sched_rr_get_interval): Ditto.
583 * select.cc (peek_serial): Ditto.
584 * libc/rexec.cc (ruserpass): Ditto.
585 * posix_ipc.cc (ipc_names): Make static to avoid a compiler warning
586 (and it's the right thing to do anyway).
588 2008-09-11 Christopher Faylor <me+cygwin@cgf.cx>
590 * net.cc (in6addr_any, in6addr_loopback): Add appropriate number of
591 braces around initializer.
592 (dup_ent): Try harder to coerce the first argument to deal with more
594 (get_2k_ifs): Remove extraneous typedef.
595 (get_2k_ifs): Reorganize expression to avoid a compiler warning.
599 2008-09-11 Christopher Faylor <me+cygwin@cgf.cx>
601 * fhandler.h (fhandler_pipe::raw_read): Remove __stdcall decoration.
602 * pipe.cc (fhandler_pipe::raw_read): Ditto.
604 2008-09-11 Christopher Faylor <me+cygwin@cgf.cx>
606 * cygheap.cc (creturn): Reorganize to avoid a new compiler
608 * dtable.cc (handle_to_fn): Ditto.
609 * fhandler_console.cc (fhandler_console::read): Ditto.
610 (fhandler_console::scroll_screen): Ditto.
611 (dev_console::set_color): Ditto.
612 * fhandler_dsp.cc (fhandler_dev_dsp::write): Ditto.
613 (fhandler_dev_dsp::read): Ditto.
614 * fhandler_tape.cc (mtinfo_drive::get_status): Ditto.
615 * hookapi.cc (find_first_notloaded_dll): Ditto.
616 * mmap.cc (msync): Ditto.
617 * pipe.cc (pipesync::pipesync): Ditto.
618 * sec_acl.cc (getace): Ditto.
619 * sec_auth.cc (create_token): Ditto.
621 * select.cc (peek_pipe): Ditto.
622 * spawn.cc (av::fixup): Ditto.
623 * syscalls.cc (popen): Ditto.
624 * tty.cc (tty::init_session): Ditto.
625 * uinfo.cc (pwdgrp::load): Ditto.
626 * fhandler.cc (fhandler_base::setup_overlapped): Ditto.
627 (fhandler_base::wait_overlapped): Rename second use of res variable to
628 wres or errors are not returned correctly.
629 * dcrt0.cc: Remove obsolete variable.
630 * dll_init.cc (release_upto): Fix typo involving incorrect use of '|'.
631 * fhandler_disk_file.cc (fhandler_base::fstat_by_handle): Avoid a
632 compiler warning regarding coercing type-punned variables.
633 (fhandler_base::fstat_by_name): Ditto.
634 * fhandler_fifo.cc (fhandler_fifo::open_nonserver): Fix = vs. == typo.
635 (fhandler_fifo::wait): Add all conditions to switch statement to avoid
637 * fhandler_process.cc: Avoid unneeded initialization of variables to
639 * fhandler_socket.cc (fhandler_socket::listen): Add braces around
641 * flock.cc (inode_t::get_all_locks_list): Reorganize to avoid a
642 compiler warning. Fix problem with EWOULDBLOCK error return.
643 * path.cc (GUID_shortcut): Use braces around struct initializer.
644 (cygwin_conv_path): Reorganize to avoid a compiler warning.
645 * random.cc (dummy): Mark variable as volatile to avoid a "used
646 uninitialized" warning.
647 * libc/getopt.c: Mark some variables as dllexport although gcc doesn't
648 seem to do the right thing with them.
649 * libc/minires-os-if.c (get_registry_dns_items): Coerce some function
650 arguments to avoid a compiler warning.
652 2008-08-27 Christopher Faylor <me+cygwin@cgf.cx>
654 * fhandler_tty.cc (close_maybe): Check for both types of invalid handle
655 before attempting CloseHandle.
656 (fhandler_pty_master::setup): Only set inheritance on pty handles, not
659 2008-08-26 Christopher Faylor <me+cygwin@cgf.cx>
661 * shared_info.h (shared_info::create_root_entry): Remove extraneous
662 mount_info:: from declaration.
664 2008-08-26 Corinna Vinschen <corinna@vinschen.de>
666 * fhandler.h (class fhandler_pipe): Rename read and write
667 declarations to raw_read and raw_write.
668 * pipe.cc (fhandler_pipe::raw_read): Rename from read.
669 (fhandler_pipe::raw_write): Rename from write.
671 2008-08-21 Christopher Faylor <me+cygwin@cgf.cx>
673 * fhandler.cc (fhandler_base::wait_overlapped): Reorganize again to
674 accommodate what appears to be an MSDN hint about not resetting the
675 overlapped event prior to calling GetOverlappedResult.
677 2008-08-20 Corinna Vinschen <corinna@vinschen.de>
679 * path.cc (symlink_info::check_shortcut): If file can't be opened,
680 treat it as non-symlink rather than generating an EIO error.
681 (symlink_info::check_sysfile): Ditto.
683 2008-08-19 Christopher Faylor <me+cygwin@cgf.cx>
685 * fhandler.cc (fhandler_base::wait_overlapped): Always assume that
686 bytes will be non-NULL. Distinguish input result from result derived
687 from WFMO and GetOverlappedResult or res can never be -1. Only raise
688 SIGPIPE when writing.
689 * fhandler.h (fhandler_base::wait_overlapped): Pass first argument by
691 * fhandler_fifo.cc (fhandler_fifo::wait): Pass in dummy byte count to
693 * pipe.cc (DEFAULT_PIPEBUFSIZE): Define to 65536 explicitly.
695 2008-08-19 Corinna Vinschen <corinna@vinschen.de>
697 * fhandler_disk_file.cc (fhandler_disk_file::mkdir): Drop fattr variable
698 and use FILE_ATTRIBUTE_DIRECTORY directly in call to NtCreateFile.
699 * posix_ipc.cc (ipc_mutex_init): Fix format string when creating IPC
701 (ipc_cond_init): Ditto.
702 * security.cc (alloc_sd): Add parentheses to fix setting initial
705 2008-08-18 Christopher Faylor <me+cygwin@cgf.cx>
707 * fhandler.cc (fhandler_base::wait_overlapped): Don't treat
708 ERROR_BROKEN_PIPE as a non-error. Do raise SIGPIPE when it is
711 2008-08-15 Corinna Vinschen <corinna@vinschen.de>
713 * mount.cc (mount_info::get_mounts_here): Don't subtract 2 from
714 Length if it's 0 anyway.
716 2008-08-15 Corinna Vinschen <corinna@vinschen.de>
718 * mount.cc (mount_info::create_root_entry): Create default cygdrive
719 prefix with MOUNT_NOPOSIX flag.
721 2008-08-15 Corinna Vinschen <corinna@vinschen.de>
723 * path.cc (symlink_info::check): Don't use eabuf when trying to open
724 file a second time. Call NtOpenFile instead of NtCreateFile in this
727 2008-08-14 Corinna Vinschen <corinna@vinschen.de>
729 * fhandler_disk_file.cc (fhandler_disk_file::link): Fix linking
732 2008-08-14 Corinna Vinschen <corinna@vinschen.de>
734 * external.cc (cygwin_internal): Call set_security_attribute with
735 additional path_conv argument.
736 * fhandler.cc (fhandler_base::open): Ditto.
737 * fhandler_disk_file.cc (fhandler_disk_file::fchmod): Never set DOS
738 R/O attribute when using ACLs.
739 (fhandler_disk_file::mkdir): Ditto. Set
740 security descriptor on remote dirs after creating the dir, same as in
742 * fhandler_socket.cc (fhandler_socket::bind): Ditto for remote AF_LOCAL
744 * path.cc (symlink_worker): Ditto. for remote symlinks.
745 * security.cc (alloc_sd): Take additional path_conv argument.
746 Accommodate throughout. Drop setting FILE_WRITE_EA/FILE_READ_EA
747 flags unconditionally (was only necessary for "ntea"). Don't set
748 FILE_READ_ATTRIBUTES and FILE_WRITE_ATTRIBUTES unconditionally on
749 Samba. Add comment to explain. Drop useless setting of
750 STANDARD_RIGHTS_WRITE, it's in FILE_GENERIC_WRITE anyway.
751 Remove FILE_READ_ATTRIBUTES bit from FILE_GENERIC_EXECUTE so as not
752 to enforce read permissions on Samba.
753 (set_security_attribute): Take additional path_conv argument.
754 * security.h (set_security_attribute): Change prototype accordingly.
756 2008-08-13 Corinna Vinschen <corinna@vinschen.de>
758 * mount.cc (fillout_mntent): Always print noumount option last.
760 2008-08-13 Corinna Vinschen <corinna@vinschen.de>
762 * mount.cc (fillout_mntent): Print options as taken in fstab and mount.
764 2008-08-13 Corinna Vinschen <corinna@vinschen.de>
766 * dll_init.cc: Throughout convert to use long pathnames.
767 * dll_init.h (struct dll): Change name to WCHAR, change operator [] to
768 take PWCHAR argument.
770 2008-08-11 Corinna Vinschen <corinna@vinschen.de>
772 * syscalls.cc (rename): If newpath doesn't exist, check if .exe suffix
773 in oldpath has been omitted before appending .exe to newpath.
775 2008-08-09 Corinna Vinschen <corinna@vinschen.de>
777 * fhandler_floppy.cc (fhandler_dev_floppy::raw_read): Don't set
778 eom_detected when EOF is detected, thus returning 0 instead of
779 setting errno to ENOSPC.
781 2008-08-07 Corinna Vinschen <corinna@vinschen.de>
783 * fhandler.cc (fhandler_base::open): Use Samba workaround generally
784 for all remote filesystems supporting ACLs. Change comment and
785 explain why. Refer to the discussion which led to this.
787 2008-08-05 Brian Dessent <brian@dessent.net>
789 * config/i386/profile.h (mcount): Mark asms volatile.
791 2008-08-05 Christopher Faylor <me+cygwin@cgf.cx>
793 * dll_init.cc (dll_global_dtors): Add an additional test to avoid
794 walking the linked list if it is empty.
795 (dll_list::detach): Don't set dll_global_dtors_recorded if we aren't
796 actually going to record any dlls.
798 2008-08-04 Christopher Faylor <me+cygwin@cgf.cx>
800 Changes suggested by Dave Korn.
801 * dcrt0.cc (cygwin_exit): Remove (hopefully) extraneous call to
803 * dll_init.cc (dll_global_dtors): Run destructors in reverse
804 dependency/load order.
805 * dll_init.h (dll_list): Add dll_global_dtors as a friend.
807 2008-08-01 Christopher Faylor <me+cygwin@cgf.cx>
809 * dcrt0.cc (dll_crt0_1): Add a symbol denoting return from call to
811 * exceptions.cc (stack_info::walk): Stop walking the stack when we
812 hit _cygwin_exit_return rather than just blindly stopping when PC
815 2008-07-31 Corinna Vinschen <corinna@vinschen.de>
817 * path.cc (symlink_info::check): Handle (and explain) a special case
818 when accessing files matching DOS device names on SMB shares.
820 2008-07-31 Corinna Vinschen <corinna@vinschen.de>
822 * spawn.cc (spawn_guts): Check constructed short pathname for being
823 a DOS device name and fall back to long path name, if so.
825 2008-07-30 Corinna Vinschen <corinna@vinschen.de>
827 * fhandler_disk_file.cc (fhandler_base::fstat_by_name): Check for
828 file systems incapable of handling FileIdBothDirectoryInformation
830 (fhandler_disk_file::opendir): Ditto.
831 * path.cc (fs_info::update): Always clear at the start.
832 Rearrange to make certain tests only on non-Samba, non-NFS remote
834 Add test for file systems known to be incapable of handling
835 FileIdBothDirectoryInformation correctly. Right now that's just
837 * path.h (struct fs_info): Add has_buggy_fileid_dirinfo flag and
839 (class path_conv): Add has_buggy_fileid_dirinfo method.
841 2008-07-30 Corinna Vinschen <corinna@vinschen.de>
843 * sec_auth.cc (extract_nt_dom_user): Return domain and user name as
845 (cygwin_logon_user): Accommodate above change. Convert password to
846 WCHAR and call LogonUserW.
847 * external.cc (cygwin_internal): Accommodate above change.
848 * security.h (extract_nt_dom_user): Change prototype accordingly.
850 2008-07-30 Christopher Faylor <me+cygwin@cgf.cx>
852 * cygwin.din (_getutline): Remove.
853 * lib/bsdlib.cc (login): Make argument const as per linux.
855 * syscalls.cc (getutid): Ditto.
858 (getutxent): Add comment mentioning non-thread-safety.
862 * sys/utmp.h: Declare arguments to various functions as const as per
863 linux. Remove bogus _getutline definition.
865 2008-07-29 Christopher Faylor <me+cygwin@cgf.cx>
867 * include/cygwin/version.h: Add comment indicating that current API number
868 bump also has another consequence.
870 2008-07-29 Corinna Vinschen <corinna@vinschen.de>
872 * Makefile.in (DLL_OFILES): Remove v8 regexp files.
873 (OBSOLETE_FUNCTIONS): Remove v8 regexp functions.
874 (NEW_FUNCTIONS): Remove POSIX regex functions.
875 * cygwin.din: Export POSIX regex functions with their correct symbol
876 name. Export with posix_ prefix for backward compatibility.
877 * syscalls.cc (regfree): Remove ancient fake function.
878 * regex/regex.h: Remove renaming regex functions within Cygwin.
880 * include/cygwin/version.h: Bump API minor number.
882 2008-07-27 Corinna Vinschen <corinna@vinschen.de>
883 Christopher Faylor <me+cygwin@cgf.cx>
885 * dcrt0.cc (dll_crt0_0): Remove calling malloc_init and
886 user_shared_initialize_1 from here.
887 (dll_crt0_1): Remove dynamically_loaded check. Just call malloc_init
888 and user_shared_initialize unconditionally.
889 * shared.cc (user_shared_create): Rename from user_shared_initialize.
890 (user_shared_initialize): Rename from user_shared_initialize_1. Move
891 complete user_shared content initialization code here from
893 * syscalls.cc (seteuid32): Remove call to user_shared_initialize_1.
894 That is implied by the "true" argument to user_shared_create().
896 2008-07-27 Christopher Faylor <me+cygwin@cgf.cx>
898 * mount.cc (mount_info::init): Add location where we're looking for
899 fstab to temporary message.
901 * lib/cygwin_crt0.c (cygwin_crt0): Simplify by eliminating
902 accommodations for ancient cygwin DLLs.
903 * lib/crt0.h: Include <windows.h> directly since it is needed.
905 2008-07-27 Christopher Faylor <me+cygwin@cgf.cx>
907 * shared_info.h (shared_destroy): Declare.
908 * shared.cc (shared_destroy): Define new function to destroy shared
910 * init.cc (dll_entry): Call shared_destroy when dll detaches from the
913 2008-07-27 Corinna Vinschen <corinna@vinschen.de>
915 * fhandler_socket.cc (fhandler_socket::send_internal): Send never more
916 then 64K bytes at once. For blocking sockets, loop until entire data
917 has been sent or an error occurs.
918 (fhandler_socket::sendto): Drop code which sends on 64K bytes.
919 (fhandler_socket::sendmsg): Ditto.
921 2008-07-26 Christopher Faylor <me+cygwin@cgf.cx>
923 * fhandler_tty.cc (fhandler_pty_master::setup): Reorganize so that all
924 operations for each end of the pipe are grouped together.
926 2008-07-25 Corinna Vinschen <corinna@vinschen.de>
928 * dcrt0.cc (dll_crt0_1): Call malloc_init and user_shared_initialize_1
929 only in non-dynamically loaded case.
931 2008-07-25 Corinna Vinschen <corinna@vinschen.de>
933 * dcrt0.cc (dll_crt0_0): Call malloc_init and user_shared_initialize_1
934 here in case we're dynamically loaded. Explain why.
935 (dll_crt0_1): Call user_shared_initialize_1 from here.
936 * mount.cc (is_native_path): New inline function testing for native
937 and long Win32 path prefix.
938 (is_unc_share): Remove long WIn32 path prefix test.
939 (mount_info::create_root_entry): Use PATH_MAX buffer.
940 (mount_info::init): Ditto.
941 (mount_info::add_item): Test for is_native_path as well.
942 * path.cc (normalize_win32_path): Simplify native path prefix code.
943 * shared.cc (user_shared_initialize_1): New function taking user
944 shared initialization code relying on malloc and cygtls.
945 (user_shared_initialize): Move mountinfo initialization to
946 user_shared_initialize_1.
947 * shared_info.h (user_shared_initialize_1): Declare.
948 * syscalls.cc (seteuid32): Call user_shared_initialize_1 after user
951 2008-07-24 Corinna Vinschen <corinna@vinschen.de>
953 * mount.cc (mount_info::from_fstab): Change system_printf to
954 debug_printf on NtOpenFile failure.
956 2008-07-24 Corinna Vinschen <corinna@vinschen.de>
958 * shared.cc (user_shared_initialize): Fetch potentially changed Cygwin
959 username from /etc/passwd before loading mount table.
960 (shared_info::init_installation_root): New function fetching Cygwin's
961 installation root dir and storing as native NT path in global shared
963 (shared_info::initialize): Call init_installation_root exactly once at
965 * shared_info.h (SHARED_INFO_CB): Accommodate change to shared_info.
966 (CURR_SHARED_MAGIC): Ditto.
967 (class shared_info): Add installation_root member.
968 (shared_info::init_installation_root): Declare.
970 * grp.cc (pwdgrp::read_group): Call pwdgrp::load with native WCHAR path.
971 * passwd.cc (pwdgrp::read_passwd): Ditto. Avoid recursion.
972 (etc::init): Take POBJECT_ATTRIBUTES instead of path_conv.
973 * path.h (etc::init): Change prototype accordingly.
974 * pwdgrp.h (class pwdgrp): Store path as UNICODE_STRING/PWCHAR instead
976 (pwdgrp::load): Accommodate prototype.
977 * uinfo.cc (pwdgrp::load): Change argument type from char to wchar_t.
978 Create native NT path here instead of calling path_conv.
980 * mount.cc (find_root_from_cygwin_dll): Drop in favor of global
981 initializaion in shared_info.
982 (mount_info::init): Fetch native NT root dir from cygwin_shared.
983 (mount_info::from_fstab): Expect native NT path and use native NT
984 functions to access file. Convert username part in user fstab path
985 according to special char transformation rules.
986 * path.cc (tfx_chars): Convert slash to backslash.
987 (transform_chars): Implement for path given as PWCHAR.
988 (transform_chars): PUNICODE_STRING version calls PWCHAR version.
989 Remove useless commented code.
991 2008-07-22 Corinna Vinschen <corinna@vinschen.de>
993 * spawn.cc (spawn_guts): Fix previous patch for UNC paths.
995 2008-07-22 Corinna Vinschen <corinna@vinschen.de>
997 * spawn.cc (spawn_guts): Remove long path prefix from win32 path
998 before calling CreateProcess if path length is < MAX_PATH.
1000 2008-07-22 Corinna Vinschen <corinna@vinschen.de>
1002 * include/ctype.h: Declare __ctype_ptr__ to keep newlib build happy.
1004 2008-07-19 Corinna Vinschen <corinna@vinschen.de>
1006 * autoload.cc (WNetGetProviderNameA): Define.
1007 (WNetGetResourceParentA): Remove.
1008 * fhandler_netdrive.cc (struct net_hdls): New structure to keep
1009 WNet handles. Stored in dir->__handle throughout.
1010 (thread_netdrive): Rewrite to enumerate all servers in all accessible
1011 domains and workgroups.
1012 (fhandler_netdrive::readdir): Simplify toplevel code. Lowercase all
1013 server names in toplevel.
1014 (fhandler_netdrive::rewinddir): Close all WNet handles and free
1017 2008-07-18 Corinna Vinschen <corinna@vinschen.de>
1019 * fhandler.cc (fhandler_base::open): Rename x to fh. On Samba, always
1020 create file with NULL security descriptor and set the permissions
1021 afterwards. Explain why.
1023 2008-07-18 Corinna Vinschen <corinna@vinschen.de>
1025 * environ.cc (known): Remove "binmode" option.
1026 * fhandler.cc (binmode): Remove.
1027 (fhandler_base::set_flags): Accommodate binmode removal.
1028 * path.h (path_conv::set_binary): Remove.
1029 * pipe.cc (pipe): Create pipes always as binary pipes.
1030 * winsup.h (binmode): Remove declaration.
1032 2008-07-17 Corinna Vinschen <corinna@vinschen.de>
1034 * mount.cc (mount_info::from_fstab_line): Default to binary mount.
1036 2008-07-16 Corinna Vinschen <corinna@vinschen.de>
1038 * path.cc (allow_winsymlinks): Revert default to create system bit
1041 2008-07-16 Corinna Vinschen <corinna@vinschen.de>
1043 Add case-sensitivity.
1044 Unconditionally handle mount points case-sensitive.
1045 Unconditionally handle virtual paths case-sensitive.
1046 Unconditionally handle registry paths case-insensitive.
1047 Otherwise, accommodate case-sensitivity of given path throughout.
1048 * cygheap.cc (cygheap_root::set): Get additional caseinsensitive
1049 parameter and store it.
1050 * cygheap.h (struct cygheap_root_mount_info): Add member
1052 * dlfcn.cc (get_full_path_of_dll): Drop PC_NOFULL parameter from call
1053 to path_conv::check.
1054 * environ.cc (pcheck_case): Remove.
1055 (check_case_init): Remove.
1056 (known): Drop "check_case" option.
1057 * exceptions.cc (open_stackdumpfile): Add comment.
1058 * fhandler.cc (fhandler_base::get_default_fmode): Call pathmatch
1059 instead of strcasematch.
1060 * fhandler_disk_file.cc: Accommodate case-sensitivity of given path
1062 (__DIR_mounts::check_mount): Unconditionally check virtual paths
1064 (fhandler_disk_file::link): Drop case clash handling.
1065 (fhandler_disk_file::open): Ditto.
1066 (fhandler_disk_file::readdir_helper): Drop managed mount code.
1067 * mount.cc: Remove managed mount code and datastructures.
1068 (struct opt): Remove "managed" option. Add "posix=0" and "posix=1"
1070 (fillout_mntent): Remove "managed" output. Add "posix" output.
1071 * path.cc (struct symlink_info): Remove case_clash member and
1073 (pcheck_case): Remove.
1074 (path_prefix_p): Take additional bool parameter "caseinsensitive".
1075 (pathnmatch): Ditto.
1078 (fs_info::update): Set caseinsensitive flag according to file system
1079 name and FILE_CASE_SENSITIVE_SEARCH flag. Add comment.
1080 (tfx_chars_managed): Remove.
1081 (transform_chars): Drop "managed" parameter. Always use tfx_chars.
1082 (get_nt_native_path): Drop "managed" parameter. Make sure drive letters
1083 are always upper case.
1084 (getfileattr): Change second parameter to denote caseinsensitivity.
1085 (path_conv::check): Initialize caseinsensitive to OBJ_CASE_INSENSITIVE.
1086 Set caseinsensitive according to global obcaseinsensitive flag, file
1087 system case sensitivity and MOUNT_NOPOSIX mount flag.
1088 Drop case_clash and all the related code.
1089 (symlink_worker): Drop case clash handling.
1090 (symlink_info::set): Drop setting case_clash.
1091 (symlink_info::case_check): Remove.
1092 (cwdstuff::set): Add comment.
1093 (etc::init): Take path_conv instead of PUNICODE_STRING as parameter to
1094 allow case sensitivity.
1095 * path.h (enum pathconv_arg): Drop PC_SYM_IGNORE.
1096 (enum case_checking): Remove.
1097 (enum path_types): Drop PATH_ENC, add PATH_NOPOSIX flag.
1098 (struct fs_info): Add caseinsensitive flag and accessor methods.
1099 (class path_conv): Add caseinsensitive member and define
1100 objcaseinsensitive method. Drop case_clash member and isencoded method.
1101 (pathmatch): Change prototype according to above change.
1102 (pathnmatch): Ditto.
1103 (path_prefix_p): Ditto.
1104 (get_nt_native_path): Ditto.
1106 (fnunmunge): Remove prototype.
1107 * shared.cc (shared_info::init_obcaseinsensitive): Initialize
1108 obcaseinsensitive flag from obcaseinsensitive registry value.
1109 (shared_info::initialize): Call init_obcaseinsensitive here by the
1110 first process creating the shared memory.
1111 * shared_info.h (mount_item::fnmunge): Remove.
1112 (shared_info::obcaseinsensitive): Rename from obcaseinsensitivity.
1113 (shared_info::init_obcaseinsensitive): Declare.
1114 * syscalls.cc (try_to_bin): Add comment.
1115 * include/sys/mount.h (MOUNT_ENC): Remove flag.
1116 (MOUNT_NOPOSIX): Add flag.
1118 2008-07-15 Corinna Vinschen <corinna@vinschen.de>
1120 * fhandler_tape.cc (mtinfo::initialize): Remove synchronization stuff.
1121 Just initialize drive data.
1122 * mtinfo.h (MTINFO_MAGIC): Remove.
1123 (MTINFO_VERSION): Remove.
1124 (class mtinfo): Remove magic and version members.
1125 * shared.cc (shared_info::initialize): Move call to
1126 get_session_parent_dir so that the dir creation is only called once.
1127 Move call to mt.initialize so that it's called only by the first
1128 process creating the shared memory.
1129 * shared_info.h (SHARED_INFO_CB): Accommodate change to shared_info.
1130 (CURR_SHARED_MAGIC): Ditto.
1131 (class shared_info): Add obcaseinsensitivity member.
1133 2008-07-14 Corinna Vinschen <corinna@vinschen.de>
1135 * fhandler.cc (fhandler_base::fpathconf): On _PC_POSIX_PERMISSIONS
1136 and _PC_POSIX_SECURITY, return true for NFS, too.
1138 2008-07-14 Corinna Vinschen <corinna@vinschen.de>
1140 Throughout drop allow_ntsec and allow_smbntsec handling.
1141 * environ.cc (set_ntsec): Remove.
1142 (set_smbntsec): Remove.
1143 (known): Remove ntsec and smbntsec options.
1144 * external.cc (check_ntsec): Return true if no filename is given.
1145 * mount.cc (oopts): Add "acl" and "noacl" options. Set MOUNT_NOACL
1147 (fillout_mntent): Handle MOUNT_NOACL flag.
1148 * path.h (enum path_types): Add PATH_NOACL.
1149 * security.cc (allow_ntsec): Remove.
1150 (allow_smbntsec): Remove.
1151 * security.h (allow_ntsec): Drop declaration.
1152 (allow_smbntsec): Drop declaration.
1153 * include/sys/mount.h (MOUNT_NOACL): Define.
1155 2008-07-14 Corinna Vinschen <corinna@vinschen.de>
1157 * miscfuncs.cc (cygwin_strncasecmp): Fix bug which results in
1158 prematurely truncated strings. Simplify target length argument to
1161 2008-07-14 Corinna Vinschen <corinna@vinschen.de>
1163 * autoload.cc (GetExtendedTcpTable): Define.
1164 * fhandler_socket.cc (address_in_use): Take const struct sockaddr
1165 pointer as argument. Implement additional AF_INET6 table check.
1166 (fhandler_socket::bind): Drop AF_INET test before calling
1168 * net.cc (ipv4_getnameinfo): Return EAI_FAMILY instead of 1 if
1169 called with unsupported af_family.
1171 2008-07-12 Eric Blake <ebb9@byu.net>
1173 Fix usage of recently fixed Interlocked* functions.
1174 * winbase.h (ilockincr, ilockdecr, ilockexch, ilockcmpexch): Add
1175 volatile qualifier, to match Interlocked* functions.
1177 2008-07-11 Corinna Vinschen <corinna@vinschen.de>
1179 * select.cc (peek_pipe): Temporarily revert patch from 2008-05-30.
1181 2008-07-11 Corinna Vinschen <corinna@vinschen.de>
1183 Change length for domain buffers from INTERNET_MAX_HOST_NAME_LENGTH to
1184 MAX_DOMAIN_NAME_LEN throughout.
1185 * cyglsa.h (CYG_LSA_MAGIC): New value.
1186 (cyglsa_t): Define username and domain as WCHAR arrays.
1187 * errno.cc (errmap): Add mapping for ERROR_NONE_MAPPED.
1188 * sec_auth.cc: Drop 'w' prefix from WCHAR string variable names where
1190 (extract_nt_dom_user): Prefer resolving by SID before resolving by
1192 (cygwin_logon_user): Don't print cleartext password in debug output.
1194 (get_user_groups): Revert calls to LookupAccountNameW to use NULL
1195 server instead of explicit server name, according to MSDN.
1196 (get_user_local_groups): Ditto.
1197 (get_server_groups): Fetch domain and user name from usersid per
1198 LookupAccountSidW instead of calling extract_nt_dom_user.
1199 (lsaauth): Fetch domain and user name from usersid per LookupAccountSidW
1200 instead of calling extract_nt_dom_user.
1201 * sec_helper.cc (cygpriv): Convert to wchar_t pointer array.
1202 (privilege_luid): Convert first parameter to PWCHAR.
1203 (privilege_name): Return wchar_t pointer.
1204 (set_privileges): Accommodate debug output.
1205 * security.h (privilege_luid): Change prototype accordingly.
1207 2008-07-10 Corinna Vinschen <corinna@vinschen.de>
1209 * cyglsa.h (SECURITY_STRING): Define.
1210 (enum _SECPKG_NAME_TYPE): Define.
1211 (struct _SECPKG_CALL_INFO): Define.
1212 (struct _LSA_SECPKG_FUNCS): Extend to full size. Define unused
1215 * sec_auth.cc (lsaauth): Use actual primary group if no admins group.
1216 Add (disabled) code to fetch token from profil data.
1218 2008-07-09 Corinna Vinschen <corinna@vinschen.de>
1220 * sec_auth.cc (verify_token): Allow builtin groups missing in a token
1221 and it's still valid. Explain why.
1223 2008-07-09 Corinna Vinschen <corinna@vinschen.de>
1225 * autoload.cc (DsGetDcNameW): Replace DsGetDcNameA.
1226 * dcrt0.cc (child_info_spawn::handle_spawn): Drop artificial
1227 supplementary group list from calling setgroups in parent.
1228 * grp.cc (internal_getgroups): Drop 9x-only code. Reformat.
1229 * sec_auth.cc (get_logon_server): Do everything in WCHAR only.
1230 (get_user_groups): Ditto. Use wlogonserver in LookupAccountNameW
1232 (is_group_member): Get logon server as first argument and use in call
1233 to NetLocalGroupGetMembers.
1234 (get_user_local_groups): Get logon server as first argument and use in
1235 calls to NetLocalGroupEnum and LookupAccountNameW. Revamp to work
1236 more correctly in domain environments.
1237 (get_server_groups): Accommodate aforementioned changed function calls.
1238 * security.h (get_logon_server): Change prototype accordingly.
1239 * uinfo.cc (cygheap_user::env_logsrv): Accommodate changed
1240 get_logon_server call.
1242 2008-07-09 Corinna Vinschen <corinna@vinschen.de>
1244 * grp.cc (internal_getgroups): Also add integrity-enabled groups.
1246 2008-07-09 Corinna Vinschen <corinna@vinschen.de>
1248 * sec_auth.cc (verify_token): Disable code which returns false if
1249 the token contains additional groups not requested by setgroups.
1252 2008-07-08 Corinna Vinschen <corinna@vinschen.de>
1254 * fhandler_socket.cc (fhandler_socket::bind): Don't run explicit
1255 local socket test in SO_REUSEADDR case on systems supporting
1256 enhanced socket security. Explain why. Only call address_in_use
1257 for AF_INET sockets.
1258 * net.cc (cygwin_setsockopt): Don't call setsockopt to set SO_REUSEADDR
1259 on systems supporting enhanced socket security. Add comment.
1260 * wincap.h (wincaps::has_enhanced_socket_security): New element.
1261 * wincap.cc: Implement above element throughout.
1263 2008-07-08 Corinna Vinschen <corinna@vinschen.de>
1265 * net.cc (ipv6_inited): Make NO_COPY.
1267 2008-07-02 Corinna Vinschen <corinna@vinschen.de>
1269 * path.cc (path_conv::is_binary): Fix test. Add comment.
1271 2008-06-24 Corinna Vinschen <corinna@vinschen.de>
1273 * net.cc (cygwin_bindresvport_sa): Fix usage of last_used_bindresvport.
1275 2008-06-21 Corinna Vinschen <corinna@vinschen.de>
1277 * include/limits.h (PATH_MAX): Add comment.
1278 * include/cygwin/config.h (__FILENAME_MAX__): Define as 4096. Add
1281 2008-06-19 Corinna Vinschen <corinna@vinschen.de>
1283 * fhandler_tty.cc (fhandler_pty_master::setup): Fix pipe inheritance.
1285 2008-06-18 Christopher Faylor <me+cygwin@cgf.cx>
1287 * strsig.cc (strsignal): Return non-const buffer to allow building with
1288 recent newlib change.
1290 2008-06-17 Corinna Vinschen <corinna@vinschen.de>
1292 * sec_auth.cc (DsGetDcNameA): Drop declaration.
1293 (DS_FORCE_REDISCOVERY): Drop definition.
1295 2008-06-17 Christopher Faylor <me+cygwin@cgf.cx>
1297 * spawn.cc (spawn_guts): Reinstate call to
1298 fhandler_console::need_invisible since it is required to prevent
1301 2008-06-17 Corinna Vinschen <corinna@vinschen.de>
1303 * include/resolv.h (_getshort): Drop declaration.
1306 2008-06-12 Corinna Vinschen <corinna@vinschen.de>
1308 * mount.cc (mount_info::get_cygdrive_info): Fix usage of user and
1309 system arguments. Strip trailing slash from path for backward
1312 2008-06-12 Corinna Vinschen <corinna@vinschen.de>
1314 * fhandler.h (set_console_state_for_spawn): Drop declaration.
1315 * fhandler_console.cc (set_console_state_for_spawn): Remove.
1316 (fhandler_console::open): Set console state last. Don't set
1317 ENABLE_PROCESSED_INPUT flag.
1318 * spawn.cc (spawn_guts): Drop call to set_console_state_for_spawn.
1320 2008-06-11 Corinna Vinschen <corinna@vinschen.de>
1322 * path.cc (get_nt_native_path): Drop considerations for DOS devices.
1323 Keep relative paths relative.
1324 (cygwin_conv_path): Don't try to skip native NT prefixes on relative
1327 2008-06-11 Corinna Vinschen <corinna@vinschen.de>
1329 * include/cygwin/version.h (CYGWIN_VERSION_MOUNT_REGISTRY): Bump.
1330 (CYGWIN_INFO_CYGWIN_MOUNT_REGISTRY_NAME): Remove.
1331 (CYGWIN_INFO_CYGDRIVE_FLAGS): Remove.
1332 (CYGWIN_INFO_CYGDRIVE_PREFIX): Remove.
1333 (CYGWIN_INFO_CYGDRIVE_DEFAULT_PREFIX): Add comment to differ from the
1334 registry related defines.
1336 2008-06-11 Corinna Vinschen <corinna@vinschen.de>
1338 * fhandler_procnet.cc (dad_to_flags): Fix comment.
1340 2008-06-10 Corinna Vinschen <corinna@vinschen.de>
1342 * fhandler_procnet.cc (get_scope): New static function to evaluate
1344 (dad_to_flags): New static array to convert Windows DAD state to
1346 (format_procnet_ifinet6): Drop asking for IfIndex, just use Ipv6IfIndex.
1347 Use get_scope and dad_to_flags to generate more accurate linux-like
1350 2008-06-10 Corinna Vinschen <corinna@vinschen.de>
1352 * net.cc (if_nametoindex): Fix typo in call to get_adapters_addresses.
1353 (if_indextoname): Prefer IPv6 loopback device name over IPv4 loopback
1354 device name on pre-Vista systems.
1355 (if_nameindex): Ditto.
1357 2008-06-10 Corinna Vinschen <corinna@vinschen.de>
1359 * fhandler_procnet.cc (format_procnet_ifinet6): Use sprintf rather than
1361 * net.cc (if_nametoindex): Prefer IPv6IfIndex over IfIndex for
1362 consistency with /proc/net/if_inet6.
1363 (if_indextoname): Ditto.
1364 (if_nameindex): Ditto.
1366 2008-06-10 Corinna Vinschen <corinna@vinschen.de>
1368 * mount.cc (mount_info::from_fstab): Read sizeof (buf) - 2 bytes.
1369 Add code to handle overly long lines.
1371 2008-06-10 Corinna Vinschen <corinna@vinschen.de>
1373 * sec_auth.cc (lsaauth): Make returned token inheritable.
1375 2008-06-10 Corinna Vinschen <corinna@vinschen.de>
1377 * devices.cc: Regenerate.
1379 2008-06-09 Christopher Faylor <me+cygwin@cgf.cx>
1381 * devices.in: Remove "Global" from tty device.
1383 2008-06-09 Eric Blake <ebb9@byu.net>
1385 * signal.cc (abort): Only flush streams after signal handler.
1387 2008-06-02 Christopher Faylor <me+cygwin@cgf.cx>
1389 * cygwin.sc: Remove unrequired and erroneous definition.
1391 2008-05-30 Christopher Faylor <me+cygwin@cgf.cx>
1393 * select.cc (peek_pipe): Semi-reinstate pipe NT-special write
1396 2008-05-29 Christopher Faylor <me+cygwin@cgf.cx>
1398 * devices.in: Change mapping for /dev/ttyS* and /dev/com*.
1399 * devices.cc: Regenerate.
1401 2008-05-25 Christopher Faylor <me+cygwin@cgf.cx>
1403 * mount.cc (mount_info::from_fstab): Use proper buffer size.
1405 2008-05-24 Christopher Faylor <me+cygwin@cgf.cx>
1407 * mount.cc (mount_info::init): Revert previous change.
1408 (mount_info::from_fstab): Change system_printf to debug_printf. Just
1409 use a local NT_MAX_PATH sized temporary buffer.
1411 2008-05-24 Corinna Vinschen <corinna@vinschen.de>
1413 * mount.cc (mount_info::init): Recreate path when trying to read the
1416 2008-05-24 Corinna Vinschen <corinna@vinschen.de>
1418 * path.cc (symlink_info::check): Reorder test for nfs symlinks.
1420 2008-05-23 Corinna Vinschen <corinna@vinschen.de>
1422 * fhandler_disk_file.cc (fhandler_disk_file::opendir): Don't try to
1423 use FileIdBothDirectoryInformation on NFS shares. Fix comment to
1425 * path.cc (symlink_info::check): Reinstantiate no_ea. Use in
1426 erroneously changed condition.
1428 2008-05-23 Christopher Faylor <me+cygwin@cgf.cx>
1430 * mount.cc (find_root_from_cygwin_dll): New function factored from
1431 from_fstab. Avoid use of tls since it isn't necessarily initialized
1432 when cygwin1.dll is dynamically loaded.
1433 (mount_info::create_root_entry): Ditto.
1434 (mount_info::init): Calculate cygwin root once. Use create_root_entry
1435 to record it. Pass fstab location to from_fstab.
1436 (mount_info::from_fstab): Move root calculation stuff elsewhere, as per
1439 * shared_info.h (mount_info::from_fstab_line): Make private.
1440 (mount_info::fstab): Ditto. Accommodate new arguments.
1442 2008-05-23 Christopher Faylor <me+cygwin@cgf.cx>
1444 * mount.cc (mount_info::from_fstab): Use cygwin_hmodule rather than
1445 trying to find handle based on cygwin1.dll.
1447 * path.cc (symlink_info::check): Remove unused variable.
1449 2008-05-23 Corinna Vinschen <corinna@vinschen.de>
1451 * shared.cc (open_shared): Fix comments. Fix a condition which has
1452 been overlooked to revert to its old state in change from 2008-04-18.
1454 2008-05-22 Corinna Vinschen <corinna@vinschen.de>
1456 * path.cc (symlink_info::check): Define eabuf and easize outside of
1457 loop. Set to NULL on first STATUS_EAS_NOT_SUPPORTED. Align comments.
1460 2008-05-23 Corinna Vinschen <corinna@vinschen.de>
1462 * fhandler_disk_file.cc (fhandler_disk_file::readdir): Eliminate
1465 2008-05-23 Christopher Faylor <me+cygwin@cgf.cx>
1467 * path.cc (symlink_info::check): Don't pass EaBuffer to NtCreateFile if
1468 it has indicated that it isn't appropriate.
1469 * ntdll.h (STATUS_EAS_NOT_SUPPORTED): Define.
1471 * winsup.h: Remove __builtin* defines.
1473 2008-05-22 Corinna Vinschen <corinna@vinschen.de>
1475 * grp.cc (internal_getgroups): Fix thinko. Only add enabled groups to
1478 2008-05-22 Corinna Vinschen <corinna@vinschen.de>
1480 * grp.cc (internal_getgroups): Don't add deny-only groups to the group
1483 2008-05-22 Corinna Vinschen <corinna@vinschen.de>
1485 * cygtls.h (struct san): Add two int values to store the current
1486 tls_pathbuf counters.
1487 (return_from_fault): Restore tls_pathbuf counters.
1488 (setup_fault): Save tls_pathbuf counters.
1489 * tlsoffset.h: Regenerate.
1491 2008-05-22 Corinna Vinschen <corinna@vinschen.de>
1493 * sec_acl.cc (setacl): Set errno to EINVAL if user or group don't exist.
1495 2008-05-22 Corinna Vinschen <corinna@vinschen.de>
1497 * path.cc (cygwin_conv_path): Define tp before setting up faul handler.
1498 * syscalls.cc: Ditto, throughout.
1499 (gen_full_path_at): Add bool parameter to allow NULL pathname.
1500 (futimesat): Allow NULL pathname as GLIBC.
1502 2008-05-21 Christopher Faylor <me+cygwin@cgf.cx>
1504 * string.h (strchr): Eliminate.
1506 * syscalls.cc (rename): Work around inexplicable C++ warning.
1508 2008-05-21 Corinna Vinschen <corinna@vinschen.de>
1510 * fhandler_disk_file.cc (get_ino_by_handle): Rename pfai to fai.
1511 (fhandler_base::fstat_by_handle): Drop fai_size and pfai in favor of
1512 static struct fai_buf. Restructure.
1513 (fhandler_base::fstat_by_name): Drop fvi_size and pfvi. Drop fdi_size
1514 and pfdi in favor of static struct fdi_buf. Drop redundant test for
1515 existance. Use FileDirectoryInformation class instead of
1516 FileBothDirectoryInformation. Drop call to NtQueryVolumeInformationFile
1517 in favor of using pc.fs_serial_number (). Fix FileId information given
1519 (fhandler_disk_file::fstatvfs): Drop fvi_size, pfvi, fai_size and pfai.
1520 Drop getting FileFsVolumeInformation and FileFsAttributeInformation in
1521 favor of using the related path_conv info.
1522 (fhandler_disk_file::opendir): Fix comment.
1523 (fhandler_disk_file::readdir): Ditto. Use FileDirectoryInformation
1524 class instead of FileBothDirectoryInformation.
1525 * path.cc (fs_info::update): Store MaximumComponentNameLength in new
1527 * path.h (struct fs_info): Use ULONG rather than DWORD. Add member
1528 name_len to store MaximumComponentNameLength. Add accessor methods.
1529 (path_conv::fs_name_len): New method.
1531 2008-05-21 Corinna Vinschen <corinna@vinschen.de>
1533 * fhandler.h (dirent_states): Add dirent_nfs_d_ino state and add it to
1535 * fhandler_disk_file.cc (fhandler_disk_file::opendir): Set
1536 dirent_nfs_d_ino flag for NFS shares. Explain why.
1537 (fhandler_disk_file::readdir): Use FileNamesInformation instead of
1538 FileBothDirectoryInformation info class on NFS clients not supporting
1539 the FileIdBothDirectoryInformation info class. Use local pointers to
1540 accommodate different offsets.
1541 * path.cc (symlink_info::check): Don't test directories for symlinks
1542 on NFS shares. Enhance comment.
1544 2008-05-21 Corinna Vinschen <corinna@vinschen.de>
1546 * syscalls.cc (FILTERED_MODE): Define valid chmod mode mask.
1547 (chmod): Call fh->fchmod with filtered mode.
1550 2008-05-20 Corinna Vinschen <corinna@vinschen.de>
1552 * fhandler_disk_file.cc (fhandler_disk_file::fchmod): Fix test for
1553 S_IFSOCK in mode bits.
1555 2008-05-20 Corinna Vinschen <corinna@vinschen.de>
1557 * path.cc (symlink_worker): Fix EA buffer size info given to
1559 (symlink_info::check_nfs_symlink): Get 64K buffer for EA buffer.
1560 Change EA buffer size info given to NtQueryEaFile accordingly.
1562 2008-05-20 Corinna Vinschen <corinna@vinschen.de>
1564 * path.cc (symlink_info::check_shortcut): Minimize requested file
1566 (symlink_info::check_sysfile): Ditto. Add missing `else'.
1567 (symlink_info::check): Only retry to open file if first try failed
1570 2008-05-20 Corinna Vinschen <corinna@vinschen.de>
1572 * path.cc (fs_info::update): Re-add opening the unsplitted path
1573 for fillout_mntent's sake.
1575 2008-05-20 Corinna Vinschen <corinna@vinschen.de>
1577 * fhandler_disk_file.cc (fhandler_disk_file::mkdir): Create directories
1578 on NFS shares with correct mode bits.
1580 2008-05-20 Corinna Vinschen <corinna@vinschen.de>
1582 * winsup.h (cygwin_inet_addr): Fix type of declaration.
1584 2008-05-20 Corinna Vinschen <corinna@vinschen.de>
1586 * Makefile.in (DLL_OFILES): Add nfs.o.
1587 * fhandler.cc (fhandler_base::open): Open files on NFS shares with
1588 correct access flags and EAs.
1589 * fhandler.h (fhandler_base::fstat_by_nfs_ea): Declare.
1590 * fhandler_disk_file.cc (fhandler_base::fstat_by_nfs_ea): New method.
1591 (fhandler_base::fstat_by_handle): Call fstat_by_nfs_ea for files on
1593 (fhandler_disk_file::fchmod): Use NFS specific method to set mode for
1594 files on NFS shares. Don't overrule errno from call to
1595 set_file_attribute with errno from NtSetInformationFile call.
1596 (fhandler_disk_file::fchown): Add comment.
1597 * mount.cc (fillout_mntent): Accommodate change in second parameter
1601 * path.cc (fs_info::update): Take handle instead of bool as second
1602 parameter. Use that handle if it's not NULL. Only close handle if
1603 it has been opened here. Use static defined buffers instead of
1605 (path_conv::check): Call symlink_info::check with reference to fs.
1606 Don't call fs.update here if file exists.
1607 (conv_path_list): Prefer tmp_pathbuf buffer over using alloca.
1608 (symlink_worker): Use NFS specific method to create symlinks on NFS
1609 shares. Prefer tmp_pathbuf buffer over using alloca.
1610 (symlink_info::check_shortcut): Reopen file from incoming handle
1611 with necessary FILE_GENERIC_READ flag. Prefer tmp_pathbuf buffer over
1613 (symlink_info::check_sysfile): Ditto.
1614 (symlink_info::check_reparse_point): Use tmp_pathbuf buffer to
1615 allocate REPARSE_DATA_BUFFER.
1616 (symlink_info::check_nfs_symlink): New method.
1617 (enum symlink_t): Remove.
1618 (symlink_info::check): Don't use NtQueryAttributesFile. Rather, open
1619 file with necessary access flags and call NtQueryInformationFile. Fix
1620 error handling in case file can't be opened. For existing files, call
1621 fs_info::update here. Restructure symlink checking to accommodate the
1622 fact that the file is already open. Add case for NFS symlinks.
1623 * path.h (fs_info::update): Take handle instead of bool as second
1626 2008-05-20 Corinna Vinschen <corinna@vinschen.de>
1628 * syscalls.cc (rename): Fix condition when to start a transaction.
1630 2008-05-20 Corinna Vinschen <corinna@vinschen.de>
1632 * path.cc (path_conv::check): Free wide_path and normalized_path if
1634 * path.h (path_conv::path_conv): Set wide_path, normalized_path and
1635 normalized_path_size to 0 in all constructors.
1637 2008-05-19 Corinna Vinschen <corinna@vinschen.de>
1639 * syscalls.cc (rename): Allocate temporary path buffers using
1640 tmp_pathbuf. Don't try to unset R/O attribute on dstpc if a
1641 removepc exists. dstpc is a non-existant file in that case.
1643 2008-05-17 Christopher Faylor <me+cygwin@cgf.cx>
1645 * include/stdint.h: Use int rather than long for {u,}int32_t.
1647 2008-05-16 Corinna Vinschen <corinna@vinschen.de>
1649 * CYGWIN_LICENSE: Remove duplicate file here.
1651 2008-05-15 Corinna Vinschen <corinna@vinschen.de>
1653 * syscalls.cc (rename): ONly start transaction if FS supports them.
1655 2008-05-15 Corinna Vinschen <corinna@vinschen.de>
1657 * autoload.cc (LoadDLLfuncNt): Re-invent.
1658 (NtCreateTransaction): Define.
1659 (NtCommitTransaction): Define.
1660 (NtRollbackTransaction): Define.
1661 (RtlGetCurrentTransaction): Define.
1662 (RtlSetCurrentTransaction): Define.
1663 * ntdll.h (TRANSACTION_ALL_ACCESS): Define.
1664 (NtCreateTransaction): Declare.
1665 (NtCommitTransaction): Declare.
1666 (NtRollbackTransaction): Declare.
1667 (RtlGetCurrentTransaction): Declare.
1668 (RtlSetCurrentTransaction): Declare.
1669 * syscalls.cc (start_transaction): New static function to start TxF
1671 (stop_transaction): New static function to end TxF transaction.
1672 (rename): Call start_transaction and stop_transaction where appropriate
1673 on systems supporting transactions.
1674 * wincap.h (wincaps::has_transactions): New element.
1675 * wincap.cc: Implement above element throughout.
1677 2008-05-14 Corinna Vinschen <corinna@vinschen.de>
1679 * fhandler_disk_file.cc (fhandler_disk_file::readdir_helper): Drop
1680 explicit transformation of special DOS chars.
1681 * strfuncs.cc (sys_wcstombs): Always transform UNICODE private use area
1684 2008-05-13 Corinna Vinschen <corinna@vinschen.de>
1686 * include/cygwin/stdlib.h (initstate): Declare.
1687 (setstate): Declare.
1689 2008-05-13 Corinna Vinschen <corinna@vinschen.de>
1691 * path.cc (path_conv::set_normalized_path): Drop strip_tail argument.
1692 Never strip trailing dots and spaces.
1693 * (path_conv::check): Accomodate above change.
1694 * path.h (path_conv::operator=): Ditto
1695 * dtable.cc (build_fh_dev): Ditto.
1696 * fhandler.h (fhandler_base::set_name): Ditto.
1698 * path.cc (transform_chars): Disable converting trailing dots and
1701 * path.cc (path_conv::check): Remove two disabled code snippets.
1703 2008-05-13 Corinna Vinschen <corinna@vinschen.de>
1705 * random.cc (initstate): Align to POSIX definition.
1708 2008-05-10 Corinna Vinschen <corinna@vinschen.de>
1710 * Makefile.in (DLL_OFILES): Remove _def_time.o.
1711 * libc/_def_time.c: Remove. Move definitions of _DefaultTimeLocale
1712 and _CurrentTimeLocale ...
1713 * libc/strptime.cc: ... here.
1715 2008-05-08 Corinna Vinschen <corinna@vinschen.de>
1717 * include/sys/localedef.h: Remove.
1718 * libc/strptime.cc: Define _TimeLocale and declare _CurrentTimeLocale
1719 as well as _DefaultTimeLocale locally for Cygwin.
1721 2008-05-08 Corinna Vinschen <corinna@vinschen.de>
1723 * Makefile.in (DLL_OFILES): Add _def_time.o. Remove timelocal.o.
1724 * include/sys/localedef.h: New file from NetBSD.
1725 * libc/_def_time.c: Ditto.
1726 * libc/getopt.c: Update to latest OpenBSD version 1.23.
1727 * libc/strptime.cc: Replace FreeBSD version 1.35 with latest NetBSD
1729 * libc/timelocal.cc: Remove.
1730 * libc/timelocal.h: Remove.
1732 2008-04-30 Corinna Vinschen <corinna@vinschen.de>
1734 * dtable.cc (dtable::release): Drop fixup_before handling.
1735 (dtable::fixup_before_fork): Remove.
1736 (dtable::fixup_before_exec): Remove.
1737 * dtable.h (class dtable): Remove cnt_need_fixup_before member.
1738 (dtable::dtable): Accommodate above change.
1739 (dtable::dec_need_fixup_before): Remove.
1740 (dtable::inc_need_fixup_before): Remove.
1741 (dtable::need_fixup_before): Remove.
1742 (dtable::fixup_before_exec): Remove declaration.
1743 (dtable::fixup_before_fork): Ditto.
1744 * fhandler.h (fhandler_base::fixup_before_fork_exec): Remove.
1745 (fhandler_base::need_fixup_before): Remove.
1746 * fork.cc (frok::parent): Drop fixup_before handling.
1747 * spawn.cc (spawn_guts): Ditto.
1749 2008-04-30 Corinna Vinschen <corinna@vinschen.de>
1751 * mount.cc (is_unc_share): Allow \\?\ prefix as well. Enhance comment.
1752 (mount_info::from_fstab): Remove patch from 2008-04-29.
1754 * mount.cc (mount_info::conv_to_posix_path): Simplify test for native
1756 * path.cc (normalize_win32_path): Ditto.
1757 (symlink_worker): Ditto.
1758 (symlink_info::posixify): Ditto.
1759 (cygwin_conv_path): Ditto.
1761 2008-04-29 Corinna Vinschen <corinna@vinschen.de>
1763 * mount.cc (mount_info::from_fstab): Skip native path prefix in
1766 2008-04-29 Corinna Vinschen <corinna@vinschen.de>
1768 * syscalls.cc (rename): Use volume serial numbers stored in path_conv
1769 rather than fetching them here for the "same file" test. Change
1770 comment to reflect this.
1772 2008-04-28 Corinna Vinschen <corinna@vinschen.de>
1774 * path.cc (symlink_info::check): Avoid special handling for
1775 STATUS_BUFFER_OVERFLOW when calling NtQueryDirectoryFile.
1776 * strace.cc (strace::vprntf): Use bigger buffer.
1778 2008-04-28 Corinna Vinschen <corinna@vinschen.de>
1780 * kernel32.cc (CreateFileMappingW): Remove stray small_printf.
1782 2008-04-28 Corinna Vinschen <corinna@vinschen.de>
1784 * autoload.cc (IsWow64Process): Remove.
1785 (Wow64DisableWow64FsRedirection): Remove.
1786 (Wow64RevertWow64FsRedirection): Remove.
1787 * ntdll.h (enum _PROCESSINFOCLASS): Define ProcessWow64Information.
1788 * init.cc (respawn_wow64_process): Use NtQueryInformationProcess to
1790 * wincap.cc (wincapc::init): Ditto.
1791 * wincap.h (wincapc::wow64): Change type to ULONG.
1793 2008-04-27 Corinna Vinschen <corinna@vinschen.de>
1795 * wincap.h (wincapc::wow64): Change type to BOOL.
1796 * wincap.cc: Remove explicit use of this pointer in wincapc methods.
1797 (wincapc::init): Fix bug in IsWow64Process handling.
1799 2008-04-26 Corinna Vinschen <corinna@vinschen.de>
1801 * dcrt0.cc (dll_crt0_0): Set SEM_NOGPFAULTERRORBOX error mode, too,
1802 to accommodate Vista/Longhorn.
1803 * spawn.cc (spawn_guts): Move check for CREATE_SUSPENDED condition
1804 after the call to ch.set() since it depends on it.
1806 2008-04-25 Corinna Vinschen <corinna@vinschen.de>
1808 * Makefile.in (install): Drop install rules for postinstall script.
1810 2008-04-25 Corinna Vinschen <corinna@vinschen.de>
1812 * postinstall: Remove (Moved to base-cygwin package).
1814 2008-04-25 Corinna Vinschen <corinna@vinschen.de>
1816 * fhandler.cc (fhandler_base::open): Move handling FILE_ATTRIBUTE_NORMAL
1817 back to its old place. Or it to file_attributes instead of setting it.
1819 2008-04-25 Corinna Vinschen <corinna@vinschen.de>
1821 * fhandler.cc (fhandler_base::open): *Only* handle SYSTEM and HIDDEN
1822 attributes in FILE_OVERWRITE case.
1824 2008-04-25 Corinna Vinschen <corinna@vinschen.de>
1826 * fhandler.cc (fhandler_base::open): Handle SYSTEM and HIDDEN attributes
1827 in FILE_OVERWRITE case as well.
1829 2008-04-24 Corinna Vinschen <corinna@vinschen.de>
1831 * fhandler_disk_file.cc (fhandler_base::fstat_helper): Disable calling
1832 pc.ndisk_links. Just use nNumberOfLinks instead.
1834 2008-04-24 Corinna Vinschen <corinna@vinschen.de>
1836 * fhandler_disk_file.cc (fhandler_base::utimens_fs): Fix typo in
1839 2008-04-24 Corinna Vinschen <corinna@vinschen.de>
1841 * cygwin.din (futimens): Export.
1842 (utimensat): Export.
1843 * fhandler.cc (fhandler_base::utimens): Replace fhandler_base::utimes.
1845 * fhandler.h (class fhandler_base): Declare utimens_fs instead of
1846 utimes_fs, utimens instead of utimes.
1847 (class fhandler_disk_file): Declare utimens instead of utimes.
1848 * fhandler_disk_file.cc (fhandler_disk_file::utimens): Replace
1849 fhandler_disk_file::utimes.
1850 (fhandler_base::utimens_fs): Replace fhandler_base::utimes_fs.
1851 Implement tv_nsec handling according to SUSv4.
1852 * syscalls.cc (utimensat): New function.
1853 * times.cc (timespec_to_filetime): New function.
1854 (timeval_to_timespec): New function.
1855 (utimens_worker): Replace utimes_worker.
1856 (utimes): Convert timeval to timespec and call utimens_worker.
1858 (futimens): Take over implementation from futimes.
1859 (futimes): Convert timeval to timespec and call futimens.
1860 * winsup.h (timespec_to_filetime): Declare.
1861 * include/cygwin/version.h: Bump API minor number.
1862 * posix.sgml: Add SUSv4 section. Add futimens and utimensat to it.
1864 2008-04-24 Yaakov (Cygwin Ports) <yselkowitz@users.sourceforge.net>
1866 * include/wait.h: New file.
1868 2008-04-23 Corinna Vinschen <corinna@vinschen.de>
1870 * posix.sgml: Add openat, faccessat, fchmodat, fchownat, fstatat,
1871 futimesat, linkat, mkdirat, mkfifoat, mknodat, readlinkat, renameat,
1872 symlinkat, unlinkat to list of implemented Solaris functions.
1874 2008-04-23 Corinna Vinschen <corinna@vinschen.de>
1877 (faccessat): Export.
1881 (futimesat): Export.
1887 (readlinkat): Export.
1889 (symlinkat): Export.
1891 * path.cc (readlink): Align definition to POSIX.
1892 * syscalls.cc (gen_full_path_at): New static function.
1893 (faccessat): Implement.
1894 (fchmodat): Implement.
1895 (fchownat): Implement.
1896 (fstatat): Implement.
1897 (futimesat): Implement.
1898 (linkat): Implement.
1899 (mkdirat): Implement.
1900 (mkfifoat): Implement.
1901 (mknodat): Implement.
1902 (openat): Implement.
1903 (readlinkat): Implement.
1904 (renameat): Implement.
1905 (symlinkat): Implement.
1906 (unlinkat): Implement.
1907 * include/cygwin/version.h: Bump API minor number.
1909 2008-04-22 Corinna Vinschen <corinna@vinschen.de>
1911 * dcrt0.cc (dll_crt0_0): Move CWD initialization from here...
1912 (dll_crt0_1): ...to here.
1914 2008-04-22 Corinna Vinschen <corinna@vinschen.de>
1916 * cygwin.din (fmemopen): Export.
1917 (open_memstream): Export.
1918 * include/cygwin/version.h: Bump API minor number.
1920 2008-04-22 Corinna Vinschen <corinna@vinschen.de>
1922 * sec_auth.cc (create_token): Add integrity level SID to token on
1923 systems supporting that. Remove useless check for dynamically loading
1924 NtCreateToken function.
1925 * sec_helper.cc (mandatory_medium_integrity_sid): Define.
1926 (mandatory_high_integrity_sid): Define.
1927 (mandatory_system_integrity_sid): Define.
1928 * sec_helper.h (mandatory_medium_integrity_sid): Declare.
1929 (mandatory_high_integrity_sid): Declare.
1930 (mandatory_system_integrity_sid): Declare.
1932 2008-04-21 Corinna Vinschen <corinna@vinschen.de>
1934 * mount.cc (mount_info::init): Remove call to from_registry. Print
1935 message that fstab is missing.
1936 (mount_info::from_fstab): Use CYGWIN_INFO_CYGDRIVE_DEFAULT_PREFIX
1937 instead of constant string.
1938 (mount_info::read_mounts): Remove.
1939 (mount_info::from_registry): Remove.
1940 (mount_info::read_cygdrive_info_from_registry): Remove.
1941 * postinstall: Enable code to create fstab entries from old registry
1943 * registry.cc (reg_key::reg_key): Drop CYGWIN_INFO_CYGNUS_REGISTRY_NAME
1945 * shared_info.h (mount_info::read_mounts): Remove declaration.
1946 (mount_info::from_registry): Ditto.
1947 (mount_info::to_registry): Ditto.
1948 (mount_info::read_cygdrive_info_from_registry): Ditto.
1949 * winver.rc (CYGWIN_REGISTRY_KEY): Remove.
1950 (LegalCopyright): Fix to include 2008.
1951 (RegistryKey): Set to CYGWIN_INFO_CYGWIN_REGISTRY_NAME.
1952 * include/cygwin/version.h (CYGWIN_INFO_CYGNUS_REGISTRY_NAME): Remove.
1954 2008-04-21 Corinna Vinschen <corinna@vinschen.de>
1956 * kernel32.cc (CreateFileMappingW): Fix bug in reserve/commit handling.
1958 2008-04-21 Corinna Vinschen <corinna@vinschen.de>
1960 * Makefile.in (DLL_OFILES): Add kernel32.o.
1961 * autoload.cc (WSACloseEvent): Remove.
1962 (WSACreateEvent): Remove.
1963 * cygheap.cc (cygheap_init): Drop initializing shared_prefix.
1964 * cygheap.h (struct init_cygheap): Drop shared_prefix and
1965 shared_prefix_buf members.
1966 * fhandler_socket.cc (sock_shared_name): New static function.
1967 (search_wsa_event_slot): Convert name buffers to WCHAR. Call
1968 NtCreateMutant/NtOpenMutant to create mutexes in session local
1970 (fhandler_socket::init_events): Ditto. Fix debug output.
1971 (fhandler_socket::release_events): Close mutexes using NtClose.
1972 (fhandler_socket::dup): Ditto.
1973 * kernel32.cc: New file, implementing Win32 calls in a Cygwin-specific
1975 * mmap.cc (MapView): Make static.
1976 * ntdll.h: Fix status code sorting.
1977 (STATUS_OBJECT_NAME_EXISTS): Define.
1978 (SEMAPHORE_QUERY_STATE): Define.
1979 (CYG_SHARED_DIR_ACCESS): Define.
1980 (CYG_MUTANT_ACCESS): Define.
1981 (CYG_EVENT_ACCESS): Define.
1982 (CYG_SEMAPHORE_ACCESS): Define.
1983 (enum _PROCESSINFOCLASS): Define ProcessSessionInformation.
1984 (struct _PROCESS_SESSION_INFORMATION): Define.
1985 (NtCreateSemaphore): Declare.
1986 (NtOpenSemaphore): Declare.
1987 * flock.cc: Use CYG_xxx_ACCESS access masks where appropriate.
1988 * posix_ipc.cc (ipc_mutex_init): Use native functions to create mutex.
1989 Create in cygwin-shared subdir.
1990 (ipc_cond_init): Ditto for event.
1991 (ipc_mutex_close): Use NtClose.
1992 (ipc_cond_close): Ditto.
1993 (mq_open): Drop "cyg" prefix from mqh_uname.
1994 * shared.cc (CYG_SHARED_DIR_ACCESS): Drop definition here.
1995 (_cygwin_testing): Declare extern on file level.
1996 (get_shared_parent_dir): Change name of shared directory. Add name
1997 to api_fatal output.
1998 (get_session_parent_dir): New function.
1999 (shared_name): Simplify.
2000 (shared_info::initialize): Call get_session_parent_dir.
2001 * shared_info.h (get_session_parent_dir): Declare.
2002 * smallprint.cc (__small_vswprintf): Fix bug in multibyte string
2004 * thread.cc (semaphore::semaphore): Align semaphore name to object
2005 names in posix IPC functions.
2006 * include/cygwin/version.h (CYGWIN_VERSION_SHARED_DATA): Bump.
2008 2008-04-18 Corinna Vinschen <corinna@vinschen.de>
2010 Revert thinko in previous patch.
2011 * fhandler.h (struct wsa_event): Move back from wsa_event.h to here.
2012 * fhandler_socket.cc (NUM_SOCKS): Ditto.
2013 (wsa_events): Move back from cygwin_shared to here. Accommodate
2015 (socket_serial_number): Ditto.
2016 * shared_info.h: Accommodate above changes.
2017 * wsa_event.h: Remove.
2019 2008-04-18 Corinna Vinschen <corinna@vinschen.de>
2021 * fhandler.h (struct wsa_event): Move to wsa_event.h. Include
2022 wsa_event.h instead.
2023 * fhandler_socket.cc (NUM_SOCKS): Move to wsa_event.h.
2024 (wsa_events): Move from DLL shared area to cygwin_shared shared
2025 memory. Accommodate throughout.
2026 (socket_serial_number): Ditto.
2027 * fhandler_tape.cc (mt): Ditto.
2028 (mtinfo_init): Remove.
2029 (mt): Define as cygwin_shared->mt.
2030 * flock.cc (FLOCK_PARENT_DIR_ACCESS): Remove.
2031 (FLOCK_INODE_DIR_ACCESS): Move up in file.
2032 (FLOCK_MUTANT_ACCESS): Ditto.
2033 (FLOCK_EVENT_ACCESS): Ditto.
2034 (get_lock_parent_dir): Remove.
2035 (inode_t::inode_t): Call get_shared_parent_dir to get parent dir handle.
2036 Add a "flock-" prefix to file's lock directory name for clarity.
2037 * mtinfo.h (mtinfo_init): Drop declaration.
2038 * net.cc (last_used_bindresvport): Move from DLL shared area to
2039 cygwin_shared shared memory.
2040 (cygwin_bindresvport_sa): Accommodate above change.
2041 * sec_helper.cc (_everyone_sd): Move here from flock.cc.
2042 * security.h (SD_MIN_SIZE): Ditto.
2043 (everyone_sd): Ditto.
2044 * shared.cc (cygwin_shared_area): Remove.
2045 (cygwin_shared_h): New handle.
2046 (get_shared_parent_dir): New static function.
2047 (shared_name): Drop session_local argument. Call get_shared_parent_dir
2048 here. Add cygwin-shared subdir to object name.
2049 (offsets): Reinstantiate SH_CYGWIN_SHARED member.
2050 (open_shared): Revert change from 2007-03-29 for systems supporting
2051 SeCreateGlobalPrivilege.
2052 (shared_info::initialize): Call mtinfo's initialize here.
2053 (memory_init): Drop call to mtinfo_init.
2054 * shared_info.h (SHARED_INFO_CB): Accommodate change to shared_info.
2055 (CURR_SHARED_MAGIC): Ditto.
2056 (class shared_info): Add members for global socket and tape info
2058 (enum shared_locations): Reinstantiate SH_CYGWIN_SHARED.
2059 (get_shared_parent_dir): Declare.
2060 (shared_name): Drop session_local argument from declaration.
2061 * wsa_event.h: New file. Move definitions of NUM_SOCKS and
2062 struct wsa_event here.
2064 2008-04-18 Christopher Faylor <me+cygwin@cgf.cx>
2066 * autoload.cc (noload): Make sure this and succeeding functions are
2067 located in the text segment.
2069 2008-04-16 Corinna Vinschen <corinna@vinschen.de>
2071 * fhandler_socket.cc (fhandler_socket::close): Disable enforced
2072 lingering since the original problem can no longer be reproduced.
2074 2008-04-16 Corinna Vinschen <corinna@vinschen.de>
2076 * grp.cc (internal_getgroups): Drop local buf. Allocate groups
2077 directly using alloca.
2079 2008-04-14 Corinna Vinschen <corinna@vinschen.de>
2081 * postinstall: Fix copy/paste bug.
2083 2008-04-14 Corinna Vinschen <corinna@vinschen.de>
2085 * fhandler_disk_file.cc (fhandler_disk_file::readdir_helper): Fix
2086 thinko in UNC path handling.
2087 * path.cc (symlink_worker): Fix typo in comment. Fix UNC path handling.
2089 2008-04-13 Corinna Vinschen <corinna@vinschen.de>
2091 * fhandler_disk_file.cc (fhandler_disk_file::readdir_helper): Simplify
2092 code which checks for symlinks. Fix problem with UNC paths.
2094 * environ.cc (struct parse_thing): Remove transparent_exe option.
2095 * syscalls.cc (transparent_exe): Remove.
2096 (unlink): Always add stat_suffixes, drop transparent_exe check.
2100 * fhandler_disk_file.cc (fhandler_disk_file::link): Ditto.
2101 * fhandler_process.cc (fhandler_process::fill_filebuf): Always remove
2103 * path.cc (realpath): Never attach known_suffix.
2105 2008-04-10 Corinna Vinschen <corinna@vinschen.de>
2107 * cygwin.din (wprintf): Remove.
2109 * syscalls.cc (wprintf): Ditto.
2110 * include/cygwin/version.h: Add FIXME comment.
2112 2008-04-08 Corinna Vinschen <corinna@vinschen.de>
2114 * mount.cc (mount_info::from_fstab): Read user fstab files from
2115 /etc/fstab.d/$USER to avoid user write access to /etc.
2116 * postinstall: Use variables for filenames. Create /etc/fstab.d dir
2117 with 01777 permissions.
2119 2008-04-08 Corinna Vinschen <corinna@vinschen.de>
2121 * postinstall: Disable adding registry mounts to /etc/fstab for now.
2123 2008-04-07 Christopher Faylor <me+cygwin@cgf.cx>
2125 Remove unneeded header files from source files throughout.
2127 2008-04-07 Corinna Vinschen <corinna@vinschen.de>
2129 * postinstall: Add function print_flags and call where appropriate.
2130 Omit system and cygdrive flag when testing cygdrive flags.
2132 2008-04-07 Christopher Faylor <me+cygwin@cgf.cx>
2134 Add miscfuncs.h to files as needed throughout.
2135 * mount.cc: New file.
2136 * path.cc: Move mount-specific stuff into mount.cc. Move common stuff
2137 into miscfuncs.cc. Remove unneeded includes.
2138 * miscfuncs.cc: Move some common path functions here.
2139 * miscfuncs.h: New file.
2140 * winsup.h: Move miscelleneous functions to miscfuncs.h.
2141 * dcrt0.cc: Remove unneeded includes.
2142 * Makefile.in (DLL_OFILES): Add mount.o.
2144 * include/cygwin/config.h: Fix a minor typo.
2146 2008-04-07 Corinna Vinschen <corinna@vinschen.de>
2148 * postinstall: Set IFS to LF only. Change while loop in subshell to
2149 for loop in parent shell. Add code to read system mount points and
2150 system cygdrive prefix from registry and append them to /etc/fstab.
2152 2008-04-06 Corinna Vinschen <corinna@vinschen.de>
2154 * path.cc (struct opt): Rename "system" to "nouser".
2155 * postinsatll: Ditto.
2157 2008-04-05 Corinna Vinschen <corinna@vinschen.de>
2159 * postinstall: New script.
2160 * Makefile.in (sysconfdir): Define.
2161 (install): Create $(sysconfdir)/postinstall dir. Install postinstall
2164 * path.cc: Add temorary comments to note later function removal.
2165 (conv_fstab_spaces): New inline function to handle \040 to space
2167 (struct opt): Add "system" and "user" mount options.
2168 (mount_info::from_fstab_line): Only allow # to start a comment at
2169 the beginning of the line. Call conv_fstab_spaces on native_path and
2170 posix_path fields. Don't enforce system mounts in /etc/fstab.
2171 Drop last argument in call to add_item.
2172 (mount_info::from_fstab): Create a default cygdrive entry. Load
2173 user mount points from fstab.<username> instead of fstab.<sid>.
2174 (mount_info::read_mounts): Drop last argument in call to add_item.
2175 (mount_info::add_reg_mount): Remove.
2176 (mount_info::del_reg_mount): Remove.
2177 (mount_info::write_cygdrive_info): Rename from
2178 mount_info::write_cygdrive_info_to_registry. Don't write to registry.
2179 Disallow to overwrite a system cygdrive prefix.
2180 (mount_info::remove_cygdrive_info_from_registry): Remove.
2181 (mount_info::get_cygdrive_info): Just fetch current cygdrive prefix and
2183 (mount_info::add_item): Drop last argument. Don't write to registry.
2184 Disallow to overwrite a system mount point.
2185 (mount_info::del_item): Drop last argument. Don't write to registry.
2186 Disallow to remove a system mount point.
2187 (mount): Enforce user mount.
2188 (cygwin_umount): Ditto.
2189 * shared_info.h (mount_info::add_item): Drop last argument.
2190 (mount_info::del_item): Ditto.
2191 (mount_info::add_reg_mount): Remove.
2192 (mount_info::del_reg_mount): Remove.
2193 (mount_info::write_cygdrive_info): Rename from
2194 mount_info::write_cygdrive_info_to_registry.
2195 (mount_info::remove_cygdrive_info_from_registry): Remove.
2197 2008-04-03 Corinna Vinschen <corinna@vinschen.de>
2199 * path.cc (mount_info::from_fstab_line): Simplify. Recognize special
2200 "cygdrive" entry from FS type field.
2201 (mount_info::from_fstab): Create a default root dir.
2203 2008-04-03 Corinna Vinschen <corinna@vinschen.de>
2205 * dcrt0.cc (insert_file): Fix potential buffer overflow.
2207 2008-04-03 Corinna Vinschen <corinna@vinschen.de>
2209 * path.cc (mount_info::from_fstab): Get module path name of the Cygwin
2210 DLL, not the path of the application.
2212 2008-04-03 Corinna Vinschen <corinna@vinschen.de>
2215 * exceptions.cc (windows_system_directory): Make static. Convert to
2217 (_cygtls::inside_kernel): Accommodate above change. Check module
2218 path name for leading \\?\ and skip, if so.
2219 (try_to_debug): Call GetEnvironmentStringsW and convert evaluation to
2220 WCHAR to avoid truncated environment problem.
2221 (has_visible_window_station): Call GetUserObjectInformationW.
2222 (events_init): Accommodate above conversion of windows_system_directory.
2223 * init.cc (respawn_wow64_process): Use WCHAR functions to start new
2225 * net.cc (__dup_ent): Drop Windows 9x consideration.
2226 (load_ipv6_funcs): Use WCHAR functions to load IPv6 libs.
2227 * syscalls.cc (syscalls.cc): Remove call to GetDiskFreeSpace.
2229 2008-04-02 Corinna Vinschen <corinna@vinschen.de>
2231 * path.cc (mount_info::init): First try to fetch mount points from
2232 fstab files. Fallback to registry if none exists.
2233 (skip_ws): New inline function.
2235 (struct opt): New structure for mount options.
2236 (read_flags): New static function to convert a mount flags string into
2238 (mount_info::from_fstab_line): New method to create a mount table
2239 entry from a fstab line.
2240 (mount_info::from_fstab): New method to read fstab file.
2241 * shared_info.h (mount_info::from_fstab_line): Declare.
2242 (mount_info::from_fstab): Declare.
2244 2008-04-02 Corinna Vinschen <corinna@vinschen.de>
2246 * path.cc (enum symlink_t): Rename from shortcut_t.
2248 2008-04-02 Corinna Vinschen <corinna@vinschen.de>
2250 * path.cc (symlink_info::check_reparse_point): Use NtFsControlFile
2251 to read reparse points.
2252 (enum shortcut_t): New type.
2253 (symlink_info::check): Convert sym_check to shortcut_t. Use shortcut_t
2254 enum values throughout. Check reparse point before checking for
2255 sysfile shortcut. Open reparse points with READ_CONTROL only to
2256 accommodate special Vista reparse points. Add comments.
2258 2008-04-02 Corinna Vinschen <corinna@vinschen.de>
2260 * flock.cc (get_lock_parent_dir): Drop call to NtOpenDirectoryObject
2261 and utilize OBJ_OPENIF flag in call to NtCreateDirectoryObject.
2262 (inode_t::inode_t): Ditto. Same for NtOpenMutant/NtCreateMutant.
2264 2008-04-02 Corinna Vinschen <corinna@vinschen.de>
2266 * posix.sgml: Change lockf to being implemented.
2268 2008-04-02 Corinna Vinschen <corinna@vinschen.de>
2270 * dcrt0.cc (insert_file): Convert filename to WCHAR and call
2271 CreateFileW to allow UTF-8 filenames.
2273 2008-04-01 Corinna Vinschen <corinna@vinschen.de>
2275 * Fix copyright dates.
2277 2008-04-01 Corinna Vinschen <corinna@vinschen.de>
2279 Throughout, call fcntl64 instead of fcntl or fcntl_worker.
2280 * fcntl.cc (fcntl_worker): Remove.
2281 (fcntl64): Add fault handler. Move fcntl_worker stuff here. Add case
2282 for locking and call fhandler's lock method directly. Make sure that
2283 F_FLOCK flag isn't set in lock call.
2284 (_fcntl): Add fault handler.
2285 * fhandler.cc (fhandler_base::fcntl): Drop lock cases.
2286 * flock.cc (flock): Add fault handler. Simplify code. Call fhandlers
2287 lock method directly instead of fcntl_worker. Add debug output.
2288 (lockf): Add fault handler. Call fhandlers lock method directly
2289 instead of fcntl_worker. Add debug output.
2290 * winsup.h (fcntl_worker): Drop declaration.
2293 2008-03-31 Corinna Vinschen <corinna@vinschen.de>
2295 * smallprint.cc (__small_vswprintf): Fix uninitialized usage of `w'.
2297 Revamp advisory file locking to avoid cross reference pointers as well
2298 as to allow BSD flock semantics. More agressively delete unused nodes
2300 * fhandler.h (fhandler_base::ino): Rename from namehash. Fix comment.
2301 (fhandler_base::node): Remove.
2302 (fhandler_base::unique_id): Add.
2303 (fhandler_base::del_my_locks): New method.
2304 (get_ino): Rename from get_namehash. Change usage throughout Cygwin.
2305 (get_unique_id): New method.
2306 * fhandler.cc (fhandler_base::close): Call own del_my_locks method.
2308 (fhandler_base::fhandler_base): Accommodate new and changed members.
2309 (fhandler_base::fixup_after_fork): Call del_my_locks.
2310 (fhandler_base::fixup_after_exec): Ditto for files with close-on-exec
2312 * fhandler_disk_file.cc (get_ino_by_handle): Rename from
2313 readdir_get_ino_by_handle. Accommodate throughout.
2314 (fhandler_base::open_fs): Fill ino with inode number if FS has good
2315 inodes. Allocate a LUID and store in unique_id to recognize file
2316 descriptors referencing the same file object.
2317 * flock.cc: Drop flock TODO comments. Use explicit types __dev32_t
2318 and __ino64_t instead of dev_t and ino_t.
2319 (LOCK_OBJ_NAME_LEN): Change to reflect longer lf_id length.
2320 (get_obj_handle_count): New method.
2321 (lockf_t::lf_id): Change type to long long.
2322 (inode_t::get_lock_obj_handle_count): Drop in favor of static function
2323 get_obj_handle_count.
2324 (inode_t::del_locks): Remove.
2325 (inode_t::get): Add create_if_missing flag argument.
2326 (inode_t::del_my_locks): Reimplement to handle POSIX and BSD flock
2327 locks. Return if node can be deleted or not.
2328 (inode_t::~inode_t): Ditto. Close handles to i_dir and i_mtx.
2329 (fixup_lockf_after_fork): Remove.
2330 (fhandler_base::del_my_locks): New method.
2331 (fixup_lockf_after_exec): Check if node can be deleted.
2332 (inode_t::get): Only create node if create_if_missing is set. Lock
2333 the returned node here before unlocking the node list.
2334 (inode_t::get_all_locks_list): Accommodate new lf_id length.
2335 (inode_t::create_lock_obj): Ditto.
2336 (lockf_t::open_lock_obj): Ditto. Change return type to bool. De-const.
2337 Set lf_obj instead of returning a handle.
2338 (lockf_t::del_lock_obj): Call SetEvent only if new incoming parameters
2339 allow it. Explain how it's supposed to work.
2340 (fhandler_disk_file::lock): Only fetch file length in SEEK_END case.
2341 Use NtQueryInformationFile(FileStandardInformation) instead of
2342 calling fstat_by_handle. Always unlock node before returning.
2343 Use fhandler's unique id to create lf_id for BSD flock locks.
2344 Rely on node lock from inode_t::get. Call del_lock_obj on removed
2345 locks here to allow explicit unlocking. Delete node if no lock exists
2346 on the file anymore.
2347 (lf_setlock): Get file handle as additional parameter. Handle the fact
2348 that lf_getblock now always opens the attached event object. Reactivate
2349 erroneously applied patch which deactivates setting thread priority.
2350 Additionally handle blocking on BSD flock locks.
2351 (lf_clearlock): Get file handle as additional parameter.
2352 (lf_getlock): Close event handle opened by lf_getblock.
2353 (lf_getblock): Open potentially blocking event object here and check
2354 its signal state if it's a BSD flock lock.
2355 (lf_wakelock): Get file handle as additional parameter.
2356 * fork.cc (frok::child): Drop call to fixup_lockf_after_fork.
2357 * ntdll.h (struct _EVENT_BASIC_INFORMATION): Define.
2358 (enum _EVENT_INFORMATION_CLASS): Define.
2359 (NtQueryEvent): Declare.
2361 * fhandler.h (fhandler_base::fs_flags): Remove.
2362 (fhandler_base::set_fs_flags): Remove.
2363 (fhandler_base::get_fs_flags): Remove.
2364 * fhandler.cc (fhandler_base::write): Check for sparse file using
2366 * fhandler_disk_file.cc (fhandler_disk_file::ftruncate): Ditto.
2368 The return of the volume serial number in fs_info.
2369 * fhandler.h (get_dev): New method.
2370 * fhandler_disk_file.cc (fhandler_base::fstat_by_handle): Drop call to
2371 NtQueryVolumeInformationFile(FileFsVolumeInformation). Just use
2373 * fhandler_fifo.cc (fhandler_fifo::open) Use device ID and inode number
2374 to generate fifo name.
2375 * path.h (fs_info::sernum): New member.
2376 (fs_info::serial_number): New method.
2377 (path_conv::fs_serial_number): New method.
2378 * path.cc (fs_info::update): Fetch volume serial number and store in
2381 2008-03-28 Corinna Vinschen <corinna@vinschen.de>
2383 * flock.cc (lockf_t::operator new): Add operator taking a pointer. Call
2384 cmalloc instead of ccalloc in the default operator. Add comments.
2385 (inode_t::operator new): Call cmalloc instead of ccalloc.
2386 (inode_t::get_all_locks_list): Return lockf_t pointer.
2387 (inode_t::del_all_locks_list): Delete. Remove calls throughout.
2388 (inode_t::get): Handle failing new gracefully.
2389 (MAX_LOCKF_CNT): Define.
2390 (inode_t::get_all_locks_list): Use pre-allocated buffer in i_all_lf
2391 instead of allocating every lock. Return pointer to start of linked
2393 (lockf_t::open_lock_obj): Create event object non-inheritable.
2394 (fhandler_disk_file::lock): Handle failing new gracefully.
2395 (lf_setlock): Allocate temporary buffer for node->i_all_lf from TLS.
2396 Remove erroneous NtClose call.
2397 (lf_getlock): Allocate temporary buffer for node->i_all_lf from TLS.
2398 (lf_getblock): Set lf to return value of get_all_locks_list.
2400 2008-03-27 Corinna Vinschen <corinna@vinschen.de>
2402 * flock.cc (FLOCK_PARENT_DIR_ACCESS): Define.
2403 (FLOCK_INODE_DIR_ACCESS): Define.
2404 (FLOCK_MUTANT_ACCESS): Define.
2405 (FLOCK_EVENT_ACCESS): Define.
2406 (SD_MIN_SIZE): Define.
2407 (everyone_sd): Define to simplify calling _everyone_sd.
2408 (_everyone_sd): Replace everyone_sync_sd. Take SECURITY_DESCRIPTOR as
2409 argument and allow to specify access mask.
2410 (get_lock_parent_dir): Open/Create parent dir with
2411 FLOCK_PARENT_DIR_ACCESS. Add text to api_fatal message.
2412 (inode_t::inode_t): Open/Create dir with FLOCK_INODE_DIR_ACCESS.
2413 Open/Create mutant with FLOCK_MUTANT_ACCESS. Add text to api_fatal
2415 (lockf_t::create_lock_obj): Create event with FLOCK_EVENT_ACCESS.
2416 Add text to api_fatal message.
2417 (lockf_t::open_lock_obj): Open event with FLOCK_EVENT_ACCESS.
2418 On failure, just return NULL pointer instead of calling api_fatal.
2419 (lockf_t::get_lock_obj_handle_count): Replace call to small_printf
2420 with call to debug_printf.
2421 (lf_setlock): Handle a failure to open the lock event object as
2422 EDEADLK. Call system_printf if opening sync objects fail.
2423 * ntdll.h (DIRECTORY_TRAVERSE): Define.
2424 (DIRECTORY_CREATE_OBJECT): Define.
2425 (DIRECTORY_CREATE_SUBDIRECTORY): Define.
2426 (EVENT_QUERY_STATE): Define.
2428 2008-03-27 Corinna Vinschen <corinna@vinschen.de>
2430 * syscalls.cc (rename): Fix setting errno in case of trailing "/."
2432 2008-03-27 Corinna Vinschen <corinna@vinschen.de>
2434 * fhandler_socket.cc: Create shared objects session local throughout.
2435 * shared.cc (shared_name): Add argument to allow opening session
2436 local shared memory.
2437 * shared_info.h (shared_name): Change declaration accordingly.
2439 2008-03-26 Christopher Faylor <me+cygwin@cgf.cx>
2441 Implement method of detecting a missing dll as suggested by Brian
2443 * hookapi.cc (find_first_notloaded_dll): New function.
2444 * pinfo.cc (status_exit): New function. Issue message when dll not
2445 found. Use find_first_notloaded_dll to find a nonexistent dll.
2446 (pinfo::maybe_set_exit_code_from_windows): Call status_exit when exit
2447 code >= 0xc0000000UL.
2448 * sigproc.cc (child_info::proc_retry): Return exit code when
2449 STATUS_DLL_NOT_FOUND.
2450 * spawn.cc (spawn_guts): Minor cleanup.
2451 * syscalls.cc (close_all_files): Don't actually close stderr
2452 filehandle. Just make it noninheritable.
2453 * winsup.h (find_first_notloaded_dll): Declare new function.
2455 2008-03-26 Brian Dessent <brian@dessent.net>
2457 * ntdll.h: Add several missing NTSTATUS defines.
2459 2008-03-24 Corinna Vinschen <corinna@vinschen.de>
2461 * flock.cc (inode_t::get_all_locks_list): Don't allow F_WAIT flag
2462 in lock event object name.
2463 (lockf_t::create_lock_obj): Ditto.
2464 (lockf_t::open_lock_obj): Ditto.
2465 (lf_setlock): Only check POSIX locks for deadlock condition.
2466 (lf_findoverlap): Don't let POSIX and flock locks interact.
2468 2008-03-24 Corinna Vinschen <corinna@vinschen.de>
2470 * flock.cc: Clarify a couple of comments.
2471 (lf_setlock): Treat not being able to sync on a process as a potential
2472 deadlock situation. Close process handle using CloseHandle.
2474 2008-03-24 Corinna Vinschen <corinna@vinschen.de>
2476 * flock.cc: Fix typo in comment.
2478 2008-03-24 Corinna Vinschen <corinna@vinschen.de>
2480 * fhandler.cc (fhandler_base::dup): Drop setting flags in the parent.
2482 Implement advisory file locking.
2483 * cygheap.h (struct init_cygheap): Add inode_list member.
2484 * cygwin.din (lockf): Export.
2485 * dcrt0.cc (child_info_spawn::handle_spawn): Call
2486 fixup_lockf_after_exec.
2487 * dtable.h (class dtable): Add fhandler_disk_file as friend class.
2488 * fhandler.cc (fhandler_base::close): Call del_my_locks if node is set.
2489 (fhandler_base::fhandler_base): Initialize node to NULL.
2490 (fhandler_base::fixup_after_fork): Ditto.
2491 * fhandler.h (class fhandler_base): Add member node.
2492 * fhandler_disk_file.cc (fhandler_disk_file::lock): Delete.
2493 * flock.cc: Implement all advisory file locking here.
2494 (fhandler_disk_file::lock): Implement here.
2495 (flock): Call fcntl with F_FLOCK bit set. Remove test main function.
2496 (lockf): New function.
2497 * fork.cc (frok::child): Call fixup_lockf_after_fork.
2498 * ntdll.h (DIRECTORY_ALL_ACCESS): Define.
2499 (struct _OBJECT_BASIC_INFORMATION): Define.
2500 (enum _EVENT_TYPE): Define.
2501 (NtCreateDirectoryObject): Declare.
2502 (NtCreateEvent): Declare.
2503 (NtCreateMutant): Declare.
2504 (NtOpenEvent): Declare.
2505 (NtOpenMutant): Declare.
2506 * include/cygwin/version.h: Bump API minor number.
2508 2008-03-22 Christopher Faylor <me+cygwin@cgf.cx>
2510 * dtable.cc (handle_to_fn): Modify to return true if handle represents
2512 (dtable::init_std_file_from_handle): Detect when we've seen a cygwin
2513 pipe and use it in overlapped mode by default.
2514 (decode_tty): Make static.
2516 2008-03-22 Christopher Faylor <me+cygwin@cgf.cx>
2518 * dtable.cc: Define various device-related string constants as wide
2519 character constants.
2520 (dtable::init_std_file_from_handle): Reorganize pipe handling to try to
2521 catch special tty case.
2522 (build_fh_name_worker): Declare for common use.
2523 (build_fh_name): Define char version.
2524 (build_fh_name): Define (currently unused) UNICODE_STRING version.
2525 (decode_tty): Detect if pipe is actually a cygwin tty, returning the
2526 tty name in the buffer.
2527 (handle_to_fn): Reorganize to use wide characters.
2528 * dtable.h (build_fh_name): Declare (currently unused) UNICODE_STRING
2530 * fhandler_tty.cc (fhandler_pty_master::setup): Use
2531 fhandler_pipe::create_selectable to create a pipe with a given name.
2532 * pipe.cc (pipe_handler): Make returned handle inheritable.
2533 (fhandler_pipe::create_selectable): Take an optional name. Use a
2534 standard cygwin introducer for the name.
2536 * path.cc (path_conv::check): Make first argument const.
2537 * path.h (path_conv::check): Ditto for declaration.
2538 (path_conv::path_conv): Ditto for UNICODE_STRING version.
2540 2008-03-18 Corinna Vinschen <corinna@vinschen.de>
2542 * include/sys/cygwin.h: Revert erroneous move of `#ifdef WINVER' to
2545 2008-03-14 Corinna Vinschen <corinna@vinschen.de>
2547 * fcntl.cc (fcntl_worker): Protect with a 'myfault'.
2549 * path.cc (normalize_posix_path): Treat X:/ as Win32 path, too.
2551 * smallprint.cc (__wrn): New static function.
2552 (__small_vswprintf): New function to generate WCHAR strings.
2553 (__small_swprintf): Ditto.
2554 * winsup.h (__small_swprintf): Declare.
2555 (__small_vswprintf): Declare.
2557 2008-03-13 Corinna Vinschen <corinna@vinschen.de>
2559 * path.sgml: Remove documentation for old path API. Add documentation
2561 * security.sgml: New file to document cygwin_set_impersonation_token
2562 and cygwin_logon_user with only eight years of delay.
2563 * shared.sgml: Remove file.
2564 * include/sys/cygwin.h (cygwin32_attach_handle_to_fd): Move declaration
2565 into fully deprecated function block.
2566 (cygwin_logon_user): Move declaration down to declaration of
2567 cygwin_set_impersonation_token.
2569 2008-03-12 Corinna Vinschen <corinna@vinschen.de>
2571 * syscalls.cc (rename): Just return with 0 if filenames are identical,
2572 per POSIX. Drop comment added in previous patch.
2574 2008-03-12 Corinna Vinschen <corinna@vinschen.de>
2576 * syscalls.cc (rename): Handle a special case of trying to rename a
2579 2008-03-12 Corinna Vinschen <corinna@vinschen.de>
2581 * environ.h: Fix comment.
2582 * winsup.h: Ditto. Reflect the fact that CYG_MAX_PATH is deprecated.
2584 2008-03-12 Corinna Vinschen <corinna@vinschen.de>
2586 * pipe.cc (fhandler_pipe::create_selectable): Use MAX_PATH instead of
2588 * tty.cc (tty_list::init_session): Ditto.
2589 (tty::alive): Ditto.
2590 (tty::open_mutex): Ditto.
2591 (tty::create_inuse): Ditto.
2592 (tty::get_event): Ditto.
2594 2008-03-12 Corinna Vinschen <corinna@vinschen.de>
2596 * fhandler_disk_file.cc (fhandler_disk_file::readdir_helper): Disable
2597 munging. Convert all chars in the 0xf0xx area to it's ascii equivalent.
2598 * path.cc (normalize_posix_path): Don't treat "X:foo" as windows path,
2600 (tfx_chars): New transformation table for special DOS chars.
2601 (tfx_chars_managed): Ditto, plus transformation of uppercase ASCII
2603 (transform_chars): New function.
2604 (get_nt_native_path): Make static. Call transform_chars for all valid
2605 FS paths. Get additional flag if file is managed or not. Accommodate
2607 (getfileattr): Get additional flag if file is managed or not.
2608 Accommodate throughout.
2609 (path_conv::check): Disable special handling for trailing dots and
2611 (mount_item::build_win32): Disable code for managed paths.
2612 (mount_info::conv_to_posix_path): Ditto.
2613 * path.h (get_nt_native_path): Remove declaration.
2615 2008-03-12 Corinna Vinschen <corinna@vinschen.de>
2617 * fhandler_disk_file.cc (fhandler_disk_file::readdir_helper): Don't
2618 copy filename twice in the non-managed case.
2620 2008-03-12 Corinna Vinschen <corinna@vinschen.de>
2622 * winsup.h (NT_MAX_PATH): Revert ill-advised change to 32767.
2623 Accommodate change throughout.
2625 * cygwin.din (cygwin_conv_path): Export.
2626 (cygwin_conv_path_list): Export.
2627 (cygwin_create_path): Export.
2628 * dcrt0.cc (dll_crt0_1): Use cygwin_conv_path.
2629 * dtable.cc (handle_to_fn): Ditto. Don't expect UNICODE_STRING being
2631 * environ.cc (env_plist_to_posix): New helper function.
2632 (env_plist_to_win32): Ditto.
2633 (env_path_to_posix): Ditto.
2634 (env_path_to_win32): Ditto.
2635 (return_MAX_PATH): Remove.
2636 (conv_envvars): Use new helper functions. Drop removed members.
2637 (win_env::operator =): Accommodate removal of path length functions.
2638 (win_env::add_cache): Accommodate new env helper function API.
2640 * environ.h (struct win_env): Ditto. Remove path length function
2641 pointers since they are unused.
2642 * path.cc (warn_msdos): Use cygwin_conv_path.
2643 (getfileattr): Use new tmp_pathbuf::u_get method.
2644 (fillout_mntent): Ditto.
2645 (symlink_info::check): Ditto.
2646 (path_conv::check): Use sizeof (WCHAR) instead of constant 2.
2647 (symlink_info::check_reparse_point): Ditto.
2648 (conv_path_list): Get max size of target string as argument. Call
2649 cygwin_conv_path as helper function.
2650 (cygwin_conv_path): New function.
2651 (cygwin_create_path): New function.
2652 (cygwin_conv_to_win32_path): Just call cygwin_conv_path with size set
2654 (cygwin_conv_to_full_win32_path): Ditto.
2655 (cygwin_conv_to_posix_path): Ditto.
2656 (cygwin_conv_to_full_posix_path): Ditto.
2657 (conv_path_list_buf_size): Add FIXME comment.
2658 (env_PATH_to_posix): Rename from env_win32_to_posix_path_list.
2659 Add size argument as required for env helper functions.
2660 (cygwin_win32_to_posix_path_list): Call conv_path_list with size set to
2662 (cygwin_posix_to_win32_path_list): Ditto.
2663 (cygwin_conv_path_list): New function.
2664 (cwdstuff::get): Fix length argument in call to sys_wcstombs.
2665 * spawn.cc (find_exec): Use cygwin_conv_path_list.
2666 * tls_pbuf.h (tmp_pathbuf::u_get: New method.
2667 * uinfo.cc (cygheap_user::ontherange): Allocate temporary path buffers
2668 using tmp_pathbuf. Use cygwin_conv_path.
2669 * winf.cc (av::unshift): Use cygwin_conv_path.
2670 * include/cygwin/version.h: Bump API minor number.
2671 * include/sys/cygwin.h: Comment out old cygwin32_XXX API.
2672 Mark old path handling API as deprecated.
2673 (cygwin_conv_path_t): Typedef. Define values.
2674 (cygwin_conv_path): Declare.
2675 (cygwin_create_path): Declare.
2676 (cygwin_conv_path_list): Declare.
2678 2008-03-11 Corinna Vinschen <corinna@vinschen.de>
2680 * dlfcn.cc (get_full_path_of_dll): Allow paths up to PATH_MAX.
2681 (dlopen): Call get_full_path_of_dll with path buffer allocate by
2684 2008-03-11 Corinna Vinschen <corinna@vinschen.de>
2686 * spawn.cc (find_exec): Use tmp_pathbuf to allocate path buffer.
2688 2008-03-11 Corinna Vinschen <corinna@vinschen.de>
2690 * dtable.cc (dtable::init_std_file_from_handle): Use tmp_pathbuf to
2691 allocate path buffer.
2692 (handle_to_fn): Ditto. Allocate fnbuf big enough to get long path
2695 2008-03-11 Corinna Vinschen <corinna@vinschen.de>
2697 * path.cc (cwdstuff::set): Make sure drive_length is 0 for virtual
2698 paths. Add comments.
2699 * spawn.cc (spawn_guts): Don't allow to start a native Win32 application
2700 from a long path or a virtual path. Print an error message to stderr.
2702 2008-03-11 Corinna Vinschen <corinna@vinschen.de>
2704 * environ.cc (parse_options): Use tmp_pathbuf to allocate buffer.
2705 (regopt): Take tmp buffer as additional argument.
2706 (environ_init): Alllcate tmpbuf earlier. Use as temporary buffer in
2708 * tls_pbuf.cc (tmp_pathbuf::c_get): Allocate one additional char.
2709 (tmp_pathbuf::w_get): Allocate one additional WCHAR.
2710 * winf.cc (av::unshift): Use tmp_pathbuf to allocate buffer.
2712 2008-03-11 Corinna Vinschen <corinna@vinschen.de>
2714 * syscalls.cc (sync): Use MAX_PATH rather than CYG_MAX_PATH.
2716 2008-03-10 Corinna Vinschen <corinna@vinschen.de>
2718 * fhandler.h (class fhandler_console): Add write_buf as pointer to
2719 temporary buffer space.
2720 * fhandler_console.cc (CONVERT_LIMIT): Define as NT_MAX_PATH. Add
2722 (fhandler_console::write_normal): Use write_buf throughout.
2723 (fhandler_console::write): Use tmp_pathbuf to allocate write_buf.
2725 2008-03-10 Corinna Vinschen <corinna@vinschen.de>
2727 * fhandler_console.cc (fhandler_console::write_normal): Don't print
2728 chars marked as ERR chars.
2730 2008-03-10 Corinna Vinschen <corinna@vinschen.de>
2732 * fhandler.h (dev_console::con_to_str): Declare returning DWORD.
2733 * fhandler_console.cc (dev_console::con_to_str): Return number of
2734 multibyte char bytes.
2735 (fhandler_console::read): Set nread to number of multibyte char bytes
2736 returned from con_to_str.
2737 (fhandler_console::write_normal): Reorder trunc buffer preocessing.
2738 Return after writing valid multibyte sequence out of trunc buffer.
2739 Change comments slightly.
2741 2008-03-08 Corinna Vinschen <corinna@vinschen.de>
2743 * fhandler_disk_file.cc (DIR_BUF_SIZE): Define required space for file
2744 name in terms of sizeof(WCHAR).
2745 (fhandler_disk_file::readdir_helper): Convert *all* of fname.
2746 * path.cc (fillout_mntent): Use tmp_pathbuf for path buffer.
2747 (symlink_worker): Ditto.
2748 (SCAN_JUSTCHECKTHIS): New state for suffix_scan to define
2749 that only the actual name gets cheked and a suffix is never attached.
2750 (suffix_scan::has): If filename + suffix would be > NAME_MAX, start
2751 in SCAN_JUSTCHECKTHIS state.
2752 (suffix_scan::next): Add case for SCAN_JUSTCHECKTHIS.
2753 (symlink_info::check): Use tmp_pathbuf for path buffer. Goto
2754 file_not_symlink in case of invalid file name.
2755 (realpath): Use tmp_pathbuf for path buffer.
2757 2008-03-07 Brian Dessent <brian@dessent.net>
2759 * dtable.cc (handle_to_fn): Null-terminate posix_fn in the case
2760 of justslash = true.
2762 2008-03-07 Brian Dessent <brian@dessent.net>
2764 * fhandler.cc (fhandler_base::open): Use %S for PUNICODE_STRING.
2765 * syscalls.cc (setmode): Ditto.
2767 2008-03-07 Corinna Vinschen <corinna@vinschen.de>
2769 * fhandler_socket.cc (fhandler_socket::sendto): Never send more than
2770 64K. Add comment to explain why.
2771 (fhandler_socket::sendmsg): Ditto.
2773 2008-03-07 Corinna Vinschen <corinna@vinschen.de>
2775 * Makefile.in (DLL_OFILES): Add tls_pbuf.o.
2776 * autoload.cc (CreateDesktopW): Replace CreateDesktopA.
2777 (CreateWindowStationW): Replace CreateWindowStationA.
2778 (GetUserObjectInformationW): Replace GetUserObjectInformationA.
2779 * cygheap.h (cwdstuff::get): Assume default buffer size NT_MAX_PATH.
2780 * cygtls.cc (_cygtls::remove): Free temporary TLS path buffers.
2781 * cygtls.h (TP_NUM_C_BUFS): Define.
2782 (TP_NUM_W_BUFS): Define.
2783 (class tls_pathbuf): New class to store pointers to thread local
2784 temporary path buffers.
2785 (_local_storage::pathbufs): New member.
2786 * environ.cc (win_env::add_cache): Use temporary TLS path buffer instead
2787 of stack based buffer.
2788 (posify): Get temporary outenv buffer from calling function.
2789 (environ_init): Create temporary TLS path buffer for posify.
2790 (build_env): Create Windows environment block as WCHAR buffer.
2791 * environ.h (build_env): Change declaration accordingly.
2792 * external.cc (sync_winenv): Accommodate build_env change.
2793 * fhandler_console.cc (fhandler_console::need_invisible): Use
2794 GetUserObjectInformationW and CreateWindowStationW.
2795 * fhandler_process.cc (format_process_maps): Use temporary TLS path
2796 buffer instead of stack based buffer.
2797 * fork.cc (frok::parent): Convert to use CreateProcessW.
2798 * path.cc: Throughout use temporary TLS path buffers instead of stack
2799 based buffer. Replace checks for CYG_MAX_PATH by checks for
2801 (getfileattr): New function to replace GetFileAttributesA.
2802 (normalize_win32_path): Remove Win32 and NT long path prefixes.
2803 (getwd): Assume PATH_MAX + 1 buffer per SUSv3.
2804 * path.h (class path_conv): Set path buffer to size NT_MAX_PATH.
2806 * pinfo.cc (commune_process): Use temporary TLS path buffer instead of
2808 * registry.cc (get_registry_hive_path): Ditto.
2809 (load_registry_hive): Ditto.
2810 * spawn.cc (spawn_guts): Convert to use CreateProcessW and
2811 CreateProcessAsUserW.
2812 (av::fixup): Open/close file using NtOpenFile/NtClose.
2813 * syscalls.cc (mknod_worker): Allow PATH_MAX file name.
2815 (getusershell): Ditto.
2816 * tls_pbuf.cc: New file implementing tls_pathbuf and tmp_pathbuf
2818 * tls_pbuf.h: New header for files using tmp_pathbuf.
2819 * tlsoffsets.h: Regenerate.
2820 * winsup.h (NT_MAX_PATH): Define as 32767 to avoid USHORT overflow.
2822 2008-03-06 Corinna Vinschen <corinna@vinschen.de>
2824 * child_info.h (CURR_CHILD_INFO_MAGIC): Reset.
2826 2008-03-06 Corinna Vinschen <corinna@vinschen.de>
2828 * fhandler.cc (fhandler_base::open_): Add missing test for O_CREAT.
2831 2008-03-05 Corinna Vinschen <corinna@vinschen.de>
2833 * child_info.h (~child_info_spawn): Check moreinfo->myself_pinfo for
2834 NULL before closing.
2835 * spawn.cc (spawn_guts): Don't close moreinfo->myself_pinfo explicitely
2836 in case of failing CloseProcess.
2838 * fhandler.cc (fhandler_base::open_): Return EISDIR when trying to
2840 * path.cc (path_conv::check): If input path had a trailing dir
2841 separator, tack it on to the native path if directory doesn't exist.
2843 2008-03-02 Christopher Faylor <me+cygwin@cgf.cx>
2845 * cygtls.cc (_cygtls::init_exception_handler): Semi-revert to making
2846 only ourselves the exception handler and nothing else.
2847 * exceptions.cc (open_stackdumpfile): Use correct format specifiers for
2848 unicode when printing the name of the stackdump file.
2849 (stack_info::walk): Stop walking if ebp points into cygwin itself.
2850 (_cygtls::handle_exceptions): Detect when signal is masked and treat as
2851 if it was not caught. Reinitialize exception handler to known state to
2852 avoid subsequent attempts to call Windows exception handlers if an
2853 exception occurs in a signal handler. Revert to a 'return 0' rather
2856 * strfuncs.cc (sys_wcstombs_alloc): Minor formatting tweak.
2857 * winsup.h: Fix comment typo.
2859 2008-03-02 Christopher Faylor <me+cygwin@cgf.cx>
2861 * smallprint.cc (__small_vsprintf): Free allocated buffer rather than
2862 pointer into the buffer.
2864 2008-03-01 Christopher Faylor <me+cygwin@cgf.cx>
2866 * cygtls.h (_cygtls::handle_threadlist_exception): Eliminate.
2867 (_cygtls::init_threadlist_exceptions): Ditto.
2868 * cygtls.cc (_cygtls::handle_threadlist_exception): Eliminate.
2869 (_cygtls::init_threadlist_exceptions): Ditto.
2870 (_cygtls::find_tls): Use myfault handling to deal with errors caused by
2871 nonexistent threads.
2872 * sigproc.cc (wait_sig): Eliminate call to init_threadlist_exceptions.
2874 2008-03-01 Christopher Faylor <me+cygwin@cgf.cx>
2876 * cygtls.cc (_cygtls::init_exception_handler): Just return.
2878 2008-03-01 Corinna Vinschen <corinna@vinschen.de>
2880 * exceptions.cc (_cygtls::handle_exceptions): Only call rtl_unwind when
2881 exiting. Just return, don't set thread context.
2882 * gendef (_setjmp): Store %fs:0 in jmp_buf.
2884 (_ljfault): Restore %fs:0 from jmp_buf.
2887 2008-02-29 Corinna Vinschen <corinna@vinschen.de>
2889 * fhandler_disk_file.cc (fhandler_disk_file::fchmod): Call close_fs
2890 instead of close to avoid calling close from wrong class when changing
2891 a file system based device node.
2892 (fhandler_disk_file::fchown): Ditto.
2893 (fhandler_disk_file::facl): Ditto.
2895 2008-02-28 Corinna Vinschen <corinna@vinschen.de>
2897 * exceptions.cc (_cygtls::handle_exceptions): When being debugged,
2898 leave through SetThreadContext, too, to keep exception handler stack
2901 2008-02-28 Corinna Vinschen <corinna@vinschen.de>
2903 * exceptions.cc (open_stackdumpfile): Add comments.
2905 2008-02-28 Corinna Vinschen <corinna@vinschen.de>
2907 * exceptions.cc (open_stackdumpfile): Use NtCreateFile to create
2910 2008-02-27 Corinna Vinschen <corinna@vinschen.de>
2912 * exceptions.cc (stack_info::walk): Fix typo.
2914 2008-02-27 Corinna Vinschen <corinna@vinschen.de>
2916 * cygtls.cc (_cygtls::init_exception_handler): Fix comment.
2918 2008-02-27 Corinna Vinschen <corinna@vinschen.de>
2920 * (struct __DIR_cache): Switch order of members so that the buffer
2921 given to NtQueryDirectoryFile is 8 byte aligned.
2923 2008-02-27 Christopher Faylor <me+cygwin@cgf.cx>
2925 * cygtls.cc (_cygtls::handle_threadlist_exception): Make it clear that
2926 the function never actually returns.
2927 * exceptions.cc (_cygtls::handle_exceptions): Jump out of function
2928 rather than returning to avoid meddling by previously installed
2931 2008-02-25 Corinna Vinschen <corinna@vinschen.de>
2933 * dcrt0.cc (initial_env): Only use local buffer "buf" if DEBUGGING is
2934 enabled. Replace calls to GetEnvironmentVariable by calls to
2935 GetEnvironmentVariableA for clarity. Call GetEnvironmentVariableA
2937 (cygbench): Ditto, drop local buffer.
2938 * environ.cc (getearly): Call GetEnvironmentVariableA.
2939 (environ_init): Retrieve unicode environment and convert to current
2941 (getwinenveq): Ditto.
2942 * exceptions.cc (try_to_debug): Accommodate new sys_mbstowcs calling
2944 * fhandler_clipboard.cc (set_clipboard): Call sys_mbstowcs to retrieve
2945 required buffer length.
2946 * fork.cc (frok::child): Call GetEnvironmentVariableA.
2947 * miscfuncs.cc: Accommodate changed arguments in calls to sys_mbstowcs.
2948 * sec_auth.cc: Ditto.
2949 * strfuncs.cc (sys_wcstombs_alloc): Fix formatting.
2950 (sys_mbstowcs): Change arguments to allow specifying a source string
2952 (sys_mbstowcs_alloc): Ditto.
2953 * uinfo.cc (cygheap_user::ontherange): Accommodate changed arguments in
2954 calls to sys_mbstowcs.
2955 * winsup.h (sys_mbstowcs): Adjust declaration.
2956 (sys_mbstowcs_alloc): Ditto.
2958 2008-02-20 Corinna Vinschen <corinna@vinschen.de>
2960 * path.cc (cwdstuff::set): Revert error handling change in case
2961 DuplicateHandle fails, because it breaks Vista/Longhorn workaround.
2963 2008-02-19 Christopher Faylor <me+cygwin@cgf.cx>
2965 * sigproc.cc (sig_send): Use sigmask of target thread if it is
2966 specified otherwise default to main sigmask.
2968 2008-02-16 Corinna Vinschen <corinna@vinschen.de>
2970 * fhandler.cc (fhandler_base::fpathconf): Fix _PC_NAME_MAX and
2973 2008-02-15 Corinna Vinschen <corinna@vinschen.de>
2975 * include/sys/cygwin.h (__INT_MAX_PATH): Remove.
2976 (external_pinfo): Convert program_long to pointer.
2977 * external.cc (fillout_pinfo): Add buffer for program_long value.
2979 2008-02-15 Corinna Vinschen <corinna@vinschen.de>
2981 * include/sys/cygwin.h (__INT_MAX_PATH): Define to 32K.
2982 (external_pinfo): Set size of program_long to __INT_MAX_PATH.
2984 2008-02-15 Christopher Faylor <me+cygwin@cgf.cx>
2986 * include/sys/cygwin.h (external_pinfo): Define program_long size using
2987 external buffer size rather than cygwin-internal buffer size.
2989 2008-02-15 Christopher Faylor <me+cygwin@cgf.cx>
2991 Perform whitespace cleanup throughout.
2993 * dcrt0.cc (signal_shift_subtract): Eliminate ancient backwards
2995 (check_sanity_and_sync): Ditto.
2996 * winsup.h (SIGTOMASK): Ditto. Just use constant in signal
2998 * include/cygwin/version: Remove backwards signal mask compatibility
3001 * path.cc (symlink_info::check_sysfile): Cosmetic change.
3003 * registry.cc (get_registry_hive_path): Remove unneeded variable.
3005 * exceptions.cc (handle_sigsuspend): Eliminate thread signal mask and
3006 use either main sigmask or current thread sigmask.
3007 (set_process_mask): Ditto.
3011 (set_process_mask_delta): Ditto.
3012 (_cygtls::call_signal_handler): Ditto.
3013 * fhandler_process.cc (format_process_status): Ditto.
3014 * fhandler_termios.cc (fhandler_termios::bg_check): Ditto.
3015 * pinfo.h (class pinfo): Ditto.
3016 * select.cc (pselect): Ditto.
3017 * signal.cc (sigprocmask): Ditto.
3022 * thread.h (pthread::parent_tls): New member.
3023 * thread.cc (pthread::pthread): Record parent_tls here.
3024 (pthread::thread_init_wrapper): Initialize sigmask from parent thread.
3026 2008-02-14 Corinna Vinschen <corinna@vinschen.de>
3028 * cygheap.cc (cwcsdup): New function.
3029 (cwcsdup1): New function.
3030 * cygheap.h (cygheap_user::get_windows_id): New method returning PWCHAR.
3032 (cwcsdup1): Declare.
3033 * registry.cc (get_registry_hive_path): Use WCHAR instead of char
3035 (load_registry_hive): Ditto.
3036 * registry.h (get_registry_hive_path): Change declaration accordingly.
3037 (load_registry_hive): Ditto.
3038 * sec_helper.cc (cygpsid::string): New method returning PWCHAR.
3039 * security.h (cygpsid::string): Declare.
3040 * syscalls.cc (seteuid32): Convert local name var to WCHAR.
3041 * uinfo.cc (cygheap_user::env_userprofile): Convert local name buffers
3042 to WCHAR. Call sys_wcstombs_alloc to generate puserprof buffer.
3044 * winsup.h: Fix comment.
3045 (NT_MAX_PATH): New definition for maximum internal path length.
3046 Use throughout where appropriate.
3047 * include/limits.h (PATH_MAX): Set to 4096 as on Linux.
3049 2008-02-13 Christopher Faylor <me+cygwin@cgf.cx>
3051 * configure.in: Remove non-working options.
3052 * configure: Regenerate.
3054 2008-02-13 Christopher Faylor <me+cygwin@cgf.cx>
3056 * syscalls.cc (_isatty): Define as an alias to isatty to override
3059 * thread.cc (pthread_kill): Deal with signal 0 as per POSIX and also
3060 avoid manipulating an invalid thread.
3062 2008-02-13 Corinna Vinschen <corinna@vinschen.de>
3064 * posix.sgml: Move llrint, llrintf, llrintl, lrintl, rintl, wcstol,
3065 wcstoll, wcstoul, wcstoull, wcsxfrm from unimplemented to implemented
3067 Change headline of "GNU extensions" to "GNU and Linux extensions".
3068 Add fgetxattr, flistxattr, fremovexattr, fsetxattr, getxattr, lgetxattr,
3069 listxattr, llistxattr, lremovexattr, lsetxattr, removexattr, setxattr,
3070 wcpcpy and wcpncpy to list of implemented GNU functions.
3072 2008-02-13 Corinna Vinschen <corinna@vinschen.de>
3074 * cygtls.cc (_cygtls::init_exception_handler): Revert patch
3076 * exceptions.cc (stack_info::walk): Add workaround for NT 5.2
3078 * wincap.h (wincaps::has_restricted_stack_args): New element.
3079 * wincap.cc: Implement above element throughout.
3080 (wincapc::init): Reset has_restricted_stack_args if not running
3083 2008-02-11 Corinna Vinschen <corinna@vinschen.de>
3085 * fhandler_disk_file.cc (fhandler_disk_file::fgetxattr): Remove unused
3087 (fhandler_disk_file::fsetxattr): Ditto.
3088 * include/attr/xattr.h: New file.
3090 2008-02-11 Corinna Vinschen <corinna@vinschen.de>
3092 * dcrt0.cc (dll_crt0_1): Fix typo in call to sys_wcstombs.
3093 * miscfuncs.cc (next_char): Initialize ret to keep gcc happy.
3095 2008-02-10 Corinna Vinschen <corinna@vinschen.de>
3097 * Makefile.in (DLL_OFILES): Add ntea.o.
3098 * cygwin.din (getxattr, listxattr, removexattr, setxattr, lgetxattr,
3099 llistxattr, lremovexattr, lsetxattr, fgetxattr, flistxattr,
3100 fremovexattr, fsetxattr): Export Linux extended attribute functions.
3102 * errno.cc (errmap): Add mappings for ERROR_EAS_DIDNT_FIT,
3103 ERROR_EAS_NOT_SUPPORTED, ERROR_EA_LIST_INCONSISTENT,
3104 ERROR_EA_TABLE_FULL, ERROR_FILE_CORRUPT, ERROR_INVALID_EA_NAME.
3105 * fhandler.h (class fhandler_base): Declare new fgetxattr and
3107 (class fhandler_disk_file): Ditto.
3108 * fhandler.cc (fhandler_base::fgetxattr): New method.
3109 (fhandler_base::fsetxattr): New method.
3110 * fhandler_disk_file.cc (fhandler_disk_file::fgetxattr): New method.
3111 (fhandler_disk_file::fsetxattr): New method.
3112 * ntdll.h (STATUS_EA_TOO_LARGE): Define.
3113 (STATUS_NONEXISTENT_EA_ENTRY): Define.
3114 (STATUS_NO_EAS_ON_FILE): Define.
3115 * ntea.cc (read_ea): Rewrite for long pathnames and for using with
3116 Linux extended attribute functions.
3118 (getxattr_worker): New static function.
3119 (getxattr): New function.
3120 (lgetxattr): New function.
3121 (fgetxattr): New function.
3122 (listxattr): New function.
3123 (llistxattr): New function.
3124 (flistxattr): New function.
3125 (setxattr_worker): New static function.
3126 (setxattr): New function.
3127 (lsetxattr): New function.
3128 (fsetxattr): New function.
3129 (removexattr): New function.
3130 (lsetxattr): New function.
3131 (fsetxattr): New function.
3132 * security.h (read_ea): Change declaration according to above changes.
3134 * include/cygwin/version.h: Bump API minor version.
3136 2008-02-10 Corinna Vinschen <corinna@vinschen.de>
3138 * libc/ftw.cc (ftw): Allow nfds <= 0 for glibc compatibility.
3139 * libc/nftw.c (nftw): Ditto.
3141 2008-02-07 Corinna Vinschen <corinna@vinschen.de>
3143 * dtable.cc (dtable::init_std_file_from_handle): Set access to
3144 read/write if handle is connected to a tty or console.
3145 * fhandler_dsp.cc (fhandler_dev_dsp::dup): Set open flags correctly
3146 after duplicating from archetype.
3147 * fhandler_tty.cc (fhandler_tty_slave::dup): Ditto.
3148 (fhandler_pty_master::dup): Ditto.
3150 2008-02-06 Corinna Vinschen <corinna@vinschen.de>
3152 * miscfuncs.cc (next_char): Fix typos in comment.
3153 * strfuncs.cc: Remove cygserver guards.
3155 2008-02-06 Corinna Vinschen <corinna@vinschen.de>
3157 * fhandler.h (fhandler_console::trunc_buf): Add to use as cache for
3158 truncated multibyte characters on input.
3159 (fhandler_console::write_replacement_char): Declare new method.
3160 * fhandler_console.cc (CONVERT_LIMIT): Raise to 64K.
3161 (fhandler_console::fhandler_console): Initialize trunc_buf.
3162 (ERR): Define as independent value again.
3163 (fhandler_console::write_replacement_char): New method to print
3165 (fhandler_console::write_normal): Add handling for truncated multibyte
3166 sequences. Call next_char instead of pathetic CharNextExA function.
3167 Don't change src, rather just work with found later on.
3168 * miscfuncs.cc (is_cp_multibyte): Move here from strfuncs.cc.
3169 Don't call Windows function, restrict to well-known ANSI/OEM codepages
3171 (next_char): Call CharNextExA only for doublebyte codepages.
3172 Implement for UTF-8 here.
3173 * strfuncs.cc (is_cp_multibyte): Move to miscfuncs.cc.
3174 * winsup.h (next_char): Declare.
3175 * include/limits.h (MB_LEN_MAX): Set to maximum value of MB_CUR_MAX
3176 as defined by newlib for now.
3178 2008-02-05 Corinna Vinschen <corinna@vinschen.de>
3180 * autoload.cc (CharToOemA): Remove.
3181 (CharNextExA): Define.
3182 * environ.cc (codepage_init): Un-static. Set active_codepage to
3183 active codepage. Default to ansi regardless of buf pointer.
3184 * fhandler.h (dev_console::get_console_cp): New method.
3185 (dev_console::con_to_str): Change declaration according to new
3187 (dev_console::str_to_con): Ditto.
3188 * fhandler_console.cc (cp_convert): Remove.
3189 (dev_console::con_to_str): Redefine to take WCHAR as incoming console
3191 (dev_console::get_console_cp): Return correct codepage according to
3192 alternate_charset_active setting.
3193 (dev_console::str_to_con): Redefine to create WCHAR buffer for console
3195 (fhandler_console::read): Read console input as WCHARs.
3196 (base_chars): Fix typo in comment.
3197 (fhandler_console::char_command): Save and restore console output
3198 buffer using UNICODE functions.
3199 (fhandler_console::write_normal): Convert to write output in UNICODE.
3200 Use CharNextExA to recognize multibyte characters in input. Workaround
3201 problem with UTF-8 and MultiByteToWideChar. Simplify the loop for
3202 printing "normal" characters.
3203 * strfuncs.cc (active_codepage): New variable to store active codepage.
3204 (get_cp): Call codepage_init() if active_codepage is uninitialized.
3205 Just return active_codepage.
3206 (is_cp_multibyte): New function.
3207 * winsup.h (active_codepage): Declare.
3208 (codepage_init): Declare.
3209 (is_cp_multibyte): Declare.
3211 2008-02-03 Brian Dessent <brian@dessent.net>
3213 * smallprint.cc (__small_vsprintf): Use HEAP_NOTHEAP for type.
3214 * strfuncs.cc (sys_wcstombs_alloc): Guard use of ccalloc
3215 to !__OUTSIDE_CYGWIN__ for use in cygserver.
3216 (sys_mbstowcs_alloc): Ditto.
3218 2008-02-01 Corinna Vinschen <corinna@vinschen.de>
3220 * miscfuncs.cc (cygwin_wcsncasecmp): Never access more than n
3222 (cygwin_strncasecmp): Ditto. Fix for strings longer than n.
3224 2008-02-01 Corinna Vinschen <corinna@vinschen.de>
3226 * string.h: Re-enable inline strcasematch and strncasematch
3227 implementations and rename to ascii_strcasematch/ascii_strncasematch.
3228 * dcrt0.cc: Replace str[n]casematch with ascii_str[n]casematch where
3230 * environ.cc: Ditto.
3231 * fhandler_process.cc: Ditto.
3232 * hookapi.cc: Ditto.
3236 * syscalls.cc: Ditto.
3240 2008-01-31 Corinna Vinschen <corinna@vinschen.de>
3242 * dcrt0.cc (dll_crt0_1): Use GetCommandLineW and convert to current
3244 * environ.cc (set_file_api_mode): Always set file api to ANSI if not
3245 using the OEM codepage.
3246 (codepage_init): Allow "utf8" codepage.
3247 * fhandler_clipboard.cc (set_clipboard): Convert clipbuf to void and
3248 cast as needed. Always convert input to wide char and write
3249 CF_UNICODETEXT to clipboard.
3250 (fhandler_dev_clipboard::read): Read CF_UNICODETEXT from clipboard and
3251 convert to current codepage if CYGWIN_NATIVE format is not available.
3252 * fhandler_console.cc: Drop redundant undef.
3253 * smallprint.cc (__small_vsprintf): Convert PWCHAR and UNICODE_STRING
3254 to current codepage for printing.
3255 * strfuncs.cc: Use PWCHAR throughout.
3256 (get_cp): Return CP_UTF8 for utf8_cp codepage setting.
3257 (sys_wcstombs): Allow NULL target buffer.
3258 (sys_wcstombs_alloc): New function.
3259 (sys_mbstowcs_alloc): Ditto.
3260 * winsup.h (codepage_type): Add utf8_cp.
3261 (HEAP_NOTHEAP): Define.
3262 (sys_wcstombs_alloc): Declare.
3263 (sys_mbstowcs_alloc): Declare.
3265 2008-01-31 Corinna Vinschen <corinna@vinschen.de>
3267 * cygheap.h (struct cwdstuff): Add dir member to store cwd handle.
3268 (cwdstuff::get_handle): New method.
3269 * path.cc (cwdstuff::set): When doit is true, always try to get
3270 directory handle. Fail if duplicating handle fails. Store handle
3271 in dir. Fix potential SEGV when setting drive_length.
3273 2008-01-28 Corinna Vinschen <corinna@vinschen.de>
3275 * path.cc: Fix Samba version in comment.
3277 2008-01-24 Corinna Vinschen <corinna@vinschen.de>
3279 * path.cc (fs_info::update): Fix old-style Samba test to support
3280 recent as well as upcoming Samba releases.
3282 2008-01-22 Corinna Vinschen <corinna@vinschen.de>
3284 * ntdll.h (struct _FILE_FS_OBJECTID_INFORMATION): Define.
3285 * path.cc (struct smb_extended_info): Define.
3286 (fs_info::update): Request object id info to get Samba information.
3287 Set flags according to new implementation.
3288 * path.h (struct fs_info): Add samba_version to status_flags.
3289 Implement flags() and samba_version() using IMPLEMENT_STATUS_FLAG.
3291 2008-01-21 Corinna Vinschen <corinna@vinschen.de>
3293 * fhandler_disk_file.cc (fhandler_disk_file::link): Open file with
3294 READ_CONTROL for Vista/Longhorn's sake.
3296 2008-01-15 Corinna Vinschen <corinna@vinschen.de>
3298 * Makefile.in (install-libs): Overwrite newlib's libg.a with symlink
3301 2008-01-15 Corinna Vinschen <corinna@vinschen.de>
3303 * Makefile.in (DLL_OFILES): Remove memmem.o.
3304 * memmem.cc: Remove in favor of newlib implementation.
3306 2008-01-07 Corinna Vinschen <corinna@vinschen.de>
3308 * fhandler.h: Update copyright.
3309 * include/limits.h: Ditto.
3311 2008-01-06 Christopher Faylor <me+cygwin@cgf.cx>
3313 * fhandler.h (fhandler_base::is_tty): Make bool.
3314 (fhandler_serial::is_tty): Ditto.
3315 (fhandler_termios::is_tty): Ditto.
3316 (fhandler_base::is_slow): Return bool value.
3317 (fhandler_socket::is_slow): Ditto.
3318 (fhandler_serial::is_slow): Ditto.
3319 (fhandler_console::is_slow): Ditto.
3320 (fhandler_tty_common::is_slow): Ditto.
3321 (fhandler_tty_master::is_slow): Ditto.
3322 (fhandler_dev_null::is_slow): Ditto.
3324 2008-01-06 Christopher Faylor <me+cygwin@cgf.cx>
3326 * include/limits.h (TTY_NAME_MAX): Increase size to same as linux to
3327 allow for (at least) null terminating byte for "/dev/console".
3329 2008-01-01 Christopher Faylor <me+cygwin@cgf.cx>
3331 * tty.cc: Update copyright.
3334 2008-01-01 Christopher Faylor <me+cygwin@cgf.cx>
3336 * newsym: First stab at understanding data as well as functions.
3338 * pipe.cc (fhandler_pipe::init): Move more intelligence here.
3339 (fhandler_pipe::create): Simplify based on above change.
3341 * tty.cc (tty_list::allocate): Remove non-NT code.