1 2003-01-27 Christopher Faylor <cgf@redhat.com>
3 * passwd.cc (pwdgrp::parse_passwd): Be more unforgiving about
6 2003-01-26 Christopher Faylor <cgf@redhat.com>
8 * uinfo.cc (pwdgrp::next_num): Remove check for NULL since it is no
9 longer a valid return from next_str.
10 (pwdgrp::add_line): Duh. Revert to use strchr.
12 2003-01-26 Christopher Faylor <cgf@redhat.com>
14 * string.h (strechr): New function.
15 * uinfo.cc (pwdgrp::next_str): Search only for input char in string.
16 Return EOS on failure. Don't check for NULL since it shouldn't be
18 (pwdgrp::add_line): Revert to replacing '\n' in input line with '\0'.
19 (pwdgrp::next_num): Pass explicit separator character to next_str.
20 * grp.cc (pwdgrp::parse_group): Ditto.
21 * passwd.cc (pwdgrp::parse_passwd): Ditto. Revamp test for garbage
23 * pwdgrp.h (pwdgrp::next_str): Don't use default parameter.
25 2003-01-26 Christopher Faylor <cgf@redhat.com>
27 * uinfo.cc (pwdgrp::load): Regularize strace output. Add warning for
30 2003-01-26 Christopher Faylor <cgf@redhat.com>
32 * passwd.cc (pwdgrp::parse_passwd): Eliminate use of memset. The
33 structure should always be completely filled out.
34 * grp.cc (pwdgrp::parse_group): Ditto.
36 2003-01-26 Christopher Faylor <cgf@redhat.com>
38 * grp.cc (pwdgrp::parse_group): Fix off-by-one problem in allocating
41 2003-01-26 Christopher Faylor <cgf@redhat.com>
43 * include/sys/strace.h (paranoid_printf): Define as not being part of
46 2003-01-25 Christopher Faylor <cgf@redhat.com>
48 * pwdgrp.h (pwdgrp::next_num): Rename from next_int. Returns
49 true/false if parse operation succeeded.
50 (pwdgrp::reparse): Remove.
51 (pwdgrp::raw_ptr): New function. Returns pointer in line.
52 (pwdgrp::next_num): New functions for parsing other than unsigned long.
53 * grp.cc (pwdgrp::parse_group): Reinstate previous parsing behavior.
54 Don't fill in fields with NULL and assign empty gr_mem to known pointer
55 rather than doing a pointless calloc. Streamline gr_mem parsing.
56 Don't increment curr_lines here.
57 * passwd.cc (pwdgrp::parse_passwd): Use new behavior of next_num.
58 Don't increment curr_lines here.
59 * uinfo.cc (pwdgrp::next_str): Keep returning EOL if out of data.
60 (pwdgrp::reparse): Remove.
61 (pwdgrp::next_num): Rename from next_int. Return bool indicating
62 success of parse, argument returns value parsed.
63 (pwdgrp::add_line): Increment curr_lines here on successful parse.
64 (pwdgrp::load): (from Pierre Humblet) Don't return status. Just report
67 2003-01-25 Christopher Faylor <cgf@redhat.com>
69 * pwdgrp.cc (pwdgrp::reparse): Declare.
70 * uinfo.cc (pwdgrp::reparse): Define.
71 * grp.cc (pwdgrp::parse_group): Use reparse.
73 2003-01-25 Pierre Humblet <pierre.humblet@ieee.org>
75 * syscalls.cc (seteuid32): On Win95 get the pw entry. If it exists
76 update the euid and call cygheap->user.set_name. Remove special
77 handling of ILLEGAL_UID.
78 (setgid32): Add a debug_printf. On Win95, always set the egid.
79 Remove special handling of ILLEGAL_GID. Do not compare gid and gr_gid.
80 * child_info.h (class cygheap_exec_info): Remove uid.
81 * spawn.cc (spawn_guts): Do not set ciresrv.moreinfo->uid.
82 * dcrto.cc (dll_crt0_1): Always call uinfo_init.
83 * uinfo.cc (uinfo_init): Reorganize and close handle if needed.
84 (cygheap_user::ontherange): Do not call internal_getpwnam if pw is NULL.
86 2003-01-24 Christopher Faylor <cgf@redhat.com>
88 * fhandler_console.cc (fhandler_console::send_winch_maybe): Reset
89 scroll region if size changes.
91 2003-01-24 Pierre Humblet <pierre.humblet@ieee.org>
92 Jason Tishler <jason@tishler.net>
94 * cygwin.din: Export setreuid32, setreuid, setregid32, setregid.
95 * syscalls.cc (setreuid32): New function.
99 * include/cygwin/version.h: Bump API minor number.
101 2003-01-23 Christopher Faylor <cgf@redhat.com>
103 * pwdrp.h (pwdgrp::refresh): Lock entire test prior to reading.
105 2003-01-23 Christopher Faylor <cgf@redhat.com>
107 * grp.cc (pwdgrp::parse_group): Eliminate arg and use class member
108 instead. Use next_str and next_int to parse arguments.
109 * passwd.cc (pwdgrp::parse_passwd): Ditto.
110 (grab_string): Eliminate.
112 * pwdgrp.h (pwdgrp::parse): Eliminate input arg.
113 (pwdgrp::parse_passwd): Reflect above change.
114 (pwdgrp::parse_group): Reflect above change.
115 (pwdgrp::next_str): New function.
116 (pwdgrp::next_int): Ditto.
117 (pwdgrp::gets): Eliminate.
118 * uinfo.cc (pwdgrp::next_str): New function.
119 (pwdgrp::next_int): Ditto.
120 (pwdgrp::add_line): Subsume gets.
121 (pwdgrp::gets): Eliminate.
122 (pwdgrp::load): Just call add_line to parse input buffer.
124 2003-01-22 Thomas Pfaff <tpfaff@gmx.net>
126 * include/pthread.h (PTHREAD_MUTEX_RECURSIVE): Revert changes from
127 2003-01-09 mutex patch.
128 (PTHREAD_MUTEX_ERRORCHECK): Ditto.
130 2003-01-22 Corinna Vinschen <corinna@vinschen.de>
132 * cygrun.c: Move from here to ../testsuite.
133 * Makefile.in: Remove cygrun.exe dependencies.
135 2003-01-21 Jason Tishler <jason@tishler.net>
137 * cygwin.din: Export nanosleep().
138 * signal.cc (nanosleep): New function.
139 (sleep): Move old functionality to nanosleep(). Call nanosleep().
140 (usleep): Remove old functionality. Call nanosleep().
141 * include/cygwin/version.h: Bump API minor number.
143 2003-01-21 Christopher Faylor <cgf@redhat.com>
145 * grp.cc: Call gr.refresh() rather than doing isunitialized tests
147 (gr): Use constructor (sigh).
148 (pwdgrp::parse_group): Rename from parse_grp.
149 (pwdgrp::read_group): Rename from read_etc_group. Just call gr.load
150 with a single argument.
151 * passwd.cc: Call pr.refresh() rather than doing isunitialized tests
153 (pr): Use constructor (sigh).
154 (pwdgrp::parse_passwd): Rename from "parse_pwd".
155 (pwdgrp::read_passwd): Rename from read_etc_passwd. Just call pr.load
156 with a single argument.
157 * pwdgrp.h (pwdgrp_state): Eliminate.
158 (pwdgrp): Reflect above renamings.
159 (pwdgrp::etc_ix): Rename from pwd_ix.
160 (pwdgrp::read): New element.
161 (pwdgrp::lock): New element.
162 (pwdgrp::refresh): New function.
163 (pwdgrp::load): Eliminate variations which take buffer arguments.
164 (pwdgrp::pwdgrp): New constructors. Initialize mutex here.
165 * uinfo.cc (pwdgrp::load): Accommodate pwd_ix -> etc_ix renaming.
166 (pwdgrp::load): Set initialized state to true rather than setting state
169 2003-01-21 Christopher Faylor <cgf@redhat.com>
171 * include/cygwin/version.h: Bump DLL minor number.
173 2003-01-21 Pierre Humblet <pierre.humblet@ieee.org>
175 * path.h (etc::change_possible): Revert the type to bool.
176 (etc::set_last_modified): Remove obsolete function.
177 * path.cc (etc::change_possible): Revert type to bool.
178 (etc::test_file_change): Do not test for negative values of
179 change_possible and do not set it to -res.
180 (etc::dir_changed): When the handle is NULL, call memset instead of
181 test_file_changed. When the handle is invalid, return true. Detect
182 filename change in /etc.
183 (etc::file_changed): Remove unneeded check for !fn[n].
184 * uinfo.cc (pwdgrp::load): Eliminate spurious setting of fh to NULL.
185 * pwdgrp.h (pwdgrp::operator =): Eliminate.
187 2003-01-19 Christopher Faylor <cgf@redhat.com>
189 * pwdgrp.h (etc): Move to path.h.
190 (pwdgrp::max_lines): New field.
191 (pwdgrp::curr_lines): New field.
192 (pwdgrp::pwdgrp_buf): Ditto.
193 (pwdgrp_buf_elem_size): Ditto.
194 (pwdgrp_parse): Ditto.
195 (pwdgrp::gets): Just declare here.
196 (pwdgrp::load): Ditto. Just take one argument.
197 (pwdgrp::load): Define overloaded function accepting passwd buf.
198 (pwdgrp::load): Define overloaded function accepting group buf.
199 * grp.cc: Use pwdgrp elements rather than standalone static variables
201 (curr_lines): Eliminate.
203 (add_grp_line): Ditto.
204 (parse_grp): Define as returning boolean. Accept void * arg and line
205 count. Coerce first argument into __group32 buf reference. Increment
206 curr_line as appropriate.
207 (read_etc_group): Pass pwdgrp buffer to gr.load.
208 * passwd.cc: Use pwdgrp elements rather than standalone static variables
210 (curr_lines): Eliminate.
212 (add_grp_line): Ditto.
213 (parse_passwd): Define as returning boolean. Accept void * arg and line
214 count. Coerce first argument into passwd buf reference. Increment
215 curr_line as appropriate.
216 (read_etc_group): Pass pwdgrp buffer to pr.load.
217 * path.cc (etc::fn): Extend buffer size to allow index by 1 rather than
219 (etc::last_modified): Ditto.
220 (etc::change_possible): Ditto. Renamed from sawchange. Change to
221 signed char since elements are now tri-state.
222 (etc::init): Assume "handle" is 1 based rather than 0.
223 (etc::test_file_change): New function. Sets change_possible based on
224 file date comparison.
225 (etc::dir_changed): Check file states immediately after changed_h is
226 initialized to avoid a race.
227 (etc::file_changed): Use test_file_change to detect if file needs to be
229 * path.h (etc): Move class here from pwdgrp.h.
230 * uinfo.cc: Move etc:: functions to path.cc. Move pwdgrp functions
232 (pwdgrp::gets): Eliminate buf checks. Just check eptr and set lptr.
233 (pwdgrp::add_line): New function.
234 (pwdgrp::load): Call generic add_line function which will call correct
237 2003-01-17 Christopher Faylor <cgf@redhat.com>
239 * cygheap.cc: Change most 'int's to 'unsigned's.
240 (_cmalloc): Only check for size of malloced region when calculating
241 bucket. Add overhead when performing the sbrk. Previous change broke
244 2003-01-17 Christopher Faylor <cgf@redhat.com>
246 * dcrt0.cc (initialize_env): Use colon for CYGWIN_DEBUG separator.
247 * grp.cc: Change most statics to NO_COPY throughout.
250 2003-01-17 Christopher Faylor <cgf@redhat.com>
252 * pwdgrp.h: Change some BOOLs to bools.
253 (pwdgrp::pwdgrp): Remove unneeded constructor.
254 * passwd.cc: Change BOOL to bool throughout.
256 2003-01-17 Corinna Vinschen <corinna@vinschen.de>
258 * cygwin.din: Add strerror_r.
259 * include/cygwin/version.h: Bump API minor number.
261 2003-01-17 Christopher Faylor <cgf@redhat.com>
263 * uinfo.cc (etc::dir_changed): Don't print a warning if can't open
264 /etc, unless debugging.
266 2003-01-17 Pierre Humblet <pierre.humblet@ieee.org>
268 * grp.cc (read_etc_group): On NT, add a line for gid = -1. Change name
269 "unknown" to "mkgroup".
270 (internal_getgrgid): Do not return default in nontsec case.
271 (internal_getgroups): Add argument srchsid and look for it in groups if
273 * passwd.cc (read_etc_passwd): On NT, add a line for uid = -1. Use
274 same default uid for Win95 and NT. Call cygheap_user::ontherange to
277 2003-01-16 Christopher Faylor <cgf@redhat.com>
279 * cygheap.cc (init_cygheap::etc_changed): Move to uinfo.cc.
280 * cygheap.h (init_cygheap::etc_changed_h): Remove.
281 (init_cygheap::etc_changed): Ditto.
282 * grp.cc (group_state): Remove. Use gr instead throughout.
283 (gr): Define as class pwdgrp.
284 (read_etc_group): Remove gr definition. Remove calls to
285 set_last_modified and close. Pass add_grp to gr.load to load file.
286 * passwd.cc (passwd_state): Remove. Use pr instead, throughout.
287 (pr): Define as class pwdgrp.
288 (read_etc_passwd): Remove pr definition. Remove calls to
289 set_last_modified and close. Pass add_pwd_line to pr.load to load
291 * pwdgrp.h (etc): New helper class for pwdgrp.
292 (pwdgrp): Combine pwdgrp_check and pwdgrp_read into one class. Remove
293 file_w32 and last_modified fields.
294 (pwdgrp::set_last_modified): Remove.
295 (pwdgrp::isinitializing): Remove FindFirstFile stuff. Move to
297 (pwdgrp::load): Rename from 'open'. Call etc::init to initialize etc
298 scanning. Close file handle after reading buffer into memory. Parse
299 buffer by calling second argument.
300 (pwdgrp::gets): Reorganize slightly to rely on eptr starting at
302 (pwdgrp::close): Remove.
303 * uinfo.cc (etc::dir_changed): New function.
305 (etc::file_changed): Ditto.
306 (etc::set_last_modified): Ditto.
308 2003-01-16 Jason Tishler <jason@tishler.net>
310 * mmap.cc (fixup_mmaps_after_fork): Add ERROR_NOACCESS to the list of
311 ReadProcessMemory() error codes that trigger a retry with temporary
312 PAGE_READONLY access. Note that this can occur on NT 4.0.
314 2003-01-15 Christopher Faylor <cgf@redhat.com>
316 * path.cc (normalize_posix_path): Convert win32 path separators to
317 slashes when full path is specified.
319 2003-01-15 Pierre Humblet <pierre.humblet@ieee.org>
321 * cmalloc.cc (_cmalloc): Fix memory leak.
323 2003-01-15 Corinna Vinschen <corinna@vinschen.de>
325 * autoload.cc: Fix copyright date.
326 * fhandler_dsp.cc: Ditto.
331 * syscalls.cc: Ditto.
335 2003-01-14 Corinna Vinschen <corinna@vinschen.de>
337 * mmap.cc (fixup_mmaps_after_fork): Copy protection to child process.
338 Change ambiguous debug output.
340 2003-01-14 Corinna Vinschen <corinna@vinschen.de>
342 * mmap.cc (mmap_record::access): Change argument type to caddr_t
344 (mprotect): Protect against calling VirtualProtect() for shared
346 (fixup_mmaps_after_fork): If ReadProcessMemory() fails, try to
347 change protection of parent page to PAGE_READONLY, then try again.
348 Revert protection afterwards.
350 2003-01-14 Thomas Pfaff <tpfaff@gmx.net>
352 * syscalls.cc (system): Add pthread_testcancel call.
353 * thread.cc: Update list of cancellation points.
355 2003-01-14 Thomas Pfaff <tpfaff@gmx.net>
357 * wait.cc: Include thread.h
358 (wait4): Add pthread_testcancel call.
359 Wait for child process and cancellation event.
360 * thread.cc: Update list of cancellation points.
362 2003-01-14 Thomas Pfaff <tpfaff@gmx.net>
364 * signal.cc (sleep): Add pthread_testcancel call.
365 Wait for signal and cancellation event.
368 2003-01-14 Thomas Pfaff <tpfaff@gmx.net>
370 * exceptions.cc (handle_sigsuspend): Add pthread_testcancel call.
371 Wait for signal and cancellation event.
372 * thread.cc: Update list of cancellation points.
374 2003-01-14 David Huang <davehzhr@hotmail.com>
376 * fhandler_dsp.cc (fhandler_dsp::ioctl): Add limited support for
379 2003-01-12 Christopher Faylor <cgf@redhat.com>
383 2003-01-12 Corinna Vinschen <corinna@vinschen.de>
385 * uname.cc (uname): Use cygwin_gethostname() to retrieve hostname.
387 2003-01-12 Pierre Humblet <pierre.humblet@ieee.org>
389 * sec_acl.cc (search_ace): Use id == -1, instead of < 0, as wildcard.
390 (setacl): Start the search for a matching default at the next entry.
391 Invalidate the type of merged entries instead of clearing it.
392 Use well_known_creator for default owner and owning group and do
393 not try to merge non-default and default entries in these cases.
394 (getacl): Recognize well_known_creator for default owner and group.
395 (acl_worker): Improve errno settings and streamline the nontsec case.
396 * security.cc (write_sd): Remove the call to set_process_privilege.
397 (alloc_sd): If the owner changes, call set_process_privilege and return
398 immediately on failure. Change inheritance rules: on new directories add
399 inherit only allow ACEs for creator_owner, creator_group and everyone.
400 Preserve all inheritances through chmod and chown calls. Introduce
401 isownergroup to implement the uid == gid case, to keep the inheritance
402 code simple. Do not initialize owner_sid and group_sid and stop using
405 2003-01-10 Christopher Faylor <cgf@redhat.com>
407 * net.cc: Use gethostname define from winsock2.h.
409 2003-01-10 Christopher Faylor <cgf@redhat.com>
411 * path.cc: Unrevert below reversion except for
412 mount_info::conv_to_posix_path part.
414 2003-01-10 Corinna Vinschen <corinna@vinschen.de>
416 * path.cc: Revert patch from 2003-01-09 to normalize a windows path
417 rather than converting to posix.
419 2003-01-10 Corinna Vinschen <corinna@vinschen.de>
421 * autoload.cc (gethostname): Make call optional, return 1 if function
423 * net.cc (cygwin_gethostname): Call GetComputerName if return value
424 of gethostname is non-zero.
426 2003-01-10 Charles Wilson <cwilson@ece.gatech.edu>
428 * cygwin.din: Add asprintf and vasprintf, as well as the reentrant
429 versions and underscore variants.
430 * include/cygwin/version.h: Bump CYGWIN_VERSION_API_MINOR.
432 2003-01-10 Corinna Vinschen <corinna@vinschen.de>
434 * net.cc (cygwin_gethostname): Fix call to wsock function gethostname.
436 2003-01-09 Christopher Faylor <cgf@redhat.com>
438 * cygthread.cc (cygthread::cygthread): Be more noisy about odd
440 * miscfuncs.cc (low_priority_sleep): Sleep in regular priority if
441 that's what we're currently running at.
443 2003-01-09 Thomas Pfaff <tpfaff@gmx.net>
445 * include/semaphore.h: Modify typedef for sem_t.
446 * include/cygwin/types.h: Modify typedefs for pthread_t,
447 pthread_mutex_t, pthread_key_t, pthread_attr_t,
448 pthread_mutexattr_t, pthread_condattr_t, pthread_cond_t,
449 pthread_rwlock_t and pthread_rwlockattr_t.
451 2003-01-09 Thomas Pfaff <tpfaff@gmx.net>
453 * thread.h (WAIT_CANCELED): New define.
454 (pthread::cancelable_wait): New static method.
455 * thread.cc (pthread::cancelable_wait): Implement.
456 (semaphore::Wait): Wait on semaphore and thread cancellation.
457 (pthread::join): Wait on joined thread and thread cancellation.
458 (semaphore::wait): Add testcancel to check for thread
459 cancellation even if the semaphore is available.
461 2003-01-09 Thomas Pfaff <tpfaff@gmx.net>
463 * include/pthread.h: Add define for errorchecking mutexes.
464 Change default mutex type.
465 * thread.cc (pthread_cond::TimedWait): Update mutex unlock
467 (pthread_mutex::pthread_mutex): New implement.
468 (pthread_mutex::~pthread_mutex): Ditto.
469 (pthread_mutex::Lock): Ditto.
470 (pthread_mutex::TryLock): Ditto.
471 (pthread_mutex::UnLock): Ditto.
472 (pthread_mutex::Destroy): Implement new method.
473 (pthread_mutex::SetOwner): Ditto.
474 (pthread_mutex::LockRecursive): Ditto.
475 (pthread_mutex::fixup_after_fork): Restore locking state after
477 (__pthread_mutex_lock): Return pthread_mutex::Lock errorcode.
478 (__pthread_mutex_trylock): Return pthread_mutex::TryLock
480 (__pthread_mutex_unlock): Return pthread_mutex::UnLock
482 (__pthread_mutex_destroy): Call pthread_mutex::Destroy to
484 (__pthread_mutexattr_settype): Allow errorchecking and recursive
486 * thread.h (MUTEX_LOCK_COUNTER_INITIAL): New define.
487 (pthread_mutex::criticalsection): Remove.
488 (pthread_mutex::lock_counter): New member.
489 (pthread_mutex::recursion_counter): Ditto.
490 (pthread_mutex::owner): Ditto.
491 (pthread_mutex::type): Ditto.
492 (pthread_mutex::Destroy): New method.
493 (pthread_mutex::SetOwner): Ditto.
494 (pthread_mutex::LockRecursive): Ditto.
496 2003-01-09 Thomas Pfaff <tpfaff@gmx.net>
498 * pthread.cc (pthread_cond_init): Use new pthread_cond::init.
499 * thread.cc: Some white spaces cleanups.
500 Change __pthread_cond_init to pthread_cond::init throughout.
501 (nativeMutex): Move class methods outside pthread_mutex.
502 (MTinterface::Init): Initialize pthread_cond init lock.
503 (pthread_cond::condInitializationLock): Instantiate.
504 (pthread_cond::initMutex): New Method.
505 (pthread_cond::isGoodInitializerOrBadObject): Ditto.
506 * thread.h: Some white spaces cleanups.
507 (nativeMutex): Move class declaration outside pthread_mutex.
508 (pthread_cond::condInitializationLock): New static member.
509 (pthread_cond::initMutex): New Method.
510 (pthread_cond::isGoodInitializerOrBadObject): Ditto.
511 (__pthread_cond_init): Remove prototype.
513 2003-01-09 Corinna Vinschen <corinna@vinschen.de>
515 * fhandler_disk_file.cc (num_entries): Return 2 as link count if
516 directory unreadable.
518 2003-01-09 Corinna Vinschen <corinna@vinschen.de>
520 * security.cc (get_nt_attribute): Always return -1 when read_sd()
522 (get_file_attribute): Set permissions to 0 and owner/group to -1
523 if security descriptor is unreadable.
525 2003-01-09 Christopher Faylor <cgf@redhat.com>
527 Use isdirsep rather than SLASH_P throughout.
528 * path.cc (iscygdrive): Disallow /cygdrive\x.
529 (normalize_posix_path): "Normalize" a windows path, if detected, rather
530 than converting to posix.
532 2003-01-06 Troy Curtiss <troyc@usa.net>
534 * fhandler_serial.cc (fhandler_serial::tcsetattr): Add support and
535 capability checking for B230400 bitrate.
536 (fhandler_serial::tcgetattr): Add support for B230400 bitrate.
537 * include/sys/termios.h: Add B230400 definition for Posix support of
540 2003-01-05 Christopher Faylor <cgf@redhat.com>
542 * pinfo.cc (_pinfo::commune_send): Use myself->lock rather than just
545 2003-01-03 Christopher Faylor <cgf@redhat.com>
547 * dtable.h (dtable::in_vfork_cleanup): New function. True if vfork
549 * dtable.cc (dtable::vfork_parent_restore): Remove assertion.
550 * pipe.cc (fhandler_pipe::close): Don't close read_state during
551 fork_fixup since it wasn't inherited.
553 2003-01-01 Christopher Faylor <cgf@redhat.com>
555 * passwd.cc (getpwuid_r32): Revert previous change.
557 2003-01-01 Christopher Faylor <cgf@redhat.com>
559 * sysconf.cc (sysconf): Return arbitrary values for
560 _SC_GETGR_R_SIZE_MAX, _SC_LOGIN_NAME_MAX, _SC_GETPW_R_SIZE_MAX.
562 * passwd.cc (getpwuid_r32): Add uid/gid fields to size check