Index: src/winsup/cygwin/Makefile.in diff -u src/winsup/cygwin/Makefile.in:1.102 src/winsup/cygwin/Makefile.in:1.63.2.23 --- src/winsup/cygwin/Makefile.in:1.102 Wed Sep 4 06:11:29 2002 +++ src/winsup/cygwin/Makefile.in Fri Sep 6 02:48:10 2002 @@ -118,24 +118,28 @@ DLL_IMPORTS:=$(w32api_lib)/libuuid.a $(w32api_lib)/libshell32.a $(w32api_lib)/libkernel32.a # Please maintain this list in sorted order, with maximum files per 80 col line -DLL_OFILES:=assert.o autoload.o cygheap.o cygserver_client.o \ - cygserver_transport.o cygserver_transport_pipes.o \ - cygserver_transport_sockets.o cygthread.o dcrt0.o debug.o delqueue.o \ - dir.o dlfcn.o dll_init.o dtable.o environ.o errno.o exceptions.o \ - exec.o external.o fcntl.o fhandler.o fhandler_clipboard.o \ - fhandler_console.o fhandler_disk_file.o fhandler_dsp.o \ - fhandler_floppy.o fhandler_mem.o fhandler_proc.o fhandler_process.o \ - fhandler_random.o fhandler_raw.o fhandler_registry.o fhandler_serial.o \ - fhandler_socket.o fhandler_tape.o fhandler_termios.o fhandler_tty.o \ - fhandler_virtual.o fhandler_windows.o fhandler_zero.o fnmatch.o fork.o \ - glob.o grp.o heap.o init.o ioctl.o ipc.o localtime.o malloc.o \ - malloc_wrapper.o miscfuncs.o mmap.o net.o ntea.o passwd.o path.o \ - pinfo.o pipe.o poll.o pthread.o regcomp.o regerror.o regexec.o \ - regfree.o registry.o resource.o scandir.o sched.o sec_acl.o \ - sec_helper.o security.o select.o shared.o shm.o signal.o \ - sigproc.o smallprint.o spawn.o strace.o strsep.o sync.o syscalls.o \ - sysconf.o syslog.o termios.o thread.o times.o tty.o uinfo.o uname.o \ - v8_regexp.o v8_regerror.o v8_regsub.o wait.o wincap.o window.o \ +DLL_OFILES:= \ + assert.o autoload.o cygheap.o cygserver_client.o \ + cygserver_transport.o cygserver_transport_pipes.o \ + cygserver_transport_sockets.o cygthread.o dcrt0.o debug.o \ + delqueue.o dir.o dlfcn.o dll_init.o dtable.o environ.o errno.o \ + exceptions.o exec.o external.o fcntl.o fhandler.o \ + fhandler_clipboard.o fhandler_console.o fhandler_disk_file.o \ + fhandler_dsp.o fhandler_floppy.o fhandler_mem.o \ + fhandler_proc.o fhandler_process.o fhandler_random.o \ + fhandler_raw.o fhandler_registry.o fhandler_serial.o \ + fhandler_socket.o fhandler_tape.o fhandler_termios.o \ + fhandler_tty.o fhandler_virtual.o fhandler_windows.o \ + fhandler_zero.o fnmatch.o fork.o glob.o grp.o heap.o init.o \ + ioctl.o ipc.o localtime.o malloc.o malloc_wrapper.o \ + miscfuncs.o mmap.o msg.o net.o ntea.o passwd.o path.o pinfo.o \ + pipe.o poll.o pthread.o regcomp.o regerror.o regexec.o \ + regfree.o registry.o resource.o scandir.o sched.o sec_acl.o \ + sec_helper.o security.o select.o sem.o shared.o shm.o signal.o \ + sigproc.o smallprint.o spawn.o strace.o strsep.o sync.o \ + syscalls.o sysconf.o syslog.o termios.o thread.o times.o tty.o \ + uinfo.o uname.o v8_regexp.o v8_regerror.o v8_regsub.o wait.o \ + wincap.o window.o \ $(EXTRA_DLL_OFILES) $(EXTRA_OFILES) $(MALLOC_OFILES) $(MT_SAFE_OBJECTS) GMON_OFILES:=gmon.o mcount.o profil.o @@ -207,7 +211,7 @@ install_target: cygserver.exe $(INSTALL_PROGRAM) cygserver.exe $(bindir)/cygserver.exe - + install_host: @@ -333,9 +337,6 @@ cygserver_client_outside.o: cygserver_client.cc $(COMPILE_CXX) -D__OUTSIDE_CYGWIN__ -o $@ $< - -cygserver_shm.o: cygserver_shm.cc - $(COMPILE_CXX) -D__OUTSIDE_CYGWIN__ -o $@ $< cygserver.exe: cygserver.o cygserver_shm.o cygserver_transport_outside.o cygserver_transport_pipes_outside.o cygserver_transport_sockets_outside.o cygserver_client_outside.o cygserver_process.o threaded_queue.o wincap.o version.o smallprint.o $(CXX) -o $@ $^ -lstdc++ Index: src/winsup/cygwin/dcrt0.cc diff -u src/winsup/cygwin/dcrt0.cc:1.149 src/winsup/cygwin/dcrt0.cc:1.112.2.25 --- src/winsup/cygwin/dcrt0.cc:1.149 Thu Sep 19 08:12:48 2002 +++ src/winsup/cygwin/dcrt0.cc Thu Sep 19 14:51:22 2002 @@ -34,8 +34,6 @@ #include "cygwin_version.h" #include "dll_init.h" #include "cygthread.h" -#include "cygwin/cygserver_transport.h" -#include "cygwin/cygserver.h" #define MAX_AT_FILE_LEVEL 10 @@ -685,8 +683,6 @@ /* Initialize signal/subprocess handling. */ sigproc_init (); - - cygserver_init (); /* Connect to tty. */ tty_init (); Index: src/winsup/cygwin/fhandler_tty.cc diff -u src/winsup/cygwin/fhandler_tty.cc:1.71 src/winsup/cygwin/fhandler_tty.cc:1.49.2.17 --- src/winsup/cygwin/fhandler_tty.cc:1.71 Sun Sep 8 12:35:41 2002 +++ src/winsup/cygwin/fhandler_tty.cc Thu Sep 12 03:07:49 2002 @@ -24,7 +24,6 @@ #include "pinfo.h" #include "cygheap.h" #include "shared_info.h" -#include "cygwin/cygserver_transport.h" #include "cygwin/cygserver.h" #include "cygthread.h" @@ -490,8 +489,8 @@ HANDLE from_master_local, to_master_local; if (!wincap.has_security () || - cygserver_running!=CYGSERVER_OK || - !cygserver_attach_tty ( &from_master_local, &to_master_local)) + cygserver_running == CYGSERVER_UNAVAIL || + !cygserver_attach_tty (&from_master_local, &to_master_local)) { termios_printf ("cannot dup handles via server. using old method."); @@ -547,29 +546,15 @@ if (!from_master_ptr || !to_master_ptr) return 0; - client_request_attach_tty *request = - new client_request_attach_tty ((DWORD) GetCurrentProcessId (), - (DWORD) get_ttyp ()->master_pid, - (HANDLE) get_ttyp ()->from_master, - (HANDLE) get_ttyp ()->to_master); + client_request_attach_tty req ((DWORD) get_ttyp ()->master_pid, + (HANDLE) get_ttyp ()->from_master, + (HANDLE) get_ttyp ()->to_master); - if (cygserver_request (request) != 0 || - request->header.error_code != 0) + if (req.make_request () == -1 || req.error_code ()) return 0; -/* - struct request_attach_tty req; - INIT_REQUEST (req, CYGSERVER_REQUEST_ATTACH_TTY); - req.pid = GetCurrentProcessId (); - req.master_pid = get_ttyp ()->master_pid; - req.from_master = get_ttyp ()->from_master; - req.to_master = get_ttyp ()->to_master; - if (cygserver_request ((struct request_header*) &req) != 0) - return 0; -*/ - *from_master_ptr = request->from_master (); - *to_master_ptr = request->to_master (); - delete request; + *from_master_ptr = req.from_master (); + *to_master_ptr = req.to_master (); return 1; } Index: src/winsup/cygwin/tty.cc diff -u src/winsup/cygwin/tty.cc:1.42 src/winsup/cygwin/tty.cc:1.29.2.14 --- src/winsup/cygwin/tty.cc:1.42 Sun Sep 8 12:35:41 2002 +++ src/winsup/cygwin/tty.cc Thu Sep 12 03:07:50 2002 @@ -22,7 +22,6 @@ #include "dtable.h" #include "cygheap.h" #include "pinfo.h" -#include "cygwin/cygserver_transport.h" #include "cygwin/cygserver.h" #include "shared_info.h" #include "cygthread.h" @@ -405,10 +404,17 @@ /* FIXME: we shold NOT set the security wide open when the daemon is running */ - if (wincap.has_security () && cygserver_running != CYGSERVER_OK && - (SetKernelObjectSecurity (hMainProc, DACL_SECURITY_INFORMATION, - get_null_sd ()) == FALSE)) - system_printf ("Can't set process security, %E"); + if (wincap.has_security ()) + { + if (cygserver_running == CYGSERVER_UNKNOWN) + cygserver_init (); + + if (cygserver_running != CYGSERVER_OK + && !SetKernelObjectSecurity (hMainProc, + DACL_SECURITY_INFORMATION, + get_null_sd ())) + system_printf ("Can't set process security, %E"); + } /* Create synchronisation events */