summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>1998-07-02 22:23:56 +0000
committerJeremy Allison <jra@samba.org>1998-07-02 22:23:56 +0000
commit1cd94b24592ca31ffae671acfd83b0d42b212cab (patch)
tree844e9cc00e088d1871bf19c4288ee8ce92389845
parent1925a29c6b355b8358ee99e5b876b6376aa7d628 (diff)
downloadsamba-1cd94b24592ca31ffae671acfd83b0d42b212cab.tar.gz
samba-1cd94b24592ca31ffae671acfd83b0d42b212cab.tar.xz
samba-1cd94b24592ca31ffae671acfd83b0d42b212cab.zip
nttrans.c: More NT SMB stuff.
shmem_sysv.c: Fix for shared memory problems on several systems, Second and subsequent use of shmget should use zero as the size. Fix from Veselin Terzic <vterzic@systems.DHL.COM> Jeremy.
-rw-r--r--source/locking/shmem_sysv.c11
-rw-r--r--source/smbd/nttrans.c4
2 files changed, 11 insertions, 4 deletions
diff --git a/source/locking/shmem_sysv.c b/source/locking/shmem_sysv.c
index 439d89c6e04..3466930f4c6 100644
--- a/source/locking/shmem_sysv.c
+++ b/source/locking/shmem_sysv.c
@@ -641,8 +641,15 @@ struct shmem_ops *sysv_shm_open(int ronly)
}
}
- /* try to use an existing key */
- shm_id = shmget(SHMEM_KEY, shm_size, 0);
+ /*
+ * Try to use an existing key. Note that
+ * in order to use an existing key successfully
+ * size must be zero else shmget returns EINVAL.
+ * Thanks to Veselin Terzic <vterzic@systems.DHL.COM>
+ * for pointing this out.
+ */
+
+ shm_id = shmget(SHMEM_KEY, 0, 0);
/* if that failed then create one */
if (shm_id == -1) {
diff --git a/source/smbd/nttrans.c b/source/smbd/nttrans.c
index f6b57046815..5327502fd37 100644
--- a/source/smbd/nttrans.c
+++ b/source/smbd/nttrans.c
@@ -106,7 +106,7 @@ int reply_ntcreate_and_X(char *inbuf,char *outbuf,int length,int bufsize)
((uint32)sizeof(fname)-1));
int smb_ofun;
int smb_open_mode;
- int smb_attr = file_attributes & SAMBA_ATTRIBUTES_MASK;
+ int smb_attr = (file_attributes & SAMBA_ATTRIBUTES_MASK);
/* Breakout the oplock request bits so we can set the
reply bits separately. */
int oplock_request = flags & (REQUEST_OPLOCK|REQUEST_BATCH_OPLOCK);
@@ -334,7 +334,7 @@ static int call_nt_transact_create(char *inbuf, char *outbuf, int bufsize, int c
((uint32)sizeof(fname)-1));
int smb_ofun;
int smb_open_mode;
- int smb_attr = file_attributes & SAMBA_ATTRIBUTES_MASK;
+ int smb_attr = (file_attributes & SAMBA_ATTRIBUTES_MASK);
}
/****************************************************************************