mirror of
git://sourceware.org/git/newlib-cygwin.git
synced 2025-01-31 19:40:33 +08:00
2002-03-05 Robert Collins <rbtcollins@hotmail.com>
* cygserver_transport_pipes.cc (transport_layer_pipes::transport_layer_pipes): Always init - until static members work correctly. * shm.cc (shmget): Initialize the security descriptor - thanks Corinna! * include/sys/ipc.h: Make the ipc control constants partitioned off from the sem control constants.
This commit is contained in:
parent
ad2864f4c8
commit
241a7c5a8c
@ -29,8 +29,13 @@
|
|||||||
#define debug_printf if (DEBUG) printf
|
#define debug_printf if (DEBUG) printf
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
//SECURITY_DESCRIPTOR transport_layer_pipes::sd;
|
||||||
|
//SECURITY_ATTRIBUTES transport_layer_pipes::sec_none_nih, transport_layer_pipes::sec_all_nih;
|
||||||
|
//bool transport_layer_pipes::inited = false;
|
||||||
|
|
||||||
transport_layer_pipes::transport_layer_pipes (HANDLE new_pipe)
|
transport_layer_pipes::transport_layer_pipes (HANDLE new_pipe)
|
||||||
{
|
{
|
||||||
|
inited = false; //FIXME: allow inited, sd, all_nih_.. to be static members
|
||||||
pipe = new_pipe;
|
pipe = new_pipe;
|
||||||
if (inited != true)
|
if (inited != true)
|
||||||
init_security();
|
init_security();
|
||||||
@ -38,13 +43,13 @@ transport_layer_pipes::transport_layer_pipes (HANDLE new_pipe)
|
|||||||
|
|
||||||
transport_layer_pipes::transport_layer_pipes ()
|
transport_layer_pipes::transport_layer_pipes ()
|
||||||
{
|
{
|
||||||
|
inited = false;
|
||||||
pipe = NULL;
|
pipe = NULL;
|
||||||
strcpy(pipe_name, "\\\\.\\pipe\\cygwin_lpc");
|
strcpy(pipe_name, "\\\\.\\pipe\\cygwin_lpc");
|
||||||
if (inited != true)
|
if (inited != true)
|
||||||
init_security();
|
init_security();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
transport_layer_pipes::init_security()
|
transport_layer_pipes::init_security()
|
||||||
{
|
{
|
||||||
|
@ -1,3 +1,11 @@
|
|||||||
|
2002-03-05 Robert Collins <rbtcollins@hotmail.com>
|
||||||
|
|
||||||
|
* cygserver_transport_pipes.cc (transport_layer_pipes::transport_layer_pipes):
|
||||||
|
Always init - until static members work correctly.
|
||||||
|
* shm.cc (shmget): Initialize the security descriptor - thanks Corinna!
|
||||||
|
* include/sys/ipc.h: Make the ipc control constants partitioned off from the sem
|
||||||
|
control constants.
|
||||||
|
|
||||||
2002-03-04 Christian Lestrade <christian.lestrade@free.fr>
|
2002-03-04 Christian Lestrade <christian.lestrade@free.fr>
|
||||||
|
|
||||||
* include/sys/termios.h: Define _POSIX_VDISABLE. Define CCEQ macro.
|
* include/sys/termios.h: Define _POSIX_VDISABLE. Define CCEQ macro.
|
||||||
|
@ -29,8 +29,13 @@
|
|||||||
#define debug_printf if (DEBUG) printf
|
#define debug_printf if (DEBUG) printf
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
//SECURITY_DESCRIPTOR transport_layer_pipes::sd;
|
||||||
|
//SECURITY_ATTRIBUTES transport_layer_pipes::sec_none_nih, transport_layer_pipes::sec_all_nih;
|
||||||
|
//bool transport_layer_pipes::inited = false;
|
||||||
|
|
||||||
transport_layer_pipes::transport_layer_pipes (HANDLE new_pipe)
|
transport_layer_pipes::transport_layer_pipes (HANDLE new_pipe)
|
||||||
{
|
{
|
||||||
|
inited = false; //FIXME: allow inited, sd, all_nih_.. to be static members
|
||||||
pipe = new_pipe;
|
pipe = new_pipe;
|
||||||
if (inited != true)
|
if (inited != true)
|
||||||
init_security();
|
init_security();
|
||||||
@ -38,13 +43,13 @@ transport_layer_pipes::transport_layer_pipes (HANDLE new_pipe)
|
|||||||
|
|
||||||
transport_layer_pipes::transport_layer_pipes ()
|
transport_layer_pipes::transport_layer_pipes ()
|
||||||
{
|
{
|
||||||
|
inited = false;
|
||||||
pipe = NULL;
|
pipe = NULL;
|
||||||
strcpy(pipe_name, "\\\\.\\pipe\\cygwin_lpc");
|
strcpy(pipe_name, "\\\\.\\pipe\\cygwin_lpc");
|
||||||
if (inited != true)
|
if (inited != true)
|
||||||
init_security();
|
init_security();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
transport_layer_pipes::init_security()
|
transport_layer_pipes::init_security()
|
||||||
{
|
{
|
||||||
|
@ -39,9 +39,10 @@ struct ipc_perm {
|
|||||||
/* this is a value that will _never_ be a valid key from ftok */
|
/* this is a value that will _never_ be a valid key from ftok */
|
||||||
#define IPC_PRIVATE -2
|
#define IPC_PRIVATE -2
|
||||||
|
|
||||||
#define IPC_RMID 0x0003
|
/* ctl commands 1000-1fff is ipc reserved */
|
||||||
#define IPC_SET 0x0002
|
#define IPC_RMID 0x1003
|
||||||
#define IPC_STAT 0x0001
|
#define IPC_SET 0x1002
|
||||||
|
#define IPC_STAT 0x1001
|
||||||
|
|
||||||
key_t ftok(const char *, int);
|
key_t ftok(const char *, int);
|
||||||
|
|
||||||
|
@ -460,6 +460,8 @@ shmget (key_t key, size_t size, int shmflg)
|
|||||||
char sd_buf[4096];
|
char sd_buf[4096];
|
||||||
PSECURITY_DESCRIPTOR psd = (PSECURITY_DESCRIPTOR) sd_buf;
|
PSECURITY_DESCRIPTOR psd = (PSECURITY_DESCRIPTOR) sd_buf;
|
||||||
/* create a sd for our open requests based on shmflag & 0x01ff */
|
/* create a sd for our open requests based on shmflag & 0x01ff */
|
||||||
|
InitializeSecurityDescriptor (psd,
|
||||||
|
SECURITY_DESCRIPTOR_REVISION);
|
||||||
psd = alloc_sd (getuid (), getgid (), cygheap->user.logsrv (),
|
psd = alloc_sd (getuid (), getgid (), cygheap->user.logsrv (),
|
||||||
shmflg & 0x01ff, psd, &sd_size);
|
shmflg & 0x01ff, psd, &sd_size);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user