summaryrefslogtreecommitdiff
path: root/source3/passdb/util_sam_sid.c
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2003-01-02 09:07:17 +0000
committerAndrew Bartlett <abartlet@samba.org>2003-01-02 09:07:17 +0000
commit6d66fb308ab85bd9691d541764e683e6040cf724 (patch)
tree10b705921665cb7bafdd332ca53b8a943e13f0e5 /source3/passdb/util_sam_sid.c
parentc105c12d122e599fe57dde8b2b73c52231f0c1d2 (diff)
downloadsamba-6d66fb308ab85bd9691d541764e683e6040cf724.tar.gz
samba-6d66fb308ab85bd9691d541764e683e6040cf724.tar.bz2
samba-6d66fb308ab85bd9691d541764e683e6040cf724.zip
BIG patch...
This patch makes Samba compile cleanly with -Wwrite-strings. - That is, all string literals are marked as 'const'. These strings are always read only, this just marks them as such for passing to other functions. What is most supprising is that I didn't need to change more than a few lines of code (all in 'net', which got a small cleanup of net.h and extern variables). The rest is just adding a lot of 'const'. As far as I can tell, I have not added any new warnings - apart from making all of tdbutil.c's function const (so they warn for adding that const string to struct). Andrew Bartlett (This used to be commit 92a777d0eaa4fb3a1c7835816f93c6bdd456816d)
Diffstat (limited to 'source3/passdb/util_sam_sid.c')
-rw-r--r--source3/passdb/util_sam_sid.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/source3/passdb/util_sam_sid.c b/source3/passdb/util_sam_sid.c
index 0881531db8..6a7675a12a 100644
--- a/source3/passdb/util_sam_sid.c
+++ b/source3/passdb/util_sam_sid.c
@@ -27,14 +27,14 @@
typedef struct _known_sid_users {
uint32 rid;
enum SID_NAME_USE sid_name_use;
- char *known_user_name;
+ const char *known_user_name;
} known_sid_users;
static struct sid_name_map_info
{
DOM_SID *sid;
- char *name;
- known_sid_users *known_users;
+ const char *name;
+ const known_sid_users *known_users;
} sid_name_map[MAX_SID_NAMES];
extern DOM_SID global_sid_Builtin; /* Local well-known domain */
@@ -46,16 +46,16 @@ extern DOM_SID global_sid_NT_Authority; /* NT Authority */
static BOOL sid_name_map_initialized = False;
/* static known_sid_users no_users[] = {{0, 0, NULL}}; */
-static known_sid_users everyone_users[] = {
+static const known_sid_users everyone_users[] = {
{ 0, SID_NAME_WKN_GRP, "Everyone" },
{0, (enum SID_NAME_USE)0, NULL}};
-static known_sid_users creator_owner_users[] = {
+static const known_sid_users creator_owner_users[] = {
{ 0, SID_NAME_WKN_GRP, "Creator Owner" },
{ 1, SID_NAME_WKN_GRP, "Creator Group" },
{0, (enum SID_NAME_USE)0, NULL}};
-static known_sid_users nt_authority_users[] = {
+static const known_sid_users nt_authority_users[] = {
{ 1, SID_NAME_ALIAS, "Dialup" },
{ 2, SID_NAME_ALIAS, "Network"},
{ 3, SID_NAME_ALIAS, "Batch"},
@@ -68,7 +68,7 @@ static known_sid_users nt_authority_users[] = {
{ 18, SID_NAME_ALIAS, "SYSTEM"},
{ 0, (enum SID_NAME_USE)0, NULL}};
-static known_sid_users builtin_groups[] = {
+static const known_sid_users builtin_groups[] = {
{ BUILTIN_ALIAS_RID_ADMINS, SID_NAME_ALIAS, "Administrators" },
{ BUILTIN_ALIAS_RID_USERS, SID_NAME_ALIAS, "Users" },
{ BUILTIN_ALIAS_RID_GUESTS, SID_NAME_ALIAS, "Guests" },
@@ -284,7 +284,7 @@ BOOL map_name_to_wellknown_sid(DOM_SID *sid, enum SID_NAME_USE *use, const char
init_sid_name_map();
for (i=0; sid_name_map[i].sid != NULL; i++) {
- known_sid_users *users = sid_name_map[i].known_users;
+ const known_sid_users *users = sid_name_map[i].known_users;
if (users == NULL)
continue;