The branch, master has been updated
       via  7180ae0b8e866d99de6827841970f16486eec7cd (commit)
      from  3d15d044a9cc998238c8f4e07094fedb3f9215fe (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 7180ae0b8e866d99de6827841970f16486eec7cd
Author: Volker Lendecke <v...@samba.org>
Date:   Sat Aug 1 10:38:13 2009 -0400

    Add some const to winbind_userinfo

-----------------------------------------------------------------------

Summary of changes:
 source3/include/nss_info.h                     |    9 +++++----
 source3/winbindd/idmap_ad.c                    |    6 +++---
 source3/winbindd/idmap_adex/idmap_adex.c       |    5 +++--
 source3/winbindd/idmap_adex/idmap_adex.h       |    5 +++--
 source3/winbindd/idmap_adex/provider_unified.c |   22 +++++++++++++---------
 source3/winbindd/idmap_hash/idmap_hash.c       |    6 +++---
 source3/winbindd/nss_info.c                    |    6 +++---
 source3/winbindd/nss_info_template.c           |    6 +++---
 source3/winbindd/winbindd.h                    |   10 +++++-----
 source3/winbindd/winbindd_ads.c                |    7 ++++---
 source3/winbindd/winbindd_cache.c              |    4 ++--
 source3/winbindd/winbindd_proto.h              |    4 ++--
 12 files changed, 49 insertions(+), 41 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/include/nss_info.h b/source3/include/nss_info.h
index 0224be0..90d992a 100644
--- a/source3/include/nss_info.h
+++ b/source3/include/nss_info.h
@@ -65,7 +65,8 @@ struct nss_info_methods {
                                  const DOM_SID *sid, 
                                  TALLOC_CTX *ctx, 
                                  ADS_STRUCT *ads, LDAPMessage *msg,
-                                 char **homedir, char **shell, char **gecos, 
gid_t *p_gid);
+                                 const char **homedir, const char **shell,
+                                 const char **gecos, gid_t *p_gid);
        NTSTATUS (*map_to_alias)(TALLOC_CTX *mem_ctx,
                                 struct nss_domain_entry *e,
                                 const char *name, char **alias);
@@ -85,10 +86,10 @@ NTSTATUS smb_register_idmap_nss(int version,
 NTSTATUS nss_init( const char **nss_list );
 
 NTSTATUS nss_get_info( const char *domain, const DOM_SID *user_sid,
-                       TALLOC_CTX *ctx,
+                      TALLOC_CTX *ctx,
                       ADS_STRUCT *ads, LDAPMessage *msg,
-                       char **homedir, char **shell, char **gecos,
-                       gid_t *p_gid);
+                      const char **homedir, const char **shell,
+                      const char **gecos, gid_t *p_gid);
 
 NTSTATUS nss_map_to_alias( TALLOC_CTX *mem_ctx, const char *domain,
                           const char *name, char **alias );
diff --git a/source3/winbindd/idmap_ad.c b/source3/winbindd/idmap_ad.c
index 3791a86..4e1ca34 100644
--- a/source3/winbindd/idmap_ad.c
+++ b/source3/winbindd/idmap_ad.c
@@ -822,9 +822,9 @@ static NTSTATUS nss_ad_get_info( struct nss_domain_entry *e,
                                  TALLOC_CTX *mem_ctx,
                                  ADS_STRUCT *ads, 
                                  LDAPMessage *msg,
-                                 char **homedir,
-                                 char **shell, 
-                                 char **gecos,
+                                 const char **homedir,
+                                 const char **shell,
+                                 const char **gecos,
                                  uint32 *gid )
 {
        const char *attrs[] = {NULL, /* attr_homedir */
diff --git a/source3/winbindd/idmap_adex/idmap_adex.c 
b/source3/winbindd/idmap_adex/idmap_adex.c
index e2fcda8..5ca7df0 100644
--- a/source3/winbindd/idmap_adex/idmap_adex.c
+++ b/source3/winbindd/idmap_adex/idmap_adex.c
@@ -318,8 +318,9 @@ static NTSTATUS _nss_adex_get_info(struct
                                      TALLOC_CTX * ctx,
                                      ADS_STRUCT * ads,
                                      LDAPMessage * msg,
-                                     char **homedir,
-                                     char **shell, char **gecos, gid_t * p_gid)
+                                     const char **homedir,
+                                     const char **shell,
+                                     const char **gecos, gid_t * p_gid)
 {
        NTSTATUS nt_status;
         struct likewise_cell *cell;
diff --git a/source3/winbindd/idmap_adex/idmap_adex.h 
b/source3/winbindd/idmap_adex/idmap_adex.h
index e068d5c..6d6881e 100644
--- a/source3/winbindd/idmap_adex/idmap_adex.h
+++ b/source3/winbindd/idmap_adex/idmap_adex.h
@@ -97,8 +97,9 @@ struct cell_provider_api {
                                    enum id_type * type, const DOM_SID * sid);
        NTSTATUS(*get_nss_info) (const DOM_SID * sid,
                                 TALLOC_CTX * ctx,
-                                char **homedir,
-                                char **shell, char **gecos, gid_t * p_gid);
+                                const char **homedir,
+                                const char **shell,
+                                const char **gecos, gid_t * p_gid);
        NTSTATUS(*map_to_alias) (TALLOC_CTX * mem_ctx,
                                 const char *domain,
                                 const char *name, char **alias);
diff --git a/source3/winbindd/idmap_adex/provider_unified.c 
b/source3/winbindd/idmap_adex/provider_unified.c
index 00db018..d48989f 100644
--- a/source3/winbindd/idmap_adex/provider_unified.c
+++ b/source3/winbindd/idmap_adex/provider_unified.c
@@ -895,21 +895,25 @@ done:
 static NTSTATUS pull_nss_info(struct likewise_cell *c,
                              LDAPMessage *msg,
                              TALLOC_CTX *ctx,
-                             char **homedir,
-                             char **shell,
-                             char **gecos,
+                             const char **homedir,
+                             const char **shell,
+                             const char **gecos,
                              gid_t *p_gid)
 {
        NTSTATUS nt_status;
+       char *tmp;
 
-       nt_status = get_object_string(c, msg, ctx, ADEX_ATTR_HOMEDIR, homedir);
+       nt_status = get_object_string(c, msg, ctx, ADEX_ATTR_HOMEDIR, &tmp);
        BAIL_ON_NTSTATUS_ERROR(nt_status);
+       *homedir = tmp;
 
-       nt_status = get_object_string(c, msg, ctx, ADEX_ATTR_SHELL, shell);
+       nt_status = get_object_string(c, msg, ctx, ADEX_ATTR_SHELL, &tmp);
        BAIL_ON_NTSTATUS_ERROR(nt_status);
+       *shell = tmp;
 
-       nt_status = get_object_string(c, msg, ctx, ADEX_ATTR_GECOS, gecos);
+       nt_status = get_object_string(c, msg, ctx, ADEX_ATTR_GECOS, &tmp);
        /* Gecos is often not set so ignore failures */
+       *gecos = tmp;
 
        nt_status = get_object_uint32(c, msg, ADEX_ATTR_GIDNUM, p_gid);
        BAIL_ON_NTSTATUS_ERROR(nt_status);
@@ -1021,9 +1025,9 @@ done:
 
 static NTSTATUS _ccp_nss_get_info(const DOM_SID * sid,
                                  TALLOC_CTX * ctx,
-                                 char **homedir,
-                                 char **shell,
-                                 char **gecos, gid_t * p_gid)
+                                 const char **homedir,
+                                 const char **shell,
+                                 const char **gecos, gid_t * p_gid)
 {
        struct likewise_cell *cell = NULL;
        LDAPMessage *msg = NULL;
diff --git a/source3/winbindd/idmap_hash/idmap_hash.c 
b/source3/winbindd/idmap_hash/idmap_hash.c
index 4283072..7d4dd2b 100644
--- a/source3/winbindd/idmap_hash/idmap_hash.c
+++ b/source3/winbindd/idmap_hash/idmap_hash.c
@@ -276,9 +276,9 @@ static NTSTATUS nss_hash_get_info(struct nss_domain_entry 
*e,
                                    TALLOC_CTX *ctx,
                                    ADS_STRUCT *ads,
                                    LDAPMessage *msg,
-                                   char **homedir,
-                                   char **shell,
-                                   char **gecos,
+                                   const char **homedir,
+                                   const char **shell,
+                                   const char **gecos,
                                    gid_t *p_gid )
 {
        NTSTATUS nt_status = NT_STATUS_UNSUCCESSFUL;
diff --git a/source3/winbindd/nss_info.c b/source3/winbindd/nss_info.c
index 734c009..382aa86 100644
--- a/source3/winbindd/nss_info.c
+++ b/source3/winbindd/nss_info.c
@@ -299,11 +299,11 @@ static struct nss_domain_entry *find_nss_domain( const 
char *domain )
 /********************************************************************
  *******************************************************************/
 
- NTSTATUS nss_get_info( const char *domain, const DOM_SID *user_sid,
+NTSTATUS nss_get_info( const char *domain, const DOM_SID *user_sid,
                       TALLOC_CTX *ctx,
                       ADS_STRUCT *ads, LDAPMessage *msg,
-                      char **homedir, char **shell, char **gecos,
-                      gid_t *p_gid)
+                      const char **homedir, const char **shell,
+                      const char **gecos, gid_t *p_gid)
 {
        struct nss_domain_entry *p;
        struct nss_info_methods *m;
diff --git a/source3/winbindd/nss_info_template.c 
b/source3/winbindd/nss_info_template.c
index f44c73f..12d9c51 100644
--- a/source3/winbindd/nss_info_template.c
+++ b/source3/winbindd/nss_info_template.c
@@ -37,9 +37,9 @@ static NTSTATUS nss_template_get_info( struct 
nss_domain_entry *e,
                                       TALLOC_CTX *ctx,
                                       ADS_STRUCT *ads,
                                       LDAPMessage *msg,
-                                      char **homedir,
-                                      char **shell, 
-                                      char **gecos,
+                                      const char **homedir,
+                                      const char **shell,
+                                      const char **gecos,
                                       gid_t *gid )
 {     
        if ( !homedir || !shell || !gecos )
diff --git a/source3/winbindd/winbindd.h b/source3/winbindd/winbindd.h
index 64fb885..8f0db44 100644
--- a/source3/winbindd/winbindd.h
+++ b/source3/winbindd/winbindd.h
@@ -91,11 +91,11 @@ struct getpwent_user {
 
 /* Server state structure */
 
-typedef struct {
-       char *acct_name;
-       char *full_name;
-       char *homedir;
-       char *shell;
+typedef struct winbind_userinfo {
+       const char *acct_name;
+       const char *full_name;
+       const char *homedir;
+       const char *shell;
        gid_t primary_gid;                   /* allow the nss_info
                                                backend to set the primary 
group */
        DOM_SID user_sid;                    /* NT user and primary group SIDs 
*/
diff --git a/source3/winbindd/winbindd_ads.c b/source3/winbindd/winbindd_ads.c
index 50985cc..a95b31d 100644
--- a/source3/winbindd/winbindd_ads.c
+++ b/source3/winbindd/winbindd_ads.c
@@ -201,9 +201,10 @@ static NTSTATUS query_user_list(struct winbindd_domain 
*domain,
        i = 0;
 
        for (msg = ads_first_entry(ads, res); msg; msg = ads_next_entry(ads, 
msg)) {
-               char *name, *gecos = NULL;
-               char *homedir = NULL;
-               char *shell = NULL;
+               const char *name;
+               const char *gecos = NULL;
+               const char *homedir = NULL;
+               const char *shell = NULL;
                uint32 group;
                uint32 atype;
                DOM_SID user_sid;
diff --git a/source3/winbindd/winbindd_cache.c 
b/source3/winbindd/winbindd_cache.c
index b8872a1..bec2a71 100644
--- a/source3/winbindd/winbindd_cache.c
+++ b/source3/winbindd/winbindd_cache.c
@@ -4090,8 +4090,8 @@ NTSTATUS nss_get_info_cached( struct winbindd_domain 
*domain,
                              const DOM_SID *user_sid,
                              TALLOC_CTX *ctx,
                              ADS_STRUCT *ads, LDAPMessage *msg,
-                             char **homedir, char **shell, char **gecos,
-                             gid_t *p_gid)
+                             const char **homedir, const char **shell,
+                             const char **gecos, gid_t *p_gid)
 {
        struct winbind_cache *cache = get_cache(domain);
        struct cache_entry *centry = NULL;
diff --git a/source3/winbindd/winbindd_proto.h 
b/source3/winbindd/winbindd_proto.h
index 03e254c..c9decf8 100644
--- a/source3/winbindd/winbindd_proto.h
+++ b/source3/winbindd/winbindd_proto.h
@@ -177,8 +177,8 @@ NTSTATUS nss_get_info_cached( struct winbindd_domain 
*domain,
                              const DOM_SID *user_sid,
                              TALLOC_CTX *ctx,
                              ADS_STRUCT *ads, LDAPMessage *msg,
-                             char **homedir, char **shell, char **gecos,
-                             gid_t *p_gid);
+                             const char **homedir, const char **shell,
+                             const char **gecos, gid_t *p_gid);
 
 /* The following definitions come from winbindd/winbindd_ccache_access.c  */
 


-- 
Samba Shared Repository

Reply via email to