1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-11 05:18:09 +03:00

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 commit is contained in:
Volker Lendecke 2007-10-05 21:41:17 +00:00 committed by Gerald (Jerry) Carter
parent 0f2552e20f
commit 0141e64ad4
14 changed files with 27 additions and 27 deletions

View File

@ -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 */

View File

@ -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,

View File

@ -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,

View File

@ -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;

View File

@ -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,

View File

@ -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 };
/********************************************************************

View File

@ -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,

View File

@ -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;

View File

@ -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 */

View File

@ -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

View File

@ -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 };

View File

@ -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 };
/******************************************************************

View File

@ -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;

View File

@ -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