]> sourceware.org Git - newlib-cygwin.git/blame - winsup/cygwin/ChangeLog
remove
[newlib-cygwin.git] / winsup / cygwin / ChangeLog
CommitLineData
78dd8bdd
CF
12002-08-28 Christopher Faylor <cgf@redhat.com>
2
3 * malloc.cc: Protect some definitions to avoid a compile time warning.
4
75d01d9e
CV
52002-08-27 Nicholas Wourms <nwourms@netscape.net>
6
7 * cygwin.din: Export getc_unlocked, getchar_unlocked,
8 putc_unlocked, putchar_unlocked functions.
9 * include/cygwin/version.h: Bump api minor.
10
281d8a32
CV
112002-08-28 Corinna Vinschen <corinna@vinschen.de>
12
13 * fhandler_socket.cc (fhandler_socket::recvfrom): Eliminate flags
14 not understood by WinSock.
15 (fhandler_socket::sendto): Ditto. If WinSock sendto() returns
16 WSAESHUTDOWN, change errno to EPIPE and raise SIGPIPE if MSG_NOSIGNAL
17 isn't set in flags.
18 * include/cygwin/socket.h: Define MSG_WINMASK and MSG_NOSIGNAL.
19 * include/cygwin/version.h: Bump API minor number.
20
667599f4
CV
212002-08-28 Corinna Vinschen <corinna@vinschen.de>
22
23 * poll.cc (poll): Eliminate erroneous POLLERR conditional.
24
0a642325
CV
252002-08-26 Conrad Scott <conrad.scott@dsl.pipex.com>
26
27 * fhandler_socket.cc (fhandler_socket::check_peer_secret_event):
28 Fix strace message.
29 (fhandler_socket::connect): Remove sigframe.
30 (fhandler_socket::accept): Ditto.
31 (fhandler_socket::getsockname): Ditto.
32 (fhandler_socket::getpeername): Ditto.
33 (fhandler_socket::recvfrom): Ditto.
34 (fhandler_socket::recvmsg): Ditto.
35 (fhandler_socket::sendto): Ditto.
36 (fhandler_socket::sendmsg): Ditto.
37 (fhandler_socket::close): Ditto.
38 (fhandler_socket::ioctl): Ditto.
39 * ioctl.cc (ioctl): Add sigframe.
40 *net.cc (cygwin_sendto): Ditto.
41 (cygwin_recvfrom): Ditto.
42 (cygwin_recvfrom): Ditto.
43 (cygwin_connect): Ditto.
44 (cygwin_shutdown): Ditto.
45 (cygwin_getpeername): Ditto.
46 (cygwin_accept): Ditto. Improve strace message.
47 (cygwin_getsockname): Ditto. Ditto.
48 (cygwin_recvmsg): Ditto. Ditto.
49 (cygwin_sendmsg): Fix strace message.
50
6d8bd861
CF
512002-08-27 Christopher Faylor <cgf@redhat.com>
52
53 * child_info.h: Add _PROC_WHOOPS enum value.
54 (CURR_CHILD_INFO_MAGIC): Update.
55 (child_info::magic): Make 'long'.
56 * cygheap.h: Export _cygheap_start.
57 * cygheap.cc: Don't declare _cygheap_start.
58 * cygmagic: Use cksum to produce checksums. Append 'U' to end of
59 checksum.
60 * dcrt0.cc (initial_env): Calculate sleep ms before reusing buffer.
61 (_dll_crt0): Detect cygheap mismatch as indicative of different cygwin
62 version. Set child_proc_info to NULL when _PROC_WHOOPS.
63 (multiple_cygwin_problem): If child_info specific problem, then set
64 child_proc_info type to _PROC_WHOOPS.
65 * shared_info.h (CURR_MOUNT_MAGIC): Update.
66 (CURR_SHARED_MAGIC): Ditto.
67
c250f914
CV
682002-08-25 Conrad Scott <conrad.scott@dsl.pipex.com>
69
70 * fhandler.h (fhandler_socket::recvfrom): Fix prototype.
71 (fhandler_socket::sendto): Ditto.
72 * fhandler_socket.cc (fhandler_socket::recvfrom): Ditto.
73 (fhandler_socket::sendto): Ditto.
74 * include/sys/socket.h (recv): Fix prototype.
75 (recvfrom): Ditto.
76 (send): Ditto.
77 (sendto): Ditto.
78 * net.cc (cygwin_sendto): Ditto. Improve strace message
79 (cygwin_recvfrom): Ditto. Ditto.
80 (cygwin_setsockopt): Improve strace message.
81 (cygwin_getsockopt): Ditto.
82 (cygwin_connect): Ditto.
83 (cygwin_accept): Ditto.
84 (cygwin_bind): Ditto.
85 (cygwin_getsockname): Ditto.
86 (cygwin_getpeername): Ditto.
87 (cygwin_recv): Fix prototype.
88 (cygwin_send): Ditto.
89 (cygwin_recvmsg): Improve strace message.
90 (cygwin_sendmsg): Ditto.
91
38170b13
CV
922002-08-25 Pierre Humblet <Pierre.Humblet@ieee.org>
93
94 * sec_acl.cc (getacl): Check ace_sid == well_known_world_sid
95 before owner_sid and group_sid so that well_known_world_sid
96 means "other" even when owner_sid and/or group_sid are Everyone.
97 * security.cc (get_attribute_from_acl): Created from code common
98 to get_nt_attribute() and get_nt_object_attribute(), with same
99 reordering as in getacl() above.
100 (get_nt_attribute): Call get_attribute_from_acl().
101 (get_nt_object_attribute): Ditto.
102
72005574
CF
1032002-08-26 Christopher Faylor <cgf@redhat.com>
104
105 * Makefile.in (cygcheck.exe): Make a -mno-cygwin program.
106 * cygrun.c (main): Export CYGWIN=ntsec unless otherwise set.
107
108 * shared.cc (shared_name): Only add build date to shared name when
109 *testing*.
110
f77cd636
CF
1112002-08-24 Christopher Faylor <cgf@redhat.com>
112
113 * Makefile.in (DLL_IMPORTS): Move libuuid.a and libshell32.a to list
114 rather than referring to them via -l. Add DLL imports last in link
115 line for new-cygwin.dll and cygrun.exe.
116
3bacc423
CF
1172002-08-19 Christopher Faylor <cgf@redhat.com>
118
119 * pinfo.h (pinfo::remember): Arrange for destructor call if
120 proc_subproc returns error.
121 * sigproc.cc (zombies): Store 1 + total zombies since proc_subproc uses
122 NZOMBIES element.
123
34f72894
CV
1242002-08-19 Corinna Vinschen <corinna@vinschen.de>
125
126 * pwdgrp.h (pwdgrp_read::pwdgrp_read): Remove.
127 (pwdgrp_read::~pwdgrp_read): Ditto.
128 (pwdgrp_read::open): Reset fh to NULL instead of INVALID_HANDLE_VALUE.
129 (pwdgrp_read::close): Ditto.
130
c060edba
CF
1312002-08-19 Christopher Faylor <cgf@redhat.com>
132
133 * fhandler.h (fhandler_console::send_winch_maybe): New method.
134 * fhandler_console.cc (set_console_state_for_spawn): Remove if 0'ed
135 code.
136 (fhandler_console::send_winch_maybe): Define new method.
137 (fhandler_console::read): Use send_winch_maybe where appropriate.
138 (fhandler_console::init): Just call all tcsetattr rather than
139 output_tcsetattr.
140 * select.cc (peek_console): Reorganize so that send_winch_maybe is
141 called for everything but keyboard input.
142
8dca9e23
CF
1432002-08-18 Christopher Faylor <cgf@redhat.com>
144
145 * perthread.h (vfork_save): Add ctty, sid, pgid, exitval fields.
146 (vfork_save::restore_pid): New method.
147 (vfork_save::restore_exit): New method.
148 * fork.cc (vfork): Save ctty, sid, pgid and restore them when returning
149 to "parent". Use exitval field if exiting but never created a new
150 process.
151 * syscalls.cc (setsid): Detect when in "vfork" and force an actual fork
152 so that pid will be allocated (UGLY!).
153 (getsid): New function.
154 * dcrt0.cc (do_exit): Use vfork_save::restore_exit method for returning
155 from a vfork.
156 * spawn.cc (spawnve): Use vfork_save::{restore_pid,restore_exit}
157 methods for returning from vfork.
158 * cygwin.din: Export getsid.
159 * include/cygwin/version.h: Bump api minor number.
160
161 * malloc.cc: #ifdef sYSTRIm for when MORECORE_CANNOT_TRIM is true.
162
d17ba05c
CF
1632002-08-18 Christopher Faylor <cgf@redhat.com>
164
165 * cygmalloc.h (MORECORE_CANNOT_TRIM): Define.
166
0428827b
CF
1672002-08-18 Christopher Faylor <cgf@redhat.com>
168
169 * sigproc.cc (sigCONT): Define.
170 * sigproc.h (sigCONT): Declare.
171 (wait_sig): Create sigCONT event here.
172 * exceptions.cc (sig_handle_tty_stop): Wait for sigCONT event rather
173 than stopping thread.
174 (sig_handle): Set sigCONT event as appropriate on SIGCONT rather than
175 calling ResumeThread.
176
a80add95
CF
1772002-08-17 Christopher Faylor <cgf@redhat.com>
178
179 * malloc.cc: Update to 2.7.2.
180 * malloc_wrapper.cc (malloc_init): Call user level mallocs to determine
0428827b 181 if the malloc routines have been overridden.
a80add95 182
98c9c456
CF
1832002-08-16 Christopher Faylor <cgf@redhat.com>
184
185 * winsup.h: Remove malloc_*lock functions.
186
c7e2187a
CF
1872002-08-16 Christopher Faylor <cgf@redhat.com>
188
189 * Makefile.in: Add support for new malloc.o and renamed
190 malloc_wrapper.o. Use -fomit-frame-pointer for malloc.o compilation.
191 * malloc_wrapper.cc: New file. Rename from malloc.cc. Add support for
192 more malloc functions. Eliminate export_* calls. Just use straight
193 malloc names. Remove unused argument from malloc lock functions.
194 * cygwin.din: Just export straight malloc names. Add malloc_stats,
195 malloc_trim, malloc_usable_size, mallopt, memalign, valloc.
196 * dcrt0.cc (__cygwin_user): Eliminate export_* malloc entries.
197 * fork.cc (fork_parent): Remove unused argument from malloc_lock
198 argument.
199 * malloc.cc: New file. Doug Lea's malloc v2.7.1.
200 * cygmalloc.h: New file.
201 * include/cygwin/version.h: Bump API_MINOR.
202
203 * sync.h (muto::acquire): Use appropriate number for regparm attribute.
204 (muto::reset): Ditto.
205 (muto::release): Ditto.
206
775275aa
CF
2072002-08-16 Pavel Tsekov <ptsekov@gmx.net>
208
209 * exceptions.cc (interrupt_setup): Ensure that the previous signal mask
210 is properly saved.
211
a54ad580
CF
2122002-08-15 Thomas Pfaff <tpfaff@gmx.net>
213
214 * dcrt0.cc: Modify define for CYGWIN_GUARD.
215 (alloc_stack_hard_way): Just use CYGWIN_GUARD in VirtualAlloc call.
216
e1209950
CS
2172002-08-11 Conrad Scott <conrad.scott@dsl.pipex.com>
218
219 * fhandler.h (fhandler_socket::recv): Remove method.
220 (fhandler_socket::send): Ditto.
221 * fhandler_socket.cc (fhandler_socket::recv): Ditto.
222 (fhandler_socket::send): Ditto.
223 (fhandler_socket::read): Delegate to fhandler_socket::recvfrom.
224 (fhandler_socket::write): Delegate to fhandler_socket::sendto.
225 (fhandler_socket::sendto): Check for null `to' address.
226 * net.cc (cygwin_sendto): Check for zero request length.
227 (cygwin_recvfrom): Ditto. Fix signature, use void *buf.
228 (cygwin_recv): Delegate to cygwin_recvfrom.
229 (cygwin_send): Delegate to cygwin_sendto.
230
5ffec1d1
CF
2312002-08-11 Christopher Faylor <cgf@redhat.com>
232
233 * cygthread.cc (cygthread::cygthread): Close another race.
234
3cb62bd6
CF
2352002-08-11 Christopher Faylor <cgf@redhat.com>
236
237 * assert.cc (__assert): Call debugger on assertion failure if
238 debugging.
239 * dcrt0.cc (dll_crt0_1): Just wait for signal thread to go live rather
240 than going through the overhead of invoking it.
241 * fork.cc (fork_child): Ditto.
242 * exceptions.cc (signal_fixup_after_fork): Call sigproc_init here.
243 * sigproc.cc (proc_can_be_signalled): Assume that the signal thread is
244 live.
245 (sig_dispatch): Ditto.
246 (sig_send): Ditto.
bb55ce4c 247 (wait_for_sigthread): Rename from "wait_for_me". Assume that
3cb62bd6
CF
248 wait_sig_inited has been set and that this function is only called from
249 the main thread.
07635137 250 * sigproc.h (wait_for_sigthread): Declare new function.
3cb62bd6 251
25859d7c
CF
2522002-08-08 Christopher Faylor <cgf@redhat.com>
253
254 * environ.cc (parse_options): Remember the "no" part of any options for
255 later export.
256
b4f06520
CS
2572002-08-07 Conrad Scott <conrad.scott@dsl.pipex.com>
258
259 * winsup.h (__check_null_invalid_struct): Make ptr argument non-const.
260 (__check_null_invalid_struct_errno): Ditto.
261 * miscfuncs.cc (__check_null_invalid_struct): Ditto.
262 (__check_null_invalid_struct_errno): Ditto.
263 (__check_invalid_read_ptr_errno): Remove superfluous cast.
264 * net.cc (get): Set appropriate errno if fd is not a socket.
265 (cygwin_sendto): Fix parameter checking.
266 (cygwin_recvfrom): Ditto.
267 (cygwin_setsockopt): Ditto.
268 (cygwin_getsockopt): Ditto.
269 (cygwin_connect): Ditto.
270 (cygwin_gethostbyaddr): Ditto.
271 (cygwin_accept): Ditto.
272 (cygwin_bind): Ditto.
273 (cygwin_getsockname): Ditto.
274 (cygwin_listen): Ditto.
275 (cygwin_getpeername): Ditto.
276 (cygwin_send): Ditto.
277 (cygwin_shutdown): Ditto. Move sigframe to fhandler_socket.
278 (cygwin_recvmsg): Fix parameter checking. Add tracing.
279 (cygwin_sendmsg): Ditto.
280 * fhandler_socket.cc (fhandler_socket::shutdown): Add sigframe.
281 * resource.cc (setrlimit): Fix parameter checking.
282
b7e66454
CV
2832002-08-08 Joe Buehler <jbuehler@hekimian.com
284
285 * sec_helper.cc (sec_acl): remove extraneous arg to debug_printf.
286
235d9fda
CV
2872002-08-07 Conrad Scott <conrad.scott@dsl.pipex.com>
288
289 * fhandler_socket.cc (fhandler_socket::accept): Fix FIONBIO call.
290
772f6c3e
CF
2912002-08-06 Christopher Faylor <cgf@redhat.com>
292
293 * cygheap.cc (_csbrk): Avoid !cygheap considerations.
294 (cygheap_init): Deal with unintialized cygheap issues here.
88de60e4 295 (cheap_init): Move cygheap_max setting here.
772f6c3e 296
e851d2fe
CF
2972002-08-06 Christopher Faylor <cgf@redhat.com>
298 Conrad Scott <conrad.scott@dsl.pipex.com
299
300 * cygheap.cc (_csbrk): Allocate some slop initially. Don't erroneously
301 add sbrk amount to returned value in initial case.
302
115a0885
CF
3032002-08-06 Christopher Faylor <cgf@redhat.com>
304
305 * spawn.cc (spawn_guts): Don't set mount_h here.
306 * sigproc.cc (init_child_info): Set it here instead.
307 * shared.cc (cygwin_mount_h): Make NO_COPY.
308
1524ae42
CF
3092002-08-06 Christopher Faylor <cgf@redhat.com>
310
311 * cygthread.cc (cygthread::stub): Accept flag to pass info structure to
312 thread function.
313 (cygthread::operator new): Add defense debugging output.
314 (cygthread::cygthread): Add debugging output. Set name after thread
315 has been awakened to avoid a race.
316 (cygthread::exit_thread): Use handle operator rather than using ev
317 directly.
318 (cygthread::exit_thread): Reorganize to provide debugging. Set __name
319 to NULL.
320 * cygthread.h (cygself): Define.
321 * fhandler_tty.cc (fhandler_tty_master::init): Use cygself as argument
322 so that invoked thread can access its own info.
323 (process_output): Derive cygthread info of thread from thread argument.
324 * sigproc.cc (sigproc_init): Use cygself as argument so that invoked
325 thread can access its own info.
326 (wait_sig): Derive cygthread info of thread from thread argument.
327
ffebb4fe
CS
3282002-08-06 Conrad Scott <conrad.scott@dsl.pipex.com>
329
330 * debug.h (handle_list::allocated): Remove field.
331 * debug.cc (newh): Don't malloc extra entries.
332 (add_handle): Downgrade strace message level.
333 (delete_handle): Remove case for `allocated' entries.
334
8d0bc156
CF
3352002-08-05 Christopher Faylor <cgf@redhat.com>
336
337 * cygthread.cc (cygthread::stub): Change event creation to manual
338 reset. Set __name after calling SetEvent to prevent races.
339 (cygthread::detach): Always reset event here to prevent races.
340
245e4e87
CS
3412002-08-03 Conrad Scott <conrad.scott@dsl.pipex.com>
342
343 * debug.h (WaitForMultipleObjects): Correct typo.
344
23d93d8d
CV
3452002-08-01 Pierre Humblet <Pierre.Humblet@ieee.org>
346
347 * security.cc (verify_token): Do not reject a token just because
348 the supplementary group list is missing Everyone or a groupsid
349 equal to usersid, or because the primary group is not in the token,
350 as long as it is equal to the usersid.
351 * syscalls.cc (seteuid32): Use common code for all successful returns.
352 * grp.cc (getgroups32): Never includes Everyone in the output.
353
6b2a9a2f
CF
3542002-08-01 Christopher Faylor <cgf@redhat.com>
355
356 * cygthread.cc (cygthread::exit_thread): Define new method.
357 * cygthread.h (cygthread::exit_thread): Declare new method.
358 * fhandler.h (fhandler_tty_master::hThread): Delete.
359 (fhandler_tty_master::output_thread): Define.
360 * fhandler_tty.cc (fhandler_tty_master::fhandler_tty_master): Adjust
361 constructor.
362 (fhandler_tty_master::init): Use cygthread rather than handle.
363 (process_output): Use cygthread method to exit.
364 (fhandler_tty_master::fixup_after_fork): Set output_thread to NULL
365 after fork.
366 (fhandler_tty_master::fixup_after_exec): Set output_thread to NULL
367 after spawn/exec.
368 * tty.cc (tty_list::terminate): Detach from output_thread using
369 cygthread method.
370
8a19897f
CF
3712002-08-01 Christopher Faylor <cgf@redhat.com>
372
373 * syscalls.cc (_link): Revert previous change and just always
374 dereference the oldpath.
375
e51cfd31
CF
3762002-08-01 Christopher Faylor <cgf@redhat.com>
377
378 * syscalls.cc (link): Properly deal with a link to a symlink.
379
92655eab
CF
3802002-08-01 Christopher Faylor <cgf@redhat.com>
381
382 * cygthread.cc: Remove cruft.
383
b6bd7037
CF
3842002-08-01 Christopher Faylor <cgf@redhat.com>
385
386 * Makefile.in (DLL_OFILES): Add cygthread.o.
387 * dcrt0.cc (dll_crt0_1): Eliminate various thread initialization
388 functions in favor of new cygthread class.
389 * debug.cc: Remove thread manipulation functions.
390 * debug.h: Ditto.
391 * external.cc (cygwin_internal): Use cygthread method for determining
392 thread name. Remove capability for setting thread name.
393 * fhandler_console.cc (fhandler_console::read): Use cygthread method
394 rather than iscygthread function.
395 * fhandler_tty.cc (fhandler_tty_master::fhandler_tty_master): Use
396 cygthread methods to create threads.
397 (fhandler_tty_common::__acquire_output_mutex): Use cygthread method to
398 retrieve thread name.
399 * select.cc (pipeinf): Use cygthread pointer rather than handle.
400 (start_thread_pipe): Ditto.
401 (pipe_cleanup): Ditto.
402 (serialinf): Ditto.
403 (start_thread_serial): Ditto.
404 (serial_cleanup): Ditto.
405 (socketinf): Ditto.
406 (start_thread_socket): Ditto.
407 (socket_cleanup): Ditto.
408 * sigproc.cc (hwait_sig): Ditto.
409 (hwait_subproc): Ditto.
410 (proc_terminate): Ditto.
411 (sigproc_terminate): Ditto.
412 (sigproc_init): Initialize cygthread hwait_sig pointer.
413 (subproc_init): Initialize cygthread hwait_subproc pointer.
414 (wait_sig): Rely on cygthread HANDLE operator.
415 * strace.cc (strace::vsprntf): Use cygthread::name rather than threadname.
416 * window.cc (gethwnd): Use cygthread method to initialize thread.
417
afcd48e6
CV
4182002-07-31 Conrad Scott <conrad.scott@dsl.pipex.com>
419
420 * fhandler.h (fhandler_base::get_r_no_interrupt): Make non-virtual.
421 * net.cc (fdsock): Call set_r_no_interrupt.
422
deaa100b
CF
4232002-07-30 Christopher Faylor <cgf@redhat.com>
424
425 * syscalls.cc (_read): Clarify debugging output.
426
c91a9a9b
CF
4272002-07-30 Christopher Faylor <cgf@redhat.com>
428
429 * fhandler.h (fhandler_base::get_r_no_interrupt): Make virtual.
430
5ba08a92
CF
4312002-07-30 Christopher Faylor <cgf@redhat.com>
432
433 * fhandler_disk_file.cc (fhandler_cygdrive::set_drives): Incorporate .
434 and .. processing here.
435 (fhandler_cygdrive::readdir): Assume . and .. are already in pdrive.
436 (fhandler_cygdrive::seekdir): Ditto.
437
c6ed5790
CF
4382002-07-29 Christopher Faylor <cgf@redhat.com>
439
440 * dcrt0.cc (dll_crt0_1): Move debug_fixup_after_fork_exec.
441 * cygheap.cc (cygheap_fixup_in_child): Call debug_fixup_after_fork_exec
4f9cdc93 442 immediately after cygheap has been set up.
c6ed5790 443
5519d543
CV
4442002-07-29 Corinna Vinschen <corinna@vinschen.de>
445
446 * security.cc: Change some formatting.
447 * include/cygwin/version.h: Bump API minor version.
448
4492002-07-28 Pierre Humblet <Pierre.Humblet@ieee.org>
450
c6ed5790
CF
451 * cygheap.h (class cygheap_user): Add member groups.
452 * security.h (class cygsidlist): Add members type and maxcount, methods
453 position, addfromgr, alloc_sids and free_sids and operator+= (const
454 PSID psid). Modify contains () to call position () and optimize add ()
455 to use maxcount.
456 (class user_groups): Create. Update declarations of verify_token and
457 create_token.
458 * security.cc (cygsidlist::alloc_sids): New.
459 (cygsidlist::free_sids): New.
460 (get_token_group_sidlist): Create from get_group_sidlist.
461 (get_initgroups_sidlist): Create from get_group_sidlist.
462 (get_group_sidlist): Suppress.
463 (get_setgroups_sidlist): Create.
464 (verify_token): Modify arguments. Add setgroups case.
465 (create_token): Modify arguments. Call get_initgroups_sidlist and
466 get_setgroups_sidlist as needed. Set SE_GROUP_LOGON_ID from auth_pos
467 outside of the loop. Rename the various group sid lists consistently.
468 * syscalls.cc (seteuid32): Modify to use cygheap->user.groups.
469 (setegid32): Call cygheap->user.groups.update_pgrp.
470 * grp.cc (setgroups): Create.
471 (setgroups32): Create.
472 * uinfo.cc (internal_getlogin): Initialize and update
473 user.groups.pgsid.
474 * cygwin.din: Add setgroups and setgroups32.
5519d543 475
eb5720f2
CF
4762002-07-28 Christopher Faylor <cgf@redhat.com>
477
478 * fhandler_console.cc (fhandler_console::read): Use appropriate
479 kill_pgrp method.
480 * select.cc (peek_console): Ditto.
481 * fhandler_termios.cc (fhandler_termios::bg_check): Send "stopped"
482 signal to entire process group as dictated by SUSv3.
483 * termios.cc (tcsetattr): Detect when stopped signal sent and force a
484 stop before setting anything.
485
667f875d
CF
4862002-07-26 Christopher Faylor <cgf@redhat.com>
487
488 * include/cygwin/version.h: Bump API version to indicate that ntsec is
489 on by default now.
490
6b3c247d
CF
4912002-07-26 Conrad Scott <conrad.scott@dsl.pipex.com>
492
493 * fhandler_registry.cc (fhandler_registry::close): Return any error
494 result to the caller.
495 * syscalls.cc (_close): Return result of fhandler::close to the caller.
496
68fb3cca
CF
4972002-07-25 Christopher Faylor <cgf@redhat.com>
498
499 * security.cc (allow_ntsec): Default to on.
500 (allow_smbntsec): Default to off.
501
be18721e
CF
5022002-07-24 David MacMahon <davidm@smartsc.com>
503
504 * times.cc (to_time_t): Always round time_t down to nearest second.
505
b9e8058d
ED
5062002-07-25 Egor Duda <deo@logos-m.ru>
507
c6ed5790 508 * Makefile.in: Check if API version is updated when exports are
b9e8058d
ED
509 changed and stop if not so.
510
bf47141f
CV
5112002-07-24 Egor Duda <deo@logos-m.ru>
512
513 * include/cygwin/version.h: Bump minor API version.
514
0a73fce0
CV
5152002-07-24 Corinna Vinschen <corinna@vinschen.de>
516
517 * fhandler_serial.cc: Change 'must_init_serial_line capability'
518 to 'supports_reading_modem_output_lines' throughout (negated meaning).
519 * wincap.cc: Ditto.
520 * wincap.h: Ditto.
521
f72a851f
CV
5222002-07-23 Nicholas Wourms <nwourms@netscape.net>
523
524 * cygwin.din (fcloseall): Add symbol for export.
525 (fcloseall_r): Ditto.
526
99138976
CF
5272002-07-24 Christopher Faylor <cgf@redhat.com>
528
529 * path.cc (path_conv::check): Always set fileattr when component == 0.
530 (readlink): Use path_conv method rather than field.
531 * fhandler_disk_file.cc (fhandler_disk_file::fstat_helper): Ditto,
532 throughout.
533 * path.h (path_conv): Make fileattr private.
534 * exceptions.cc (try_to_debug): Default to idle priority when looping.
535
010bb8a4
CV
5362002-07-23 Corinna Vinschen <corinna@vinschen.de>
537
538 * fhandler_serial.cc: Use must_init_serial_line capability throughout.
539 * wincap.cc: Set flag must_init_serial_line appropriately.
540 * wincap.h: Add flag must_init_serial_line.
541
fdb93cd2
CV
5422002-07-23 Corinna Vinschen <corinna@vinschen.de>
543
544 * security.cc (get_group_sidlist): Create group list from /etc files
545 even if DC is available but access fails.
546
08e2551c
CF
5472002-07-22 Christopher Faylor <cgf@redhat.com>
548
549 * fhandler_serial.cc: Fix formatting problems introduced by below
550 changes.
551
780c42b4
CV
5522002-07-22 Jacek Trzcinski <jacek@certum.pl>
553
08e2551c
CF
554 * fhandler.h (class fhandler_serial): Add new members of the class -
555 rts,dtr and method ioctl(). Variables rts and dtr important for Win 9x
556 only.
557 * fhandler_serial.cc (fhandler_serial::open): Add initial setting of
558 dtr and rts. Important for Win 9x only.
559 (fhandler_serial::ioctl): New function. Implements commands TIOCMGET,
780c42b4 560 TIOCMSET and TIOCINQ.
bb55ce4c 561 (fhandler_serial::tcflush): Fix found error.
08e2551c 562 (fhandler_serial::tcsetattr): Add settings of rts and dtr. Important
780c42b4 563 for Win 9x only.
08e2551c
CF
564 * termios.h: Add new defines as a support for ioctl() function on
565 serial device.
780c42b4 566
5ec1dcc5
CF
5672002-07-20 Christopher Faylor <cgf@redhat.com>
568
569 * autoload.cc (LoadDLLprime): Add jmp call to allow streamlining of
570 later jmp rewrite.
571 (doit): Avoid use of cx register. Just change one word to avoid races.
572
095a1272
CV
5732002-07-18 Pierre Humblet <pierre.humblet@ieee.org>
574
575 * security.cc (get_unix_group_sidlist): Create.
576 (get_supplementary_group_sidlist): Evolve into get_unix_group_sidlist.
577 (get_user_local_groups): Add check for duplicates.
578 (get_user_primary_group): Suppress.
579 (get_group_sidlist): Silently ignore PDC unavailability.
580 Call get_unix_group_sidlist() before get_user_local_groups().
581 Remove call to get_supplementary_group_sidlist(). Never call
582 get_user_primary_group() as the passwd group is always included.
583 Add well_known_authenticated_users_sid in only one statement.
584
86620e8f
CF
5852002-07-19 Christopher Faylor <cgf@redhat.com>
586
587 * fhandler_serial.cc (fhandler_serial::tcflush): Fix typo.
588
315fb3af
CV
5892002-07-15 Corinna Vinschen <corinna@vinschen.de>
590
591 * security.cc (get_group_sidlist): Fix formatting.
592
56a42791
CF
5932002-07-14 Christopher Faylor <cgf@redhat.com>
594
595 * dcrt0.cc (initial_env): Force path and CYGWIN_DEBUG contents to lower
596 case.
597 * exceptions.cc (error_start_init): Use the name derived from
598 GetModuleName rather than myself->progname.
599
3d0ba393
CF
6002002-07-14 Christopher Faylor <cgf@redhat.com>
601
602 * dcrt0.cc (dll_crt0_1): Move debug_init call back to here. Avoid a
603 compiler warning.
604 * shared.cc (memory_init): Remove debug_init call.
605 * debug.h (handle_list): Change "clexec" to "inherited".
606 * debug.cc: Remove a spurious declaration.
607 (setclexec): Conditionalize away since it is currently unused.
608 (add_handle): Use inherited field rather than clexec.
609 (debug_fixup_after_fork_exec): Ditto. Move debugging output to
610 delete_handle.
611 (delete_handle): Add debugging output.
612 * fhandler.cc (fhandler_base::set_inheritance): Don't bother setting
613 inheritance in debugging table since the handle was never protected
614 anyway.
615 (fhandler_base::fork_fixup): Ditto.
616
617 * exceptions.cc (debugger_command): Revert.
618
f5c3d180
CF
6192002-07-14 Conrad Scott <conrad.scott@dsl.pipex.com>
620
621 * debug.cc (clexec): Add missing `hl = hl->next'.
622
e8a6396f
CF
6232002-07-14 Christopher Faylor <cgf@redhat.com>
624
625 * Makefile.in (cygrun.exe): Add a -lcygwin on the end.
626
fea4c29f
CF
6272002-07-14 Christopher Faylor <cgf@redhat.com>
628
629 * Makefile.in (cygserver.exe): Add -lstdc++.
630 (cygrun.exe): Move -lgcc last.
631
c03dba93
CF
6322002-07-13 Christopher Faylor <cgf@redhat.com>
633
634 * dcrt0.cc (dll_crt0_1): Delay closing of some handles until cygheap
635 has been set up.
636 (break_here): New function, for debugging.
637 (initial_env): Add program name to "Sleeping" message. Implement new
638 "CYGWIN_DEBUG" environment variable option.
639 * exceptions.cc (debugger_command): Add argument to dumper call.
640 * strace.cc (strace::hello): Use winpid if cygwin pid is unavailable.
641 (strace::vsprntf): Ditto.
642
0301bfd0
CF
6432002-07-13 Christopher Faylor <cgf@redhat.com>
644
645 * debug.h (handle_list): Move here from debug.cc. Add "inherit" flag
646 functionality.
647 * cygheap.cc (init_cheap): Move cygheap_max calculation to _csbrk.
648 (_csbrk): Reorganize to not assume first allocation is <= 1 page.
649 (cygheap_setup_for_child): Mark protected handle as inheritable.
650 * cygheap.h (cygheap_debug): New struct.
651 (init_cygheap): Add new structure when debugging.
652 * dcrt0.cc (dll_crt0_1): Remove call to debug_init. Close ppid_handle
653 here, if appropriate. Don't protect subproc_ready, since it is already
654 protected in the parent. Call memory_init prior to ProtectHandle to
655 ensure that cygheap is set up. Call debug_fixup_after_fork_exec when
656 appropriate.
657 (_dll_crt0): Don't close ppid_handle here.
658 * debug.cc: Use cygheap debug structure rather than static elements
659 throughout.
660 (add_handle): Don't issue a warning if attempt to protect handle in
661 exactly the same way from exactly the same place. Add pid info to
662 warning output. Accept additional argument controlling whether handle
663 is to be inherited. Add pid to stored information.
664 (debug_fixup_after_fork_exec): Renamed from debug_fixup_after_fork.
665 Reorganize to avoid erroneously skipping handles.
666 (mark_closed): Add pid info to warning output.
667 (setclexec): Rename from setclexec_pid.
668 * fhandler.cc (fhandler_base::get_default_fmode): Minor reorg.
669 (fhandler_base::fstat): Add debugging output.
670 (fhandler_base::set_inheritance): Call setclexec rather than
671 setclexec_pid.
672 (fhandler_base::fork_fixup): Ditto.
673 * fhandler_console.cc (get_tty_stuff): Mark protected handle as
674 inheritable.
675 * fhandler_tty.cc (fhandler_tty_slave::open): Ditto.
676 * tty.cc (tty::make_pipes): Ditto.
677 (tty::common_init): Ditto.
678 * fork.cc (fork_parent): Ditto.
679 (fork_child): Close protected handles with correct name. Remove
680 debug_fixup_after_fork call.
681 * fhandler_socket.cc (fhandler_socket::create_secret_event): Mark
682 protected handle as inheritable/non-inheritable, as appropriate.
683 * shared.cc (memory_init): Mark protected handle as inheritable.
684 Call debug_init here.
685 * sigproc.cc (wait_sig): Close protected handle with correct name.
686 * spawn.cc (spawn_guts): Rename spr to subproc_ready and mark it as
687 inheritable.
688
689 * exceptions.cc (debugger_command): Try to run dumper.exe, if found.
690
691 * syscalls.cc (fstat64): Don't follow symlinks for path_conv lookup
692 since path is already resolved.
693
e82f98d0
CF
6942002-07-12 Christopher Faylor <cgf@redhat.com>
695
37f7c64b 696 * cygwin.din: Change erroneous entries.
e82f98d0 697
472a8223
CV
6982002-07-11 Pavel Tsekov <ptsekov@gmx.net>
699
700 * fhandler_disk_file.cc (fhandler_disk_file::open): Don't
701 move the file pointer to the end of file if O_APPEND is
702 specified in the open flags.
703
1f5ff387
CF
7042002-07-09 Christopher Faylor <cgf@redhat.com>
705
706 * debug.cc: Avoid explicit zeroing of globals.
707 (lock_debug): Make locker a static member. Avoid unlocking when
708 already unlocked (from Conrad Scott).
709 (debug_init): Initialize lock_debug::locker here.
710 * fork.cc (fork_child): Fix up fdtab earlier to avoid some (but not
711 all) confusion with close-on-exec craziness.
712
6bb769ef
CV
7132002-07-05 Corinna Vinschen <corinna@vinschen.de>
714
715 * fhandler.h (fhandler_socket::is_unconnected): Constify.
716 (fhandler_socket::is_connect_pending): Ditto.
717 (fhandler_socket::is_connected): Ditto.
718 (fhandler_socket::set_connect_state): New method.
719 (struct select_record): Add member `except_on_write'.
720 (select_record::select_record): Initialize all bool values to `false'.
721 * fhandler_socket.cc: Use set_connect_state() method throughout.
722 (fhandler_socket::connect): Set state always to connected if connection
723 isn't pending.
724 * net.cc (cygwin_getsockopt): Revert erroneous previous patch.
725 * select.cc (set_bits): Check for `except_on_write'. Set fd in
726 write_fds if set. Set connect state to connected if fd has been
727 returned by WINSOCK_SELECT.
728 (peek_socket): Check for `except_on_write'.
729 (start_thread_socket): Ditto.
730 (fhandler_socket::select_write): Don't set `write_ready' if connect
731 is pending. Set `except_on_write' if connect is pending.
732
91a2f87b
CF
7332002-07-05 Christopher Faylor <cgf@redhat.com>
734
735 * ntdll.h (_SYSTEM_PROCESSOR_TIMES): Force eight byte alignment.
736 (_SYSTEM_TIME_OF_DAY_INFORMATION): Ditto.
737
6201dd26
CF
738 * path.cc (suffix_scan::has): Reorganize to eliminate double scanning
739 for for .exe (in the typical case).
740
d5591d9d
CV
7412002-07-05 Corinna Vinschen <corinna@vinschen.de>
742
743 * fhandler.h (UNCONNECTED): New define.
744 (CONNECT_PENDING): Ditto.
745 (CONNECTED): Ditto.
746 (class fhandler_socket): Add member `had_connect_or_listen'.
747 Add member functions `is_unconnected', `is_connect_pending' and
748 `is_connected'.
749 * fhandler_socket.cc (fhandler_socket::connect): Set member
750 `had_connect_or_listen' according to return code of WinSock
751 call.
752 (fhandler_socket::listen): Ditto.
753 * net.cc (cygwin_getsockopt): Modify SO_ERROR return value in
754 case of socket with pending connect().
755 * select.cc (peek_socket): Only add socket to matching fd_set
756 if it's not "ready". Call WINSOCK_SELECT only if at least one
757 socket is in one of the fd_sets.
758 (start_thread_socket): Only add socket to matching fd_set
759 if it's not "ready".
760 (fhandler_socket::select_write): Set write_ready to true also
761 if socket isn't connected or listening.
762
5cff62d6
CV
7632002-07-04 Corinna Vinschen <corinna@vinschen.de>
764
765 * fhandler_socket.cc (fhandler_socket::set_sun_path): Don't free
766 memory here. Allow NULL parameter.
767
e4894708
CV
7682002-07-04 Corinna Vinschen <corinna@vinschen.de>
769
770 * fhandler_socket.cc (fhandler_socket::dup): Add missing copy operation
771 on sun_path.
772
073aa681
CF
7732002-07-03 Christopher Faylor <cgf@redhat.com>
774
775 * include/cygwin/version.h: Bump DLL minor number.
776
a0ee9f75
CF
7772002-07-03 Christopher Faylor <cgf@redhat.com>
778
779 * include/sys/statfs.h: New header file.
780
58b43c8d
CF
7812002-07-03 Christopher Faylor <cgf@redhat.com>
782
783 * dtable.cc (cygwin_attach_handle_to_fd): Default to implicit bin mode
784 if none specified.
785 * fhandler.cc (fhandler_base::init): Make bin argument a guarantee
786 rather than a suggestion.
787 * path.cc (path_conv::check): Load flag returned from
788 cygwin_conv_to_win32_path into path_flags.
789
bd86408f
CS
7902002-07-03 Conrad Scott <conrad.scott@dsl.pipex.com>
791
792 * tty.cc (tty::common_init): Reverse logic of cygserver check in
793 call to SetKernelObjectSecurity.
794
3c6bd991
CV
7952002-07-03 Thomas Pfaff <tpfaff@gmx.net>
796
797 * autoload.cc (WSAEventSelect): Define new autoload function.
798 (WSAEnumNetworkEvents): Ditto.
799 * fhandler_socket.cc (fhandler_socket::accept): If socket is
800 in blocking mode wait for incoming connection and signal.
801
45586380
CF
8022002-07-02 Christopher Faylor <cgf@redhat.com>
803
804 * cygheap.cc (init_cheap): Rearrange error message.
805 (cygheap_fixup_in_child): Ditto.
806 * dtable.cc: Remove if 0'ed code.
807 * fhandler_dsp.cc (fhandler_dev_dsp::open): Force binmode.
808 * sec_helper.cc (cygsid::get_id): Use system_printf for error message.
809 * tty.cc (tty::common_init): Ditto.
810
5d230174
CF
8112002-07-02 Christopher Faylor <cgf@redhat.com>
812
813 * net.cc (cygwin_getpeername): Defend against NULL pointer dereference.
814
b7e51146
CV
8152002-07-02 Egor Duda <deo@logos-m.ru>
816
817 * include/cygwin/version.h: Bump API minor version.
818
891bb974
CV
8192002-07-01 Pierre Humblet <pierre.humblet@ieee.org>
820
821 * security.cc (get_logon_server): Interpret a zero length
822 domain as the local domain.
823 (get_group_sidlist): Add authenticated users SID to SYSTEM's group
824 list instead of SYSTEM itself.
825 (verify_token): Accept the primary group sid if it equals
826 the token user sid.
827
aeed87e8
CV
8282002-07-02 Corinna Vinschen <corinna@vinschen.de>
829
830 * cygwin.din (__fpclassifyd): Add symbol.
831 (__fpclassifyf): Ditto.
832 (__signbitd): Ditto.
833 (__signbitf): Ditto.
834
654bad37
CV
8352002-07-02 Corinna Vinschen <corinna@vinschen.de>
836
837 * security.h (DONT_INHERIT): Eliminate definition.
838 (INHERIT_ALL): Ditto.
839 (INHERIT_ONLY): Ditto.
840 * sec_acl.cc: Use appropriate defines from accctrl.h instead of the
841 above throughout.
842 * security.cc: Ditto.
843
e968058f
CF
8442002-07-01 Pierre Humblet <pierre.humblet@ieee.org>
845
846 * syscalls.c (seteuid32): Return immediately if the program is not
847 impersonated and both uid and gid are original.
848 (setegid32): Return immediately if the new gid is the current egid.
849
3434e0c8
CF
8502002-07-01 Christopher Faylor <cgf@redhat.com>
851
852 * syscalls.cc (seteuid32): Fix incorrect placement of Pierre's patch
853 below.
854
3557bbc1
CF
8552002-07-01 Christopher Faylor <cgf@redhat.com>
856
857 * syscalls.cc (seteuid32): Fix incorrect use of system_printf.
858
74fcdaec
CF
8592002-07-02 Christopher January <chris@atomice.net>
860
861 * autoload.cc (GetSecurityInfo): Define new autoload function.
862 (RegQueryInfoKeyA): Ditto.
863 * fhandler.h (fhandler_virtual::fill_filebuf): Change return type to
864 bool.
865 (fhandler_proc::fill_filebuf): Ditto.
866 (fhandler_registry::fill_filebuf): Ditto.
867 (fhandler_process::fill_filebuf): Ditto.
868 (fhandler_registry::value_name): Add new member.
869 (fhandler_registry::close): Add new method.
870 (fhandler_process::p): Remove member.
871 * fhandler_proc.cc (fhandler_proc::open): Add set_nohandle after
872 calling superclass method. Check return value of fill_filebuf.
873 (fhandler_proc::fill_filebuf): Change return type to bool. Add return
874 statement.
875 * fhandler_process.cc (fhandler_process::open): Add set_nohandle after
876 calling superclass method. Remove references to p. Check return value
877 of fill_filebuf.
878 (fhandler_process::fill_filebuf): Change return type to bool. Don't
879 use dereference operator on p. Add return statement.
880 (fhandler_process::format_process_stat): Fix typo.
881 * fhandler_registry.cc: Add static open_key declaration.
882 (fhandler_registry::exists): Assume path is already normalised. Try
883 opening the path as a key in its own right first, before reverting to
884 enumerating subkeys and values of the parent key.
885 (fhandler_registry::fstat): Add additional code to return more relevant
886 information about the registry key/value.
887 (fhandler_registry::readdir): Explicitly set desired access when
888 opening registry key. Remove output of buf from debug_printf format
889 string.
890 (fhandler_registry::open): Use set_io_handle to store registry key
891 handle. Set value_name member. Move code to read a value from the
892 registry to fill_filebuf. Add call to fill_filebuf.
893 (fhandler_registry::close): New method.
894 (fhandler_registry::fill_filebuf): Change return type to bool. Add
895 code to read a value from registry.
896 (fhandler_registry::open_key): Make function static. Use KEY_READ as
897 desired access unless this is the last path component. Check the
898 return value of RegOpenKeyEx for an error instead of hKey.
899 * fhandler_virtual.cc (fhandler_virtual::lseek): Check the return value
900 of fill_filebuf.
901 (fhandler_virtual::open): Remove call to set_nohandle.
902 (fhandler_virtual::fill_filebuf): Change return type to bool. Add
903 return statement.
904 * security.cc (get_nt_object_attribute): New function.
905 (get_object_attribute): New function.
906 * security.h (get_object_attribute): New function declaration.
907
9082002-07-01 Pierre Humblet <pierre.humblet@ieee.org>
96edd0a9
CF
909
910 * syscalls.c (seteuid32): Do not return an error when the token cannot
911 be created only because of a problem with the gid.
912
1bc9effd
CF
9132002-07-01 Christopher Faylor <cgf@redhat.com>
914
915 * fhandler_clipboard.c (fhandler_dev_clipboard::open): Force text mode.
916 * fhandler_console.cc (fhandler_console::open): *Really* force binary
917 mode rather than make it optional.
918 * fhandler_proc.cc (fhandler_proc::open): Ditto.
919 * fhandler_process.cc (fhandler_process::open): Ditto.
920 * fhandler_random.cc (fhandler_dev_random::fhandler_dev_random): Ditto.
921 * fhandler_raw.cc (fhandler_dev_raw::open): Ditto.
922 * fhandler_registry.cc (fhandler_registry::open): Ditto.
923 * fhandler_tty.cc (fhandler_tty_slave::open): Ditto.
924 * fhandler_virtual.cc (fhandler_virtual::open): Ditto.
925 * fhandler_windows.cc (fhandler_windows::open): Ditto.
926 * fhandler_zero.cc (fhandler_dev_zero::open): Ditto.
927 * net.cc (fdsock): Ditto.
928 * path.cc (set_flags): Add more debugging.
929
b5e1ec76
CF
9302002-07-01 Christopher Faylor <cgf@redhat.com>
931
932 * debug.cc (threads): Avoid initialization.
933 * uinfo.cc (cygheap_user::ontherange): (from Corinna Vinschen) Actually
934 make below changes work.
935
db57a363
CF
9362002-07-01 Christopher Faylor <cgf@redhat.com>
937
938 * uinfo.cc (cygheap_user::ontherange): Make cygwin root the last resort
939 for HOMEPATH/HOMEDRIVE for consistency with HOME.
940
73d97618
CV
9412002-07-01 Corinna Vinschen <corinna@vinschen.de>
942
943 * shared.cc (sec_none): Move to sec_helper.cc.
944 (sec_none_nih): Ditto.
945 (sec_all): Ditto.
946 (sec_all_nih): Ditto.
947 (get_null_sd): Ditto.
948 (sec_acl): Ditto.
949 (__sec_user): Ditto.
950 * sec_helper.cc (sec_none): Move from shared.cc to here.
951 (sec_none_nih): Ditto.
952 (sec_all): Ditto.
953 (sec_all_nih): Ditto.
954 (get_null_sd): Ditto.
955 (sec_acl): Ditto.
956 (__sec_user): Ditto.
957
8297bda0
CF
9582002-06-30 Christopher Faylor <cgf@redhat.com>
959
960 * uinfo.cc (cygheap_user::ontherange): Potentially set HOME from
961 existing homepath and homedrive cygheap_user fields (not currently used
962 yet). Set HOME to / if no other alternative.
963 (cygheap_user::test_uid): Simplify.
964
8a2ce995
CF
9652002-06-30 Christopher Faylor <cgf@redhat.com>
966
967 * environ.cc (parse_options): Use setenv to potentially replace CYGWIN
968 value on export. Fixes broken behavior since November 2000 changes.
969 (regopt): Return indication of whether or not something has been parsed
970 from the registry.
971 (environ_init): Only attempt to export CYGWIN variable when values were
972 set from the registry. It is exported automatically otherwise.
973
fdf0b5de
CF
9742002-06-30 Christopher Faylor <cgf@redhat.com>
975
976 * fhandler.h (fhandler_process::pid): New field.
977 (fhandler_process::fstat): Remove unneeded array. Set pid element.
978 (fhandler_process::open): Ditto.
979 (fhandler_process::fill_filebuf): Handle case where 'p' field is NULL.
980
ccacec81
CF
9812002-06-30 Christopher Faylor <cgf@redhat.com>
982
983 * fhandler.h (fhandler_process::p): New field.
984 (fhandler_process:fill_filebuf): Revert to same definition as virtual
985 in parent class.
986 (fhandler_process::open): Fill out p field rather than passing as an
987 argument.
988 (fhandler_process::fill_filebuf): Use p pointer rather than argument.
989
fad1c3a8 9902002-06-29 Pierre Humblet <pierre.humblet@ieee.org>
c6d90e84
CV
991
992 * security.cc (extract_nt_dom_user): Check for all buffer overflows.
993 Call LookupAccountSid after trying to get domain & user from passwd.
994 (get_group_sidlist): Obtain the domain and user by calling
995 extract_nt_dom_user instead of LookupAccountSid.
996
839b2942
CF
9972002-06-29 Christopher Faylor <cgf@redhat.com>
998
999 * uinfo.cc (cygheap_user::test_uid): Use standard issetuid test.
1000
efc1575e
CF
10012002-06-29 Christopher Faylor <cgf@redhat.com>
1002
1003 * autoload.cc (NetGetDCName): Change to make this an optional load
1004 function.
1005 * cygheap.h (cygheap_user::logsrv): Return NULL when operation fails.
1006 (cygheap_user::winname): Ditto.
1007 (cygheap_user::domain): Ditto.
1008 * uinfo.cc (cygheap_user::env_logsrv): Save results in temp variable.
1009 (cygheap_user::env_userprofile): Ditto.
1010
638180f5
CF
10112002-06-29 Christopher Faylor <cgf@redhat.com>
1012
1013 * environ.cc (spenv::retrieve): Detect return of env_dontadd from
1014 cygheap_user methods.
1015 (build_env): Avoid incrementing environment pointer if not actually
1016 adding to the environment. That could result in garbage in the
1017 environment table. Be more defensive when reallocing envblock.
1018
38bc1196
CF
10192002-06-29 Christopher Faylor <cgf@redhat.com>
1020
1021 * uinfo.cc (cygheap_user::test_uid): Return NULL or further tests are
1022 sorta useless.
1023 (cygheap_user::env_domain): Recalculate if name is missing.
1024
664075a3
CF
10252002-06-29 Christopher Faylor <cgf@redhat.com>
1026
1027 * environ.cc (spenv::from_cygheap): Still need to take setuid into
1028 consideration.
1029
e97962b9
CF
10302002-06-28 Christopher Faylor <cgf@redhat.com>
1031
1032 * uinfo.cc (cygheap_user::env_logsrv): Return "almost_null" in case
1033 where no domain or username is "SYSTEM".
1034
094d5193
CF
10352002-06-28 Christopher Faylor <cgf@redhat.com>
1036
1037 * cygheap.h (cygheap_user): Reorg to accommodate environment caching.
1038 (cygheap_user::logsrv): New method.
1039 (cygheap_user::winname): Ditto.
1040 (cygheap_user::domain): Ditto.
1041 (cygheap_user::test_uid): Ditto.
1042 * cygheap.cc (cygheap_user::set_name): Reflect name "pwinname" name
1043 change.
1044 * environ.cc (getwinenveq): New function.
664075a3 1045 (penv::from_cygheap): penv::from_cygheap): Change arguments.
094d5193
CF
1046 (spenv::retrieve): Ditto for call. Use getwinenveq to retrieve info
1047 from environment. Always return value from cygwin environment, if it
1048 exists.
1049 * environ.h (getwinenveq): Declare.
1050 * uinfo.cc (cygheap_user::ontherange): Use logsrv() rather than
1051 env_logsrv().
1052 (cygheap_user::test_uid): Define new method.
1053 (cygheap_user::env_logsrv): Accept environment arguments. Use test_uid
1054 to find info.
1055 (cygheap_user::env_domain): Ditto.
1056 (cygheap_user::env_userprofile): Ditto.
1057 (cygheap_user::env_homepath): Ditto.
1058 (cygheap_user::env_homedrive): Ditto.
1059 (cygheap_user::env_name): Ditto.
1060
179cae11
CF
10612002-06-27 Christopher Faylor <cgf@redhat.com>
1062
1063 * cygheap.cc (cfree_and_set): New function.
1064 (cygheap_user::set_name): Use cfree_and_set to reset members.
1065 * cygheap.h (cygheap_user): Delete static members.
1066 (cygheap_user::puserprof): New member.
1067 (cfree_and_set): Declare.
1068 * dcrt0.cc (almost_null): Define.
bf75aae8 1069 * environ.cc (env_dontadd): Redefine as "almost_null".
179cae11
CF
1070 * winsup.h (almost_null): Declare.
1071 * syscalls.cc (cfree_and_set): Remove unused variable.
1072 * uinfo.cc (cygheap_user::homepath_env_buf): Eliminate.
1073 (cygheap_user::homedrive_env_buf): Ditto.
1074 (cygheap_user::userprofile_env_buf): Ditto.
1075 (cygheap_user::ontherange): YA change to try to preserve existing
1076 HOMEPATH and HOMEDRIVE. Return almost_null values when variables
1077 should not actually exist.
1078 (cygheap_user::env_logsrv): Ditto.
1079 (cygheap_user::env_domain): Ditto.
1080 (cygheap_user::env_userprofile): Ditto.
1081
eba23038
CV
10822002-06-27 Corinna Vinschen <corinna@vinschen.de>
1083
1084 * dcrt0.cc (dll_crt0_1): Let __progname point to the applications
1085 basename. Move eliminating ".exe" suffix from argv[0] so that it
1086 always also affects __progname.
1087
196cdd45
CF
10882002-06-27 Thomas Pfaff <tpfaff@gmx.net>
1089
bb55ce4c 1090 * thread.cc (pthread::create): Add trace printf to get CreateThread
196cdd45
CF
1091 LastError.
1092
5b509758
CV
10932002-06-27 Corinna Vinschen <corinna@vinschen.de>
1094
1095 * mmap.cc (list::match): Check using pagesize aligned size.
1096
75c6a983
CF
10972002-06-26 Christopher Faylor <cgf@redhat.com>
1098
1099 * fhandler_disk_file.cc (fhandler_disk_file::fstat_by_name): Force
1100 FindFirstFile on first file of directory when asking for x:\ .
1101
b3e2d035
CF
11022002-06-26 Christopher Faylor <cgf@redhat.com>
1103
1104 * cygheap.cc (cygheap_user::set_name): Correct thinko in below change.
1105
c99902b9
CF
11062002-06-26 Christopher Faylor <cgf@redhat.com>
1107
1108 * cygheap.cc (cygheap_user::set_name): Avoid clearing things when just
1109 setting name to itself or during first time initialization.
1110
1111 * environ.cc (check_case_init): Make case insensitive.
1112
be5007aa
CV
11132002-06-26 Corinna Vinschen <corinna@vinschen.de>
1114
1115 * fhandler.h (fhandler_socket::bind): Add method definition.
1116 (fhandler_socket::connect): Ditto.
1117 (fhandler_socket::listen): Ditto.
1118 (fhandler_socket::accept): Ditto.
1119 (fhandler_socket::getsockname): Ditto.
1120 (fhandler_socket::getpeername): Ditto.
1121 (fhandler_socket::recvfrom): Ditto.
1122 (fhandler_socket::recvmsg): Ditto.
1123 (fhandler_socket::sendto): Ditto.
1124 (fhandler_socket::sendmsg): Ditto.
1125 (fhandler_socket::shutdown): Ditto.
1126 * fhandler_socket.cc (get_inet_addr): Move here from net.cc.
1127 (fhandler_socket::bind): New method.
1128 (fhandler_socket::connect): Ditto.
1129 (fhandler_socket::listen): Ditto.
1130 (fhandler_socket::accept): Ditto.
1131 (fhandler_socket::getsockname): Ditto.
1132 (fhandler_socket::getpeername): Ditto.
1133 (fhandler_socket::recvfrom): Ditto.
1134 (fhandler_socket::recvmsg): Ditto.
1135 (fhandler_socket::sendto): Ditto.
1136 (fhandler_socket::sendmsg): Ditto.
1137 (fhandler_socket::shutdown): Ditto.
1138 * net.cc: Various formatting cleanups throughout.
1139 (get_inet_addr): Move to fhandler_socket.cc.
1140 (cygwin_bind): Move base functionality to appropriate fhandler_socket
1141 method.
1142 (cygwin_connect): Ditto.
1143 (cygwin_listen): Ditto.
1144 (cygwin_accept): Ditto.
1145 (cygwin_getsockname): Ditto.
1146 (cygwin_getpeername): Ditto.
1147 (cygwin_recvfrom): Ditto.
1148 (cygwin_recvmsg): Ditto.
1149 (cygwin_sendto): Ditto.
1150 (cygwin_sendmsg): Ditto.
1151 (cygwin_shutdown): Ditto.
1152
303af157
CV
11532002-06-26 Corinna Vinschen <corinna@vinschen.de>
1154
1155 * pwdgrp.h (pwdgrp_read::~pwdgrp_read): Avoid compiler warning.
1156
8698edb8
CF
11572002-06-26 Christopher Faylor <cgf@redhat.com>
1158
1159 * dcrt0.cc (_dcrt0): Be more defensive when reserved block is used and
1160 it's not cygwin info.
1161
f279e522
CF
11622002-06-26 Christopher Faylor <cgf@redhat.com>
1163
1164 * autoload (noload): Avoid clobbering bx register.
1165
1166 * environ.cc (codepage_init): Use case insensitive match.
1167
1168 * fhandler_console.cc (cp_get_internal): Delete.
1169 (con_to_str): Use get_cp to derive code page.
1170 (str_to_con): Ditto.
1171 * miscfuncs.cc (get_cp): New function.
1172 (sys_wcstombs): New function. Converted from macro.
1173 (sys_mbstowcs): Ditto.
1174 * winsup.h: Reflect above changes.
1175
109e4822
CF
11762002-06-26 Christopher Faylor <cgf@redhat.com>
1177
1178 * winsup.h: Minor cleanup.
1179 * path.h (path_conv::[]): New operator.
1180 * syscalls.cc (_link): Use path_conv operators rather than methods,
1181 where appropriate. Minor white space cleanup.
1182
11832002-06-26 Christopher Faylor <cgf@redhat.com>
1184
1185 * include/cygwin/version.h: Bump DLL minor number.
1186
a635af7c
CF
11872002-06-25 Thomas Pfaff <tpfaff@gmx.net>
1188
bb55ce4c 1189 * include/pthread.h (PTHREAD_CANCELED): Define a reasonable value.
a635af7c
CF
1190 * pthread.cc (pthread_exit): Call method instead of function.
1191 (pthread_setcancelstate): Ditto.
1192 (pthread_setcanceltype): Ditto.
1193 (pthread_testcancel): Ditto.
1194 * thread.h (pthread::cancel_event): New member.
c6ed5790 1195 (__pthread_cancel_self): New prototype.
a635af7c
CF
1196 (pthread::exit): New Method.
1197 (pthread::cancel): Ditto.
1198 (pthread::testcancel): Ditto.
1199 (pthread::cancel_self): Ditto.
1200 (pthread::static_cancel_self): Ditto.
1201 (pthread::setcancelstate): Ditto.
1202 (pthread::setcanceltype): Ditto.
1203 (__pthread_cancel): Give c++ linkage.
1204 (__pthread_exit): Remove.
1205 (__pthread_setcancelstate): Ditto.
1206 (__pthread_setcanceltype): Ditto.
1207 (__pthread_testcancel): Ditto.
c6ed5790 1208 * thread.cc (pthread::pthread): Inititialize cancel_event.
a635af7c
CF
1209 (pthread::~pthread): Close cancel_event if needed.
1210 (pthread::create): Create cancel_event.
c6ed5790 1211 (pthread::exit): New method. Replacement for __pthread_exit.
a635af7c
CF
1212 (pthread::cancel): New method.
1213 (pthread::testcancel): Ditto.
1214 (pthread::static_cancel_self); New static method.
c6ed5790 1215 (pthread::setcancelstate): New method. Replacement for
a635af7c 1216 __pthread_setcancelstate.
c6ed5790 1217 (pthread::setcanceltype): New method. Replacement for
a635af7c 1218 __pthread_setcanceltype.
bb55ce4c 1219 (pthread::pop_cleanup_handler): Add lock for async cancel safe
a635af7c
CF
1220 cancellation.
1221 (pthread::thread_init_wrapper): Change __pthread_exit to
1222 thread->exit().
1223 (__pthread_cancel): Call method thread->cancel().
1224 (__pthread_exit): Remove.
1225 (__pthread_setcancelstate): Ditto.
1226 (__pthread_setcanceltype): Ditto.
1227 (__pthread_testcancel): Ditto.
1228
109e4822
CF
12292002-06-25 Christopher Faylor <cgf@redhat.com>
1230
1231 * dcrt0.cc (sm): Make NO_COPY.
1232
6331b658
CV
12332002-06-25 Corinna Vinschen <corinna@vinschen.de>
1234
1235 * syscalls.cc (chown): Convert uid to 32 bit.
1236 (lchown): Ditto.
1237 (fchown): Ditto.
1238
e773b7cf
CF
12392002-06-24 Christopher Faylor <cgf@redhat.com>
1240
1241 * dtable.cc (dtable::find_unused_handle): Avoid coercion.
1242
4c78be52
CF
12432002-06-24 Christopher Faylor <cgf@redhat.com>
1244
1245 * dtable.cc (fhandler_base::dup2): Cleanup. Ensure that lock is turned
1246 off in error condition.
1247
1fd072b6
CV
12482002-06-24 Corinna Vinschen <corinna@vinschen.de>
1249
1250 * uinfo.cc (internal_getlogin): Set myself->uid and myself->gid instead
1251 of user.real_uid and user.real_gid.
1252 (uinfo_init): Evaluate orig_uid and real_uid from myself->uid. Ditto
1253 for gid.
1254
de0557f7
CF
12552002-06-23 Pierre Humblet <pierre.humblet@ieee.org>
1256
1257 * security.cc (get_group_sidlist): Add pw argument and use pw->pw_name
1258 in call to get_supplementary_group_sidlist.
1259 (create_token): Add pw argument and use it in call to
1260 get_group_sidlist.
1261 * security.h: Add pw argument in declaration of create_token.
1262 * syscalls.cc (seteuid32): Add pw argument in call to create_token.
1263
035bfbdd
CF
12642002-06-23 Conrad Scott <conrad.scott@dsl.pipex.com>
1265
1266 * fhandler.cc (fhandler_base::fstat): Set S_IFIFO for pipes.
1267 * fhandler_socket.cc (fhandler_socket.cc::fstat): Set S_IFSOCK.
1268
eecef29f
CF
12692002-06-23 Christopher Faylor <cgf@redhat.com>
1270
1271 * lib/_cygwin_S_IEXEC.cc: Remove obsolete file.
1272
85b995d4
CF
12732002-06-23 Christopher Faylor <cgf@redhat.com>
1274
1275 Use cygwin_{shm,ipc}.h instead of /sys/{shm,ipc}.h throughout.
1276 * sys/ipc.h: Remove.
1277 * sys/shm.h: Remove.
1278 * cygwin_ipc.h: New file.
1279 * cygwin_shm.h: New file.
1280
6bda8def
CF
12812002-06-23 Christopher Faylor <cgf@redhat.com>
1282
1283 * cygwin.sc: Add recent changes from ld sources.
1284
12852002-06-23 Conrad Scott <conrad.scott@dsl.pipex.com>
1286
1287 * winsup.h: Move #ifdef EXPCGF code into "winbase.h".
1288 * winbase.h: #ifdef EXPCGF code moved here from "winsup.h".
1289
f6709c07
RC
12902002-06-12 Thomas Pfaff <tpfaff@gmx.net>
1291
bb55ce4c 1292 * thread.h (pthread::cleanup_stack): Rename cleanup_handlers to
f6709c07
RC
1293 cleanup_stack.
1294 * thread.cc (pthread::pthread): Ditto.
bb55ce4c
CF
1295 (pthread::create): Fix mutex verification.
1296 (pthread::push_cleanup_handler): Renam cleanup_handlers to
1297 cleanup_stack. Remvoe Mutex calls, use InterlockedExchangePointer
1298 instead.
1299 (pthread::pop_cleanup_handler): Rename cleanup_handlers to
f6709c07
RC
1300 cleanup_stack.
1301 (pthread::pop_all_cleanup_handlers): Ditto.
1302 (__pthread_once): Check state first and return if already done.
bb55ce4c 1303 (__pthread_join): Revert DEADLOCK test to __pthread_equal call.
f6709c07
RC
1304 (__pthread_detach): Unlock mutex before deletion.
1305
0278e3a3
CF
13062002-06-21 Christopher Faylor <cgf@redhat.com>
1307
1308 * Makefile.in (cygrun.exe): Move -lgcc where it will do some good.
1309
1a7cb557
CV
13102002-06-21 Corinna Vinschen <corinna@vinschen.de>
1311
1312 * syscalls.cc (stat64_to_stat32): Correctly evaluate st_rdev.
1313 (fstat64): Set st_rdev to same value as st_dev.
1314 (stat_worker): Ditto.
1315
49056987
CV
13162002-06-21 Corinna Vinschen <corinna@vinschen.de>
1317
1318 * security.cc (alloc_sd): Carefully check owner_sid again after trying
1319 SIDs from cygheap.
1320
dd0208eb
CV
13212002-06-21 Corinna Vinschen <corinna@vinschen.de>
1322
1323 * security.cc (alloc_sd): Remove unnecessary retrieval of owner name.
1324 Check uid for current user first and use SIDs from cygheap if so.
1325 Set errno to EINVAL if user SID isn't retrievable. Just print user SID
1326 as debug output.
1327 Don't bail out if group SID isn't retrievable. Change debug output
1328 appropriately.
1329
d7c2bd8e
CF
13302002-06-21 Christopher Faylor <cgf@redhat.com>
1331
1332 * errno.cc: Change text description for EBADF throughout.
1333
7c02f861
CF
13342002-06-20 Pierre Humblet <pierre.humblet@ieee.org>
1335
1336 * uinfo.cc (cygheap_user::ontherange): Use env_name for NetUserGetInfo.
1337 (cygheap_user::env_logsrv): Verify env_domain is valid.
1338 * environ.cc: Include child_info.h and keep spenvs[] sorted.
1339 (environ_init): Check child_proc_info instead of myself->ppid_handle.
1340
c25ebbaf
CF
13412002-06-19 Christopher Faylor <cgf@redhat.com>
1342
1343 * fhandler.cc (fhandler_base::set_flags): Change priority of "linked
1344 in" default binmode setting so that it has priority over optional
1345 setting.
1346
03a2ce9a
CF
13472002-06-19 Christopher Faylor <cgf@redhat.com>
1348
d70b993f 1349 Use hMainProc where appropriate, throughout.
03a2ce9a
CF
1350 * environ.cc (spenv::retrieve): Add debugging statements.
1351
1352 * pinfo.cc (set_myself): Don't call strace.hello if already stracing.
1353 * strace.cc (strace): Move NO_COPY keyword so that it will actually
1354 take effect.
1355
834224ab
CV
13562002-06-19 Corinna Vinschen <corinna@vinschen.de>
1357
1358 * uinfo.cc (cygheap_user::ontherange): Call NetUserGetInfo() only with
1359 non-NULL logserver parameter.
1360
e40670ee
CF
13612002-06-16 Christopher Faylor <cgf@redhat.com>
1362
1363 * cygheap.h (cygheap_user::issetuid): New method.
1364 * dtable.cc (dtable::vfork_child_dup): Use new method to determine if
1365 we are in "setuid mode."
1366 * fork.cc (fork_parent): Ditto.
1367 * spawn.cc (spawn_guts): Ditto.
1368 * syscalls.cc (seteuid32): Ditto.
1369 (setegid32): Ditto.
1370 * environ.cc (spenv::retrieve): (Suggested by Pierre Humblet) Do
1371 potential recalculation of cygheap_user stuff when in setuid mode.
00a9e8a0
CF
1372 Return special value when environment variable should be calculated but
1373 not added.
e40670ee
CF
1374 (build_env): Don't add retrieved value to dstp if it is 'dont_add'.
1375
a05a9e01
CF
13762002-06-16 Christopher Faylor <cgf@redhat.com>
1377
1378 Changes suggested by Pierre Humblet.
1379 * environ.cc (NL): New macro.
1380 (conv_envvars): Use NL macro to fill in name and namelen.
1381 (spenv::namelen): New field.
1382 (spenvs): Use NL to fill in name and namelen.
1383 (spenv::retrieve): Eliminate length argument. Instead, use namelen
1384 throughout.
1385 (build_env): Don't calculate length of initial FOO= part of
1386 environment. Accommodate spenv::retrive argument change.
1387
5f25e1d1
CF
13882002-06-16 Christopher Faylor <cgf@redhat.com>
1389
1390 * cygheap.h (cygheap_user::winname): New field.
1391 * cygheap.cc (cygheap_user::set_name): Clear winname when name changes.
1392 * uinfo.cc (cygheap_user::env_logsrv): Avoid calculating server when
1393 Windows user == SYSTEM.
1394 (cygheap_user::env_domain): Set winname here too.
1395 (cygheap_user::env_userprofile): Eliminate superfluous tests.
1396 (cygheap_user::env_name): Seed winname by calling env_domain().
1397
5c8bce24
CF
13982002-06-12 Pierre Humblet <pierre.humblet@ieee.org>
1399
1400 * spawn.cc (spawn_guts): Revert removal of ciresrv.moreinfo->uid =
1401 ILLEGAL_UID.
1402
6ea3e429
CF
14032002-06-15 Christopher Faylor <cgf@redhat.com>
1404
1405 * child_info.h (child_proc_info): Declare as base class.
1406 (spawn_info): Declare as alias of child_proc_info to aid debugging.
1407 (fork_info): Ditto.
1408 * cygheap.cc (cygheap_fixup_in_child): Use child_proc_info global
1409 rather than parameter.
1410 * cygheap.h (cygheap_fixup_in_child): Reflect above change in
1411 declaration.
1412 * dcrt0.cc (_dll_crt0): Move 'si' definition here. Assign
1413 child_proc_info.
1414 (dll_crt0_1): Accommodate cygheap_fixup_in_child and *_info changes.
1415 * environ.cc (spenv::retrieve): Make regparm.
1416 * environ.h (environ_init): Ditto.
1417 (win_env::add_cache): Ditto.
1418 (build_env): Ditto.
1419 (getwinenv): Ditto.
1420 * fork.cc (sync_with_parent): Use fork_info global.
1421 (fork_child): Ditto.
1422
cff111a6
CF
14232002-06-14 Christopher Faylor <cgf@redhat.com>
1424
1425 * uinfo.cc (cygheap_user::ontherange): Don't set HOMEDRIVE or HOMEPATH
1426 unless one or the other is specified.
1427
6d171b44
CF
14282002-06-14 Christopher Faylor <cgf@redhat.com>
1429
1430 * cygheap.h (cygheap_user::userprofile_env_buf): New static member.
1431 * environ.cc (build_env): Add debugging statement.
1432 (spenvs): Switch functions for USERDOMAIN and USERNAME.
1433 * spawn.cc (spawn_guts): Move environment initialization prior to
1434 cygheap_setup_for_child or environment info will never be copied to
1435 child.
1436
a77d35f7
CF
14372002-06-14 Christopher Faylor <cgf@redhat.com>
1438
1439 * cygheap.h (cygheap_user): Add static members to hold home{drive,path}
1440 info.
1441 * uinfo.cc (cygheap_user::ontherange): Use static class members for
1442 local HOME* storage.
1443
9a771b29
CF
14442002-06-14 Christopher Faylor <cgf@redhat.com>
1445
1446 * cygheap.cc (cygheap_user::set_logsrv): Remove.
1447 (cygheap_user::set_domain): Ditto.
1448 * cygheap.h (cygheap_user::set_logsrv): Remove declaration.
1449 (cygheap_user::set_domain): Ditto.
1450 (cygheap_user::env_domain): Declare new method.
1451 (cygheap_user::env_name): Ditto.
1452 * environ.cc (spenvs): Add two environment variables.
1453 * spawn.cc (spawn_guts): Call build_env after RevertToSelf. Always set
1454 ciresrv.mount_h.
1455 (cygheap_user::ontherange): Recalculate homedrive/homepath if they are
1456 empty. Use env_logsrv to get logon server.
1457 (cygheap_user::env_logsrv): Calculate server name here rather than
1458 relying on it having been previously calculated.
1459 (cygheap_user::env_domain): Ditto for domain name.
1460 (cygheap-user::env_name): New method.
1461
14622002-06-12 Pierre Humblet <pierre.humblet@ieee.org>
1463
1464 * syscalls.cc (seteuid32): Do not get or set the environment. Do not
1465 call LookupAccountSid nor internal_getlogin. Set cygheap->user name
1466 and sid from the passwd entry.
1467 * uinfo.cc (uinfo_init): Only call internal_getlogin when starting from
1468 a non Cygwin process and use the values returned in user.
1469 (internal_getlogin): Simplify to case where starting from a non Cygwin
1470 process. Store return values in user and return void. Do not set the
1471 Windows default environment.
1472 * dcrt0.cc (dll_crt0_1): Call uinfo_init only when needed. Do not set
1473 myself->uid nor reset user.sid.
1474 * spawn.cc (spawn_guts): Get the sid from cygheap->user. Always
1475 RevertToSelf(). Don't set uid in impersonated case.
1476 * cygheap.cc (cygheap_user::set_sid): Do not set orig_sig.
1477 (cygheap_user::set_orig_sid): New.
1478 * cygheap.h: Declare cygheap_user::set_sid.
1479 * winsup.h: Add argument to uinfo_init().
1480
470e8c46
CV
14812002-06-14 Corinna Vinschen <corinna@vinschen.de>
1482
1483 * environ.cc (build_env): If realloc moves envblock, move s with it.
1484
39be53dc
CF
14852002-06-13 Nicholas S. Wourms <nwourms@netscape.net>
1486
1487 * winver.rc: Add more words to copyright.
1488
0e6d80e4
CV
14892002-06-13 Corinna Vinschen <corinna@vinschen.de>
1490
1491 * cygheap.cc (cygheap_user::set_name): Revert previous change.
1492 * environ.cc (spenv::retrieve): Check return value of call to
1493 cygheap->user.*from_cygheap().
1494
5682a6dd
CV
14952002-06-13 Corinna Vinschen <corinna@vinschen.de>
1496
1497 * cygheap.cc (cygheap_user::set_name): Remove setting homedrive and
1498 homepath to NULL.
1499 (cygheap_user::set_logsrv): Fix free'ing of plogsrv.
1500 * cygheap.h (cygheap_user::cygheap_user): Initialize homedrive and
1501 homepath to NULL.
1502
5f74ae83
CF
15032002-06-13 Christopher Faylor <cgf@redhat.com>
1504
1505 * security.cc (get_logon_server): Use strcasematch rather than
1506 strcasecmp.
1507
4863867a
CF
15082002-06-12 Christopher Faylor <cgf@redhat.com>
1509
1510 * path.cc (chdir): Minor cleanup.
1511
12a2ef44
CF
15122002-06-12 Christopher Faylor <cgf@redhat.com>
1513
1514 * environ.cc (build_env): Correctly fill out windows environment block
1515 with win32 paths rather than posix paths.
1516
da086d02
CF
15172002-06-12 Christopher Faylor <cgf@redhat.com>
1518
1519 * cygheap.cc (cygheap_user::set_name): Set homedrive and homepath to
1520 NULL on user name change.
1521 (cygheap_user::set_logsrv): Allocate enough space for leading \\ so
1522 that we can put this in the environment, if needed.
1523 * cygheap.h (homebodies): New enum.
1524 (cygheap_user::homedrive): New field.
1525 (cygheap_user::homepath): Ditto.
1526 (cygheap_user::env_logsrv): New method.
1527 (cygheap_user::env_homepath): New method.
1528 (cygheap_user::env_homedrive): New method.
1529 (cygheap_user::env_userprofile): New method.
1530 (cygheap_user::ontherange): New method.
1531 * environ.cc (envsize): Eliminate debugging argument.
1532 (environ_init): Assume that envc counts number of elments not total
1533 size.
1534 (spenv): New class.
bb55ce4c 1535 (spenvs): New array, rename from forced_winenv_vars, using spenv.
da086d02
CF
1536 (spenv::retrieve): New method.
1537 (build_env): Rename from 'winenv' -- one stop shopping for building new
1538 environment blocks for both windows and "unix".
1539 * environ.h (build_env: Declare.
1540 (winenv): Delete declaration.
1541 (envsize): Ditto.
1542 * spawn.cc (spawn_guts): Use build_env to build windows and cygwin
1543 environment blocks.
1544 * uinfo.cc (internal_getlogin): Eliminate environment manipulation.
1545 Default to info from GetUserName if it exists. Move HOMEPATH and
1546 HOMEDRIVE stuff elsewhere. Move HOME setting elsewhere. Only set HOME
1547 environment variable in processes that are not parented by a cygwin
1548 process.
1549 (cygheap_user::ontherange): Define new method.
1550 (cygheap_user::env_logsrv): Ditto.
1551 (cygheap_user::env_homepath): Ditto.
1552 (cygheap_user::env_homedrive): Ditto.
1553 (cygheap_user::env_userprofile): Ditto.
1554
077d8b23
CF
15552002-06-11 Christopher Faylor <cgf@redhat.com>
1556
1557 * spawn.cc (spawn_guts): More hToken removal cleanup.
1558
d5377829
CF
15592002-06-09 Pierre Humblet <pierre.humblet@ieee.org>
1560
1561 * spawn.cc (spawn_guts): Define sec_attribs and call sec_user_nih()
1562 only once.
1563
380aaf2d
CF
15642002-06-10 Christopher Faylor <cgf@redhat.com>
1565
1566 * Makefile.in: Ensure that -MD gets added to CFLAGS regardless of
1567 CFLAGS command-line setting.
1568
1569 * cygwin.din: Export sexec* functions as function which returns ENOSYS
1570 (i.e., sexec* is deprecated).
1571 * dtable.cc (dtable::vfork_child_dup): Ensure that impersonation is
1572 restored even on failure.
1573 * exec.cc: Throughout, remove references to sexec* and _spawnve.
1574 * pinfo.h: Remove _spawnve declaration.
1575 * spawn.cc: Rename _spawnve to spawnve and use throughout.
1576 (spawn_guts): Eliminate hToken argument and processing of same. Just
1577 perform special actions if impersonating.
1578 (spawnve): Rename from _spawnve.
1579
b01cbd5d
CF
15802002-06-10 Christopher Faylor <cgf@redhat.com>
1581
1582 * include/sys/strace.h (strace): Avoid use of constructor.
1583
fe4283af
CF
15842002-06-10 Christopher Faylor <cgf@redhat.com>
1585
1586 * dcrt0.cc (dll_crt0_1): Initialize wincap and check for sanity before
1587 running global ctors.
1588 * wincap.h (wincap): Eliminate constructor. Default is to zero memory,
1589 anyway.
1590 * wincap.cc (wincap): Copy this on fork to avoid initialization in
1591 forked processes.
1592
3d78e129
CV
15932002-06-10 Corinna Vinschen <corinna@vinschen.de>
1594
1595 * fhandler.h (fhandler_socket::fixup_after_fork): Revert patch from
1596 2002-06-04.
1597 * fhandler_socket.cc (fhandler_socket::fixup_after_fork): Ditto.
1598 (fhandler_socket::dup): Ditto.
1599 * net.cc (fdsock): Make sockets explicitely noninheritable on NT.
1600
c2102631
CF
16012002-06-09 Christopher Faylor <cgf@redhat.com>
1602
1603 * fhandler_disk_file.cc (fhandler_disk_file::fstat_helper): Correctly
1604 set number of links for directory, if appropriate.
1605
43c3c4e3
RC
16062002-06-10 Robert Collins <rbtcollins@hotmail.com>
1607
1608 * thread.cc: Variation of a patch from Thomas Pffaf.
d70b993f 1609 (__pthread_detach): Cleanup thread object if the thread has terminated.
43c3c4e3
RC
1610 (__pthread_join): Change order of error checks, and lock against
1611 join/detach/exit races.
1612 (__pthread_exit): Lock object against join/detach/exit races.
1613 (pthread::thread_init_wrapper): Ditto.
1614 (thread_init_wrapper): Rename to pthread::thread_init_wrapper.
1615 (pthread::create): Check that the mutex initialized correctly.
1616 (pthread::push_cleanup_handler): Lock against potential cancellation
1617 race. NB: this may not be required if pthread_cleanup_push is non-
1618 cancelable.
1619 * thread.h (pthread::mutex): New member.
1620 (thread_init_wrapper): Rename to pthread::thread_init_wrapper.
1621 (pthread::thread_init_wrapper_: New static member.
1622
007276b3
RC
16232002-06-10 Robert Collins <rbtcollins@hotmail.com>
1624
1625 * cygwin.din: Add _pthread_cleanup_push and _pthread_cleanup_pop.
1626 * pthread.cc: Change __pthread_self to pthread::self() thruoghout.
1627 (_pthread_cleanup_push): New function.
1628 (_pthread_cleanup_pop): Ditto.
1629 * thread.cc: Thanks to Thomas Pfaff for the pthread cleanup_push,_pop
1630 patch, this work is derived from that.
1631 Change __pthread_self to pthread::self() thruoghout.
1632 (__pthread_self): Rename to pthread::self.
1633 (pthread::self): New method.
1634 (pthread::pthread): Initialize new member.
1635 (pthread::push_cleanup_handler): New method.
1636 (pthread::pop_cleanup_handler): New method.
1637 (pthread::pop_all_cleanup_handlers): New method.
1638 (__pthread_exit): Pop all cleanup handlers.
1639 * thread.h (pthread::push_cleanup_handler): Declare.
1640 (pthread::pop_cleanup_handler): Ditto.
1641 (pthread::pop_all_cleanup_handlers): Ditto.
1642 (pthread::self): New static method.
1643 (__pthread_exit): Give C++ linkage.
1644 (__pthread_join): Ditto.
1645 (__pthread_detach): Ditto.
1646 (__pthread_self): Remove.
1647
16482002-04-24 Thomas Pfaff <tpfaff@gmx.net>
1649
c2102631
CF
1650 * include/pthread.h (__pthread_cleanup_handler): New structure.
1651 (pthread_cleanup_push): Rewritten.
007276b3
RC
1652 (pthread_cleanup_pop): Ditto.
1653 (_pthread_cleanup_push): New prototype.
c2102631 1654 (_pthread_cleanup_pop): Ditto.
007276b3
RC
1655
16562002-04-24 Thomas Pfaff <tpfaff@gmx.net>
1657
1658 * thread.cc (thread_init_wrapper): Check if thread is already joined.
1659 (__pthread_join): Set joiner first.
1660 (__pthread_detach): Ditto.
1661
fec98ec9
RC
16622002-06-10 Robert Collins <rbtcollins@hotmail.com>
1663
1664 * cygserver_transport.cc (create_server_transport): Finish the split
1665 out of sockets code from transport_layer_base. Thanks to Nicholas
1666 Wourms and Conrad Scott for catching this.
1667
7ac66bdd
CF
16682002-06-08 Christopher Faylor <cgf@redhat.com>
1669
1670 * pinfo.cc (pinfo_dummy): Initialize to correct size.
1671
a004a5b8
CF
16722002-06-08 Christopher Faylor <cgf@redhat.com>
1673
1674 * path.cc: Change MOUNT_AUTO to MOUNT_CYGDRIVE throughout.
1675 * shared_info.h (CURR_MOUNT_MAGIC): Update.
1676
50484e8e
CF
16772002-06-08 Christopher Faylor <cgf@redhat.com>
1678
1679 * external.cc (cygwin_internal): Make v1 mount table access invalid.
1680 * path.cc (mount_info::init): Remove had_to_create_mount_areas initialization.
1681 (mount_info::from_registry): Remove v1 table import.
1682 (mount_info::read_v1_mounts): Eliminate.
1683 (mount_info::import_v1_mounts): Ditto.
1684 * shared_info.h (mount_info): Ditto for both of above.
1685 * sys/mount.h (MOUNT_DEVFS): New enum.
1686 (MOUNT_PROC): Ditto.
1687
2e2dcba3
CF
16882002-06-08 Christopher Faylor <cgf@redhat.com>
1689
1690 * include/wchar.h: Define __need_size_t.
1691
9cde3cf3
CF
16922002-06-07 Christopher Faylor <cgf@redhat.com>
1693
1694 * fhandler_socket.cc (fhandler_socket::fstat): Don't assume that socket
1695 is unix-domain socket.
1696
16972002-06-07 Christopher Faylor <cgf@redhat.com>
1698
1699 * times.cc (hires_ms::prime): Set init flag.
1700
17012002-06-07 Conrad Scott <conrad.scott@dsl.pipex.com>
1702
1703 * times.cc (hires_ms::prime): Adjust epoch of initime_us from 1601 to
1704 1970.
1705
9d0efbb3
CF
17062002-06-06 Christopher Faylor <cgf@redhat.com>
1707
1708 * autoload.cc (timeGetDevCaps): Define new autoload function.
1709 (timeGetTime): Ditto.
1710 (timeBeginPeriod): Ditto.
1711 (timeEndPeriod): Ditto.
bb55ce4c 1712 * hires.h (hires_base): New class. Rename from hires.
9d0efbb3
CF
1713 (hires_us): New class.
1714 (hires_ms): New class.
1715 * strace.cc (strace::microseconds): Use hires_us class.
1716 * times.cc (gettimeofday): Use hires-ms class.
bb55ce4c
CF
1717 (hires_us::prime): Rename from hires::prime.
1718 (hires_us::usecs): Rename from hires:usecs.
9d0efbb3
CF
1719 (hires_ms::prime): New method.
1720 (hires_ms::usecs): New method.
1721 (hires_ms::~hires_ms): New destructor.
1722
46b941fc
CF
17232002-06-06 Christopher Faylor <cgf@redhat.com>
1724
1725 * autoload.cc (noload): Correctly save argument count register.
1726
c4e6ff48
CV
17272002-06-05 Conrad Scott <conrad.scott@dsl.pipex.com>
1728
1729 * fhandler.cc (fhandler_base::fstat): Initialise tv_nsec member of
1730 st_atim, st_mtim, and st_ctim fields.
1731 * fhandler_disk_file.cc (fhandler_disk_file::fstat_helper): Ditto.
1732 * fhandler_process.cc (fhandler_process::fstat): Ditto.
46b941fc
CF
1733 * glob.c (stat32_to_STAT): Copy across the whole st_atim, st_mtime, and
1734 st_ctim fields.
c4e6ff48
CV
1735 * syscalls.cc (stat64_to_stat32): Ditto.
1736 * times.cc (to_timestruc_t): New function.
1737 (time_as_timestruc_t): New function.
1738 * winsup.h: Add to_timestruc_t and time_as_timestruc_t functions.
46b941fc
CF
1739 * include/cygwin/stat.h: Replace time_t with timestruc_t throughout for
1740 all file times, removing the st_spare1, st_spare2, and st_spare3 fields
1741 in the process. Add macros to access tv_sec fields by old names.
1742 * include/cygwin/types.h: Typedef timespec_t and timestruc_t as struct
1743 timespec.
c4e6ff48 1744
2e8abfc1
CV
17452002-06-03 Pierre Humblet <pierre.humblet@ieee.org>
1746
1747 * sec_helper.cc (lookup_name): Suppress.
1748 * security.cc (alloc_sd): Remove logsrv argument.
1749 Remove two calls to lookup_name.
1750 (set_security_attribute): Remove logsrv argument.
1751 Remove logsrv argument in call to alloc_sd.
1752 (set_nt_attribute): Remove logsrv argument.
1753 Remove logsrv argument in call to set_security_attribute.
1754 (set_file_attribute): Remove logsrv argument.
1755 Remove logsrv argument in call to set_nt_attribute.
1756 (set_file_attribute): Remove logsrv argument.
1757 Remove logsrv argument in call to set_file_attribute.
1758 * syscalls.cc (chown_worker): Remove logserver argument in
1759 call to set_file_attribute.
1760 (chmod): Ditto.
1761 * shm.cc (shmget): Remove logsrv argument in call to alloc_sd.
1762 * uinfo.cc (internal_getlogin): Replace calls to
1763 lookup_name by call to LookupAccountName.
1764 * security.h: Remove logsrv in declarations of set_file_attribute
1765 and alloc_sd. Remove declaration of lookup_name.
1766
f7a7cc90
CF
17672002-06-05 Christopher Faylor <cgf@redhat.com>
1768
1769 * child_info.h (CHILD_INFO_MAGIC): Oops. Revert previous change. gcc
1770 3.1 bug?
1771
784e340c
CF
17722002-06-05 Christopher Faylor <cgf@redhat.com>
1773
1774 * child_info.h (CHILD_INFO_MAGIC): Update.
1775
58fcd93a
CF
17762002-06-05 Christopher Faylor <cgf@redhat.com>
1777
1778 * strace.cc (strace::hello): Set inited, when appropriate.
1779
ee964e2f
CF
17802002-06-05 Christopher Faylor <cgf@redhat.com>
1781
1782 * cygwin.din: Eliminate some newlib wrappers.
1783 * path.cc (get_devn): Only consider first 99 potential com devices.
1784 (get_device_number): Ditto.
1785 * times.cc (_times): Eliminate.
bb55ce4c 1786 (_times): Rename from times().
ee964e2f 1787
ea4e6ec8
CF
17882002-06-05 Christopher Faylor <cgf@redhat.com>
1789
1790 * dir.cc (rmdir): Streamline. Detect attempts to remove directories
1791 from "read-only" virtual devices. (Suggested by Pavel Tsekov)
46b941fc
CF
1792 * syscalls.cc (unlink): Detect attempts to remove directories from
1793 "read-only" virtual devices. (From Pavel Tsekov)
ea4e6ec8 1794
2bb6b3e5
CF
17952002-06-05 Christopher Faylor <cgf@redhat.com>
1796
1797 * dtable.cc (handle_to_fn): Check error return value from NtQueryObject
1798 first before seeing if name buffer is NULL.
1799
1800 * grp.cc (read_etc_group): Fix gcc warning regarding snprintf format.
1801 * passwd.cc (read_etc_passwd): Ditto.
1802
e9259cb2
RC
18032002-04-18 Thomas Pfaff <tpfaff@gmx.net>
1804
1805 * thread.h (pthread::joiner): New member.
1806 * thread.cc (pthread::pthread): Initialize joiner to NULL
1807 (pthread::create): Increment of thread counter moved from
1808 __pthread_create to this location.
1809 (__pthread_create): Increment thread counter removed.
1810 (thread_init_wrapper): Set joiner to self when thread was created
1811 detached.
1812 (__pthread_exit): delete thread when it is detached and not
1813 joined.
1814 (__pthread_join): Check for deadlock and delete thread when it has
1815 terminated.
1816 (__pthread_detach): Set joiner to self when thread state
1817 changed to detached.
1818
eceee297
CV
18192002-06-05 Corinna Vinschen <corinna@vinschen.de>
1820
1821 * grp.cc (read_etc_group): When emulating nonexisting group file on
1822 NT systems, read primary group SID from process token. Use that info
1823 to create correct group entry. On error or on 9x systems fallback
1824 to emulating Administrators group as before.
ae1ebb81 1825 * passwd.cc (read_etc_passwd): When emulating nonexisting passwd file
46b941fc 1826 on NT systems, read user and primary group SID from process token.
ae1ebb81
CV
1827 Use that info to create correct passwd entry. On error or on 9x
1828 systems fallback to emulating user with Administrator user id and
1829 Administrators group as before.
eceee297 1830
38f39368
CV
18312002-06-05 Corinna Vinschen <corinna@vinschen.de>
1832
1833 * grp.cc (etc_group): Removed.
1834 (parse_grp): Make line parameter nonconst. Don't copy data into new
1835 allocated memory. Check for CR instead of LF to accomodate new
1836 read method.
1837 (add_grp_line): Make line parameter nonconst.
1838 (read_etc_group): Rearrange using new pwdgrp_read class.
1839 * passwd.cc (parse_pwd): Don't copy data into new allocated memory.
1840 Check for CR instead of LF to accomodate new read method.
1841 (read_etc_passwd): Rearrange using new pwdgrp_read class.
1842 * pwdgrp.h (pwdgrp_check::set_last_modified): Use different
1843 parameters.
1844 (class pwdgrp_read): New class for opening and reading passwd and
1845 group files.
1846
ce006ffa
CF
18472002-06-04 Christopher Faylor <cgf@redhat.com>
1848
1849 * dtable.cc (handle_to_fn): Attempt to handle "raw" accesses to remote
1850 shares.
1851 * path.cc (mount_info::conv_to_win32_path): Set flags to binary when
1852 mount entry is not found.
1853 (mount_info::set_flags_from_win32_path): Ditto.
1854
147d2ab4
CF
18552002-06-04 Christopher Faylor <cgf@redhat.com>
1856
1857 * dtable.cc (handle_to_fn): Correct placement and length of name
ea4e6ec8 1858 buffer. (Suggested by Pavel Tsekov)
147d2ab4 1859
e35f391f
CF
18602002-06-04 Christopher Faylor <cgf@redhat.com>
1861
1862 Remove fcntl.h includes throughout.
1863 * fhandler.h: Move fcntl.h include here.
1864 (fhandler_base::set_flags): Accept supplied_bin argument. Make
1865 non-inlined.
1866 * dtable.cc (dtable::init_std_file_from_handle): Just use binmode from
1867 pc.
1868 (reset_to_open_binmode): Use set_flags.
1869 * cygwin.din (open): Avoid newlib wrapper.
1870 (read): Ditto.
1871 (unlink): Ditto.
1872 (write): Ditto.
1873 * fhandler.cc (fhandler_base::set_flags): Accept supplied_bin argument.
1874 Make binmode decisions here.
1875 (fhandler_base::open): Avoid using pc if it is NULL. Eliminate binmode
1876 logic. Just call set_flags with binmode argument.
1877 (fhandler_base::init): Call set_flags with binmode argument.
1878 * fhandler_clipboard.cc (fhandler_dev_clipboard::open): Ditto.
1879 * fhandler_console.cc (fhandler_console::open): Ditto.
1880 (fhandler_console::init): Force binary on open.
1881 * fhandler_disk_file.cc (fhandler_disk_file::open): Don't set binmode
1882 here. Let it happen in base class.
1883 * fhandler_dsp.cc (fhandler_dev_dsp::open): Force binmode open. Set
1884 return value appropriately if unable to open.
1885 * fhandler_proc.cc (fhandler_proc::open): Make sure flags are set
1886 before open_status.
1887 * fhandler_process.cc (fhandler_process::open): Ditto.
1888 * fhandler_registry.cc (fhandler_registry::open): Ditto.
1889 * fhandler_random.cc (fhandler_dev_random::fhandler_dev_random): Ditto.
1890 * fhandler_raw.cc (fhandler_dev_raw::open): Force O_BINARY by default.
1891 * fhandler_serial.cc (fhandler_serial::init): Ditto.
1892 * fhandler_tty.cc (fhandler_tty_slave::open): Ditto.
1893 (fhandler_pty_master::open): Ditto.
1894 * fhandler_virtual.cc (fhandler_virtual::open): Ditto.
1895 * fhandler_windows.cc (fhandler_windows::open): Ditto.
1896 * fhandler_zero.cc (fhandler_dev_zero::open): Ditto.
1897 * net.cc (fdsock): Ditto.
1898 * path.cc (path_conv::check): Avoid checking for executable extension
1899 when directory. (Suggested by Pavel Tsekov)
1900 (set_flags): Set PATH_TEXT explicitly, when appropriate.
1901 (mount_info::conv_to_win32_path): Use set_flags() to set path flags.
1902 * path.h (PATH_TEXT): New enum.
1903 (path_conv::binmode): Return appropriate constant based on binmode.
1904 * pipe.cc (make_pipe): Set binmode to O_TEXT xor O_BINARY.
1905 * syscalls.cc (setmode_helper): Make debugging message a little
1906 clearer.
1907 (setmode): Set binmode via set_flags.
1908
4e138847
CV
19092002-06-04 Corinna Vinschen <corinna@vinschen.de>
1910
1911 * fhandler.h (class fhandler_socket): Add private method
1912 fixup_after_fork (bool, HANDLE).
1913 * fhandler_socket.cc (fhandler_socket::fixup_after_fork): Move
1914 functionality to new private method. Add closing parent socket
1915 if not called from dup(). Create method new calling private method
1916 with appropriate parameter.
1917 (fhandler_socket::fixup_after_exec): Call private method
1918 fixup_after_fork with appropriate parameter.
1919 (fhandler_socket::dup): Ditto.
1920
19212002-06-04 Corinna Vinschen <corinna@vinschen.de>
6bfca3cc
CV
1922
1923 * fhandler_dsp.cc (fhandler_dev_dsp::open): Set errno to EACCES if
1924 requested mode isn't supported.
1925
e02f1e9c
CF
19262002-06-03 Christopher Faylor <cgf@redhat.com>
1927
1928 * fhandler.cc (fhandler_base::open): Don't set binmode if already set.
1929 Don't check for file. Files should already be set. Report on binary
1930 mode for debugging.
1931 (fhandler_base::fhandler_base): Don't set default binmode here. That's
1932 for later.
1933 * fhandler_console.cc (fhandler_console::output_tcsetattr): Don't set
1934 binmode, ever, for console.
1935 * fhandler_disk_file.cc (fhandler_disk_file::open): Always set the
1936 binary mode to the value derived from mount table.
1937 * path.cc (mount_info::conv_to_win32_path): Default to binmode if path
1938 does not translate into anything in the mount table.
1939
31b98a62
CV
19402002-06-03 Corinna Vinschen <corinna@vinschen.de>
1941
1942 * external.cc (cygwin_internal): Add CW_EXTRACT_DOMAIN_AND_USER
1943 handling to call extract_nt_dom_user() from applications.
1944 * include/sys/cygwin.h (cygwin_getinfo_types): Add
1945 CW_EXTRACT_DOMAIN_AND_USER.
1946
b3c29731
CV
19472002-06-03 Corinna Vinschen <corinna@vinschen.de>
1948
1949 * syscalls.cc (stat64_to_stat32): Transform st_dev correctly.
1950 (fstat64): Add evaluating st_ino and st_dev.
1951 (stat_worker): Evaluate st_dev as 32 bit value.
1952 * include/cygwin/stat.h: Use new dev_t definition throughout.
1953 * include/cygwin/types.h: Define __dev16_t and __dev32_t. Define
1954 dev_t according to __CYGWIN_USE_BIG_TYPES__ setting.
1955 * include/sys/sysmacros.h: Define major, minor and makedev
1956 according to __CYGWIN_USE_BIG_TYPES__ setting.
1957
656c3192
CV
19582002-06-03 Pierre Humblet <pierre.humblet@ieee.org>
1959
1960 * syscalls.cc (setegid32): Verify the correctness of the gid
1961 of the group returned by getgrgid32.
1962
1eb934b7
CV
19632002-06-03 Pierre Humblet <pierre.humblet@ieee.org>
1964
1965 * security.cc (lsa2wchar): Suppressed.
1966 (get_lsa_srv_inf): Suppressed.
1967 (get_logon_server_and_user_domain): Suppressed.
1968 (get_logon_server): Essentially new.
1969 (get_user_groups): Add "domain" argument. Only lookup the
1970 designated server and use "domain" in LookupAccountName.
1971 (is_group_member): Simplify the arguments.
1972 (get_user_local_groups): Simplify the arguments. Do only a
1973 local lookup. Use "BUILTIN" and local domain in LookupAccountName.
1974 (get_user_primary_group). Only lookup the designated server.
1975 (get_group_sidlist): Remove logonserver argument. Do not lookup
1976 any server for the SYSTEM account.
1977 (create_token): Delete logonserver and call to get_logon_server.
1978 Adjust arguments of get_group_sidlist, see above.
1979 * security.h: Delete declaration of get_logon_server_and_user_domain
e35f391f 1980 and add declaration of get_logon_server.
1eb934b7
CV
1981 * uinfo.cc (internal_get_login): Call get_logon_server instead of
1982 get_logon_server_and_user_domain.
1983
37be5a67
CF
19842002-06-02 Christopher Faylor <cgf@redhat.com>
1985
e35f391f
CF
1986 * dtable.cc (handle_to_fn): Use largest match for device. Correctly
1987 (?) deal with remote drive weirdness.
37be5a67 1988
97478fe6
CF
19892002-06-02 Christopher Faylor <cgf@redhat.com>
1990
1991 * fhandler_disk_file.cc (fhandler_disk_file::fstat_by_name): Check
1992 specifically for non-existent file, first.
1993 (fhandler_disk_file::fstat): Perform fd open on files with funny
1994 characters.
1995
47413f84
CF
19962002-06-02 Christopher January <chris@atomice.net>
1997
1998 * fhandler_process.cc (fhandler_process::open): Set fileid.
1999
6b7cd251
CF
20002002-06-02 Christopher Faylor <cgf@redhat.com>
2001
2002 Remove unneeded sigproc.h includes throughout.
2003 * fhandler.h (fhandler_proc::fill_filebuf): Take a pinfo argument.
2004 * fhandler_proc.cc (fhandler_proc::get_proc_fhandler): Simplify search
2005 for given pid.
2006 (fhandler_proc::readdir): Assume that pid exists if it shows up in the
2007 winpid list.
2008 * fhandler_process.cc (fhandler_process::open): Simplify search for
2009 given pid. Call fill_filebuf with pinfo argument.
2010 (fhandler_process::fill_filebuf): Pass pinfo here and assume that it
2011 exists.
2012 * pinfo.h (pinfo::remember): Define differently if sigproc.h is not
2013 included.
2014
20152002-06-02 Christopher Faylor <cgf@redhat.com>
2016
2017 * dll_init.cc (dll_list::detach): Don't run destructor on exit.
2018
e065a187
CF
20192002-06-01 Christopher Faylor <cgf@redhat.com>
2020
2021 * fhandler.cc (fhandler_base::fstat): Move dev and ino calculation into
2022 caller.
2023 * syscalls.cc (stat_worker): Calculate dev and ino calculation here, if
2024 zero.
2025 * fhandler_proc.cc (fhandler_proc::fhandler_proc): Minor reorg for
2026 debugging.
2027 * fhandler_process.cc (fhandler_process::exists): Return 0 on
2028 nonexistence.
2029 (fhandler_process::fstat): Simplify pid logic.
2030 * fhandler_tape.cc (fhandler_dev_tape::fstat): Minor reformatting.
2031
60abf1c4
CF
20322002-06-01 Christopher Faylor <cgf@redhat.com>
2033
2034 * path.cc (chdir): Don't allow cd'ing to a non-directory virtual path.
2035
28af03fa
CF
20362002-05-31 Christopher Faylor <cgf@redhat.com>
2037
2038 * fhandler_disk_file.cc (readdir): Move inode calculation into caller.
2039 (fhandler_cygdrive::readdir): Add "." and "..".
2040 * dir.cc (readdir): Move inode calculation here so that fhandler
2041 readdirs can benefit.
2042
8e74c320
CF
20432002-05-31 Christopher Faylor <cgf@redhat.com>
2044
2045 * fhandler_console.cc (fhandler_console::open): Reinstate setting of
2046 flags.
2047
30478f15
CF
2048 * dtable.cc (dtable::init_std_file_from_handle): Default to using
2049 binmode derived from path_conv, when required.
2050 * fhandler.h (fhandler_base::get_w_binary): Default to binmode if
2051 nothing else is specified.
2052 * fhandler.h (fhandler_base::get_r_binary): Ditto.
2053
2054 * fhandler_disk_file.cc (fhandler_disk_file::fstat_by_handle): Work
2055 around g++ warning.
2056
2057 * path.cc (path_conv::check): Remove a debugging statement.
2058
de86e35b
CF
20592002-05-31 Christopher Faylor <cgf@redhat.com>
2060
2061 * fhandler_console.cc (fhandler_console::open): Always default to
2062 binmode.
2063 (fhandler_console::write_normal): Don't honor binmode setting. There
2064 is already a termios setting for this.
2065 (fhandler_console::init): Correct argument order in init call.
2066
8461f41e
CF
20672002-05-31 Christopher Faylor <cgf@redhat.com>
2068
2069 * fhandler.cc (fhandler_base::open): Make default open mode == binmode.
2070 (fhandler_base::init): Set open flags based on derived binmode argument.
2071
bcd0ed9f
CF
20722002-05-31 Christopher Faylor <cgf@redhat.com>
2073
2074 * dll_init.cc (dll_list::init): Eliminate unneeded debugging statement.
2075
18c04cc4
CF
20762002-05-31 Christopher Faylor <cgf@redhat.com>
2077
2078 * fhandler_proc.cc (fhandler_proc::readdir): Set errno when no more
2079 files.
2080 * fhandler_process.cc (fhandler_process::readdir): Ditto.
2081 * fhandler_registry.cc (fhandler_registry::readdir): Ditto.
2082
69be001c
CF
20832002-05-30 Christopher Faylor <cgf@redhat.com>
2084
2085 * path.cc (path_conv::check): Set fileattr to INVALID_FILE_ATTRIBUTES
2086 for nonexistent virtual device path.
2087 (chdir): Set correct errno when attempt is made to cd to nonexistent
2088 virtual device path.
2089
5d8c7a56
CF
20902002-05-30 Christopher Faylor <cgf@redhat.com>
2091
2092 * fhandler_disk_file.cc (fhandler_disk_file::fstat): Always call
2093 fstat_by_name if fd is not opened to allow fstat_by_name to properly
2094 set errno.
2095
d74eced5
CV
20962002-05-30 Corinna Vinschen <corinna@vinschen.de>
2097
2098 * autoload.cc: Replace autoload statments for ZwXXX by NtXXX.
2099 Drop ZwQuerySystemInformation since NtQuerySystemInformation was
2100 already available.
2101 * fhandler_proc.cc (format_proc_uptime): Replace call to
2102 ZwQuerySystemInformation by call to NtQuerySystemInformation.
2103 (format_proc_stat): Ditto.
2104 * fhandler_process.cc (format_process_stat): Replace call to
2105 ZwQueryInformationProcess by call to NtQueryInformationProcess.
2106 (get_process_state): Ditto.
2107 (get_mem_values): Ditto. Replace call to ZwQueryVirtualMemory by
2108 call to NtQueryVirtualMemory.
2109 * ntdll.h: Cleanup. Drop ZwQuerySystemInformation since
2110 NtQuerySystemInformation was already available. Replace declarations
2111 of ZwXXX functions by declarations of NtXXX.
2112 * pinfo.cc (winpids::enumNT): Replace call to ZwQuerySystemInformation
2113 by call to NtQuerySystemInformation.
2114
5d8c7a56
CF
21152002-05-29 Christopher Faylor <cgf@redhat.com>
2116
2117 * fhandler.cc (binmode): Default to binmode when mode is not known.
2118
186637a5
CF
21192002-05-29 Christopher Faylor <cgf@redhat.com>
2120
2121 * include/sys/cygwin.h (EXTERNAL_PINFO_VERSION): Reinstate.
2122 * external.cc (fillout_pinfo): Use it.
2123
3a571063
CV
21242002-05-29 Corinna Vinschen <corinna@vinschen.de>
2125
2126 * external.cc (fillout_pinfo): Use new version define.
2127 * include/sys/cygwin.h (external_pinfo): Define
2128 EXTERNAL_PINFO_VERSION_16_BIT and EXTERNAL_PINFO_VERSION_32_BIT
2129 instead of just EXTERNAL_PINFO_VERSION.
2130
9fef0139
CF
21312002-05-29 Christopher Faylor <cgf@redhat.com>
2132
2133 * external.cc (fillout_pinfo): Set new version field in external_pinfo
2134 structure.
2135 * include/sys/cygwin.h (external_pinfo): Replace strace_file with
2136 version field.
2137
a8d7ae61
CV
21382002-05-29 Corinna Vinschen <corinna@vinschen.de>
2139
2140 Change internal uid datatype from __uid16_t to __uid32_t
2141 throughout.
2142 * cygwin.din: Export new symbols getpwuid32, getpwuid_r32, getuid32,
2143 geteuid32, setuid32, seteuid32.
2144 * passwd.cc (getpwuid32): New function.
2145 (getpwuid_r32): Ditto.
2146 * syscalls.cc (seteuid32): Ditto.
2147 (setuid32): Ditto.
2148 * uinfo.cc (getuid32): Ditto.
2149 (geteuid32): Ditto.
d4000bc4 2150 * winsup.h (uid16touid32): New macro, correct casting from __uid16_t
a8d7ae61
CV
2151 to __uid32_t.
2152 (gid16togid32): Ditto fir gids.
2153 (getuid32): Declare.
2154 (geteuid32): Ditto.
2155 (getpwuid32): Ditto.
2156 * include/sys/cygwin.h (struct external_pinfo): Add members uid32 and
2157 gid32.
2158
9854c44c
CV
21592002-05-29 Corinna Vinschen <corinna@vinschen.de>
2160
2161 * include/cygwin/socket.h: Protect some symbols against multiple
2162 definition.
2163 * include/netinet/ip.h: Ditto.
2164 * include/netinet/tcp.h: Ditto.
2165
21662002-05-29 Wu Yongwei <adah@netstd.com>
2167
2168 * include/netinet/ip.h: Replace by BSD derived version of the file.
2169 * include/netinet/tcp.h: Ditto.
2170 * include/netinet/udp.h: New file.
2171 * include/cygwin/ip.h: Remove.
2172
cef69559
CF
21732002-05-29 Christopher Faylor <cgf@redhat.com>
2174
2175 * dtable.cc (dtable::init_std_file_from_handle): Attempt stronger
2176 detection of invalid handle.
2177 (handle_to_fn): Detect pathological condition where NT resets the
2178 buffer pointer to NULL on an invalid handle.
2179
a761ad82
CF
21802002-05-28 Christopher Faylor <cgf@redhat.com>
2181
2182 * fhandler_disk_file.cc (fhandler_disk_file::fstat_helper): Properly
2183 check for whether we should be opening the file to search for #!
654783b6
CF
2184 characters. Set path_conv structure execability, too, when
2185 appropriate.
a761ad82 2186
7ea70e99
CV
21872002-05-28 Corinna Vinschen <corinna@vinschen.de>
2188
2189 * security.cc (set_security_attribute): Call getegid32() instead of
2190 getegid().
2191 * include/cygwin/grp.h: Declare getegid32().
2192
57196405
CV
21932002-05-28 Corinna Vinschen <corinna@vinschen.de>
2194
2195 Change internal gid datatype from __gid16_t to __gid32_t
2196 throughout.
2197 * cygwin.din: Export new symbols chown32, fchown32, getegid32,
2198 getgid32, getgrgid32, getgrnam32, getgroups32, initgroups32, lchown32,
2199 setgid32, setegid32, getgrent32.
2200 * grp.cc (grp32togrp16): New static function.
2201 (getgrgid32): New function.
2202 (getgrnam32): Ditto.
2203 (getgrent32): Ditto.
2204 (getgroups32): Change name of internal function from getgroups.
2205 (getgroups32): New function.
2206 (initgroups32): Ditto.
2207 * syscalls.cc (chown32): Ditto.
2208 (lchown32): Ditto.
2209 (fchown32): Ditto.
2210 (setegid32): Ditto.
2211 (setgid32): Ditto.
2212 * uinfo.cc (getgid32): Ditto.
2213 (getegid32): Ditto.
2214 * include/cygwin/grp.h: Remove declaration of getgrgid() and getgrnam().
2215 Declare getgrgid32() and getgrnam32() instead. Declare getgid32().
2216
0c12979b
CF
22172002-05-27 Christopher Faylor <cgf@redhat.com>
2218
2219 * autoload.cc (noload): Properly mask low order word for determining
2220 number of bytes to pop.
2221
57e2ae68
CF
22222002-05-27 Christopher Faylor <cgf@redhat.com>
2223
2224 * fhandler_disk_file.cc (fhandler_disk_file::fstat): Minor logic
2225 cleanup.
2226
2402700d
CF
22272002-05-27 Christopher Faylor <cgf@redhat.com>
2228
2229 * autoload.cc (LoadFuncEx): Define via new LoadFuncEx2 macro.
bb55ce4c 2230 (LoadFuncEx2): Adapt from LoadFuncEx. Provides control of return
2402700d
CF
2231 value for nonexistent function.
2232 (NtQueryObject): Declare.
2233 (IsDebuggerPresent): Declare via LoadFuncEx2 and always return true if
2234 not available.
2235 * debug.h (being_debugged): Just rely on IsDebuggerPresent return
2236 value.
2237 * dtable.cc (handle_to_fn): New function.
2238 (dtable::init_std_file_from_handle): Attempt to derive std handle's
2239 name via handle_to_fn.
2240 (dtable::build_fhandler_from_name): Fill in what we can in path_conv
2241 structure when given a handle and path doesn't exist.
2242 * fhandler.cc (fhandler_base::open): Don't set the file pointer here.
2243 Use pc->exists () to determine if file exists rather than calling
2244 GetFileAttributes again.
2245 * fhandler.h (fhandler_base::exec_state_isknown): New method.
2246 (fhandler_base::fstat_helper): Add extra arguments to declaration.
2247 (fhandler_base::fstat_by_handle): Declare new method.
2248 (fhandler_base::fstat_by_name): Declare new method.
2249 * fhandler_disk_file (num_entries): Make __stdcall.
2250 (fhandler_base::fstat_by_handle): Define new method.
2251 (fhandler_base::fstat_by_name): Define new method.
2252 (fhandler_base:fstat): Call fstat_by_{handle,name} as appropriate.
2253 (fhandler_disk_file::fstat_helper): Accept extra arguments for filling
2254 out stat structure. Move handle or name specific stuff to new methods
2255 above.
2256 (fhandler_disk_file::open): Use real_path->exists rather than calling
2257 GetFileAttributes again.
2258 * ntdll.h (FILE_NAME_INFORMATION): Define new structure.
2259 (OBJECT_INFORMATION_CLASS): Partially define new enum.
2260 (OBJECT_NAME_INFORMATION): Define new structure.
2261 (NtQueryInformationFile): New declaration.
2262 (NtQueryObject): New declaration.
2263 * path.cc (path_conv::fillin): Define new method.
2264 * path.h (path_conv::fillin): Declare new method.
2265 (path_conv::drive_thpe): Rename from 'get_drive_type'.
2266 (path_conv::volser): Declare new method.
2267 (path_conv::volname): Declare new method.
2268 (path_conv::root_dir): Declare new method.
2269 * syscalls.cc (fstat64): Send real path_conv to fstat as second
2270 argument.
2271
74b2f73e
CV
22722002-05-24 Pierre Humblet <pierre.humblet@ieee.org>
2273
2274 * security.cc (lsa2str): New function.
2275 (get_priv_list): Call lsa2str instead of sys_wcstombs.
2276
75bf2931
CV
22772002-05-22 Pierre Humblet <pierre.humblet@ieee.org>
2278
2279 * syscalls.cc (seteuid): Do not take allow_ntsec into account.
2280 Attempt to use an existing or new token even when the uid
2281 matches orig_uid, but the gid is not in the process token.
2282 Major reorganization after several incremental changes.
2283 (setegid): Do not take allow_ntsec into account. Minor
2284 reorganization after several incremental changes.
2285
918a268c
CF
22862002-05-26 Christopher Faylor <cgf@redhat.com>
2287
2288 * debug.h (being_debugged): New macro.
2289 * dtable.cc (dtable::extend): Use new macro.
2290 * exceptions.cc (try_to_debug): Ditto.
2291 * strace.cc (strace::hello): Only output debugging info when we think
2292 we're being debugged.
2293
0cfbfc24
CF
22942002-05-25 Robert Collins <rbtcollins@hotmail.com>
2295
2296 * winsup.h: Remove duplicate declarations of malloc_lock and
2297 malloc_unlock.
2298
d7b4a300
CF
22992002-05-24 Christopher Faylor <cgf@redhat.com>
2300
2301 Remove unneeded sync.h, where appropriate, throughout.
2302 Remove unneeded heap.h, where appropriate, throughout.
2303 Remove unneeded exceptions.h, where appropriate, throughout.
2304 Remove unneeded perprocess.h, where appropriate, throughout.
2305
908f9b65
CV
23062002-05-22 Pierre Humblet <pierre.humblet@ieee.org>
2307
2308 * security.cc (create_token): Call __sec_user() instead of
2309 sec_user() to remove dependence on allow_ntsec. Verify that
2310 the returned sd is non-null.
2311
a6247be9
RC
23122002-05-25 Robert Collins <rbtcollins@hotmail.com>
2313
2314 * gmon.c (fake_sbrk): Correctly return -1 on failed malloc's.
2315
ff938546
CF
23162002-05-24 Christopher Faylor <cgf@redhat.com>
2317
2318 * dtable.cc (dtable::build_fhandler_from_name): Just pass posix path
2319 along to set_name via return_and_clear_normalized_path.
2320 (dtable::build_fhandler): New method with const char * argument.
2321 (dtable::reset_unix_path_name): Eliminate.
2322 (dtable::dup_worker): Use correct build_fhandler method.
2323 * mmap.cc (mmap_record::alloc_fh): Ditto.
2324 * dtable.h (dtable::build_fhandler): New method.
2325 (dtable::reset_unix_path_name): Eliminate.
2326 * fhandler.cc (fhandler_base::set_name): Assume that unix_name has
2327 already been cmalloced.
2328 (fhandler_base::reset_unix_path_name): Eliminate.
2329 (fhandler_base::~fhandler_base): Coercion for cfree.
2330 * fhandler.h (fhandler_base::unix_path_name): Make const char *.
2331 (fhandler_base::win32_path_name): Ditto.
2332 (fhandler_base::reset_unix_path_name): Eliminate.
2333 * fhandler_disk_file.cc (fhandler_cygdrive::set_drives): Accommodate
2334 const char *ness of win32_path_name.
2335 * fhandler_socket.cc (fhandler_socket::fstat): Accommodate new set_name
2336 requirements.
2337 * path.cc (path_conv::return_and_clear_normalized_path): New method.
2338 (path_conv::clear_normalized_path): Eliminate.
2339 (path_conv::~path_conv): Ditto.
2340 (path_conv::check): Accommodate new build_fhandler method.
2341 * path.h (path_conv::~path_conv): Eliminate.
2342 (path_conv::clear_normalized_path): Ditto.
2343 (path_conv::return_and_clear_normalized_path): Declare new method.
2344
b4bb31ad
CF
23452002-05-23 Christopher Faylor <cgf@redhat.com>
2346
2347 * path.cc (path_conv::check): Make sure any trailing path component is
2348 part of potential normalized posix path.
2349
b2f338e9
CF
23502002-05-23 Christopher Faylor <cgf@redhat.com>
2351
2352 * smallprint.c (__small_vsprintf): Implement '%o' after all these
2353 years.
2354
fc240f58
CF
23552002-05-22 Christopher Faylor <cgf@redhat.com>
2356
2357 * fhandler.h (fhandler_virtual::exists): Eliminate path argument.
2358 (fhandler_proc::exists): Ditto.
2359 (fhandler_registry::exists): Ditto.
2360 (fhandler_process::exists): Ditto.
2361 * fhandler_proc.cc (fhandler_proc::exists): Ditto. Use built-in name.
2362 * fhandler_process.cc (fhandler_process::exists): Ditto.
2363 (fstat): Ditto.
2364 * fhandler_registry.cc (fhandler_registry::exists): Ditto.
2365 (fhandler_registry::fstat): Ditto.
2366 * fhandler_virtual.cc (fhandler_virtual::opendir): Ditto.
2367 * path.cc (path_conv::check): Ditto. Add debugging.
2368
23692002-05-22 Christopher Faylor <cgf@redhat.com>
2370
2371 * syscalls.cc (dup): Always call dup2 for error handling.
2372
1d2b71d6
CV
23732002-05-22 Corinna Vinschen <corinna@vinschen.de>
2374
2375 * include/cygwin/types.h: Revert previous patch.
2376
36f86a55
CV
23772002-05-22 Corinna Vinschen <corinna@vinschen.de>
2378
2379 * include/cygwin/types.h: Define pthread stuff only if _POSIX_THREADS
2380 is defined.
2381
2d6ce5c2
CV
23822002-05-19 Pierre Humblet <pierre.humblet@ieee.org>
2383
fc240f58 2384 * security.cc (open_local_policy): Initialize lsa to
2d6ce5c2
CV
2385 INVALID_HANDLE_VALUE instead of NULL.
2386 (get_logon_server_and_user_domain): Test for INVALID_HANDLE_VALUE
2387 instead of NULL.
2388 (create_token): Both of the above.
2389
9ded8bd8
CF
23902002-05-18 Christopher Faylor <cgf@redhat.com>
2391
2392 * fhandler_disk_file.cc (fhandler_disk_file::fstat): Make handling of
2393 nlink consistent for remote files.
2394
2701126a
CF
23952002-05-18 Christopher Faylor <cgf@redhat.com>
2396
2397 * path.cc (path_conv::check): Always set executable bit for executable
2398 extension.
2399
b05b7d84
CF
24002002-05-17 Christopher Faylor <cgf@redhat.com>
2401
2402 * fhandler.cc (fhandler_base::lseek): Avoid calling SetFilePointer with
2403 high order part of 64 bit address on OS's which do not support that
2404 kind of operation. Otherwise Windows 95 will become confused.
2405
d6dc9825
CV
24062002-05-16 Pierre Humblet <pierre.humblet@ieee.org>
2407
2408 * fhandler_raw.cc (fhandler_dev_raw::open): Replace set_errno()
2409 by __seterrno_from_win_error().
2410 * security.cc (open_local_policy): Ditto.
2411 (get_lsa_srv_inf): Ditto.
2412 (get_user_groups): Ditto.
2413 (get_user_primary_group): Ditto.
2414 (create_token): Ditto.
2415 (subauth): Ditto.
2416
35a89cbe
CV
24172002-05-17 Corinna Vinschen <corinna@vinschen.de>
2418
2419 * times.cc (utimes): Use FILE_WRITE_ATTRIBUTES even on 9x/Me when
2420 opening file for writing timestamp.
2421 * wincap.cc: Remove flag has_specific_access_rights.
2422 * wincap.h: Ditto.
2423
ebbdc703
CV
24242002-05-13 Pierre Humblet <pierre.humblet@ieee.org>
2425
2426 * syscalls.cc (seteuid): Set default dacl in process token.
2427 Replace in-line code by call to verify_token().
2428 (setegid): Reverse change from 2002-01-21. Add call to
2429 RevertToSelf and set primary group in impersonation token.
2430 * security.cc (create_token): Store pgrpsid in token security
2431 descriptor, except if it already appears in my_grps.
2432 Use sec_acl() in place of get_dacl().
2433 (verify_token): Create from code in seteuid(), with tighter checks.
c2102631 2434 (get_dacl): Deleted.
ebbdc703
CV
2435 (get_group_sidlist): Add argument to indicate if pgrpsid is already
2436 in the groups.
2437 * security.h: Define verify_token().
2438 * autoload.cc: Load GetKernelObjectSecurity().
2439
feb7f1a9
CF
24402002-05-13 Mark Bradshaw <bradshaw@staff.crosswalk.com>
2441
2442 * cygwin.din: Add strlcat and strlcpy.
2443 * include/cygwin/version.h: Increment API minor version number.
2444
fc240f58 24452002-05-09 Pierre Humblet <pierre.humblet@ieee.org>
043bc3e1
CV
2446
2447 * shared.cc (__sec_user): Split into sec_acl() and call orig_sid().
2448 (sec_acl): Create from part of __sec_user(), except creator/owner.
2449 * security.h: Define sec_acl() and MAX_DACL_LEN.
2450
c8b20196
CF
24512002-05-12 Christopher Faylor <cgf@redhat.com>
2452
2453 * fhandler_disk_file.cc (fhandler_disk_file::open): Avoid using
2454 O_DIROPEN when OS doesn't support it. Return proper errno in that
2455 case.
2456
b4f8d31f
CF
24572002-05-12 Christopher Faylor <cgf@redhat.com>
2458
56caca1d
CF
2459 * syscalls.cc (_read): Change error to EBADF if attempt to read from a
2460 non-readable fd.
b4f8d31f 2461
29ee580d
CF
24622002-05-11 Christopher Faylor <cgf@redhat.com>
2463
2464 * fhandler.h (executable_states): For now, make dont_care_if_executable
2465 equivalent to not_executable.
2466 * sys/mount.h: Define MOUNT_NOTEXEC.
2467 * path.h (fs_info): New class.
2468 (path_conv): Move fs-specific fields to new 'fs' structure.
2469 (path_conv::update_fs_info): Move to fs_info and rename to just 'update'.
2470 * path.cc (fs_info::update): Ditto. Return 'true' if successful.
2471 (fillout_mntent): Add ',noexec' to list of reported options.
2472
b84621d2
CF
24732002-05-11 Christopher Faylor <cgf@redhat.com>
2474
2475 * fhandler_virtual.cc (fhandler_virtual::close): Quiet a compiler
2476 warning.
2477
9ba913a5
CF
24782002-05-10 Christopher January <chris@atomice.net>
2479
2480 * autoload.cc: Add dynamic load statements for
2481 'ZwQueryInformationProcess' and 'ZwQueryVirtualMemory'.
2482 * fhandler.h: Change type of bufalloc and filesize members of
2483 fhandler_virtual from int to size_t. Change type of position member
2484 from __off32_t to __off64_t. Add new fileid member to fhandler_virtual
2485 class. Make seekdir take an __off64_t argument. Make lseek take an
2486 __off64_t argument. Add fill_filebuf method to fhandler_virtual. Add
2487 fill_filebuf method to fhandler_proc. Add fill_filebuf method to
2488 fhandler_registry. Add fill_filebuf method to fhandler_process. Add
2489 saved_pid and saved_p members to fhandler_process.
2490 * fhandler_proc.cc (proc_listing_array): Add 'loadavg', 'meminfo', and 'stat'.
2491 (proc_fhandlers array): Ditto.
2492 (fhandler_proc::open): Use fill_filebuf to flesh out the file contents.
2493 (fhandler_proc::fill_filebuf): New method.
2494 (fhandler_proc::format_proc_meminfo): Ditto.
2495 (fhandler_proc::format_proc_stat): Ditto.
2496 (fhandler_proc::format_proc_uptime): Ditto.
2497 * fhandler_process.cc (process_listing): Add 'stat' and 'statm'.
2498 (fhandler_process::fstat): Find the _pinfo structure for the process
2499 named in the filename. Return ENOENT if the process is no longer
2500 around. Set the gid and uid fields of the stat structure.
2501 (fhandler_process::open): Store pid and pointer to _pinfo structure in
2502 saved_pid and saved_p respectively. Use fill_filebuf to flesh out file
2503 contents.
2504 (fhandler_proc::fill_filebuf): New method.
2505 (format_process_stat): New function.
2506 (format_process_status): Ditto.
2507 (format_process_statm): Ditto.
2508 (get_process_state): Ditto.
2509 (get_mem_values): Ditto.
2510 * fhandler_registry.cc (fhandler_registry::seekdir): Change argument
2511 type from __off32_t to __off64_t.
2512 (fhandler_registry::fill_filebuf): New method.
2513 * fhandler_virtual.cc (fhandler_virtual::seekdir): Change argument type
2514 from __off32_t to __off64_t.
2515 (fhandler_virtual::lseek): Ditto.
2516 (fhandler_virtual::fill_filebuf): New method.
2517 (fhandler_virtual::fhandler_virtual): Initialise fileid to -1.
2518 * wincap.cc: Set flag has_process_io_counters appropriately.
2519 * wincap.h: Add flag has_process_io_counters.
2520
25212002-05-09 Christopher Faylor <cgf@redhat.com>
f561f644
CF
2522
2523 * syscalls.cc (_write): Change error to EBADF if attempt to write to a
56caca1d 2524 non-writeable fd.
f561f644 2525
6327de5f
CV
25262002-05-08 Corinna Vinschen <corinna@vinschen.de>
2527
2528 * cygheap.h (class cygheap_user): Add member `orig_psid'.
2529 Add method `orig_sid()'.
2530 * cygheap.cc (cygheap_user::set_sid): Maintain orig_psid.
2531
795b46cf
CV
25322002-04-28 Norbert Schulze <norbert.schulze@web.de>
2533
2534 * localtime.cc (tzsetwall): Use wildabbr if generated timezone name
2535 length < 3.
2536
a9917779
CV
25372002-05-05 Pierre Humblet <pierre.humblet@ieee.org>
2538
2539 * spawn.cc (spawn_guts): Move call to set_process_privilege()
2540 to load_registry_hive().
2541 * registry.cc (load_registry_hive): ditto.
2542 * fork.cc (fork_parent): Call sec_user_nih() only once.
2543
25442002-05-04 Christopher January <chris@atomice.net>
13ee3618
CF
2545
2546 * path.h (path_conv::path_conv): Initialise normalized_path to NULL.
2547
8761c1dc
CF
25482002-05-03 Christopher Faylor <cgf@redhat.com>
2549
2550 * net.cc (getdomainname): Change second argument of getdomainname to
2551 size_t.
2552
25532002-05-03 Christopher January <chris@atomice.net>
2554
2555 * fhandler_proc.cc (proc_listing): Add '.' and '..' to directory
2556 listing.
2557 (fhandler_proc::open): Change use of mode to flags. If the file does
2558 not exist already, fail with EROFS if O_CREAT flag is set. Change
2559 EROFS error to EACCES error when writing to a file. Use cmalloc to
2560 allocate memory for filebuf.
2561 (fhandler_proc::close): Use cfree to free filebuf.
2562 (fhandler_proc::get_proc_fhandler): Properly detect attempts to access
2563 unknown subdir.
2564 * fhandler_process.cc (process_listing): Add '.' and '..' to directory
2565 listing.
2566 (fhandler_process::open): Use cmalloc to allocate memory for filebuf.
2567 (fhandler_process::close): Use cfree to free filebuf.
2568 * fhandler_registry.cc (registry_listing): Add . and '..' to directory
2569 listing.
2570 (fhandler_registry::open): Move check for open for writing before
2571 open_key. Use cmalloc to allocate memory for filebuf.
2572 (fhandler_registry::close): Use cfree to free filebuf.
2573 (fhandler_registry::telldir): Use lower 16 bits of __d_position as
2574 position in directory.
2575 (fhandler_registry::seekdir): Ditto.
2576 * fhandler_virtual.cc (fhandler_virtual::write): Change EROFS error to
2577 EACCES error.
2578 (fhandler_virtual::open): Set the NOHANDLE flag.
2579 (fhandler_virtual::dup): Add call to fhandler_base::dup. Allocate
2580 child's filebuf using cmalloc. Copy filebuf from parent to child.
2581 (fhandler_virtual::close): Use cfree to free filebuf.
2582 (fhandler_virtual::~fhandler_virtual): Ditto.
2583 (from Chris Faylor <cgf@redhat.com>).
2584 (fhandler_registry::readdir): Add support for '.' and '..' files in
2585 subdirectories of /proc/registry.
2586 * path.cc (path_conv::check): Do not return ENOENT if a file is not
2587 found in /proc.
2588
335c87f9
CF
25892002-05-02 Christopher Faylor <cgf@redhat.com>
2590
2591 * fhandler_proc.cc (fhandler_proc::fstat): Use fhandler name rather
2592 than path_conv name.
2593 (fhandler_proc::open): Ditto.
2594 * fhandler_process.cc (fhandler_process::fstat): Use fhandler name
2595 rather than path_conv name.
2596 (fhandler_process::open): Ditto.
2597 * fhandler_registry.cc (fhandler_registry::fstat): Use fhandler name
2598 rather than path_conv name.
2599 (fhandler_registry::open): Ditto.
2600 * path.cc (path_conv::check): Don't copy posix path when virtual.
2601 (mount_info::conv_to_win32_path): Don't zero string when isproc. Just
2602 derive normal windows path.
2603
2604 * path.h (path_conv::clear_normalized_path): Declare new method.
2605 * path.cc (path_conv::clear_normalized_path): Define new method.
2606 * dtable.cc (build_fhandler_from_name): Clear normalized path when
2607 finished to conserve space.
2608
3bb7eb44
CF
26092002-05-02 Christopher Faylor <cgf@redhat.com>
2610
2611 * fhandler_proc.cc (fhandler_proc::fstat): Prime with information from
2612 fhandler_base::fstat. Use defines rather than constants for permission
2613 settings.
2614
d055ecb0
CV
26152002-04-30 Eric Blake <ebb9@email.byu.edu>
2616
2617 * path.cc (hash_path_name): Improve hash function strength.
2618
37143995
RC
26192002-05-02 Robert Collins <rbtcollins@hotmail.com>
2620
2621 * thread.cc (__pthread_cond_dowait): Fix a race on signalling from a
2622 thread woken by the same condition variable it's signalling on. Thanks
2623 to Michael Beach for the report and test case.
2624
291be307
CF
26252002-05-02 Christopher Faylor <cgf@redhat.com>
2626
2627 * path.h (pathconv_arg): Add PC_POSIX.
2628 (path_conv): Add normalized_path field.
2629 * path.cc (path_conv::~path_conv): New destructor.
2630 (path_conv::check): Set normalized_path, where appropriate.
2631 * dtable.cc (build_fhandler_from_name): Use normalized path from
2632 path_conv.
2633 * syscalls.cc (chroot): Ditto.
2634
2635 * cygheap.h: Remove path_prefix_p declaration.
2636
26372002-02-26 Christopher January <chris@atomice.net>
2638 Christopher Faylor <cgf@redhat.com> (minor fixups)
2639
2640 * Makefile.in: Add fhandler_proc.o, fhandler_registry.o,
2641 fhandler_process.o and fhandler_virtual.o.
2642 * dtable.cc (dtable::build_fhandler): Add entries for FH_PROC,
2643 FH_REGISTRY and FH_PROCESS. Set unix_name to the normalized posix
2644 path.
2645 * fhandler.h: Add constants for FH_PROC, FH_REGISTRY and FH_PROCESS.
2646 Add class declarations for fhandler_virtual, fhandler_proc,
2647 fhandler_registry and fhandler_virtual. Update fhandler_union
2648 accordingly.
2649 * fhandler_proc.cc: New file. Add implementation for fhandler_proc.
2650 * fhandler_virtual.cc: New file. Add implementation for
2651 fhandler_virtual.
2652 * fhandler_process.cc: New file. Add implementation for
2653 fhandler_process.
2654 * fhandler_registry.cc: New file. Add implementation for
2655 fhandler_registry.
8761c1dc
CF
2656 * path.cc (isproc): New macro.
2657 (isvirtual_dev): Ditto.
291be307
CF
2658 * path.cc (path_conv::check): Add check for virtual devices.
2659 * path.cc (mount_info::conv_to_win32_path): Convert paths in /proc to
2660 empty Win32 paths.
2661 * path.cc (chdir): Replace check for FH_CYGDRIVE with more generic
2662 isvirtual_dev macro. Force setting of posix path for virtual
2663 fhandlers.
8761c1dc 2664 * path.h (path_prefix_p): Declare.
291be307
CF
2665
2666
fee93846
CF
2667Wed May 1 16:06:02 2002 Jason Tishler <jason@tishler.net>
2668
2669 * include/cygwin/types.h: Include <sys/sysmacros.h>.
2670
9b15f5fa
CV
2671Wed Apr 17 11:27:04 2002 Jason Tishler <jason@tishler.net>
2672
2673 * security.cc (get_lsa_srv_inf): Prevent extraneous backslashes for
2674 the NT Domain case.
2675
4deace13
CV
26762002-04-12 Corinna Vinschen <corinna@vinschen.de>
2677
2678 * net.cc (cygwin_accept): Set socket type for accepted socket.
2679 (socketpair): Set socket type for both sockets.
2680
26812002-04-12 Egor Duda <deo@logos-m.ru>
2682
291be307 2683 * fhandler.h (class fhandler_socket): New member to store socket type.
4deace13
CV
2684 (fhandler_socket::get_socket_type): Access it.
2685 (fhandler_socket::set_socket_type): Ditto.
2686 * net.cc (cygwin_socket): Store socket type.
2687 (cygwin_connect): Disable security checks for connectionless sockets.
2688 (cygwin_accept): Ditto.
2689
dbe67a81
CF
26902002-04-09 Mark Bradshaw <bradshaw@staff.crosswalk.com>
2691
2692 * cygwin.din: Add strptime.
2693 * include/cygwin/version.h: Increment API version number.
2694
464b3e80
CV
26952002-04-09 Corinna Vinschen <corinna@vinschen.de>
2696
2697 * fork.cc (fork_child): Call fixup_mmaps_after_fork() somewhat earlier.
2698
d78bda7b
CV
26992002-04-09 Corinna Vinschen <corinna@vinschen.de>
2700
2701 * fhandler.cc (fhandler_base::open): Set read-only bit in
2702 file_attributes when adequate.
2703
8996623b
CF
27042002-03-28 Christopher Faylor <cgf@redhat.com>
2705
2706 * times.cc (gettimeofday): Fix typo in previous patch.
2707
7d7524e5
CF
27082002-03-27 Wu Yongwei <adah@netstd.com>
2709
2710 * times.cc (gettimeofday): Revert to setting timezone info if tz !=
2711 NULL.
2712
2f3126f6
CF
27132002-03-21 Christopher Faylor <cgf@redhat.com>
2714
2715 * fhandler_disk_file.cc (fhandler_disk_file::fstat_helper): Always set
2716 st_[ug]id to value derived from get_file_attributes.
2717
45d2ea8a
CF
27182002-03-21 Christopher Faylor <cgf@redhat.com>
2719
2720 * spawn.cc (find_exec): Return input if file not found.
2721
99dbafac
CV
27222002-03-19 Boris Schaeling <boriss@web.de>
2723
291be307 2724 * poll.cc (poll): Add support for invalid descriptors.
99dbafac 2725
b0359971
RC
27262002-03-15 Robert Collins <rbtcollins@hotmail.com>
2727
2728 * fhandler.h (fhandler_termios::lseek): Override lseek.
2729 * fhandler_termios.cc (fhandler_termios::lseek): Implement this.
2730
59a2339f
CF
27312002-03-15 Christopher Faylor <cgf@redhat.com>
2732
2733 * cygserver.cc: Include stdlib.h for exit declaration.
2734 * threaded_queue.cc: Ditto.
2735
ca175377
CF
27362002-03-15 Christopher Faylor <cgf@redhat.com>
2737
2738 * pinfo.cc (pinfo::init): Use PID_ALLPIDS flag to control when a
2739 redirected block should be marked as nonexistent.
2740 (winpids::add): Use PID_ALLPIDS when looking for all pids.
2741 * cygwin.h (PID_ALLPIDS): New enum element.
2742
d78bda7b 27432002-03-15 Corinna Vinschen <corinna@vinschen.de>
2f263187 2744
291be307 2745 * glob.c (stat32_to_STAT): New function.
2f263187
CV
2746 (g_lstat): Call user space functions always with 32 bit struct stat
2747 as a workaround.
2748 (g_stat): Ditto.
2749 * include/glob.h (struct glob): Don't prototype function pointers
2750 when compiling Cygwin.
2751
4af6d4a9
CF
27522002-03-14 Christopher Faylor <cgf@redhat.com>
2753
2754 * pinfo.cc (pinfo::init): Properly handle execed process stub when
2755 PID_NOREDIR is specified.
2756
6ea9c716
CV
27572002-03-13 Boris Schaeling <boriss@web.de>
2758
e10c087b
CF
2759 * poll.cc (poll): Remove variable open_fds. Rearrange and add code to
2760 fix settings of revents.
6ea9c716 2761
d78bda7b 27622002-03-13 Corinna Vinschen <corinna@vinschen.de>
bbe09139
CV
2763
2764 * mmap.cc (mmap_record::map_map): Return -1 if VirtualProtect fails.
2765 (list::erase): New method with no argument. Erase latest record
2766 added.
2767 (mmap64): Fail if map_map() fails.
2768
d78bda7b 27692002-03-12 Corinna Vinschen <corinna@vinschen.de>
cb4589f4
CV
2770
2771 * sysconf.cc (sysconf): Fix condition.
2772
d78bda7b 27732002-03-11 Corinna Vinschen <corinna@vinschen.de>
2817e0dc
CV
2774
2775 * mmap.cc (msync): Check area given by addr and len for being a
2776 contigeous mmap'd region.
2777
d78bda7b 27782002-03-11 Corinna Vinschen <corinna@vinschen.de>
713fb38b
CV
2779
2780 * fork.cc (fork_child): Call fixup_mmaps_after_fork() before
2781 closing parent process handle. Call fixup_mmaps_after_fork()
2782 with parent process handle as parameter.
2783 * mmap.cc (mmap_record::access): New method.
2784 (fixup_mmaps_after_fork): Take process handle as parameter.
2785 In case of FILE_MAP_COPY access, copy valid memory regions to child.
2786 * pinfo.h (fixup_mmaps_after_fork): Change prototype accordingly.
2787
d78bda7b 27882002-03-07 Corinna Vinschen <corinna@vinschen.de>
c8c3824d
CV
2789
2790 * autoload.cc (NetGetDCName): Add symbol.
2791 (NetServerEnum): Remove symbol.
2792 * security.cc (get_lsa_srv_inf): Call NetGetDCName() instead of
2793 NetServerEnum() since it's faster. Don't call it at all if machine
2794 is not a domain member.
2795
9420d2b8
CF
27962002-03-06 Christopher Faylor <cgf@redhat.com>
2797
2798 * path.cc (normalize_posix_path): Avoid runs of '.'s > 2.
2799
07a21bce
CF
28002002-03-05 Christopher Faylor <cgf@redhat.com>
2801
2802 * errno.cc: Change EPERM associated text to "Operation not permitted"
2803 throughout.
2804
eeac69d8
CF
28052002-03-05 Christopher Faylor <cgf@redhat.com>
2806
2807 * fhandler_socket.cc (fhandler_socket::close): Respond to signals while
2808 looping, waiting for socket to close. Superstitiously clear last error
2809 when WSAEWOULDBLOCK.
2810
241a7c5a
RC
28112002-03-05 Robert Collins <rbtcollins@hotmail.com>
2812
291be307 2813 * cygserver_transport_pipes.cc (transport_layer_pipes::transport_layer_pipes):
241a7c5a
RC
2814 Always init - until static members work correctly.
2815 * shm.cc (shmget): Initialize the security descriptor - thanks Corinna!
291be307 2816 * include/sys/ipc.h: Make the ipc control constants partitioned off from the sem
241a7c5a
RC
2817 control constants.
2818
ad2864f4
CV
28192002-03-04 Christian Lestrade <christian.lestrade@free.fr>
2820
2821 * include/sys/termios.h: Define _POSIX_VDISABLE. Define CCEQ macro.
2822 * fhandler_termios.cc: Include <sys/termios.h>.
2823 (line_edit): Recognize disabled c_cc[] chars. Ignore VDISCARD when
2824 not in ICANON mode.
2825
59149930
CV
28262002-03-04 Dmitry Timoshkov <dmitry@baikal.ru>
2827
2828 * syscalls.cc (truncate64): Use ftruncate64 directly to not lose
2829 upper 32 bits.
2830
7c3617cc
RC
28312002-03-04 Robert Collins <rbtcollins@hotmail.com>
2832
2833 * cygserver_shm.cc (delete_shmnode): New function.
2834 (client_request_shm::serve): Use it.
2835
038c71f1
RC
28362002-03-04 Robert Collins <rbtcollins@hotmail.com>
2837
2838 * cygserver_shm.cc (client_request_shm::serve): Implement SHM_DETACH.
2839 * shm.cc (shmdt): Implement.
2840
67be0adb
RC
28412002-03-04 Robert Collins <rbtcollins@hotmail.com>
2842
2843 * cygserver_shm.cc: Run indent.
2844 (deleted_head): New global for storing shm id's pending deletion.
2845 (client_request_shm::serve): Return ENOSYS for invalid request types.
2846 Implement SHM_DEL - delete a shm id.
2847 * cygserver_shm.h (SHM_DEL): New type value.
2848 * shm.cc (delete_inprocess_shmds): New function, does what it's name implies.
2849 (shmctl): Implement shm_rmid control type.
2850
74c3173a
RC
28512002-03-04 Robert Collins <rbtcollins@hotmail.com>
2852
2853 * Makefile.in (install): Remove install-bin to allow make install to work.
2854
009314a4
RC
28552002-03-03 Robert Collins <rbtcollins@hotmail.com>
2856
2857 * shm.cc (shmat): Prevent a compile error.
2858 (shmdt): Set errno as this function is incomplete.
2859
e7729287
CF
28602002-02-28 Christopher Faylor <cgf@redhat.com>
2861
2862 * times.cc: Remove if 0'd code. Clean up slightly.
2863
f449bfef
RC
28642002-02-28 Robert Collins <rbtcollins@hotmail.com>
2865
bb55ce4c 2866 * Merge cygwin_daemon into head minus the new shm and ipc exports.
f449bfef
RC
2867
28682002-02-28 Robert Collins <rbtcollins@hotmail.com>
2869
2870 * fhandler_tty.cc (fhandler_tty_slave::open): More debugging.
2871 (fhandler_tty_slave::read): Fix printf type for the handle.
2872 * tty.cc (tty::common_init): Add a FIXME for security.
2873
28742002-01-29 Robert Collins <rbtcollins@hotmail.com>
2875
2876 * Makefile.in (OBJS): Remove duplicate localtime.o.
2877
28782002-01-17 Robert Collins <rbtcollins@hotmail.com>
2879
291be307 2880 * cygserver.cc (check_and_dup_handle): Consolidate the two variants for
f449bfef
RC
2881 simplicity.
2882 Add Some basic debug output.
2883 (client_request_attach_tty::serve): Use the new debug_printf for clarity.
2884 Mark the duplicated handles as inheritable - fixup_after_fork() doesn't reopen
2885 tty's.
2886
28872002-01-16 Robert Collins <rbtcollins@hotmail.com>
2888
2889 * cygserver.cc (transport): Correct scope.
2890 (client_request_attach_tty::serve): Add more debug information.
2891 Fix erroneous use of transport instead of conn.
2892 * cygserver_transport_pipes.cc (transport_layer_pipes::close): More debug.
2893 (transport_layer_pipes::read): Ditto.
2894 (transport_layer_pipes::write): Ditto.
2895 (transport_layer_pipes::impersonate_client): Ditto.
2896
2897Mon Oct 8 7:41:00 2001 Robert Collins <rbtcollins@hotmail.com>
2898
2899 * cygserver.cc (server_request::process): Rename client_request_shm_get to
2900 client_request_shm.
2901 * cygserver_process.cc (process_cache::add): Rename to add_task.
2902 Use process_cleanup instead of process_request.
2903 (process_cache::remove_process): New method.
2904 (process::process): Initialize new members.
2905 (process::~process): New member.
2906 (process::cleanup): New method.
2907 (process::add_cleanup_routine): New method.
2908 (process_request::process): Rename to process_cleanup.
2909 Call the process object's cleanup method and then delete it.
2910 (process_process_param::request_loop): Remove the signalling process.
2911 * cygserver_shm.cc: Globally rename client_request_shm_get to client_request_shm.
2912 (client_request_shm_get::serve): Handle attach request counting.
2913 * cygserver_shm.h: Globally rename client_request_shm_get to client_request_shm.
2914 (class shm_cleanup): New class.
2915 * shm.cc: Globally rename client_request_shm_get to client_request_shm.
2916 (client_request_shm::client_request_shm): New constructor for attach requests.
2917 (shmat): Use it.
291be307 2918 * include/cygwin/cygserver_process.h (class process_request): Rename to
f449bfef
RC
2919 process_cleanup.
2920 (class cleanup_routine): New class.
2921 (class process): New members and methods to allow calling back when the process
2922 terminates.
2923
2924Thu Oct 4 14:12:00 2001 Robert Collins <rbtcollins@hotmail.com>
2925 * cygserver.cc (request_loop): Make static.
2926 (main): Use new cache constructor syntax.
2927 Start cache worker threads.
2928 Cleanup the cache at shutdown.
2929 * cygserver_process.cc: Run indent.
2930 (process_cache::process_cache): Add a trigger to use when adding a process.
2931 (process_cache::process): Move process_entry to process.
2932 Insert at the end of the list.
2933 Trigger the request loop when new process's inserted.
2934 (process_cache::process_requests): Do it.
2935 (process_cache::add): New method.
2936 (process_cache::handle_snapshot): New method.
2937 (process::process): Merge in the process_entry fields.
2938 (process::handle): Make a stub function.
2939 (process::exit_code): New method.
2940 (process_request::process): New method.
2941 (process_process_param::request_loop): New method.
2942 * cygserver_shm.cc: New header dependency - threaded_queue.h.
2943 * threaded_queue.cc (threaded_queue::cleanup): Clearer messages.
2944 (queue_process_param::stop): Short spinlock on interruptible threads.
2945 * threaded_queue.h (class threaded_queue): New constructor.
2946 * include/cygwin/cygserver_process.h (process_request): New class.
2947 (process_entry): Remove.
2948 (process): Merge in process_entry.
2949 (process_cache): Inherit from threaded_queue.
2950
2951Tue Oct 2 23:24:00 2001 Robert Collins <rbtcollins@hotmail.com>
2952
2953 * cygserver.cc (class server_process_param): Use new constructor syntax.
2954 * cygserver_process.cc (process_cache::~process_cache): New function.
2955 * threaded_queue.cc: Define condition debug_printf.
2956 Run indent.
2957 (threaded_queue::cleanup): Move queue_process_param guts to a method.
2958 (threaded_queue::process_requests): Ditto.
2959 (queue_process_param::queue_process_param): New method.
2960 (queue_process_param::~queue_process_param): Ditto.
2961 (queue_process_param::start): Ditto.
2962 (queue_process_param::stop): Ditto.
291be307 2963 * threaded_queue.h (class queue_process_param): Add support for
f449bfef
RC
2964 interruptible request loops.
2965 * cygwin/include/cygwin/cygserver_process.h (class process_cache): Add
2966 destructor.
2967
2968Tue Oct 2 23:24:00 2001 Robert Collins <rbtcollins@hotmail.com>
2969
2970 * cygserver_client.cc: New flag allow_daemon to disable the daemon completely.
2971 (cygserver_request): Check it.
2972 (cygserver_init): Ditto.
2973 * environ.cc (parse_thing): Add (no)daemon option.
2974
2975Tue Oct 2 23:00:00 2001 Robert Collins <rbtcollins@hotmail.com>
2976
2977 * shm.cc: Update to handle include changes from HEAD.
2978
2979Tue Oct 2 16:06:00 2001 Robert Collins <rbtcollins@hotmail.com>
2980
291be307 2981 * Makefile.in: Remove cygserver_shm.o from cygwin1.dll.
f449bfef
RC
2982 Rename cygserver_shm_outside.o to cygserver_shm.o.
2983 * cygserver.cc (server_request::process): Use the new client_request
2984 constructor.
2985 * cygserver_client.cc: Remove the #ifdef's stubs for the server method
2986 within cygwin.
2987 (client_request_attach_tty::client_request_attach_tty): Use the new
2988 client_request constructor.
2989 (client_request_shutdown::client_request_shutdown): Ditto.
2990 (client_request::client_request): Ditto.
291be307 2991 * cygserver_shm.cc (client_request_shm_get::serve): Remove the
f449bfef
RC
2992 #ifdef'd stub for in-cygwin builds.
2993 (client_request_shm_get::client_request_shm_get): Use the new
2994 client_request constructor, and remove the in-cygwin variants.
2995 * cygserver_shm.h (class client_request_shm_get): #ifndef test the
2996 serve method - it's only used in cygserver.
2997 * shm.cc (client_request_shm_get::client_request_shm_get): New function.
2998 * include/cygwin/cygserver.h (request_header): New constructor.
291be307 2999 (class client_request): Use it.
f449bfef
RC
3000 New constructor accepting the header size.
3001 #ifndef test the server method - it's only used within cygserver.
3002 (client_request_get_version): #ifdef test the server method.
3003 (client_request_shutdown): Ditto.
3004 (client_request_attach_tty): Ditto.
3005
3006Tue Oct 2 9:57:00 2001 Robert Collins <rbtcollins@hotmail.com>
3007
3008 * Makefile.in: add threaded_queue.o to cygserver.exe.
3009 * cygserver.cc: Include threaded_queue.h
3010 (class server_request): Inherit from queue_request.
3011 (class server_process_param): Inherit from queue_process_param.
3012 (class server_request_queue): Inherit from threaded_queue.
3013 (request_loop): Adjust for new types.
291be307 3014 (server_request_queue::process_requests): Remove guts to
f449bfef
RC
3015 threaded_queue::process_requests.
3016 (server_request::server_request): Adjust for new types.
3017 (worker_function): Delete.
3018 (server_request_queue::create_workers): Delete.
3019 (server_request_queue::cleanup): Delete.
3020 (server_request_queue::add): Move guts to threaded_queue::add.
3021 * threaded_queue.cc: New file.
3022 * threaded_queue.h: New file.
3023
3024Mon Oct 1 12:38:00 2001 Robert Collins <rbtcollins@hotmail.com>
3025
3026 * cygserver.cc (client_request::serve): New function.
3027 * cygserver_process.cc: Inlude <pthread.h> for pthread_once.
3028 (process_cache::process_cache): Initialise a crtiical section for write access.
291be307 3029 (process_cache::process): Use the critical section. Also add missing entries to
f449bfef
RC
3030 the cache.
3031 (do_process_init): New function to initalise class process static variables.
291be307 3032 (process::process): Ensure that the process access critical section is
f449bfef
RC
3033 initialised.
3034 (process::handle): Close the handle of old process's when they have terminated
3035 and we are returning the handle for a process with the same pid.
3036 * cygserver_shm.cc: Run indent.
3037 Include cygserver_process.h to allow process cache functionality.
3038 (client_request_shm_get::serve): New parameter for process cache support.
3039 Use the process cache, not OpenProcess to get a handle to the originating process.
3040 Fix a handle leak with token_handle.
291be307 3041 * cygserver_shm.h (class client_request_shm_get): Update ::serve for process
f449bfef
RC
3042 cache support.
3043 * cygserver_transport_pipes.cc: Redefine debug_printf to be conditional on DEBUG.
291be307 3044 * include/cygwin/cygserver.h: Do not implement client_request::serve in the
f449bfef 3045 header.
291be307
CF
3046 * include/cygwin/cygserver_process.h (class process_cache): Add a write access
3047 critical section to prevent races when requests from a multithreaded
f449bfef
RC
3048 application arrive.
3049
3050Sun Sep 30 23:41:00 2001 Robert Collins <rbtcollins@hotmail.com>
3051
3052 * Makefile.in: Add cygserver_process.o to cygserver.exe.
3053 * cygserver.cc: Include signal.h and cygwin_version.h.
3054 Define debug_printf as a macro.
3055 Define DEBUG to a value.
3056 (client_request_attach_tty::serve): Add beginning of process cache support.
3057 Change from #ifdef DEBUG to work with new DEBUG style.
3058 (client_request_get_version::serve): Add beginning of process cache support.
3059 (class server_request): New prototype for support of process cache.
3060 (class queue_process_param): New class to allow request loop threading.
3061 (class server_request_queue): Add beginning of process cache support.
3062 Allow request loop threading.
3063 (request_loop): Thread function for request loops.
3064 (server_request_queue::process_requests): Initiator for threaded request loops.
3065 (client_request_shutdown::serve): Add beginning of process cache support.
3066 (server_request::server_request): Ditto.
291be307 3067 (server_request::process): Use debug_printf. Add beginning of process cache
f449bfef
RC
3068 support.
3069 (server_request_queue::cleanup): Kill off any request loop threads.
3070 (server_request_queue::add): Add beginning of process cache support.
3071 (handle_signal): Trigger a shutdown.
3072 (main): Print out some useful info at startup - version, date time.
3073 Add process cache support.
3074 Spawn a separate thread for the transport request loop, thus allowing concurrent
3075 support for multiple transports.
291be307 3076 * cygserver_client.cc (client_request_get_version::serve): Add process cache
f449bfef
RC
3077 support.
3078 (client_request_attach_tty::serve): Add process cache support.
3079 (client_request_shutdown::serve): Add process cache support.
3080 * cygsserver_process.cc: New file with the process cache support.
3081 * cygserver_shm.cc: Redefine debug_printf to allow conditional output.
3082 * cygwin.din: Export shmdt().
3083 * shm.cc: Run indent.
3084 Update FIXME's.
3085 (shmdt): New function.
3086 * include/cygwin/cygserver.h (class client_request): Add process cache support.
3087 (class client_request_get_version): Ditto.
3088 (class client_request_shutdown): Ditto.
3089 (class client_request_attach_tty): Ditto.
3090 * include/cygwin/cygserver_process.h: New header for process cache support.
3091
3092Sun Sep 30 8:52:00 2001 Robert Collins <rbtcollins@hotmail.com>
3093
3094 * include/cygwin/cygserver_transport.h: Add copyright header.
3095 * include/cygwin/cygserver_transport_pipes.h: Ditto.
3096 * include/cygwin/cygserver_transport_sockets.h: Ditto.
3097
3098Sat Sep 29 20:40:00 2001 Robert Collins <rbtcollins@hotmail.com>
3099
3100 * Makefile.in: Add cygserver_transport_sockets.o to DLL_OFILES.
3101 Add cygserver_transport_sockets_outside.o to cygserver.exe.
3102 * cygserver.cc: Include new include files.
3103 * cygserver_client.cc: Ditto.
3104 * cygserver_shm.h: No need to include <sys/socket.h> now.
3105 * cygerver_transport.cc: Include new include files.
3106 (transport_layer_base::transport_layer_base): Strip back to a stub.
3107 (transport_layer_base::listen): Ditto.
3108 (transport_layer_base::accept): Ditto.
3109 (transport_layer_base::close): Ditto.
3110 (transport_layer_base::read): Ditto.
3111 (transport_layer_base::write): Ditto.
3112 (transport_layer_base::connect): Ditto.
291be307 3113 * cygserver_transport_pipes.cc: Include new header
f449bfef
RC
3114 "cygwin/cygserver_transport_pipes.h".
3115 * cygserver_transport_sockets.cc: New file.
3116 * dcrt0.cc: No need to include <sys/socket.h> now.
3117 * fhandler_tty.cc: Ditto.
3118 * tty.cc: Ditto.
3119 * include/cygwin/cygserver_transport.h: Strip the base class to a stub.
3120 Remove the cygserver_transport_pipes class.
3121 * include/cygwin/cygserver_transport_pipes.h: New file.
3122 * include/cygwin/cygserver_transport_sockets.h: New file.
3123
3124Tue Sep 25 16:22:00 2001 Robert Collins <rbtcollins@hotmail.com>
3125
3126 * autoload.cc: Add dynamic load statement for 'ImpersonateNamedPipeClient'.
3127 * Makefile.in: Add new object files, and build instructions for cygserver.exe.
3128 * cygwin.din: Export ftok, shmat, shmctl and shmget.
3129 * dcrt0.cc: Additional includes for cygserver support.
3130 (dll_crt0_1): Initialise the cygserver client.
3131 * fhandler.h (fhandler_tty): New method cygserver_attach_tty.
3132 * fhandler_tty.cc: Additional includes for cygserver support.
3133 (fhandler_tty_slave::open): Attempt to use the cygserver when obtaining
3134 handles from the parent process. On failure or 9x use the current method.
3135 (fhandler_tty_slave::cygserver_attach_tty): New function.
3136 * fork.cc (fork_child): Fixup shm memory mapped areas.
3137 * pinfo.h: Declare fixup_shms_after_fork().
3138 * security.h: Declare alloc_sd().
3139 * tty.cc: Additonal includes to support cygserver.
3140 (tty::common_init): Don't allow others to open us if the cygserver is running.
3141 * winsup.h: Declare cygserver_running.
3142 * cygserver.cc: New file.
3143 * cygserver_client.cc: New file.
3144 * cygserver_shm.cc: New file.
3145 * cygserver_shm.h: New file.
3146 * cygserver_transport.cc: New file.
3147 * cygserver_transport_pipes.cc: New file.
3148 * ipc.cc: New file.
3149 * shm.cc: New file.
3150 * include/cygwin/cygserver.h: New file.
3151 * include/cygwin/cygserver_transport.h: New file.
3152 * include/sys/ipc.h: New file.
3153 * include/sys/shm.h: New file.
3154
062401c9
RC
31552002-02-28 Robert Collins <rbtcollins@hotmail.com>
3156
3157 * thread.cc (semaphore::TryWait): Set errno as required by posix 1003.1.
3158 (__sem_wait): Ditto.
3159 (__sem_trywait): Ditto.
3160
d1f50ae5
CF
31612002-02-27 Christopher Faylor <cgf@redhat.com>
3162
3163 * include/cygwin/version.h: Bump DLL minor number.
3164
acb56175
CV
31652002-02-23 Corinna Vinschen <corinna@vinschen.de>
3166
3167 * cygwin.din (fstat64): New symbol.
3168 (ftruncate64): Ditto.
3169 (lseek64): Ditto.
3170 (lstat64): Ditto.
3171 (mmap64): Ditto.
3172 (seekdir64): Ditto.
3173 (stat64): Ditto.
3174 (telldir64): Ditto.
3175 (truncate64): Ditto.
3176 * dir.cc (telldir64): New function.
3177 (telldir): Call telldir64().
3178 (seekdir64): New function.
3179 (seekdir): Call seekdir64().
3180 * fhandler.h: Redefine all methods using __off32_t to use __off64_t.
3181 * fhandler.cc: Use __off64_t and struct __stat64 throughout.
3182 * fhandler_clipboard.cc: Ditto.
3183 * fhandler_disk_file.cc: Ditto.
3184 * fhandler_dsp.cc: Ditto.
3185 * fhandler_floppy.cc: Ditto.
3186 * fhandler_mem.cc: Ditto.
3187 * fhandler_random.cc: Ditto.
3188 * fhandler_socket.cc: Ditto.
3189 * fhandler_tape.cc: Ditto.
3190 * fhandler_zero.cc: Ditto.
3191 * pipe.cc: Ditto.
3192 * glob.c: Ditto, call lstat64 and stat64 in Cygwin.
3193 * mmap.cc: Use __off64_t throughout.
3194 (mmap64): New function.
3195 * sec_acl.cc (acl_worker): Use struct __stat64, call stat64 and lstat64.
3196 * syscalls.cc (lseek64): New function.
3197 (stat64_to_stat32): Ditto.
3198 (fstat64): Ditto.
3199 (stat64): Ditto.
3200 (lstat64): Ditto.
3201 (ftruncate64): Ditto.
3202 (truncate64): Ditto.
3203 (_fstat): Call fstat64.
3204 (_stat): Call stat64.
3205 (cygwin_lstat): Rename to avoid declaration problem. Call lstat64.
3206 (stat_worker): Use struct __stat64.
3207 (access): Ditto.
3208 (ftruncate): Call ftruncate64.
3209 (truncate): Call truncate64.
3210 * wincap.cc: Set flag has_64bit_file_access appropriately.
3211 * wincap.h: Add flag has_64bit_file_access.
3212 * winsup.h (ILLEGAL_SEEK): Define as __off64_t.
3213 (stat_dev): Declare using struct __stat64.
3214 (stat_worker): Ditto.
3215 * include/cygwin/stat.h (struct __stat32): Define if compiling Cygwin.
3216 (struct __stat64): Ditto.
3217 (struct stat): Revert definition with explicitly sized datatypes.
3218 Eliminate sized field names.
3219 * include/cygwin/types.h (blksize_t): New type.
3220 (__blkcnt32_t): Ditto.
3221 (__blkcnt64_t): Ditto.
3222 (blkcnt_t): Ditto.
3223
083abe54
CF
32242002-02-22 Christopher Faylor <cgf@redhat.com>
3225
3226 * sync.h (new_muto): Just accept an argument which denotes the name of
3227 the muto. Use this argument to construct static storage.
3228 * cygheap.cc (cygheap_init): Reflect above change.
3229 * exceptions.cc (events_init): Ditto.
3230 * malloc.cc (malloc_init): Ditto.
3231 * path.cc (cwdstuff::init): Ditto.
3232 * cygheap.h (cwdstuff): Change name of lock element to make it less
3233 generic.
3234 * path.cc (cwdstuff::get_hash): Ditto.
3235 (cwdstuff::get_initial): Ditto.
3236 (cwdstuff::set): Ditto.
3237 (cwdstuff::get): Ditto.
3238 * sigproc.cc (proc_subproc): Ditto.
3239
3240 * debug.cc (lock_debug): Change to method. Use method rather than
3241 macro throughout.
3242
3243 * tty.h (tty_min::kill_pgrp): Declare new method.
3244 * fhandler_termios.cc (tty_min::kill_pgrp): New method.
3245 (fhandler_termios::line_edit): Use new method for killing process.
3246 * dcrt0.cc (do_exit): Ditto.
3247
3248 * dtable.cc (dtable::get_debugger_info): New method for inheriting
3249 dtable info from a debugger.
3250 * tty.cc (tty_init): Attempt to grab file handle info from parent
3251 debugger, if appropriate.
3252
3253 # dtable.cc (dtable::stdio_init): Make this a method.
3254 (dtable::init_std_file_from_handle): Don't set fd unless it's not open.
3255 (dtable::build_fhandler_from_name): Move name setting to
3256 dtable::build_fhandler.
3257 (dtable::build_fhandler): Add win32 name parameter.
3258 * dcrt0.cc (dll_crt0_1): Change to use dtable stdio_init.
3259 * dtable.h (dtable): Reflect build_fhandler parameter change.
3260 * mmap.cc (mmap_record::alloc_fh): Don't set name parameter in
3261 build_fhandler.
3262 * net.cc (fdsock): Remove set_name call since it is now handled by
3263 build_fhandler.
3264
3265 * sigproc.cc (proc_subproc): Release muto as early as possible.
3266
a6790c5f
CV
32672001-02-22 Corinna Vinschen <corinna@vinschen.de>
3268
3269 * smallprint.c (rn): Allow long long values.
3270 (__small_vsprintf): Add 'D', 'U' and 'X' formats for long long
3271 parameters.
3272
aa6df8d7
CF
32732002-02-19 Christopher Faylor <cgf@redhat.com>
3274
3275 * fhandler.cc (fhandler_base::puts_readahead): Remove default parameter
3276 setting. Newer gcc's complain about this.
3277 (fhandler_base::set_readahead_valid): Ditto.
3278 * fhandler_dsp.cc (Audio::open): Ditto.
3279 (fhandler_dev_dsp::open): Ditto.
3280
cecb74ae
CF
32812002-02-19 Christopher Faylor <cgf@redhat.com>
3282
3283 * fork.cc (fork_parent): Use sec_user_nih to control process/thread
3284 inheritance/permission.
3285 * spawn.cc (spawn_guts): Ditto.
3286 * security.cc (create_token): Initialize token so that it is not tested
3287 for bogus value later. Use sec_user to control process/thread
3288 creation.
3289 * security.h (__sec_user): Rename declaration from sec_user.
3290 (sec_user_nih): Declare here as inline function wrapper for __sec_user.
3291 (sec_user): Ditto.
3292 * sigproc.cc (czombies): Allocate a character array for zombies to
3293 avoid constructor overhead
3294 (extremely hackish, I know).
3295 (cpchildren): Ditto.
3296 (pchildren): New define.
3297 (zombies): Ditto.
3298 (getsem): Use sec_user_nih to control semaphore inheritance/permission.
3299
2bd22312
CF
33002002-02-16 Christopher Faylor <cgf@redhat.com>
3301
3302 * times.cc (hires::prime): Restore thread priority on failure
3303 condition.
3304
3305 * uinfo.cc (uinfo_init): Use more robust method for determining if
3306 process was invoked from a non-cygwin process.
3307
3308 * sync.h (muto::init): Eliminate "inheritance" parameter.
3309 (new_muto): Reflect removal of parameter.
3310 * sync.cc (muto::init): Ditto.
3311 * cygheap.cc (cygheap_init): Ditto.
3312 * debug.cc (threadname_init): Ditto.
3313 * exceptions.cc (events_init): Ditto.
3314 * malloc.cc (malloc_init): Ditto.
3315 * path.cc (cwdstuff::init): Ditto.
3316 * sigproc.cc (sigproc_init): Ditto.
3317
4c761646
CF
3318 * grp.cc (group_lock): Use different method for locking with static
3319 member.
2bd22312 3320 (read_etc_group): REALLY ensure that read lock mutex is released.
4c761646
CF
3321 * passwd.cc (passwd_lock): Use different method for locking with static
3322 member.
3323 (read_etc_passwd): REALLY ensure that read lock mutex is released.
2bd22312
CF
3324
3325 * shared.cc (sec_user): Correct reversed inheritance test.
3326
60b68f0d
CF
33272002-02-15 Christopher Faylor <cgf@redhat.com>
3328
3329 * hires.h (hires::usecs): Rename from utime. Accept an argument.
3330 * strace.cc (strace::microseconds): Use hires class for calculating
3331 times.
3332 * sync.h (new_muto): Use NO_COPY explicitly in declaration.
3333 * times.cc (gettimeofday): Reflect change in usecs argument.
3334 (hires::usecs): Ditto. Changed name from utime.
3335 * winsup.h (NO_COPY): Add nocommon attribute to force setting aside
3336 space for variable.
3337 * regcomp.c (REQUIRE): Add a void cast to bypass a warning.
3338
dce87b21
CF
33392002-02-15 Christopher Faylor <cgf@redhat.com>
3340
3341 * hires.h: New file.
3342 * times.cc (gettimeofday): Use hires class for calculating current time.
3343 (hires::prime): New method.
3344 (hires::utime): Ditto.
3345
3d456520
CF
33462002-02-14 Christopher Faylor <cgf@redhat.com>
3347
3348 * include/sys/cygwin.h (cygwin_getinfo_types): New CW_STRACE_ACTIVE.
3349 * external.cc (cygwin_internal): Handle CW_STRACE_ACTIVE.
3350
907dc7d0
CF
33512002-02-14 Christopher Faylor <cgf@redhat.com>
3352
3353 * exceptions.cc (unused_sig_wrapper): Eliminate unused parameter to
3354 asm.
3355 * external.cc (cygwin_internal): Change CW_STRACE_ON to
3356 CW_STRACE_TOGGLE.
3357 * strace.cc (strace::hello): Toggle strace on and off.
bb55ce4c 3358 * sync.cc (muto::init): Rename from constructor.
907dc7d0
CF
3359 * sync.h (muto::new): Delete.
3360 (muto::delete): Ditto.
3361 (new_muto): Simplify. Use muto.init for nearly everything.
3362 * uinfo.cc (uinfo_init): Avoid closing a NULL handle.
3363 * include/sys/cygwin.h (cygwin_getinfo_types): Rename CW_STRACE_OFF to
3364 CW_STRACE_TOGGLE. Delete CW_STRACE_OFF.
3365 * include/sys/strace.h (strace): Add "inited" field.
3366
4753a17b
CV
33672001-02-12 Corinna Vinschen <corinna@vinschen.de>
3368
3369 * include/cygwin/acl.h: Fix definition of aclent_t.
3370
909acaf6
CF
33712002-02-10 Christopher Faylor <cgf@redhat.com>
3372
3373 * Makefile.in (DLL_OFILES): Consolidate object files.
3374
de4e0d30
CV
33752002-02-10 Corinna Vinschen <corinna@vinschen.de>
3376
b31c68c4
CV
3377 * child_info.h, cygheap.h, fhandler_clipboard.cc, fhandler_dsp.cc,
3378 fhandler_floppy.cc, fhandler_mem.cc, fhandler_random.cc,
3379 fhandler_tape.cc, fhandler_zero.cc, grp.cc, mmap.cc, passwd.cc,
3380 pinfo.cc, pinfo.h, pipe.cc, sec_acl.cc, sec_helper.cc, security.cc,
3381 security.h, thread.h, uinfo.cc, include/cygwin/acl.h: Fix copyright.
3382
33832002-02-10 Corinna Vinschen <corinna@vinschen.de>
3384
3385 * child_info.h, cygheap.h, dcrt0.cc, dir.cc, fhandler.cc, fhandler.h,
de4e0d30
CV
3386 fhandler_clipboard.cc, fhandler_disk_file.cc, fhandler_dsp.cc,
3387 fhandler_floppy.cc, fhandler_mem.cc, fhandler_random.cc,
3388 fhandler_tape.cc, fhandler_zero.cc, grp.cc, mmap.cc, passwd.cc,
3389 pinfo.cc, pinfo.h, pipe.cc, sec_acl.cc, sec_helper.cc, security.cc,
b31c68c4 3390 security.h, spawn.cc, syscalls.cc, thread.h, uinfo.cc, winsup.h:
de4e0d30
CV
3391 Change usage of uid_t to __uid16_t, gid_t to __gid16_t and
3392 off_t to __off32_t throughout. Use INVALID_UID, INVALID_GID and
3393 INVALID_SEEK instead casting -1 to the appropriate type.
3394 * winsup.h: Define INVALID_UID, INVALID_GID and INVALID_SEEK.
3395 * include/cygwin/acl.h: Define internal __aclent16_t and __aclent32_t
3396 types. Don't declare acl functions when compiling Cygwin.
3397 * include/cygwin/grp.h: Declare getgrgid() and getgrnam() with
3398 correct types for internal usage.
3399
39b553b8
CV
34002002-02-10 Corinna Vinschen <corinna@vinschen.de>
3401
3402 Patch suggested by Pierre A. Humblet <Pierre.Humblet@ieee.org>:
3403 * uinfo.cc (internal_getlogin): Try evaluating user by SID even if
3404 ntsec is off.
3405 (uinfo_init): Set primary group even if ntsec is off.
3406
52296b85
CV
34072002-02-09 Corinna Vinschen <corinna@vinschen.de>
3408
3409 * include/cygwin/grp.h: New file.
3410 * include/cygwin/stat.h: Ditto.
3411 * include/cygwin/types.h: Add definitions for __off32_t,
3412 __off64_t, off_t, __uid16_t, __uid32_t, uid_t, __gid16_t,
3413 __gid32_t and gid_t.
3414 * include/sys/cygwin.h: Use correct uid and gid types.
3415
ff86860b
CV
34162002-02-09 Corinna Vinschen <corinna@vinschen.de>
3417
3418 * dtable.cc (dtable::dup2): Revert previous patch.
3419 * fhandler.h: Ditto.
3420 (fhandler_socket::recv): Define new method.
3421 (fhandler_socket::send): Ditto.
3422 * fhandler_socket.cc (fhandler_socket::recv): New method.
3423 (fhandler_socket::send): Ditto.
3424 (fhandler_socket::read): Call fhandler_socket::recv() now.
3425 (fhandler_socket::write): Call fhandler_socket::send() now.
3426 * net.cc (class wsock_event): Move definition to wsock_event.h.
3427 (fdsock): Revert previous patch.
3428 (cygwin_recv): Move implementation to fhandler_socket::recv().
3429 (cygwin_send): Move implementation to fhandler_socket::send().
3430 * wsock_event.h: New file.
3431
d0672acc
CV
34322002-02-06 Alexander Gottwald <Alexander.Gottwald@s1999.tuchemnitz.de>
3433
3434 * net.cc (get_2k_ifconf): Create interface entries for tokenring cards.
3435
fae28904
CV
34362002-02-08 Corinna Vinschen <corinna@vinschen.de>
3437
3438 * dtable.cc (dtable::dup2): Store fd for fhandler_socket.
3439 * fhandler.h (fhandler_base::set_fd): New virtual method.
3440 (fhandler_base::get_fd): Ditto.
3441 (fhandler_socket::set_fd): Ditto.
3442 (fhandler_socket::get_fd): Ditto.
3443 * fhandler_socket.cc (fhandler_socket::read): Call cygwin_recv instead
3444 of native Winsock recv.
3445 (fhandler_socket::write): Call cygwin_send instead of native Winsock
3446 send.
3447 * net.cc (fdsock): Store fd in fhandler_socket.
3448
1f64102f
CV
34492002-02-07 Corinna Vinschen <corinna@vinschen.de>
3450
3451 * net.cc (cygwin_getsockname): Fix handling of NULL sun_path.
3452
562d9745
CV
34532002-01-29 Corinna Vinschen <corinna@vinschen.de>
3454
3455 * net.cc (getdomainname): Fix registry key for 9x systems, too.
3456
94ee02fa
CV
34572002-01-29 Corinna Vinschen <corinna@vinschen.de>
3458
3459 * net.cc (getdomainname): Fix registry key for NT systems.
3460
494a66d9
CF
34612002-01-28 Christopher Faylor <cgf@redhat.com>
3462
3463 * external.cc (cygwin_internal): Initialize various internal settings
3464 if required to allow use of some things from user loaded DLL.
3465 (CW_STRACE_ON): Add new feature.
3466 (CW_CYGWIN_PID_TO_WINPID): Ditto.
3467 * pinfo.cc (set_myself): Call "strace.hello" to initiate possible
3468 strace session.
3469 (pinfo::init): Guard against dereferencing uninitialized myself.
3470 * sigproc.cc (wait_sig): Call strace.hello() when __SIGTRACE "signal"
3471 received.
3472 * strace.cc (strace::hello): New method.
3473 * wincap.cc (wincapc::init): Avoid initializing if already initialized.
3474 * wincap.h (wincapc::wincapc): New method.
3475 * include/sys/cygwin.h: Add new CW_ enums. Kludge typedefs of
3476 {g,u}id_t if required.
3477 * strace.h (strace::hello): Declare new method.
3478
6616e6cf
CF
34792002-01-28 Earnie Boyd <earnie@users.sf.net>
3480
3481 * include/sys/strace.h (_STRACE_ON): Define.
3482 (_STRACE_OFF): Ditto.
3483
dfb4c347
CF
34842002-01-24 Christopher Faylor <cgf@redhat.com>
3485
3486 * speclib: Ensure that temporary def file is removed.
3487
3c07fbeb
CF
34882002-01-23 Christopher Faylor <cgf@redhat.com>
3489
3490 * speclib: Use rm -f to remove temp file just to quiet any potential
3491 warnings.
3492
f6fc31e1
CV
34932002-01-23 Corinna Vinschen <corinna@vinschen.de>
3494
3495 * security.cc (create_token): Use sec_user() to create
be6d8567
CV
3496 SECURITY_ATTRIBUTES structure for primary token. Use
3497 MAXIMUM_ALLOWED access rights instead of TOKEN_ALL_ACCESS.
f6fc31e1 3498
adbd01af
CV
34992002-01-23 Corinna Vinschen <corinna@vinschen.de>
3500
3501 * path.cc (symlink): Fix check for already existing file.
3502
aed69a5b
CF
35032002-01-21 Christopher Faylor <cgf@redhat.com>
3504
3505 * cygmagic: Suppress error output when figuring out if sum takes an
3506 option.
3507
f3647dd7
CF
35082002-01-21 Christopher Faylor <cgf@redhat.com>
3509
3510 * cygmagic: Attempt to figure out if sum takes an option.
3511
51076b73
CF
35122002-01-21 DJ Delorie <dj@redhat.com>
3513
3514 * Makefile.in (libpthread.a): Pass the assembler also.
291be307 3515 (libm.a): Ditto.
51076b73
CF
3516 (libc.a): Ditto.
3517 * speclib: Specify the assembler to dlltool.
3518
0ac2abea
CF
35192002-01-21 Christopher Faylor <cgf@redhat.com>
3520
3521 * include/cygwin/version.h: Bump DLL minor number.
3522
ac11ec88
CV
35232002-01-21 Corinna Vinschen <corinna@vinschen.de>
3524
28982aa8 3525 * grp.cc (getgrgid): Don't return default gid entry when ntsec is on.
ac11ec88
CV
3526 * syscalls.cc (setegid): Don't set primary group in process token.
3527
8ef47135
CF
35282002-01-21 Christopher Faylor <cgf@redhat.com>
3529
3530 * speclib: Don't use /dev/null as DLL name. Just default to what's
3531 already in .def file.
3532
35332002-01-21 Christopher Faylor <cgf@redhat.com>
3534
3535 * exceptions.cc (sig_handle): Remove last vestiges of SA_NOCLDSTOP code
3536 which caused SIGCHLD to be ignored.
3537
07cc1f1f
CF
35382002-01-20 Christopher Faylor <cgf@redhat.com>
3539
3540 * include/cygwin/version.h: Bump DLL minor number.
3541
385437d4
CF
35422002-01-20 Christopher Faylor <cgf@redhat.com>
3543
3544 * syscalls.cc (regfree): Make dll_export.
3545
d7c16d8d
CF
35462002-01-20 Christopher Faylor <cgf@redhat.com>
3547
3548 * exceptions.cc (ctrl_c_handler): Convert windows pid to cygwin pid
3549 when detecting if we should actually handle CTRL-C.
3550
216109a8
CF
35512002-01-19 Christopher Faylor <cgf@redhat.com>
3552
3553 * Makefile.in (new-cygwin1.dll): Revert previous change. libsupc++.a
3554 is only available in libstdc++-v3.
3555
9e73b339
CF
35562002-01-19 Christopher Faylor <cgf@redhat.com>
3557
3558 * exceptions.cc (sig_handle_tty_stop): Don't send SIGCHLD if parent
3559 doesn't want it.
3560 (sig_handle): Don't check for SA_NOCLDSTOP here. We don't have enough
3561 information.
3562
5946622e
CF
35632002-01-19 Christopher Faylor <cgf@redhat.com>
3564
3565 * include/cygwin/version.h: Bump DLL minor number.
3566
994fe87b
CF
35672002-01-19 Christopher Faylor <cgf@redhat.com>
3568
3569 * Makefile.in (new-cygwin1.dll): Just use -lsupc++ for link.
3570 * sigproc.cc (proc_exists): Change existence criteria.
3571 * sync.h (new_muto): Add volatile to definition to avoid gcc
3572 optimization problems.
3573
df3af773
CV
35742002-01-19 Corinna Vinschen <corinna@vinschen.de>
3575
3576 * include/cygwin/version.h: Bump API minor version to 51.
3577
7d6be0d6
CV
35782002-01-19 Mark Bradshaw <bradshaw@staff.crosswalk.com>
3579
291be307
CF
3580 * cygwin.din: Add recvmsg and sendmsg.
3581 * net.cc: Add cygwin_recvmsg and cygwin_sendmsg.
3582 * /usr/include/sys/socket.h: Add recvmsg and sendmsg.
7d6be0d6 3583
2d3dab2e
CV
35842002-01-19 Corinna Vinschen <corinna@vinschen.de>
3585
3586 * security.cc (create_token): Close processes token handle as soon
3587 as it's not used anymore.
3588
104c3be6
CV
35892002-01-17 Corinna Vinschen <corinna@vinschen.de>
3590
3591 * Makefile.in: Add fnmatch.o to DLL_OFILES.
3592 * cygwin.din: Add fnmatch export symbol.
3593 * fnmatch.c: New file.
3594 * include/fnmatch.h: Ditto.
3595 * include/cygwin/version.h: Bump API minor version to 50.
3596
9a7e1562
CV
35972002-01-15 Corinna Vinschen <corinna@vinschen.de>
3598
3599 * path.cc (fchdir): Call chdir with full windows path.
3600
7eddac1b
CV
36012002-01-14 Corinna Vinschen <corinna@vinschen.de>
3602
3603 * dir.cc: Use INVALID_FILE_ATTRIBUTES instead of "(DWORD) -1"
3604 for file attributes throughout.
3605 * fhandler.cc: Ditto.
3606 * fhandler_disk_file.cc: Ditto.
3607 * path.cc: Ditto.
3608 * path.h: Ditto.
3609 * syscalls.cc: Ditto.
3610 * times.cc (utimes): Use path_conv::isdir() instead of explicit
3611 GetFileAttributes() call.
3612
5daa0835
CF
36132002-01-13 Christopher Faylor <cgf@redhat.com>
3614
3615 * dcrt0.cc (multiple_cygwin_problem): Clarify logic and make
3616 CYGWIN_MISMATCH_OK more powerful.
3617
06486d9e
CF
36182002-01-10 Christopher Faylor <cgf@redhat.com>
3619
3620 * exceptions.cc (sig_handle): Accept a second argument indicating
3621 whether the signal came from this process or not.
3622 * sigproc.h: Reflect sig_handle arg change.
3623 * signal.cc (kill_pgrp): Add sigframe info.
3624 (abort): New function. Eliminates newlib function of same name.
3625 * sigproc.cc (wait_sig): Pass "signal from this process" value as arg
3626 2.
3627
bb5225c2
CV
36282002-01-10 Corinna Vinschen <corinna@vinschen.de>
3629
3630 * syscalls.cc (pathconf): Guard _PC_PATH_MAX branch against invalid
3631 file parameter.
3632
c0a8e8d0 36332002-01-09 Christopher Faylor <cgf@redhat.com>
291be307 3634 Robert Collins <rbtcollins@hotmail.com>
c0a8e8d0
CF
3635
3636 * exceptions.cc (early_stuff_init): Rename from misnamed
3637 set_console_handler.
3638 (ctrl_c_handler): Attempt to work around potential signal duplication
3639 during process startup.
3640 (sig_handle): Ignore SIGINT when we're just an "exec stub".
3641 * spawn.cc (spawn_guts): Store pid of spawned process in global for use
3642 by ctrl_c_handler.
3643 * dcrt0.cc (dll_crt0_1): Call renamed initialization function.
3644 * winsup.h: Reflect function name change.
3645
fe37dd79
CV
36462002-01-08 Corinna Vinschen <corinna@vinschen.de>
3647
3648 * net.cc (cygwin_accept): Set sun_path for newly connected socket.
3649
cbf7a9eb
CF
36502002-01-07 Ralf Habacker <Ralf.Habacker@freenet.de>
3651
3652 * Makefile.in: Add uninstall target.
3653
a2e12d0c
CF
36542002-01-07 Christopher Faylor <cgf@redhat.com>
3655
3656 * sigproc.cc (getsem): Clean up debugging output.
3657
4a08cbfe
CF
36582002-01-07 Christopher Faylor <cgf@redhat.com>
3659
3660 * sigproc.cc (getsem): Set errno when unable to create own semaphore.
3661 Reorganize to make clearer that error should only come from initial
3662 creation of process semaphore.
3663
10dedaaa
CF
36642002-01-06 Christopher Faylor <cgf@redhat.com>
3665
3666 * dtable.cc (dtable::init_std_file_from_handle): Add some defensive
3667 code to invalid handle case.
3668
d6154fb7
CV
36692002-01-06 Corinna Vinschen <corinna@vinschen.de>
3670
3671 * ioctl.cc (ioctl): Make third argument optional.
3672 * include/sys/ioctl.h: Ditto in declaration.
3673 * dtable.cc (dtable::init_std_file_from_handle): Revert previous
3674 bogus patch.
3675 * window.cc (WndProc): Raise SIGURG instead of SIGIO in case of FD_OOB
3676 message.
3677
9125cbd7 36782002-01-05 Christopher Faylor <cgf@redhat.com>
fcb76c5d 3679
9125cbd7
CF
3680 * dir.cc (opendir): Guarantee release of alloced fhandler structure on
3681 error.
fcb76c5d 3682
9125cbd7
CF
36832002-01-05 Corinna Vinschen <corinna@vinschen.de>
3684
3685 * exceptions.cc (sig_handle): Set default action for SIGURG to SIG_IGN.
3686
36872002-01-05 Corinna Vinschen <corinna@vinschen.de>
2edba236
CV
3688
3689 * dtable.cc (dtable::init_std_file_from_handle): Don't treat NULL
3690 handle as errorneous.
3691
acf05df7
CF
36922002-01-04 Christopher Faylor <cgf@redhat.com>
3693
3694 * cygmagic: Change logic for equality test.
3695
7acba971
CF
36962002-01-04 Christopher Faylor <cgf@redhat.com>
3697
3698 * dir.cc (opendir): Don't attempt to call sub-opendir if ENOENT.
3699
9125cbd7 37002002-01-04 Corinna Vinschen <corinna@vinschen.de>
dc63cea5
CV
3701
3702 * net.cc: Replace usage of AF_UNIX by Posix compliant AF_LOCAL
3703 throughout.
3704 (socketpair): Explicitly allow SOCK_STREAM and SOCK_DGRAM socket types
3705 in families AF_UNIX and AF_LOCAL. Explicitly allow PF_UNSPEC, PF_LOCAL
3706 and PF_INET protocols. Return error otherwise. Implement datagram
3707 socketpairs.
3708
3b789217
CF
37092002-01-01 Christopher Faylor <cgf@redhat.com>
3710
291be307 3711 * speclib: Remove temp files automatically.
3b789217 3712
2fe27909 37132002-01-01 Corinna Vinschen <corinna@vinschen.de>
2fe27909
CV
3714 * fhandler.h (fhandler_socket::sun_path): New private member.
3715 (fhandler_socket::set_sun_path): New method.
3716 (fhandler_socket::get_sun_path): Ditto.
3717 * fhandler_socket.cc (fhandler_socket::fhandler_socket): Initialize
3718 sun_path to NULL.
3719 (fhandler_socket::~fhandler_socket): Free sun_path if needed.
3720 (fhandler_socket::set_sun_path): New method.
3721 * net.cc (cygwin_bind): Set sun_path to path of local socket file.
3722 (cygwin_getsockname): Add code to return correct sockaddr for unix
3723 domain sockets.
This page took 0.466868 seconds and 5 git commands to generate.