summaryrefslogtreecommitdiffstats
path: root/source
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2007-10-05 21:41:17 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:31:12 -0500
commit0141e64ad4972232de867137064d0dae62da22ee (patch)
tree3412a241dd2c989e40713a4aec32af17dd5f82a4 /source
parent0f2552e20fb66b0b80006a8a7b999ccf6f54c656 (diff)
downloadsamba-0141e64ad4972232de867137064d0dae62da22ee.tar.gz
samba-0141e64ad4972232de867137064d0dae62da22ee.tar.xz
samba-0141e64ad4972232de867137064d0dae62da22ee.zip
r25534: Apply some const
Why? It moves these structs from the data into the text segment, so they will never been copy-on-write copied. Not much, but as in German you say "Kleinvieh macht auch Mist...."
Diffstat (limited to 'source')
-rw-r--r--source/include/rpc_secdes.h8
-rw-r--r--source/lib/secdesc.c2
-rw-r--r--source/lib/sharesec.c2
-rw-r--r--source/lib/util_seaccess.c2
-rw-r--r--source/printing/nt_printing.c8
-rw-r--r--source/registry/reg_frontend_hilvl.c2
-rw-r--r--source/rpc_server/srv_lsa_nt.c2
-rw-r--r--source/rpc_server/srv_samr_nt.c14
-rw-r--r--source/rpc_server/srv_spoolss_nt.c2
-rw-r--r--source/rpc_server/srv_srvsvc_nt.c2
-rw-r--r--source/rpc_server/srv_svcctl_nt.c4
-rw-r--r--source/rpc_server/srv_winreg_nt.c2
-rw-r--r--source/smbd/open.c2
-rw-r--r--source/smbd/posix_acls.c2
14 files changed, 27 insertions, 27 deletions
diff --git a/source/include/rpc_secdes.h b/source/include/rpc_secdes.h
index 298d4e664e3..649e8069df3 100644
--- a/source/include/rpc_secdes.h
+++ b/source/include/rpc_secdes.h
@@ -108,19 +108,19 @@ typedef struct sec_desc_buf SEC_DESC_BUF;
/* A type to describe the mapping of generic access rights to object
specific access rights. */
-typedef struct generic_mapping {
+struct generic_mapping {
uint32 generic_read;
uint32 generic_write;
uint32 generic_execute;
uint32 generic_all;
-} GENERIC_MAPPING;
+};
-typedef struct standard_mapping {
+struct standard_mapping {
uint32 std_read;
uint32 std_write;
uint32 std_execute;
uint32 std_all;
-} STANDARD_MAPPING;
+};
/* Security Access Masks Rights */
diff --git a/source/lib/secdesc.c b/source/lib/secdesc.c
index 34954aa7a56..99f5c0cb12b 100644
--- a/source/lib/secdesc.c
+++ b/source/lib/secdesc.c
@@ -24,7 +24,7 @@
/* Map generic permissions to file object specific permissions */
-struct generic_mapping file_generic_mapping = {
+const struct generic_mapping file_generic_mapping = {
FILE_GENERIC_READ,
FILE_GENERIC_WRITE,
FILE_GENERIC_EXECUTE,
diff --git a/source/lib/sharesec.c b/source/lib/sharesec.c
index 0363055a581..d30ccbe7ebf 100644
--- a/source/lib/sharesec.c
+++ b/source/lib/sharesec.c
@@ -29,7 +29,7 @@ static TDB_CONTEXT *share_tdb; /* used for share security descriptors */
/* Map generic permissions to file object specific permissions */
-static struct generic_mapping file_generic_mapping = {
+static const struct generic_mapping file_generic_mapping = {
FILE_GENERIC_READ,
FILE_GENERIC_WRITE,
FILE_GENERIC_EXECUTE,
diff --git a/source/lib/util_seaccess.c b/source/lib/util_seaccess.c
index f725656085f..8d49ea2c8be 100644
--- a/source/lib/util_seaccess.c
+++ b/source/lib/util_seaccess.c
@@ -146,7 +146,7 @@ static BOOL get_max_access( SEC_ACL *the_acl, const NT_USER_TOKEN *token, uint32
objects. Each type of object has its own mapping of generic to object
specific access rights. */
-void se_map_generic(uint32 *access_mask, struct generic_mapping *mapping)
+void se_map_generic(uint32 *access_mask, const struct generic_mapping *mapping)
{
uint32 old_mask = *access_mask;
diff --git a/source/printing/nt_printing.c b/source/printing/nt_printing.c
index cbd220d2602..5e7e2a4ca04 100644
--- a/source/printing/nt_printing.c
+++ b/source/printing/nt_printing.c
@@ -42,14 +42,14 @@ static TDB_CONTEXT *tdb_printers; /* used for printers files */
/* Map generic permissions to printer object specific permissions */
-GENERIC_MAPPING printer_generic_mapping = {
+const struct generic_mapping printer_generic_mapping = {
PRINTER_READ,
PRINTER_WRITE,
PRINTER_EXECUTE,
PRINTER_ALL_ACCESS
};
-STANDARD_MAPPING printer_std_mapping = {
+const struct standard_mapping printer_std_mapping = {
PRINTER_READ,
PRINTER_WRITE,
PRINTER_EXECUTE,
@@ -58,14 +58,14 @@ STANDARD_MAPPING printer_std_mapping = {
/* Map generic permissions to print server object specific permissions */
-GENERIC_MAPPING printserver_generic_mapping = {
+const struct generic_mapping printserver_generic_mapping = {
SERVER_READ,
SERVER_WRITE,
SERVER_EXECUTE,
SERVER_ALL_ACCESS
};
-STANDARD_MAPPING printserver_std_mapping = {
+const struct generic_mapping printserver_std_mapping = {
SERVER_READ,
SERVER_WRITE,
SERVER_EXECUTE,
diff --git a/source/registry/reg_frontend_hilvl.c b/source/registry/reg_frontend_hilvl.c
index 4ed409353f8..de64beb9dce 100644
--- a/source/registry/reg_frontend_hilvl.c
+++ b/source/registry/reg_frontend_hilvl.c
@@ -28,7 +28,7 @@
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_REGISTRY
-static struct generic_mapping reg_generic_map =
+static const struct generic_mapping reg_generic_map =
{ REG_KEY_READ, REG_KEY_WRITE, REG_KEY_EXECUTE, REG_KEY_ALL };
/********************************************************************
diff --git a/source/rpc_server/srv_lsa_nt.c b/source/rpc_server/srv_lsa_nt.c
index 40d5005c4f7..4bd6a634d81 100644
--- a/source/rpc_server/srv_lsa_nt.c
+++ b/source/rpc_server/srv_lsa_nt.c
@@ -39,7 +39,7 @@ struct lsa_info {
uint32 access;
};
-struct generic_mapping lsa_generic_mapping = {
+const struct generic_mapping lsa_generic_mapping = {
POLICY_READ,
POLICY_WRITE,
POLICY_EXECUTE,
diff --git a/source/rpc_server/srv_samr_nt.c b/source/rpc_server/srv_samr_nt.c
index 950a186e039..bec288730a0 100644
--- a/source/rpc_server/srv_samr_nt.c
+++ b/source/rpc_server/srv_samr_nt.c
@@ -72,32 +72,32 @@ struct samr_info {
TALLOC_CTX *mem_ctx;
};
-static struct generic_mapping sam_generic_mapping = {
+static const struct generic_mapping sam_generic_mapping = {
GENERIC_RIGHTS_SAM_READ,
GENERIC_RIGHTS_SAM_WRITE,
GENERIC_RIGHTS_SAM_EXECUTE,
GENERIC_RIGHTS_SAM_ALL_ACCESS};
-static struct generic_mapping dom_generic_mapping = {
+static const struct generic_mapping dom_generic_mapping = {
GENERIC_RIGHTS_DOMAIN_READ,
GENERIC_RIGHTS_DOMAIN_WRITE,
GENERIC_RIGHTS_DOMAIN_EXECUTE,
GENERIC_RIGHTS_DOMAIN_ALL_ACCESS};
-static struct generic_mapping usr_generic_mapping = {
+static const struct generic_mapping usr_generic_mapping = {
GENERIC_RIGHTS_USER_READ,
GENERIC_RIGHTS_USER_WRITE,
GENERIC_RIGHTS_USER_EXECUTE,
GENERIC_RIGHTS_USER_ALL_ACCESS};
-static struct generic_mapping usr_nopwchange_generic_mapping = {
+static const struct generic_mapping usr_nopwchange_generic_mapping = {
GENERIC_RIGHTS_USER_READ,
GENERIC_RIGHTS_USER_WRITE,
GENERIC_RIGHTS_USER_EXECUTE & ~SA_RIGHT_USER_CHANGE_PASSWORD,
GENERIC_RIGHTS_USER_ALL_ACCESS};
-static struct generic_mapping grp_generic_mapping = {
+static const struct generic_mapping grp_generic_mapping = {
GENERIC_RIGHTS_GROUP_READ,
GENERIC_RIGHTS_GROUP_WRITE,
GENERIC_RIGHTS_GROUP_EXECUTE,
GENERIC_RIGHTS_GROUP_ALL_ACCESS};
-static struct generic_mapping ali_generic_mapping = {
+static const struct generic_mapping ali_generic_mapping = {
GENERIC_RIGHTS_ALIAS_READ,
GENERIC_RIGHTS_ALIAS_WRITE,
GENERIC_RIGHTS_ALIAS_EXECUTE,
@@ -107,7 +107,7 @@ static struct generic_mapping ali_generic_mapping = {
*******************************************************************/
static NTSTATUS make_samr_object_sd( TALLOC_CTX *ctx, SEC_DESC **psd, size_t *sd_size,
- struct generic_mapping *map,
+ const struct generic_mapping *map,
DOM_SID *sid, uint32 sid_access )
{
DOM_SID domadmin_sid;
diff --git a/source/rpc_server/srv_spoolss_nt.c b/source/rpc_server/srv_spoolss_nt.c
index f573d3fdc65..d5795cca253 100644
--- a/source/rpc_server/srv_spoolss_nt.c
+++ b/source/rpc_server/srv_spoolss_nt.c
@@ -63,7 +63,7 @@ static uint32 smb_connections=0;
/* in printing/nt_printing.c */
-extern STANDARD_MAPPING printer_std_mapping, printserver_std_mapping;
+extern struct standard_mapping printer_std_mapping, printserver_std_mapping;
/* API table for Xcv Monitor functions */
diff --git a/source/rpc_server/srv_srvsvc_nt.c b/source/rpc_server/srv_srvsvc_nt.c
index 503ecc1d1c2..321ff831564 100644
--- a/source/rpc_server/srv_srvsvc_nt.c
+++ b/source/rpc_server/srv_srvsvc_nt.c
@@ -27,7 +27,7 @@
#define MAX_SERVER_DISK_ENTRIES 15
-extern struct generic_mapping file_generic_mapping;
+extern const struct generic_mapping file_generic_mapping;
extern userdom_struct current_user_info;
#undef DBGC_CLASS
diff --git a/source/rpc_server/srv_svcctl_nt.c b/source/rpc_server/srv_svcctl_nt.c
index 6d807f3ee81..dba209eb07c 100644
--- a/source/rpc_server/srv_svcctl_nt.c
+++ b/source/rpc_server/srv_svcctl_nt.c
@@ -49,9 +49,9 @@ extern SERVICE_CONTROL_OPS wins_svc_ops;
struct service_control_op *svcctl_ops;
-static struct generic_mapping scm_generic_map =
+static const struct generic_mapping scm_generic_map =
{ SC_MANAGER_READ_ACCESS, SC_MANAGER_WRITE_ACCESS, SC_MANAGER_EXECUTE_ACCESS, SC_MANAGER_ALL_ACCESS };
-static struct generic_mapping svc_generic_map =
+static const struct generic_mapping svc_generic_map =
{ SERVICE_READ_ACCESS, SERVICE_WRITE_ACCESS, SERVICE_EXECUTE_ACCESS, SERVICE_ALL_ACCESS };
diff --git a/source/rpc_server/srv_winreg_nt.c b/source/rpc_server/srv_winreg_nt.c
index fe3295e7e9e..2d6ff7454ac 100644
--- a/source/rpc_server/srv_winreg_nt.c
+++ b/source/rpc_server/srv_winreg_nt.c
@@ -26,7 +26,7 @@
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_RPC_SRV
-static struct generic_mapping reg_generic_map =
+static const struct generic_mapping reg_generic_map =
{ REG_KEY_READ, REG_KEY_WRITE, REG_KEY_EXECUTE, REG_KEY_ALL };
/******************************************************************
diff --git a/source/smbd/open.c b/source/smbd/open.c
index 6c2b5a49077..c2d7807158e 100644
--- a/source/smbd/open.c
+++ b/source/smbd/open.c
@@ -21,7 +21,7 @@
#include "includes.h"
-extern struct generic_mapping file_generic_mapping;
+extern const struct generic_mapping file_generic_mapping;
extern struct current_user current_user;
extern userdom_struct current_user_info;
extern BOOL global_client_failed_oplock_break;
diff --git a/source/smbd/posix_acls.c b/source/smbd/posix_acls.c
index f7cadeec3eb..116917d7eb8 100644
--- a/source/smbd/posix_acls.c
+++ b/source/smbd/posix_acls.c
@@ -21,7 +21,7 @@
#include "includes.h"
extern struct current_user current_user;
-extern struct generic_mapping file_generic_mapping;
+extern const struct generic_mapping file_generic_mapping;
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_ACLS