winbindd/idmap: apply const to struct nss_info_methods pointers
authorStefan Metzmacher <metze@samba.org>
Thu, 21 Mar 2019 11:30:37 +0000 (12:30 +0100)
committerStefan Metzmacher <metze@samba.org>
Tue, 15 Oct 2019 07:36:38 +0000 (09:36 +0200)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
source3/include/nss_info.h
source3/winbindd/idmap_ad_nss.c
source3/winbindd/idmap_hash/idmap_hash.c
source3/winbindd/nss_info.c

index 448f8847be906f68a9061e98a8459e177ac057d1..94df56ee7db0b85b8ec159e9b59ebdd15d5c01f6 100644 (file)
@@ -38,7 +38,7 @@ struct nss_function_entry {
        struct nss_function_entry *prev, *next;
 
        const char *name;
-       struct nss_info_methods *methods;
+       const struct nss_info_methods *methods;
 };
 
 /* List of configured domains.  Each domain points 
@@ -50,7 +50,7 @@ struct nss_domain_entry {
        const char *domain;
 
        NTSTATUS init_status;   
-       struct nss_function_entry *backend;
+       const struct nss_function_entry *backend;
 
        /* hold state on a per domain basis */
 
@@ -75,7 +75,7 @@ struct nss_info_methods {
 
 NTSTATUS smb_register_idmap_nss(int version, 
                                const char *name, 
-                               struct nss_info_methods *methods);
+                               const struct nss_info_methods *methods);
 
 NTSTATUS nss_map_to_alias( TALLOC_CTX *mem_ctx, const char *domain,
                           const char *name, char **alias );
index 0fd2b51e15695f11cee8f34b1a700cf02e806c70..96fee84997f29c60e58cdb486f7b0866c706ccd4 100644 (file)
@@ -370,19 +370,19 @@ done:
 /* The SFU and RFC2307 NSS plugins share everything but the init
    function which sets the intended schema model to use */
 
-static struct nss_info_methods nss_rfc2307_methods = {
+static const struct nss_info_methods nss_rfc2307_methods = {
        .init           = nss_rfc2307_init,
        .map_to_alias   = nss_ad_map_to_alias,
        .map_from_alias = nss_ad_map_from_alias,
 };
 
-static struct nss_info_methods nss_sfu_methods = {
+static const struct nss_info_methods nss_sfu_methods = {
        .init           = nss_sfu_init,
        .map_to_alias   = nss_ad_map_to_alias,
        .map_from_alias = nss_ad_map_from_alias,
 };
 
-static struct nss_info_methods nss_sfu20_methods = {
+static const struct nss_info_methods nss_sfu20_methods = {
        .init           = nss_sfu20_init,
        .map_to_alias   = nss_ad_map_to_alias,
        .map_from_alias = nss_ad_map_from_alias,
index 267ff3e5edc6b2681a956fade95d6cb963d6c9d4..be0ba45a044346bfa278d6794f636f77359e4504 100644 (file)
@@ -337,7 +337,7 @@ static const struct idmap_methods hash_idmap_methods = {
        .sids_to_unixids = sids_to_unixids,
 };
 
-static struct nss_info_methods hash_nss_methods = {
+static const struct nss_info_methods hash_nss_methods = {
        .init           = nss_hash_init,
        .map_to_alias   = nss_hash_map_to_alias,
        .map_from_alias = nss_hash_map_from_alias,
index 1a8325ce7dc6168b22a504674e69de546ba5e51e..9c502e84ef0609c8771bc63db0522ae69000d921 100644 (file)
@@ -46,7 +46,8 @@ static struct nss_function_entry *nss_get_backend(const char *name )
  Allow a module to register itself as a backend.
 **********************************************************************/
 
- NTSTATUS smb_register_idmap_nss(int version, const char *name, struct nss_info_methods *methods)
+ NTSTATUS smb_register_idmap_nss(int version, const char *name,
+                                const struct nss_info_methods *methods)
 {
        struct nss_function_entry *entry;
 
@@ -319,7 +320,7 @@ static struct nss_domain_entry *find_nss_domain( const char *domain )
                            const char *name, char **alias )
 {
        struct nss_domain_entry *p;
-       struct nss_info_methods *m;
+       const struct nss_info_methods *m;
 
        if ( (p = find_nss_domain( domain )) == NULL ) {
                DEBUG(4,("nss_map_to_alias: Failed to find nss domain pointer for %s\n",
@@ -340,7 +341,7 @@ static struct nss_domain_entry *find_nss_domain( const char *domain )
                              const char *alias, char **name )
 {
        struct nss_domain_entry *p;
-       struct nss_info_methods *m;
+       const struct nss_info_methods *m;
 
        if ( (p = find_nss_domain( domain )) == NULL ) {
                DEBUG(4,("nss_map_from_alias: Failed to find nss domain pointer for %s\n",