diff options
author | Volker Lendecke <vlendec@samba.org> | 2007-10-05 21:41:17 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:31:12 -0500 |
commit | 0ebab65706e7e2ef82d8af81225db05a5f78b5c4 (patch) | |
tree | 1d5f4210f081984176ae8274050c4bb673bef4cf | |
parent | 9d1a95ac9c780339c80cbb0fe3fdf3a78d8c7059 (diff) | |
download | samba-0ebab65706e7e2ef82d8af81225db05a5f78b5c4.tar.gz samba-0ebab65706e7e2ef82d8af81225db05a5f78b5c4.tar.bz2 samba-0ebab65706e7e2ef82d8af81225db05a5f78b5c4.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...."
(This used to be commit 0141e64ad4972232de867137064d0dae62da22ee)
-rw-r--r-- | source3/include/rpc_secdes.h | 8 | ||||
-rw-r--r-- | source3/lib/secdesc.c | 2 | ||||
-rw-r--r-- | source3/lib/sharesec.c | 2 | ||||
-rw-r--r-- | source3/lib/util_seaccess.c | 2 | ||||
-rw-r--r-- | source3/printing/nt_printing.c | 8 | ||||
-rw-r--r-- | source3/registry/reg_frontend_hilvl.c | 2 | ||||
-rw-r--r-- | source3/rpc_server/srv_lsa_nt.c | 2 | ||||
-rw-r--r-- | source3/rpc_server/srv_samr_nt.c | 14 | ||||
-rw-r--r-- | source3/rpc_server/srv_spoolss_nt.c | 2 | ||||
-rw-r--r-- | source3/rpc_server/srv_srvsvc_nt.c | 2 | ||||
-rw-r--r-- | source3/rpc_server/srv_svcctl_nt.c | 4 | ||||
-rw-r--r-- | source3/rpc_server/srv_winreg_nt.c | 2 | ||||
-rw-r--r-- | source3/smbd/open.c | 2 | ||||
-rw-r--r-- | source3/smbd/posix_acls.c | 2 |
14 files changed, 27 insertions, 27 deletions
diff --git a/source3/include/rpc_secdes.h b/source3/include/rpc_secdes.h index 298d4e664e..649e8069df 100644 --- a/source3/include/rpc_secdes.h +++ b/source3/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/source3/lib/secdesc.c b/source3/lib/secdesc.c index 34954aa7a5..99f5c0cb12 100644 --- a/source3/lib/secdesc.c +++ b/source3/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/source3/lib/sharesec.c b/source3/lib/sharesec.c index 0363055a58..d30ccbe7eb 100644 --- a/source3/lib/sharesec.c +++ b/source3/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/source3/lib/util_seaccess.c b/source3/lib/util_seaccess.c index f725656085..8d49ea2c8b 100644 --- a/source3/lib/util_seaccess.c +++ b/source3/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/source3/printing/nt_printing.c b/source3/printing/nt_printing.c index cbd220d260..5e7e2a4ca0 100644 --- a/source3/printing/nt_printing.c +++ b/source3/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/source3/registry/reg_frontend_hilvl.c b/source3/registry/reg_frontend_hilvl.c index 4ed409353f..de64beb9dc 100644 --- a/source3/registry/reg_frontend_hilvl.c +++ b/source3/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/source3/rpc_server/srv_lsa_nt.c b/source3/rpc_server/srv_lsa_nt.c index 40d5005c4f..4bd6a634d8 100644 --- a/source3/rpc_server/srv_lsa_nt.c +++ b/source3/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/source3/rpc_server/srv_samr_nt.c b/source3/rpc_server/srv_samr_nt.c index 950a186e03..bec288730a 100644 --- a/source3/rpc_server/srv_samr_nt.c +++ b/source3/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/source3/rpc_server/srv_spoolss_nt.c b/source3/rpc_server/srv_spoolss_nt.c index f573d3fdc6..d5795cca25 100644 --- a/source3/rpc_server/srv_spoolss_nt.c +++ b/source3/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/source3/rpc_server/srv_srvsvc_nt.c b/source3/rpc_server/srv_srvsvc_nt.c index 503ecc1d1c..321ff83156 100644 --- a/source3/rpc_server/srv_srvsvc_nt.c +++ b/source3/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/source3/rpc_server/srv_svcctl_nt.c b/source3/rpc_server/srv_svcctl_nt.c index 6d807f3ee8..dba209eb07 100644 --- a/source3/rpc_server/srv_svcctl_nt.c +++ b/source3/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/source3/rpc_server/srv_winreg_nt.c b/source3/rpc_server/srv_winreg_nt.c index fe3295e7e9..2d6ff7454a 100644 --- a/source3/rpc_server/srv_winreg_nt.c +++ b/source3/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/source3/smbd/open.c b/source3/smbd/open.c index 6c2b5a4907..c2d7807158 100644 --- a/source3/smbd/open.c +++ b/source3/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/source3/smbd/posix_acls.c b/source3/smbd/posix_acls.c index f7cadeec3e..116917d7eb 100644 --- a/source3/smbd/posix_acls.c +++ b/source3/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 |