The branch, master has been updated
       via  39af6a0 s4-winbind handle all values for server role
       via  6f4c093 s3-lib Remove unused get_cmdline_auth_info_copy
       via  0e4a4c8 s4-param finish services hooks for s4->s3 loadparm context
       via  07f14aa s4-param cope with parameters of type char
       via  3fc182d s3-param Plug 'netbios aliases' via the parameter bridge
      from  1838e16 Add intrasite code test switch

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


- Log -----------------------------------------------------------------
commit 39af6a0927bfc3fa0d8a536bae6c3d0168c3c589
Author: Andrew Bartlett <[email protected]>
Date:   Wed Jul 13 17:26:30 2011 +1000

    s4-winbind handle all values for server role
    
    Autobuild-User: Andrew Bartlett <[email protected]>
    Autobuild-Date: Thu Jul 14 08:20:13 CEST 2011 on sn-devel-104

commit 6f4c0937298bee0e4af4dff9228e8469303516b4
Author: Andrew Bartlett <[email protected]>
Date:   Tue Jul 12 16:36:34 2011 +1000

    s3-lib Remove unused get_cmdline_auth_info_copy

commit 0e4a4c8b19c9962fc8cbdb407ccd7e9a3e7bc536
Author: Andrew Bartlett <[email protected]>
Date:   Tue Jul 12 16:03:11 2011 +1000

    s4-param finish services hooks for s4->s3 loadparm context

commit 07f14aa3a7431ee1bd2994db84e32afddcaaf8dd
Author: Andrew Bartlett <[email protected]>
Date:   Tue Jul 12 14:55:24 2011 +1000

    s4-param cope with parameters of type char

commit 3fc182dba51e50c8f7fb9b233a1c951e2b5ac712
Author: Andrew Bartlett <[email protected]>
Date:   Tue Jul 12 14:53:57 2011 +1000

    s3-param Plug 'netbios aliases' via the parameter bridge

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

Summary of changes:
 source3/include/proto.h      |    4 ++--
 source3/lib/util_cmdline.c   |   24 ------------------------
 source3/param/loadparm.c     |   13 +++++++++++++
 source3/param/loadparm_ctx.c |    5 +++++
 source4/param/loadparm.c     |   40 ++++++++++++++++++++++++++++++++++++++--
 source4/script/mks3param.pl  |    4 ++++
 source4/winbind/wb_server.c  |    1 +
 7 files changed, 63 insertions(+), 28 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/include/proto.h b/source3/include/proto.h
index 5d15e4e..010992d 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -637,8 +637,6 @@ void set_cmdline_auth_info_use_machine_account(struct 
user_auth_info *auth_info)
 bool get_cmdline_auth_info_got_pass(const struct user_auth_info *auth_info);
 bool get_cmdline_auth_info_smb_encrypt(const struct user_auth_info *auth_info);
 bool get_cmdline_auth_info_use_machine_account(const struct user_auth_info 
*auth_info);
-struct user_auth_info *get_cmdline_auth_info_copy(TALLOC_CTX *mem_ctx,
-                                                const struct user_auth_info 
*info);
 bool set_cmdline_auth_info_machine_account_creds(struct user_auth_info 
*auth_info);
 void set_cmdline_auth_info_getpass(struct user_auth_info *auth_info);
 
@@ -1577,6 +1575,8 @@ const char *lp_ldap_idmap_suffix(void);
 struct parm_struct;
 /* Return a pointer to a service by name.  */
 struct loadparm_service *lp_service(const char *pszServiceName);
+struct loadparm_service *lp_servicebynum(int snum);
+struct loadparm_service *lp_default_loadparm_service(void);
 void *lp_parm_ptr(struct loadparm_service *service, struct parm_struct *parm);
 void *lp_local_ptr_by_snum(int snum, struct parm_struct *parm);
 bool lp_do_parameter(int snum, const char *pszParmName, const char 
*pszParmValue);
diff --git a/source3/lib/util_cmdline.c b/source3/lib/util_cmdline.c
index 39f1368..81b158e 100644
--- a/source3/lib/util_cmdline.c
+++ b/source3/lib/util_cmdline.c
@@ -190,30 +190,6 @@ bool get_cmdline_auth_info_use_machine_account(const 
struct user_auth_info *auth
        return auth_info->use_machine_account;
 }
 
-struct user_auth_info *get_cmdline_auth_info_copy(TALLOC_CTX *mem_ctx,
-                                                 const struct user_auth_info 
*src)
-{
-       struct user_auth_info *result;
-
-       result = user_auth_info_init(mem_ctx);
-       if (result == NULL) {
-               return NULL;
-       }
-
-       *result = *src;
-
-       result->username = talloc_strdup(
-               result, get_cmdline_auth_info_username(src));
-       result->password = talloc_strdup(
-               result, get_cmdline_auth_info_password(src));
-       if ((result->username == NULL) || (result->password == NULL)) {
-               TALLOC_FREE(result);
-               return NULL;
-       }
-
-       return result;
-}
-
 bool set_cmdline_auth_info_machine_account_creds(struct user_auth_info 
*auth_info)
 {
        char *pass = NULL;
diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c
index 79f1b23..1258709 100644
--- a/source3/param/loadparm.c
+++ b/source3/param/loadparm.c
@@ -6419,6 +6419,19 @@ struct loadparm_service *lp_service(const char 
*pszServiceName)
        return ServicePtrs[iService];
 }
 
+struct loadparm_service *lp_servicebynum(int snum)
+{
+       if (snum = -1 || !LP_SNUM_OK(snum)) {
+               return NULL;
+       }
+       return ServicePtrs[snum];
+}
+
+struct loadparm_service *lp_default_loadparm_service()
+{
+       return &sDefault;
+}
+
 
 /***************************************************************************
  Copy a service structure to another.
diff --git a/source3/param/loadparm_ctx.c b/source3/param/loadparm_ctx.c
index 0136c8b..7c59ca7 100644
--- a/source3/param/loadparm_ctx.c
+++ b/source3/param/loadparm_ctx.c
@@ -30,6 +30,10 @@ static const struct loadparm_s3_context s3_fns =
        .get_parm_struct = lp_get_parameter,
        .get_parm_ptr = lp_parm_ptr,
        .get_service = lp_service,
+       .get_servicebynum = lp_servicebynum,
+       .get_default_loadparm_service = lp_default_loadparm_service,
+       .get_numservices = lp_numservices,
+       .set_cmdline = lp_set_cmdline,
 
        .server_role = lp_server_role,
 
@@ -47,6 +51,7 @@ static const struct loadparm_s3_context s3_fns =
 
        .netbios_name = lp_netbios_name,
        .netbios_scope = lp_netbios_scope,
+       .netbios_aliases = lp_netbios_aliases,
 
        .lanman_auth = lp_lanman_auth,
        .ntlm_auth = lp_ntlm_auth,
diff --git a/source4/param/loadparm.c b/source4/param/loadparm.c
index df8b054..b18f8fc 100644
--- a/source4/param/loadparm.c
+++ b/source4/param/loadparm.c
@@ -1311,6 +1311,9 @@ struct loadparm_context {
 
 struct loadparm_service *lpcfg_default_service(struct loadparm_context *lp_ctx)
 {
+       if (lp_ctx->s3_fns) {
+               return lp_ctx->s3_fns->get_default_loadparm_service();
+       }
        return lp_ctx->sDefault;
 }
 
@@ -1428,6 +1431,9 @@ static struct loadparm_context *global_loadparm_context;
         return lp_ctx->globals->var_name;                              \
  }
 
+/* Local parameters don't need the ->s3_fns because the struct
+ * loadparm_service is shared and lpcfg_service() checks the ->s3_fns
+ * hook */
 #define FN_LOCAL_STRING(fn_name,val) \
  _PUBLIC_ const char *lpcfg_ ## fn_name(struct loadparm_service *service, \
                                        struct loadparm_service *sDefault) { \
@@ -2079,6 +2085,10 @@ static struct loadparm_service *getservicebyname(struct 
loadparm_context *lp_ctx
 {
        int iService;
 
+       if (lp_ctx->s3_fns) {
+               return lp_ctx->s3_fns->get_service(pszServiceName);
+       }
+
        for (iService = lp_ctx->iNumServices - 1; iService >= 0; iService--)
                if (lp_ctx->services[iService] != NULL &&
                    strwicmp(lp_ctx->services[iService]->szService, 
pszServiceName) == 0) {
@@ -2504,6 +2514,10 @@ static bool set_variable(TALLOC_CTX *mem_ctx, int 
parmnum, void *parm_ptr,
                        *(int *)parm_ptr = atoi(pszParmValue);
                        break;
 
+               case P_CHAR:
+                       *(char *)parm_ptr = *pszParmValue;
+                       break;
+
                case P_OCTAL:
                        *(int *)parm_ptr = strtol(pszParmValue, NULL, 8);
                        break;
@@ -2720,9 +2734,15 @@ bool lpcfg_do_global_parameter_var(struct 
loadparm_context *lp_ctx,
 bool lpcfg_set_cmdline(struct loadparm_context *lp_ctx, const char 
*pszParmName,
                       const char *pszParmValue)
 {
-       int parmnum = map_parameter(pszParmName);
+       int parmnum;
        int i;
 
+       if (lp_ctx->s3_fns) {
+               return lp_ctx->s3_fns->set_cmdline(pszParmName, pszParmValue);
+       }
+
+       parmnum = map_parameter(pszParmName);
+
        while (isspace((unsigned char)*pszParmValue)) pszParmValue++;
 
 
@@ -2819,6 +2839,10 @@ static void print_parameter(struct parm_struct *p, void 
*ptr, FILE * f)
                        fprintf(f, "%d", *(int *)ptr);
                        break;
 
+               case P_CHAR:
+                       fprintf(f, "%c", *(char *)ptr);
+                       break;
+
                case P_OCTAL:
                        fprintf(f, "0%o", *(int *)ptr);
                        break;
@@ -2866,6 +2890,9 @@ static bool equal_parameter(parm_type type, void *ptr1, 
void *ptr2)
                case P_ENUM:
                        return (*((int *)ptr1) == *((int *)ptr2));
 
+               case P_CHAR:
+                       return (*((char *)ptr1) == *((char *)ptr2));
+
                case P_CMDLIST:
                case P_LIST:
                        return str_list_equal((const char **)(*(char ***)ptr1),
@@ -2957,6 +2984,7 @@ static bool is_default(struct loadparm_service *sDefault, 
int i)
                        return parm_table[i].def.bvalue ==
                                *(int *)def_ptr;
                case P_INTEGER:
+               case P_CHAR:
                case P_OCTAL:
                case P_BYTES:
                case P_ENUM:
@@ -3532,6 +3560,10 @@ bool lpcfg_load(struct loadparm_context *lp_ctx, const 
char *filename)
 
 int lpcfg_numservices(struct loadparm_context *lp_ctx)
 {
+       if (lp_ctx->s3_fns) {
+               return lp_ctx->s3_fns->get_numservices();
+       }
+
        return lp_ctx->iNumServices;
 }
 
@@ -3567,8 +3599,12 @@ void lpcfg_dump_one(FILE *f, bool show_defaults, struct 
loadparm_service *servic
 }
 
 struct loadparm_service *lpcfg_servicebynum(struct loadparm_context *lp_ctx,
-                                        int snum)
+                                           int snum)
 {
+       if (lp_ctx->s3_fns) {
+               return lp_ctx->s3_fns->get_servicebynum(snum);
+       }
+
        return lp_ctx->services[snum];
 }
 
diff --git a/source4/script/mks3param.pl b/source4/script/mks3param.pl
index dee3da1..761cd69 100644
--- a/source4/script/mks3param.pl
+++ b/source4/script/mks3param.pl
@@ -89,6 +89,10 @@ sub print_header($$)
        $file->("\tstruct parm_struct * (*get_parm_struct)(const char 
*param_name);\n");
        $file->("\tvoid * (*get_parm_ptr)(struct loadparm_service *service, 
struct parm_struct *parm);\n");
        $file->("\tstruct loadparm_service * (*get_service)(const char 
*service_name);\n");
+       $file->("\tstruct loadparm_service * 
(*get_default_loadparm_service)(void);\n");
+       $file->("\tstruct loadparm_service * (*get_servicebynum)(int snum);\n");
+       $file->("\tint (*get_numservices)(void);\n");
+       $file->("\tbool (*set_cmdline)(const char *pszParmName, const char 
*pszParmValue);\n");
 }
 
 sub print_footer($$) 
diff --git a/source4/winbind/wb_server.c b/source4/winbind/wb_server.c
index 5390dab..7bed235 100644
--- a/source4/winbind/wb_server.c
+++ b/source4/winbind/wb_server.c
@@ -265,6 +265,7 @@ static void winbind_task_init(struct task_server *task)
                }
                break;
        case ROLE_DOMAIN_CONTROLLER:
+       case ROLE_DOMAIN_PDC:
                primary_sid = secrets_get_domain_sid(service,
                                                     service->task->lp_ctx,
                                                     
lpcfg_workgroup(service->task->lp_ctx),


-- 
Samba Shared Repository

Reply via email to