summaryrefslogtreecommitdiff
path: root/source3/include
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>1997-10-29 01:59:54 +0000
committerAndrew Tridgell <tridge@samba.org>1997-10-29 01:59:54 +0000
commit4fd96fddd2b13f60c4eb13263bac2a62a2795dcc (patch)
tree93c269b25da65f647dcca036b8d3682021142d68 /source3/include
parentb925b3d20c8e85c7b65a0ad599248443ae12905c (diff)
downloadsamba-4fd96fddd2b13f60c4eb13263bac2a62a2795dcc.tar.gz
samba-4fd96fddd2b13f60c4eb13263bac2a62a2795dcc.tar.bz2
samba-4fd96fddd2b13f60c4eb13263bac2a62a2795dcc.zip
clean up the hash entry code a bit. Got rid of lp_shmem_hash_size()
and made it private to the 2 shmem implementations. Added new shmops->hash_size() function. Added code to handle the IPC system limits by looping decreasing the size of the resources (semaphores and shared memory) that we request until we get under the system limits, which can be quite low on some systems! Added checks that the creator of the IPC objects is root. Otherwise we would be open to a security hole where someone pre-creates the shared memory segment and attaches. (This used to be commit 6b6f624b63137d4750200e8cb4961b1402513632)
Diffstat (limited to 'source3/include')
-rw-r--r--source3/include/proto.h5
-rw-r--r--source3/include/smb.h10
2 files changed, 3 insertions, 12 deletions
diff --git a/source3/include/proto.h b/source3/include/proto.h
index 10b0f0b796..944e92e450 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -245,7 +245,6 @@ int lp_passwordlevel(void);
int lp_usernamelevel(void);
int lp_readsize(void);
int lp_shmem_size(void);
-int lp_shmem_hash_size(void);
int lp_deadtime(void);
int lp_maxprotocol(void);
int lp_security(void);
@@ -880,11 +879,11 @@ int construct_reply(char *inbuf,char *outbuf,int size,int bufsize);
/*The following definitions come from shmem.c */
-struct shmem_ops *smb_shm_open(char *file_name, int size, int ronly);
+struct shmem_ops *smb_shm_open(int ronly);
/*The following definitions come from shmem_sysv.c */
-struct shmem_ops *sysv_shm_open(int size, int ronly);
+struct shmem_ops *sysv_shm_open(int ronly);
/*The following definitions come from smbdes.c */
diff --git a/source3/include/smb.h b/source3/include/smb.h
index 24cb279f43..ab1ff0557f 100644
--- a/source3/include/smb.h
+++ b/source3/include/smb.h
@@ -44,15 +44,6 @@
#define SHMEM_SIZE 102400
#endif
-/* Default number of hash buckets used in shared memory share mode */
-#ifndef SHMEM_HASH_SIZE
-#ifdef SEMMSL
-#define SHMEM_HASH_SIZE (SEMMSL-1)
-#else
-#define SHMEM_HASH_SIZE 15
-#endif
-#endif
-
#define NMB_PORT 137
#define DGRAM_PORT 138
#define SMB_PORT 139
@@ -1425,6 +1416,7 @@ struct shmem_ops {
BOOL (*lock_hash_entry)(unsigned int);
BOOL (*unlock_hash_entry)( unsigned int );
BOOL (*get_usage)(int *,int *,int *);
+ unsigned (*hash_size)(void);
};