Corinna Vinschen [Wed, 26 Nov 2003 13:23:27 +0000 (13:23 +0000)]
* dir.cc (mkdir): Use local security_descriptor. Call
set_security_attribute appropriately.
* external.cc (cygwin_internal): Ditto.
* fhandler.cc (fhandler_base::open): Ditto.
* fhandler_socket.cc (fhandler_socket::bind): Ditto.
* path.cc (symlink_worker): Ditto.
* sec_acl.cc (setacl): Ditto. Call read_sd appropriately.
(getace): Ditto.
* sec_helper.cc (security_descriptor::malloc): New method.
(security_descriptor::realloc): New method.
(security_descriptor::free): New method.
* security.cc (read_sd): Get security_descriptor as parameter instead
of PSECURITY_DESCRIPTOR and a size. Drop unnecessary parameter check.
Allocate the security_descriptor buffer according to size returned by
a call to GetFileSecurity. Return buffer size on success.
(write_sd): Get security_descriptor as parameter instead of
PSECURITY_DESCRIPTOR and a size.
(get_nt_attribute): Use local security_descriptor.
(get_nt_object_attribute): Ditto in case of type == SE_REGISTRY_KEY.
Allocate security_descriptor buffer according to size returned by
a call to RegGetKeySecurity.
(alloc_sd): Make static. Get security_descriptor as parameter instead
of PSECURITY_DESCRIPTOR and a size. Drop unnecessary parameter check.
(set_security_attribute): Get security_descriptor as parameter instead
of PSECURITY_DESCRIPTOR and a size.
(set_nt_attribute): Use local security_descriptor.
(check_file_access): Ditto.
* security.h: Add class security_descriptor.
(read_sd): Change declaration to get security_descriptor as parameter
instead of PSECURITY_DESCRIPTOR and a size.
(write_sd): Ditto.
(set_security_attribute): Ditto.
(alloc_sd): Remove declaration.
* thread.cc (semaphore::semaphore): Use local security_descriptor. Call
set_security_attribute appropriately.
Corinna Vinschen [Wed, 26 Nov 2003 10:52:21 +0000 (10:52 +0000)]
* sec_acl.h (getace): Use FILE_*_BITS as permission mask.
* security.cc (get_attribute_from_acl): Ditto.
* security.h (FILE_READ_BITS): Define to match also GENERIC bits.
(FILE_WRITE_BITS): Ditto.
(FILE_EXEC_BITS): Ditto.
* sigproc.cc (proc_exists): A zombie process does not exist.
(sig_send): Improve debugging output. Wait for pipe to be created before
trying to send to it. Call call_signal_handler_now if sending a signal to
myself.
Corinna Vinschen [Sat, 22 Nov 2003 22:37:13 +0000 (22:37 +0000)]
* msg.cc (client_request_msg::serve): Add default case to msgop switch.
* sem.cc (client_request_sem::serve): Add default case to semop switch.
* shm.cc (client_request_shm::serve): Add default case to shmop switch.
Jeff Johnston [Sat, 22 Nov 2003 01:07:24 +0000 (01:07 +0000)]
2003-11-21 Artem B. Bityuckiy <mail_lists@mail.ru>
* libc/stdio/vfprintf.c (_VFPRINTF_R, get_arg): Move mb-specific
code within checks for MB_CAPABLE. For non-mb-capable platforms,
use simple byte logic.
* sem.cc: Always include signal.h to handle SIGSYS raise when !USE_SERVER.
* shm.cc: Ditto.
* msg.cc: Always include signal.h to handle SIGSYS raise when !USE_SERVER.
Jeff Johnston [Fri, 21 Nov 2003 20:48:49 +0000 (20:48 +0000)]
2003-11-21 Jeff Johnston <jjohnstn@redhat.com>
* libc/stdio/vfscanf.c (__svfscanf_r)[!_NO_LONGDBL]: Don't use
_strtold routine for processing floats and doubles since it
is not as fast as _strtod_r.
Jeff Johnston [Wed, 19 Nov 2003 21:57:52 +0000 (21:57 +0000)]
2003-11-19 Nicholas Wourms <nwourms@netscape.net>
* configure.host: Enable positional arguments for printf
family for Cygwin.
* libc/stdio/vfprintf.c (_VFPRINTF_R): Remove extraneous
pointer reference for quad_ptr_t.
Corinna Vinschen [Wed, 19 Nov 2003 18:50:23 +0000 (18:50 +0000)]
* cygserver.h (client_request::request_code_t): Add
CYGSERVER_REQUEST_MSG and CYGSERVER_REQUEST_SEM.
(admininstrator_group_sid): Add extern declaration.
* cygserver_ipc.h: Rewrite.
* cygserver_msg.h: New file.
* cygserver_sem.h: New file.
* cygserver_shm.h: More or less rewrite.
* cygwin.din: Add msgctl, msgget, msgrcv, msgsnd, semctl, semget and
semop.
* msg.cc: Rewrite.
* safe_memory.h: Remove.
* sem.cc: Rewrite.
* shm.cc: Rewrite.
* include/cygwin/ipc.h: Use appropriate guard.
(struct ipc_perm): Add seq.
(IPCID_TO_IX): New define from BSD.
(IPCID_TO_SEQ): Ditto.
(IXSEQ_TO_IPCID): Ditto.
(IPC_R): Ditto.
(IPC_W): Ditto.
(IPC_M): Ditto.
* include/cygwin/msg.h: Use appropriate guard. #ifdef _KERNEL all stuff
not explicitely defined by SUSv3. Use signed types in structs to match
types used in BSD.
(msgqnum_t): Define unsigned.
(msglen_t): Ditto.
(struct msqid_ds): Add msg_first and msg_last.
(struct msginfo): Remove msgpool. Add msgssz and msgseg.
* include/cygwin/sem.h: Use appropriate guard. #ifdef _KERNEL all stuff
not explicitely defined by SUSv3. Use signed types in structs to match
types used in BSD.
(SEM_UNDO): Define appropriately.
(struct semid_ds): Add sem_base.
(struct seminfo): Add semmap and semusz.
(SEM_A): New define from BSD.
(SEM_R): Ditto.
(SEM_ALLOC): Ditto.
(union semun): Define.
* include/cygwin/shm.h: Use appropriate guard. #ifdef _KERNEL all stuff
not explicitely defined by SUSv3. Use signed types in structs to match
types used in BSD.
(SHMLBA): Define using cygwin_internal(CW_GET_SHMLBA) call.
(struct shmid_ds): Add shm_internal.
(struct shm_info): Rename shm_ids to used_ids as in BSD. Add define
for shm_ids.
* include/cygwin/sysproto.h: New file.
* include/cygwin/version.h: Bump API minor number.
* include/sys/ipc.h: New file.
* include/sys/msg.h: New file.
* include/sys/queue.h: New file from BSD.
* include/sys/sem.h: New file.
* include/sys/shm.h: New file.
* include/sys/sysproto.h: New file.
Corinna Vinschen [Wed, 19 Nov 2003 18:49:41 +0000 (18:49 +0000)]
Don't use safe_new but new throughout. Fix copyright dates
throughout.
* Makefile.in: Accomodate all new files and name changes.
Add a *.d dependency.
(sbindir): Add.
(etcdir): Drop in favor of more appropriate sysconfdir definition.
(sysconfdir): Add.
(CXXFLAGS): Add -MMD flag. Add SYSCONFDIR definition.
(.SUFFIXES): Add.
(install): Add action items.
(libclean): New target.
(fullclean): Ditto.
* bsd_helper.cc: New file.
* bsd_helper.h: Ditto.
* bsd_log.cc: Ditto.
* bsd_log.h: Ditto.
* bsd_mutex.cc: Ditto.
* bsd_mutex.h: Ditto.
* client.cc: Rearrange to build as less as possible if
__INSIDE_CYGWIN__.
(client_request::handle_request): Add Message Queue and Semaphore
handling.
* cygserver.cc: Rearrange to build as less as possible if
__INSIDE_CYGWIN__. Use new debug/log/panic logging functions.
(DEF_CONFIG_FILE): New definition for configuration file. Use
throughout.
(getfunc): Remove.
(__cygserver__printf): Remove.
(client_request_attach_tty::serve): Return error if impersonation
fails.
(print_usage): Pump up help message.
(print_version): Add output of default configuration file.
(main): Accommodate new options. Allow overwrite of threading options
from config file. Call several new initialization functions. Drop
printing dots. Don't define SIGHANDLE inline.
* cygserver.conf: New file.
* cygserver_process.h: Rename to process.h.
* cygserver_transport.h: Rename to transport.h.
* cygserver_transport_pipes.h: Rename to transport_pipes.h.
* cygserver_transport_sockets.h: Rename to transport_sockets.h.
* msg.cc: Rewrite.
* sem.cc: Rewrite.
* shm.cc: Rewrite.
* sysv_msg.cc: New file, derived from FreeBSD version 1.52.
* sysv_sem.cc: New file, derived from FreeBSD version 1.66.
* sysv_shm.cc: New file, derived from FreeBSD version 1.89.
* threaded_queue.cc: Rearrange to build as less as possible if
__INSIDE_CYGWIN__.
* transport.cc (transport_layer_base::impersonate_client): Define bool.
(transport_layer_base::revert_to_self): Ditto.
* transport.h (transport_layer_base::impersonate_client): Declare bool.
(transport_layer_base::revert_to_self): Ditto.
* transport_pipes.cc (transport_layer_pipes::transport_layer_pipes):
Don't call init_security.
(init_security): Remove.
(transport_layer_pipes::accept): Use global sec_all_nih.
(transport_layer_pipes::connect): Ditto.
(transport_layer_pipes::impersonate_client): Define bool.
(transport_layer_pipes::revert_to_self): Ditt.
* transport_pipes.h (transport_layer_pipes::impersonate_client): Declare
bool.
(transport_layer_pipes::revert_to_self): Ditto.
* woutsup.h: Include bsd compatibility headers.
(SIGHANDLE): Add definition.
(__cygserver__printf): Remove definition.
(__noop_printf): Ditto.
(debug_printf): Define using debug.
(syscall_printf): Define using log.
(system_printf): Ditto.
Drop all other _printf definitions.
Jeff Johnston [Wed, 19 Nov 2003 17:07:36 +0000 (17:07 +0000)]
2003-11-19 Nicholas Wourms <nwourms@netscape.net>
* configure.host: Enable positional arguments for printf
family for Cygwin.
* libc/stdio/vfprintf.c (_VFPRINTF_R): Remove extraneous
pointer reference for quad_ptr_t.
* config/tc-mips.c (macro): Handle new macros: "lca" and "dlca"
for loading addresses using CALL relocations.
Don't emit CALL relocations when a base register is used.
* gas/mips/lca-svr4pic.d: New test for the "lca" macro.
* gas/mips/lca-xgot.d: Likewise.
* gas/mips/lca.s: Source for the new tests.
* gas/mips/mips.exp: Run the new tests.
* opcode/mips.h: Define new enum members, M_LCA_AB and M_DLCA_AB.
* mips-opc.c (mips_builtin_opcodes): Handle new macros: "lca" and
"dlca".
Corinna Vinschen [Mon, 17 Nov 2003 17:25:59 +0000 (17:25 +0000)]
* bsdlib.cc (getprogname): New function.
(setprogname): New funtion.
* cygwin.din: Export getprogname and setprogname.
* include/cygwin/version.h: Bumb API version number.
* dtable.cc (build_fh_pc): Use DEV_SERIAL_MAJOR to catch all serial ports.
Remove redundant FH_CYGDRIVE case since it is handled by DEV_CYGDRIVE_MAJOR.
* syscalls.cc (ftruncate64): Log length as long long.
(logout): Erase ut_host. Don't write wtmp entry. Return 1 only
if matching utmp entry has been found, 0 otherwise.
* external.cc (cygwin_internal): Add CW_GET_UID_FROM_SID and
CW_GET_GID_FROM_SID handling.
* include/cygwin/version.h: Bump API minor number.
* include/sys/cygwin.h (cygwin_getinfo_types): Add
CW_GET_UID_FROM_SID and CW_GET_GID_FROM_SID.
Jeff Johnston [Fri, 7 Nov 2003 23:47:05 +0000 (23:47 +0000)]
2003-11-07 Jeff Johnston <jjohnstn@redhat.com>
* configure.host: Remove -DLOOSE_KERNEL_NAMES flag for linux
x86 build.
* iconvdata/Makefile.am: Make dependent on newlib's configure.host
and set up default flags to pass to aclocal.
* iconvdata/Makefile.in: Regenerated.
* libc/sys/linux/Makefile.am: Add _ELIX_LEVEL_4 getlogin, getpwnam,
and getpwuid routines.
* libc/sys/linux/Makefile.in: Regenerated.
* libc/sys/linux/getlogin.c: New stub file to allow x86-linux
applications to link with newlib's shared libc library.
* libc/sys/linux/getpwnam.c: Ditto.
* libc/sys/linux/getpwuid.c: Ditto.
* libc/sys/linux/sys/types.h: Include <features.h> and supply types
that were formerly supplied by /usr/include/linux/types.h with
kernel types.
* testsuite/newlib.wctype/twctype.c: Fix testcase to properly
test _ELIX_LEVEL macro.
* cygthread.cc (cygthread::freerange): Set inuse count. Avoid setting ev from
h as h would be NULL at this point.
(cygthread::operator new): Issue debugging info when overflowing the thread
pool.
(cygthread::cygthread): Set ev from h here after h has been initialized.
Jeff Johnston [Thu, 6 Nov 2003 00:50:57 +0000 (00:50 +0000)]
2003-11-05 Jeff Johnston <jjohnstn@redhat.com>
Artem B. Bityuckiy <mail_lists@mail.ru>
* libc/stdio/vfprintf.c (_VFPRINTF_R): Add support for
%ls, %S, %lc, and %C format specifiers.
(get_arg): Ditto.
* libc/stdio/sprintf.c: Add documentation regarding new
format specifiers added in vfprintf.c.
* passwd.c (PrintPW): Turn around meaning printed for "Password not
required" option to be in line with Windows meaning.
(main): Use more appropriate 1008 option when calling
NetUserSetInfo to change flag values.
* passwd.c (UF_LOCKOUT): Remove (defined in lmaccess.h).
(version): Bump version number to 1.5.
(longopts): Add -c, -C, -e, -E, -p, -P options.
(opts): Ditto.
(PrintPW): Print values of UF_PASSWD_CANT_CHANGE and
UF_DONT_EXPIRE_PASSWD flags. Slightly reformat output. Don't suppress
correct system password settings just because the account has admin
privileges.
(usage): Define as "noreturn" function. Restructure and rephrase
output. Accomodate new options.
(print_version): Fix copyright dates.
(main): Accomodate new options for setting UF_PASSWD_CANT_CHANGE,
UF_DONT_EXPIRE_PASSWD and UF_PASSWD_NOTREQD settings.
* m68k/asm.h: Add macros for -fPIC, -msep-data and
-mid-shared-library support.
* m68k/crt0.S: Use macros for -fPIC, -msep-data and
-mid-shared-library support.
* m68k/sim-crt0.S: Likewise.
Corinna Vinschen [Mon, 27 Oct 2003 11:48:29 +0000 (11:48 +0000)]
* cygwin.din: Add sem_close, sem_getvalue, sem_open and sem_timedwait.
* pthread.cc (+mangle_sem_name): New function.
(sem_open): Ditto.
(sem_close: Ditto.
(sem_timedwait): Ditto.
(sem_getvalue): Ditto.
* thread.cc (semaphore::semaphore): Rearrange member initialization.
Use appropriate security attribute for process shared semaphores.
(semaphore::semaphore): New constructor for named semaphores.
(semaphore::~semaphore): Care for semaphore name.
(semaphore::_post): Accomodate failing ReleaseSemaphore. Use value
returned by ReleaseSemaphore vor currentvalue.
(semaphore::_getvalue): New method.
(semaphore::_timedwait): Ditto.
(semaphore::_fixup_after_fork): Rearrange. Don't fail for process
shared semaphores.
(semaphore::open): New method.
(semaphore::timedwait): Ditto.
(semaphore::post): Fix return value. Set errno appropriately.
(semaphore::getvalue): New method.
* thread.h (class semaphore): Add prototypes for open, getvalue,
timedwait, _getvalue, _timedwait. Add prototypes for new constructor.
Add name member.
* include/semaphore.h: Add prototypes for sem_open, sem_close,
sem_timedwait and sem_getvalue.
include/cygwin/version.h: Bump API minor number.