Rev 12124: Get rid of a couple more references to global_params. in file:///home/jelmer/bzr.samba/SAMBA_4_0/
At file:///home/jelmer/bzr.samba/SAMBA_4_0/ revno: 12124 revision-id: [EMAIL PROTECTED] parent: [EMAIL PROTECTED] committer: Jelmer Vernooij [EMAIL PROTECTED] branch nick: SAMBA_4_0 timestamp: Wed 2007-05-09 12:46:52 +0200 message: Get rid of a couple more references to global_params. modified: source/param/loadparm.csvn-v2:[EMAIL PROTECTED] === modified file 'source/param/loadparm.c' --- a/source/param/loadparm.c 2007-05-09 01:11:50 + +++ b/source/param/loadparm.c 2007-05-09 10:46:52 + @@ -10,6 +10,7 @@ Copyright (C) Stefan (metze) Metzmacher 2002 Copyright (C) Jim McDonough ([EMAIL PROTECTED]) 2003. Copyright (C) James Myers 2003 [EMAIL PROTECTED] + Copyright (C) Jelmer Vernooij 2007 [EMAIL PROTECTED] This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -64,13 +65,11 @@ #include lib/util/dlinklist.h #include param/loadparm.h -static BOOL bLoaded = false; - #define standard_sub_basic(str,len) /* some helpful bits */ -#define LP_SNUM_OK(i) (((i) = 0) ((i) global_params.iNumServices) global_params.ServicePtrs[(i)]-valid) -#define VALID(i) global_params.ServicePtrs[i]-valid +#define LP_SNUM_OK(ctx, i) (((i) = 0) ((i) (ctx)-iNumServices) (ctx)-ServicePtrs[(i)]-valid) +#define VALID(ctx, i) ctx-ServicePtrs[i]-valid static BOOL do_parameter_var(struct loadparm_context *, const char *pszParmName, const char *fmt, ...); @@ -103,7 +102,6 @@ char *szPidDir; char *szSetupDir; char *szServerString; - char *szAutoServices; char *szPasswdChat; char *szConfigFile; char *szShareBackend; @@ -255,15 +253,15 @@ True, /* bAvailable */ True, /* bBrowseable */ True, /* bRead_only */ - False, /* bPrint_ok */ - False, /* bMap_system */ - False, /* bMap_hidden */ + false, /* bPrint_ok */ + false, /* bMap_system */ + false, /* bMap_hidden */ True, /* bMap_archive */ True, /* bStrictLocking */ NULL, /* copymap */ - False, /* bMSDfsRoot */ - False, /* bStrictSync */ - False, /* bCIFileSystem */ + false, /* bMSDfsRoot */ + false, /* bStrictSync */ + false, /* bCIFileSystem */ NULL, /* Parametric options */ /* dummy */ @@ -276,11 +274,20 @@ struct loadparm_context { int iNumServices; service **ServicePtrs; + + /* Files used by this loadparm context */ + struct file_lists { + struct file_lists *next; + char *name; + char *subfname; + time_t modtime; + } *file_lists; }; struct loadparm_context global_params = { .iNumServices = 0, .ServicePtrs = NULL, + .file_lists = NULL, }; #define NUMPARAMETERS (sizeof(parm_table) / sizeof(struct parm_struct)) @@ -539,8 +546,6 @@ {config file, P_STRING, P_GLOBAL, GLOBALS_OFFSET(szConfigFile), NULL, NULL, FLAG_HIDE}, {share backend, P_STRING, P_GLOBAL, GLOBALS_OFFSET(szShareBackend), NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, - {preload, P_STRING, P_GLOBAL, GLOBALS_OFFSET(szAutoServices), NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, - {auto services, P_STRING, P_GLOBAL, GLOBALS_OFFSET(szAutoServices), NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, {lock dir, P_STRING, P_GLOBAL, GLOBALS_OFFSET(szLockDir), NULL, NULL, FLAG_HIDE}, {lock directory, P_STRING, P_GLOBAL, GLOBALS_OFFSET(szLockDir), NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, {modules dir, P_STRING, P_GLOBAL, GLOBALS_OFFSET(szModulesDir), NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, @@ -815,19 +820,19 @@ int fn_name(void) {return(*(int *)(ptr));} #define FN_LOCAL_STRING(fn_name,val) \ - const char *fn_name(int i) {return(lp_string((LP_SNUM_OK(i) global_params.ServicePtrs[(i)]-val) ? global_params.ServicePtrs[(i)]-val : sDefault.val));} + const char *fn_name(int i) {return(lp_string((LP_SNUM_OK(global_params, i) global_params.ServicePtrs[(i)]-val) ? global_params.ServicePtrs[(i)]-val : sDefault.val));} #define FN_LOCAL_CONST_STRING(fn_name,val) \ - const char *fn_name(int i) {return (const char *)((LP_SNUM_OK(i) global_params.ServicePtrs[(i)]-val) ? global_params.ServicePtrs[(i)]-val : sDefault.val);} + const char *fn_name(int i) {return (const char *)((LP_SNUM_OK(global_params, i) global_params.ServicePtrs[(i)]-val) ?
Rev 12125: Avoid use of typedefs, in Samba 4 style. in file:///home/jelmer/bzr.samba/SAMBA_4_0/
At file:///home/jelmer/bzr.samba/SAMBA_4_0/ revno: 12125 revision-id: [EMAIL PROTECTED] parent: [EMAIL PROTECTED] committer: Jelmer Vernooij [EMAIL PROTECTED] branch nick: SAMBA_4_0 timestamp: Wed 2007-05-09 12:52:43 +0200 message: Avoid use of typedefs, in Samba 4 style. modified: source/param/loadparm.csvn-v2:[EMAIL PROTECTED] === modified file 'source/param/loadparm.c' --- a/source/param/loadparm.c 2007-05-09 10:46:52 + +++ b/source/param/loadparm.c 2007-05-09 10:52:43 + @@ -88,7 +88,7 @@ /* * This structure describes global (ie., server-wide) parameters. */ -typedef struct +struct global { int server_role; @@ -189,15 +189,14 @@ int bDisableNetbios; int bRpcBigEndian; struct param_opt *param_opt; -} -global; +}; -static global Globals; +static struct global Globals; /* * This structure describes a single service. */ -typedef struct +struct service { int valid; char *szService; @@ -229,13 +228,12 @@ struct param_opt *param_opt; char dummy[3]; /* for alignment */ -} -service; +}; /* This is a default service used to prime a services structure */ -static service sDefault = { - True, /* valid */ +static struct service sDefault = { + true, /* valid */ NULL, /* szService */ NULL, /* szPath */ NULL, /* szCopy */ @@ -250,14 +248,14 @@ 1000, /* iMaxPrintJobs */ 0, /* iMaxConnections */ 0, /* iCSCPolicy */ - True, /* bAvailable */ - True, /* bBrowseable */ - True, /* bRead_only */ + true, /* bAvailable */ + true, /* bBrowseable */ + true, /* bRead_only */ false, /* bPrint_ok */ false, /* bMap_system */ false, /* bMap_hidden */ - True, /* bMap_archive */ - True, /* bStrictLocking */ + true, /* bMap_archive */ + true, /* bStrictLocking */ NULL, /* copymap */ false, /* bMSDfsRoot */ false, /* bStrictSync */ @@ -273,7 +271,7 @@ struct loadparm_context { int iNumServices; - service **ServicePtrs; + struct service **ServicePtrs; /* Files used by this loadparm context */ struct file_lists { @@ -955,13 +953,13 @@ static int map_parameter(const char *pszParmName); static int getservicebyname(struct loadparm_context *ctx, const char *pszServiceName, - service * pserviceDest); -static void copy_service(service * pserviceDest, -service * pserviceSource, int *pcopymapDest); + struct service * pserviceDest); +static void copy_service(struct service * pserviceDest, +struct service * pserviceSource, int *pcopymapDest); static BOOL service_ok(struct loadparm_context *ctx, int iService); static BOOL parse_section(const char *pszSectionName, void *); static BOOL parse_parameter(const char *, const char *, void *); -static void init_copymap(service * pservice); +static void init_copymap(struct service * pservice); /* This is a helper function for parametrical options support. */ /* It returns a pointer to parametrical option value if it exists or NULL otherwise */ @@ -1157,9 +1155,9 @@ Initialise a service to the defaults. ***/ -static void init_service(service * pservice) +static void init_service(struct service * pservice) { - memset((char *)pservice, '\0', sizeof(service)); + ZERO_STRUCTP(pservice); copy_service(pservice, sDefault, NULL); } @@ -1167,7 +1165,7 @@ Free the dynamically allocated parts of a service struct. ***/ -static void free_service(service *pservice) +static void free_service(struct service *pservice) { int i; struct param_opt *data, *pdata; @@ -1217,10 +1215,10 @@ ***/ static int add_a_service(struct loadparm_context *ctx, -const service *pservice, const char *name) +const struct service *pservice, const char *name) { int i; - service tservice; + struct service tservice; int
Rev 12126: Use talloc in loadparm. in file:///home/jelmer/bzr.samba/SAMBA_4_0/
At file:///home/jelmer/bzr.samba/SAMBA_4_0/ revno: 12126 revision-id: [EMAIL PROTECTED] parent: [EMAIL PROTECTED] committer: Jelmer Vernooij [EMAIL PROTECTED] branch nick: SAMBA_4_0 timestamp: Wed 2007-05-09 13:28:13 +0200 message: Use talloc in loadparm. modified: source/lib/util/util_str.c svn-v2:[EMAIL PROTECTED] source/param/loadparm.csvn-v2:[EMAIL PROTECTED] === modified file 'source/lib/util/util_str.c' --- a/source/lib/util/util_str.c2007-04-19 14:21:56 + +++ b/source/lib/util/util_str.c2007-05-09 11:28:13 + @@ -246,36 +246,23 @@ } /** - Set a string value, allocing the space for the string -**/ -static BOOL string_init(char **dest,const char *src) -{ - if (!src) src = ; - - (*dest) = strdup(src); - if ((*dest) == NULL) { - DEBUG(0,(Out of memory in string_init\n)); - return False; - } - return True; -} - -/** - Free a string value. -**/ -_PUBLIC_ void string_free(char **s) -{ - if (s) SAFE_FREE(*s); -} - -/** Set a string value, deallocating any existing space, and allocing the space for the string **/ -_PUBLIC_ BOOL string_set(char **dest, const char *src) +_PUBLIC_ BOOL string_set(TALLOC_CTX *mem_ctx, char **dest, const char *src) { - string_free(dest); - return string_init(dest,src); + if (dest != NULL) + talloc_free(*dest); + + if (src == NULL) + src = ; + + (*dest) = talloc_strdup(mem_ctx, src); + if ((*dest) == NULL) { + DEBUG(0,(Out of memory in string_set\n)); + return false; + } + return true; } /** === modified file 'source/param/loadparm.c' --- a/source/param/loadparm.c 2007-05-09 10:52:43 + +++ b/source/param/loadparm.c 2007-05-09 11:28:13 + @@ -598,7 +598,7 @@ parm_table[i].type == P_USTRING) parm_table[i].ptr !(parm_table[i].flags FLAG_CMDLINE)) { - string_set(parm_table[i].ptr, ); + string_set(ctx, parm_table[i].ptr, ); } } @@ -974,30 +974,28 @@ if (lookup_service = ctx-iNumServices) return NULL; - data = (lookup_service 0) ? - Globals.param_opt : ctx-ServicePtrs[lookup_service]-param_opt; asprintf(vfskey, %s:%s, type, option); strlower(vfskey); - while (data) { + data = (lookup_service 0) ? + Globals.param_opt : ctx-ServicePtrs[lookup_service]-param_opt; + for (; data; data = data-next) { if (strcmp(data-key, vfskey) == 0) { free(vfskey); return data-value; } - data = data-next; } if (lookup_service = 0) { /* Try to fetch the same option but from globals */ /* but only if we are not already working with Globals */ - data = Globals.param_opt; - while (data) { + + for (data = Globals.param_opt; data; data = data-next) { if (strcmp(data-key, vfskey) == 0) { free(vfskey); return data-value; } - data = data-next; } } @@ -1167,45 +1165,7 @@ static void free_service(struct service *pservice) { - int i; -struct param_opt *data, *pdata; - if (!pservice) - return; - - if (pservice-szService) - DEBUG(5, (free_service: Freeing service %s\n, - pservice-szService)); - - string_free(pservice-szService); - SAFE_FREE(pservice-copymap); - - for (i = 0; parm_table[i].label; i++) { - if ((parm_table[i].type == P_STRING || -parm_table[i].type == P_USTRING) - parm_table[i].class == P_LOCAL) { - string_free((char **) - (((char *)pservice) + -PTR_DIFF(parm_table[i].ptr, sDefault))); - } else if (parm_table[i].type == P_LIST - parm_table[i].class == P_LOCAL) { - char ***listp = (char ***)(((char *)pservice) + - PTR_DIFF(parm_table[i].ptr, sDefault)); - talloc_free(*listp); - *listp = NULL; - } - } - - DEBUG(5,(Freeing parametrics:\n)); - data = pservice-param_opt; - while (data) { - DEBUG(5,([%s = %s]\n, data-key, data-value)); - string_free(data-key); - string_free(data-value); - pdata = data-next; -
svn commit: samba r22766 - in branches/SAMBA_3_0/source: passdb rpc_server utils
Author: vlendec Date: 2007-05-09 11:39:55 + (Wed, 09 May 2007) New Revision: 22766 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=22766 Log: Merge from 3_0: r22412 | obnox | 2007-04-20 14:23:36 +0200 (Fr, 20 Apr 2007) | 5 lines Add a deletelocalgroup subcommand to net sam. Thanks to Karolin Seeger [EMAIL PROTECTED]. Modified: branches/SAMBA_3_0/source/passdb/pdb_interface.c branches/SAMBA_3_0/source/rpc_server/srv_samr_nt.c branches/SAMBA_3_0/source/utils/net_sam.c Changeset: Modified: branches/SAMBA_3_0/source/passdb/pdb_interface.c === --- branches/SAMBA_3_0/source/passdb/pdb_interface.c2007-05-09 00:52:46 UTC (rev 22765) +++ branches/SAMBA_3_0/source/passdb/pdb_interface.c2007-05-09 11:39:55 UTC (rev 22766) @@ -904,35 +904,28 @@ return pdb-del_groupmem(pdb, mem_ctx, group_rid, member_rid); } -BOOL pdb_find_alias(const char *name, DOM_SID *sid) -{ - struct pdb_methods *pdb = pdb_get_methods(); - return NT_STATUS_IS_OK(pdb-find_alias(pdb, name, sid)); -} - NTSTATUS pdb_create_alias(const char *name, uint32 *rid) { struct pdb_methods *pdb = pdb_get_methods(); return pdb-create_alias(pdb, name, rid); } -BOOL pdb_delete_alias(const DOM_SID *sid) +NTSTATUS pdb_delete_alias(const DOM_SID *sid) { struct pdb_methods *pdb = pdb_get_methods(); - return NT_STATUS_IS_OK(pdb-delete_alias(pdb, sid)); - + return pdb-delete_alias(pdb, sid); } -BOOL pdb_get_aliasinfo(const DOM_SID *sid, struct acct_info *info) +NTSTATUS pdb_get_aliasinfo(const DOM_SID *sid, struct acct_info *info) { struct pdb_methods *pdb = pdb_get_methods(); - return NT_STATUS_IS_OK(pdb-get_aliasinfo(pdb, sid, info)); + return pdb-get_aliasinfo(pdb, sid, info); } -BOOL pdb_set_aliasinfo(const DOM_SID *sid, struct acct_info *info) +NTSTATUS pdb_set_aliasinfo(const DOM_SID *sid, struct acct_info *info) { struct pdb_methods *pdb = pdb_get_methods(); - return NT_STATUS_IS_OK(pdb-set_aliasinfo(pdb, sid, info)); + return pdb-set_aliasinfo(pdb, sid, info); } NTSTATUS pdb_add_aliasmem(const DOM_SID *alias, const DOM_SID *member) Modified: branches/SAMBA_3_0/source/rpc_server/srv_samr_nt.c === --- branches/SAMBA_3_0/source/rpc_server/srv_samr_nt.c 2007-05-09 00:52:46 UTC (rev 22765) +++ branches/SAMBA_3_0/source/rpc_server/srv_samr_nt.c 2007-05-09 11:39:55 UTC (rev 22766) @@ -1354,7 +1354,7 @@ DOM_SID sid; struct acct_info info; uint32acc_granted; - BOOL ret; + NTSTATUS status; r_u-status = NT_STATUS_OK; @@ -1368,11 +1368,11 @@ } become_root(); - ret = pdb_get_aliasinfo(sid, info); + status = pdb_get_aliasinfo(sid, info); unbecome_root(); - if ( !ret ) - return NT_STATUS_NO_SUCH_ALIAS; + if ( !NT_STATUS_IS_OK(status)) + return status; if ( !(r_u-ctr = TALLOC_ZERO_P( p-mem_ctx, ALIAS_INFO_CTR )) ) return NT_STATUS_NO_MEMORY; @@ -4301,7 +4301,7 @@ uint32 acc_granted; SE_PRIV se_rights; BOOL can_add_accounts; - BOOL ret; + NTSTATUS status; DISP_INFO *disp_info = NULL; DEBUG(5, (_samr_delete_dom_alias: %d\n, __LINE__)); @@ -4340,15 +4340,15 @@ become_root(); /* Have passdb delete the alias */ - ret = pdb_delete_alias(alias_sid); + status = pdb_delete_alias(alias_sid); if ( can_add_accounts ) unbecome_root(); / END SeAddUsers BLOCK */ - if ( !ret ) - return NT_STATUS_ACCESS_DENIED; + if ( !NT_STATUS_IS_OK(status)) + return status; if (!close_policy_hnd(p, q_u-alias_pol)) return NT_STATUS_OBJECT_NAME_INVALID; @@ -4693,8 +4693,8 @@ struct acct_info info; ALIAS_INFO_CTR *ctr; uint32 acc_granted; - BOOL ret; BOOL can_mod_accounts; + NTSTATUS status; DISP_INFO *disp_info = NULL; if (!get_lsa_policy_samr_sid(p, q_u-alias_pol, group_sid, acc_granted, disp_info)) @@ -4709,18 +4709,16 @@ /* get the current group information */ become_root(); - ret = pdb_get_aliasinfo( group_sid, info ); + status = pdb_get_aliasinfo( group_sid, info ); unbecome_root(); - if ( !ret ) { - return NT_STATUS_NO_SUCH_ALIAS; - } + if ( !NT_STATUS_IS_OK(status)) + return status; switch (ctr-level) { case 2: { fstring group_name, acct_name; - NTSTATUS status; /* We currently do not
svn commit: samba r22767 - in branches/SAMBA_3_0/source: passdb rpc_server utils
Author: vlendec Date: 2007-05-09 11:40:48 + (Wed, 09 May 2007) New Revision: 22767 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=22767 Log: Argl. Typed in 'svn ci' in the wrong branch. Revert. Modified: branches/SAMBA_3_0/source/passdb/pdb_interface.c branches/SAMBA_3_0/source/rpc_server/srv_samr_nt.c branches/SAMBA_3_0/source/utils/net_sam.c Changeset: Modified: branches/SAMBA_3_0/source/passdb/pdb_interface.c === --- branches/SAMBA_3_0/source/passdb/pdb_interface.c2007-05-09 11:39:55 UTC (rev 22766) +++ branches/SAMBA_3_0/source/passdb/pdb_interface.c2007-05-09 11:40:48 UTC (rev 22767) @@ -904,28 +904,35 @@ return pdb-del_groupmem(pdb, mem_ctx, group_rid, member_rid); } +BOOL pdb_find_alias(const char *name, DOM_SID *sid) +{ + struct pdb_methods *pdb = pdb_get_methods(); + return NT_STATUS_IS_OK(pdb-find_alias(pdb, name, sid)); +} + NTSTATUS pdb_create_alias(const char *name, uint32 *rid) { struct pdb_methods *pdb = pdb_get_methods(); return pdb-create_alias(pdb, name, rid); } -NTSTATUS pdb_delete_alias(const DOM_SID *sid) +BOOL pdb_delete_alias(const DOM_SID *sid) { struct pdb_methods *pdb = pdb_get_methods(); - return pdb-delete_alias(pdb, sid); + return NT_STATUS_IS_OK(pdb-delete_alias(pdb, sid)); + } -NTSTATUS pdb_get_aliasinfo(const DOM_SID *sid, struct acct_info *info) +BOOL pdb_get_aliasinfo(const DOM_SID *sid, struct acct_info *info) { struct pdb_methods *pdb = pdb_get_methods(); - return pdb-get_aliasinfo(pdb, sid, info); + return NT_STATUS_IS_OK(pdb-get_aliasinfo(pdb, sid, info)); } -NTSTATUS pdb_set_aliasinfo(const DOM_SID *sid, struct acct_info *info) +BOOL pdb_set_aliasinfo(const DOM_SID *sid, struct acct_info *info) { struct pdb_methods *pdb = pdb_get_methods(); - return pdb-set_aliasinfo(pdb, sid, info); + return NT_STATUS_IS_OK(pdb-set_aliasinfo(pdb, sid, info)); } NTSTATUS pdb_add_aliasmem(const DOM_SID *alias, const DOM_SID *member) Modified: branches/SAMBA_3_0/source/rpc_server/srv_samr_nt.c === --- branches/SAMBA_3_0/source/rpc_server/srv_samr_nt.c 2007-05-09 11:39:55 UTC (rev 22766) +++ branches/SAMBA_3_0/source/rpc_server/srv_samr_nt.c 2007-05-09 11:40:48 UTC (rev 22767) @@ -1354,7 +1354,7 @@ DOM_SID sid; struct acct_info info; uint32acc_granted; - NTSTATUS status; + BOOL ret; r_u-status = NT_STATUS_OK; @@ -1368,11 +1368,11 @@ } become_root(); - status = pdb_get_aliasinfo(sid, info); + ret = pdb_get_aliasinfo(sid, info); unbecome_root(); - if ( !NT_STATUS_IS_OK(status)) - return status; + if ( !ret ) + return NT_STATUS_NO_SUCH_ALIAS; if ( !(r_u-ctr = TALLOC_ZERO_P( p-mem_ctx, ALIAS_INFO_CTR )) ) return NT_STATUS_NO_MEMORY; @@ -4301,7 +4301,7 @@ uint32 acc_granted; SE_PRIV se_rights; BOOL can_add_accounts; - NTSTATUS status; + BOOL ret; DISP_INFO *disp_info = NULL; DEBUG(5, (_samr_delete_dom_alias: %d\n, __LINE__)); @@ -4340,15 +4340,15 @@ become_root(); /* Have passdb delete the alias */ - status = pdb_delete_alias(alias_sid); + ret = pdb_delete_alias(alias_sid); if ( can_add_accounts ) unbecome_root(); / END SeAddUsers BLOCK */ - if ( !NT_STATUS_IS_OK(status)) - return status; + if ( !ret ) + return NT_STATUS_ACCESS_DENIED; if (!close_policy_hnd(p, q_u-alias_pol)) return NT_STATUS_OBJECT_NAME_INVALID; @@ -4693,8 +4693,8 @@ struct acct_info info; ALIAS_INFO_CTR *ctr; uint32 acc_granted; + BOOL ret; BOOL can_mod_accounts; - NTSTATUS status; DISP_INFO *disp_info = NULL; if (!get_lsa_policy_samr_sid(p, q_u-alias_pol, group_sid, acc_granted, disp_info)) @@ -4709,16 +4709,18 @@ /* get the current group information */ become_root(); - status = pdb_get_aliasinfo( group_sid, info ); + ret = pdb_get_aliasinfo( group_sid, info ); unbecome_root(); - if ( !NT_STATUS_IS_OK(status)) - return status; + if ( !ret ) { + return NT_STATUS_NO_SUCH_ALIAS; + } switch (ctr-level) { case 2: { fstring group_name, acct_name; + NTSTATUS status; /* We currently do not support renaming groups in the the BUILTIN domain. Refer to util_builtin.c to understand @@ -4774,17
svn commit: samba r22768 - in branches/SAMBA_3_0_26/source/utils: .
Author: vlendec Date: 2007-05-09 11:41:32 + (Wed, 09 May 2007) New Revision: 22768 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=22768 Log: Merge from 3_0: r22412 | obnox | 2007-04-20 14:23:36 +0200 (Fr, 20 Apr 2007) | 5 lines Add a deletelocalgroup subcommand to net sam. Thanks to Karolin Seeger [EMAIL PROTECTED]. Modified: branches/SAMBA_3_0_26/source/utils/net_sam.c Changeset: Modified: branches/SAMBA_3_0_26/source/utils/net_sam.c === --- branches/SAMBA_3_0_26/source/utils/net_sam.c2007-05-09 11:40:48 UTC (rev 22767) +++ branches/SAMBA_3_0_26/source/utils/net_sam.c2007-05-09 11:41:32 UTC (rev 22768) @@ -572,6 +572,46 @@ } /* + * Delete a local group + */ + +static int net_sam_deletelocalgroup(int argc, const char **argv) +{ + DOM_SID sid; +enum lsa_SidType type; +const char *dom, *name; + int ret; + + if (argc != 1) { + d_fprintf(stderr, usage: net sam deletelocalgroup name\n); + return -1; + } + + if (!lookup_name(tmp_talloc_ctx(), argv[0], LOOKUP_NAME_ISOLATED, +dom, name, sid, type)) { + d_fprintf(stderr, Could not find name %s.\n, argv[0]); + return -1; + } + + if (type != SID_NAME_ALIAS) { + d_fprintf(stderr, %s is a %s, not a local group.\n, argv[0], + sid_type_lookup(type)); + return -1; + } + + ret = pdb_delete_alias(sid); + + if ( !ret ) { + d_fprintf(stderr, Could not delete local group %s.\n, argv[0]); + return -1; + } + + d_printf(Deleted local group %s.\n, argv[0]); + + return 0; +} + +/* * Create a local group */ @@ -1341,6 +1381,8 @@ Create a new BUILTIN group }, { createlocalgroup, net_sam_createlocalgroup, Create a new local group }, + { deletelocalgroup, net_sam_deletelocalgroup, + Delete an existing local group }, { mapunixgroup, net_sam_mapunixgroup, Map a unix group to a domain group }, { addmem, net_sam_addmem,
Rev 12126: Fix include location. in file:///home/jelmer/bzr.samba/real4/
At file:///home/jelmer/bzr.samba/real4/ revno: 12126 revision-id: [EMAIL PROTECTED] parent: svn-v2:[EMAIL PROTECTED] committer: Jelmer Vernooij [EMAIL PROTECTED] branch nick: real4 timestamp: Wed 2007-05-09 13:51:14 +0200 message: Fix include location. modified: source/dsdb/samdb/ldb_modules/entryUUID.c svn-v2:[EMAIL PROTECTED] source/dsdb/samdb/ldb_modules/samba3sam.c svn-v2:[EMAIL PROTECTED] === modified file 'source/dsdb/samdb/ldb_modules/entryUUID.c' --- a/source/dsdb/samdb/ldb_modules/entryUUID.c 2007-04-27 11:13:37 + +++ b/source/dsdb/samdb/ldb_modules/entryUUID.c 2007-05-09 11:51:14 + @@ -31,7 +31,7 @@ #include ldb/include/ldb.h #include ldb/include/ldb_private.h #include ldb/include/ldb_errors.h -#include ldb/modules/ldb_map.h +#include ldb/ldb_map/ldb_map.h #include librpc/gen_ndr/ndr_misc.h #include librpc/ndr/libndr.h === modified file 'source/dsdb/samdb/ldb_modules/samba3sam.c' --- a/source/dsdb/samdb/ldb_modules/samba3sam.c 2007-02-15 12:54:58 + +++ b/source/dsdb/samdb/ldb_modules/samba3sam.c 2007-05-09 11:51:14 + @@ -9,7 +9,7 @@ #include ldb/include/ldb.h #include ldb/include/ldb_private.h #include ldb/include/ldb_errors.h -#include ldb/modules/ldb_map.h +#include ldb/ldb_map/ldb_map.h #include system/passwd.h #include librpc/gen_ndr/ndr_security.h
svn commit: samba r22769 - in branches/SAMBA_4_0: . source/dsdb/samdb/ldb_modules
Author: jelmer Date: 2007-05-09 11:51:39 + (Wed, 09 May 2007) New Revision: 22769 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=22769 Log: Fix include location. Modified: branches/SAMBA_4_0/ branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/entryUUID.c branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/samba3sam.c Changeset: Property changes on: branches/SAMBA_4_0 ___ Name: bzr:revprop:branch-nick - SAMBA_4_0 + real4 Name: bzr:merge ...skipped... Modified: branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/entryUUID.c === --- branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/entryUUID.c 2007-05-09 11:41:32 UTC (rev 22768) +++ branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/entryUUID.c 2007-05-09 11:51:39 UTC (rev 22769) @@ -31,7 +31,7 @@ #include ldb/include/ldb.h #include ldb/include/ldb_private.h #include ldb/include/ldb_errors.h -#include ldb/modules/ldb_map.h +#include ldb/ldb_map/ldb_map.h #include librpc/gen_ndr/ndr_misc.h #include librpc/ndr/libndr.h Modified: branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/samba3sam.c === --- branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/samba3sam.c 2007-05-09 11:41:32 UTC (rev 22768) +++ branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/samba3sam.c 2007-05-09 11:51:39 UTC (rev 22769) @@ -9,7 +9,7 @@ #include ldb/include/ldb.h #include ldb/include/ldb_private.h #include ldb/include/ldb_errors.h -#include ldb/modules/ldb_map.h +#include ldb/ldb_map/ldb_map.h #include system/passwd.h #include librpc/gen_ndr/ndr_security.h
Rev 12127: Use service struct pointers rather than integers where possible. in file:///home/jelmer/bzr.samba/SAMBA_4_0/
At file:///home/jelmer/bzr.samba/SAMBA_4_0/ revno: 12127 revision-id: [EMAIL PROTECTED] parent: [EMAIL PROTECTED] committer: Jelmer Vernooij [EMAIL PROTECTED] branch nick: SAMBA_4_0 timestamp: Wed 2007-05-09 14:00:26 +0200 message: Use service struct pointers rather than integers where possible. modified: source/param/loadparm.csvn-v2:[EMAIL PROTECTED] === modified file 'source/param/loadparm.c' --- a/source/param/loadparm.c 2007-05-09 11:28:13 + +++ b/source/param/loadparm.c 2007-05-09 12:00:26 + @@ -1174,7 +1174,7 @@ service. ***/ -static int add_a_service(struct loadparm_context *ctx, +static struct service *add_a_service(struct loadparm_context *ctx, const struct service *pservice, const char *name) { int i; @@ -1197,7 +1197,7 @@ data = pdata; } ctx-ServicePtrs[i]-param_opt = NULL; - return i; + return ctx-ServicePtrs[i]; } } @@ -1215,7 +1215,7 @@ if (!tsp) { DEBUG(0,(add_a_service: failed to enlarge ServicePtrs!\n)); - return (-1); + return NULL; } else { ctx-ServicePtrs = tsp; @@ -1223,7 +1223,7 @@ } if (!ctx-ServicePtrs[ctx-iNumServices]) { DEBUG(0,(add_a_service: out of memory!\n)); - return (-1); + return NULL; } ctx-iNumServices++; @@ -1236,7 +1236,7 @@ copy_service(ctx-ServicePtrs[i], tservice, NULL); if (name) string_set(ctx, ctx-ServicePtrs[i]-szService, name); - return i; + return ctx-ServicePtrs[i]; } /*** @@ -1248,13 +1248,12 @@ const char *pszHomename, int iDefaultService, const char *user, const char *pszHomedir) { - int i; pstring newHomedir; - i = add_a_service(ctx, ctx-ServicePtrs[iDefaultService], pszHomename); + struct service *svc = add_a_service(ctx, ctx-ServicePtrs[iDefaultService], pszHomename); - if (i 0) - return (False); + if (svc == NULL) + return false; if (!(*(ctx-ServicePtrs[iDefaultService]-szPath)) || strequal(ctx-ServicePtrs[iDefaultService]-szPath, lp_pathname(-1))) { @@ -1264,16 +1263,16 @@ string_sub(newHomedir,%H, pszHomedir, sizeof(newHomedir)); } - string_set(ctx, ctx-ServicePtrs[i]-szPath, newHomedir); + string_set(svc, svc-szPath, newHomedir); - if (!(*(ctx-ServicePtrs[i]-comment))) { + if (!(*(svc-comment))) { pstring comment; slprintf(comment, sizeof(comment) - 1, Home directory of %s, user); - string_set(ctx, ctx-ServicePtrs[i]-comment, comment); + string_set(ctx, svc-comment, comment); } - ctx-ServicePtrs[i]-bAvailable = sDefault.bAvailable; - ctx-ServicePtrs[i]-bBrowseable = sDefault.bBrowseable; + svc-bAvailable = sDefault.bAvailable; + svc-bBrowseable = sDefault.bBrowseable; DEBUG(3, (adding home's share [%s] for user '%s' at '%s'\n, pszHomename, user, newHomedir)); @@ -1285,7 +1284,7 @@ Add a new service, based on an old one. ***/ -int lp_add_service(struct loadparm_context *ctx, +struct service *lp_add_service(struct loadparm_context *ctx, const char *pszService, int iDefaultService) { return (add_a_service(ctx, ctx-ServicePtrs[iDefaultService], pszService)); @@ -1299,25 +1298,25 @@ const char *name, const char *fstype) { pstring comment; - int i = add_a_service(ctx, sDefault, name); + struct service *svc = add_a_service(ctx, sDefault, name); - if (i 0) - return (False); + if (svc == NULL) + return false; slprintf(comment, sizeof(comment) - 1, %s Service (%s), fstype, Globals.szServerString); - string_set(ctx, ctx-ServicePtrs[i]-szPath, tmpdir()); - string_set(ctx, ctx-ServicePtrs[i]-comment, comment); - string_set(ctx, ctx-ServicePtrs[i]-fstype, fstype); - ctx-ServicePtrs[i]-iMaxConnections = -1; - ctx-ServicePtrs[i]-bAvailable = true; - ctx-ServicePtrs[i]-bRead_only = true; -
svn commit: samba r22770 - in branches/SAMBA_3_0_RELEASE/source: . lib modules nsswitch rpc_client rpc_parse rpc_server smbd
Author: jerry Date: 2007-05-09 16:26:43 + (Wed, 09 May 2007) New Revision: 22770 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=22770 Log: sync with SAMBA_3_0_25 as of svn r22765 Modified: branches/SAMBA_3_0_RELEASE/source/configure.in branches/SAMBA_3_0_RELEASE/source/lib/charcnv.c branches/SAMBA_3_0_RELEASE/source/modules/vfs_afsacl.c branches/SAMBA_3_0_RELEASE/source/nsswitch/idmap.c branches/SAMBA_3_0_RELEASE/source/nsswitch/winbindd_async.c branches/SAMBA_3_0_RELEASE/source/nsswitch/winbindd_group.c branches/SAMBA_3_0_RELEASE/source/rpc_client/cli_svcctl.c branches/SAMBA_3_0_RELEASE/source/rpc_parse/parse_misc.c branches/SAMBA_3_0_RELEASE/source/rpc_server/srv_lsa_nt.c branches/SAMBA_3_0_RELEASE/source/smbd/notify.c branches/SAMBA_3_0_RELEASE/source/smbd/reply.c Changeset: Modified: branches/SAMBA_3_0_RELEASE/source/configure.in === --- branches/SAMBA_3_0_RELEASE/source/configure.in 2007-05-09 11:51:39 UTC (rev 22769) +++ branches/SAMBA_3_0_RELEASE/source/configure.in 2007-05-09 16:26:43 UTC (rev 22770) @@ -5764,10 +5764,6 @@ AC_SUBST(WINBIND_NSS_EXTRA_LIBS) AC_SUBST(NSSSONAMEVERSIONSUFFIX) -if test $BLDSHARED = true -a x$HAVE_WINBIND = xyes; then - NSS_MODULES=${WINBIND_NSS} ${WINBIND_WINS_NSS} -fi - AC_SUBST(SMB_KRB5_LOCATOR) # Check the setting of --with-winbind @@ -5802,6 +5798,10 @@ WINBIND_WINS_NSS= fi +if test $BLDSHARED = true -a x$HAVE_WINBIND = xyes; then + NSS_MODULES=${WINBIND_NSS} ${WINBIND_WINS_NSS} +fi + if test x$HAVE_WINBIND = xyes; then AC_MSG_RESULT(yes) AC_DEFINE(WITH_WINBIND,1,[Whether to build winbind]) Modified: branches/SAMBA_3_0_RELEASE/source/lib/charcnv.c === --- branches/SAMBA_3_0_RELEASE/source/lib/charcnv.c 2007-05-09 11:51:39 UTC (rev 22769) +++ branches/SAMBA_3_0_RELEASE/source/lib/charcnv.c 2007-05-09 16:26:43 UTC (rev 22770) @@ -972,13 +972,18 @@ ret = convert_string(CH_DOS, CH_UNIX, src, src_len, dest, dest_len, True); if (ret == (size_t)-1) { + ret = 0; dest_len = 0; } - if (dest_len) - dest[MIN(ret, dest_len-1)] = 0; - else + if (dest_len ret) { + /* Did we already process the terminating zero ? */ + if (dest[MIN(ret-1, dest_len-1)] != 0) { + dest[MIN(ret, dest_len-1)] = 0; + } + } else { dest[0] = 0; + } return src_len; } @@ -1219,10 +1224,14 @@ if (src_len == (size_t)-1) src_len = ret*2; - if (dest_len) - dest[MIN(ret, dest_len-1)] = 0; - else + if (dest_len ret) { + /* Did we already process the terminating zero ? */ + if (dest[MIN(ret-1, dest_len-1)] != 0) { + dest[MIN(ret, dest_len-1)] = 0; + } + } else { dest[0] = 0; + } return src_len; } Modified: branches/SAMBA_3_0_RELEASE/source/modules/vfs_afsacl.c === --- branches/SAMBA_3_0_RELEASE/source/modules/vfs_afsacl.c 2007-05-09 11:51:39 UTC (rev 22769) +++ branches/SAMBA_3_0_RELEASE/source/modules/vfs_afsacl.c 2007-05-09 16:26:43 UTC (rev 22770) @@ -616,7 +616,7 @@ uid_to_sid(owner_sid, sbuf.st_uid); gid_to_sid(group_sid, sbuf.st_gid); - if (num_aces) { + if (afs_acl-num_aces) { nt_ace_list = TALLOC_ARRAY(mem_ctx, SEC_ACE, afs_acl-num_aces); if (nt_ace_list == NULL) Modified: branches/SAMBA_3_0_RELEASE/source/nsswitch/idmap.c === --- branches/SAMBA_3_0_RELEASE/source/nsswitch/idmap.c 2007-05-09 11:51:39 UTC (rev 22769) +++ branches/SAMBA_3_0_RELEASE/source/nsswitch/idmap.c 2007-05-09 16:26:43 UTC (rev 22770) @@ -1025,17 +1025,16 @@ DEBUG(10, (Query backends to map sids-ids\n)); /* split list per domain */ - - if (num_domains) { - dom_ids = TALLOC_ZERO_ARRAY(ctx, struct id_map **, num_domains); - IDMAP_CHECK_ALLOC(dom_ids); - counters = TALLOC_ZERO_ARRAY(ctx, int, num_domains); - IDMAP_CHECK_ALLOC(counters); - } else { - dom_ids = NULL; - counters = NULL; + if (num_domains == 0) { + DEBUG(1, (No domains available?\n)); + return NT_STATUS_UNSUCCESSFUL; } + dom_ids = TALLOC_ZERO_ARRAY(ctx, struct id_map **, num_domains); + IDMAP_CHECK_ALLOC(dom_ids); + counters = TALLOC_ZERO_ARRAY(ctx, int, num_domains); + IDMAP_CHECK_ALLOC(counters); + /* partition the requests by domain */ for
svn commit: samba r22771 - in branches: SAMBA_3_0/source/nsswitch SAMBA_3_0_25/source/nsswitch SAMBA_3_0_26/source/nsswitch
Author: idra Date: 2007-05-09 21:38:41 + (Wed, 09 May 2007) New Revision: 22771 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=22771 Log: One liner fix for idmap_ldap Fixes the strange behavior we were seeing about idmap_ldap creating a new connection for each query. Jerry we need this in for 3.0.25 Modified: branches/SAMBA_3_0/source/nsswitch/idmap_ldap.c branches/SAMBA_3_0_25/source/nsswitch/idmap_ldap.c branches/SAMBA_3_0_26/source/nsswitch/idmap_ldap.c Changeset: Modified: branches/SAMBA_3_0/source/nsswitch/idmap_ldap.c === --- branches/SAMBA_3_0/source/nsswitch/idmap_ldap.c 2007-05-09 16:26:43 UTC (rev 22770) +++ branches/SAMBA_3_0/source/nsswitch/idmap_ldap.c 2007-05-09 21:38:41 UTC (rev 22771) @@ -821,6 +821,7 @@ talloc_set_destructor(ctx, idmap_ldap_close_destructor); dom-private_data = ctx; + dom-initialized = True; talloc_free(config_option); return NT_STATUS_OK; Modified: branches/SAMBA_3_0_25/source/nsswitch/idmap_ldap.c === --- branches/SAMBA_3_0_25/source/nsswitch/idmap_ldap.c 2007-05-09 16:26:43 UTC (rev 22770) +++ branches/SAMBA_3_0_25/source/nsswitch/idmap_ldap.c 2007-05-09 21:38:41 UTC (rev 22771) @@ -818,6 +818,7 @@ talloc_set_destructor(ctx, idmap_ldap_close_destructor); dom-private_data = ctx; + dom-initialized = True; talloc_free(config_option); return NT_STATUS_OK; Modified: branches/SAMBA_3_0_26/source/nsswitch/idmap_ldap.c === --- branches/SAMBA_3_0_26/source/nsswitch/idmap_ldap.c 2007-05-09 16:26:43 UTC (rev 22770) +++ branches/SAMBA_3_0_26/source/nsswitch/idmap_ldap.c 2007-05-09 21:38:41 UTC (rev 22771) @@ -818,6 +818,7 @@ talloc_set_destructor(ctx, idmap_ldap_close_destructor); dom-private_data = ctx; + dom-initialized = True; talloc_free(config_option); return NT_STATUS_OK;
Rev 266: merged ronnies code to delay client requests when in recovery mode in http://samba.org/~tridge/ctdb
revno: 266 revision-id: [EMAIL PROTECTED] parent: [EMAIL PROTECTED] parent: [EMAIL PROTECTED] committer: Andrew Tridgell [EMAIL PROTECTED] branch nick: tridge timestamp: Thu 2007-05-10 07:43:18 +1000 message: merged ronnies code to delay client requests when in recovery mode modified: common/ctdb_daemon.c ctdb_daemon.c-20070409200331-3el1kqgdb9m4ib0g-1 revno: 197.1.90 merged: [EMAIL PROTECTED] parent: [EMAIL PROTECTED] committer: Ronnie Sahlberg [EMAIL PROTECTED] branch nick: ctdb timestamp: Wed 2007-05-09 14:08:11 +1000 message: hang the event from the retry structure instead of the hdr structure revno: 197.1.89 merged: [EMAIL PROTECTED] parent: [EMAIL PROTECTED] committer: Ronnie Sahlberg [EMAIL PROTECTED] branch nick: ctdb timestamp: Wed 2007-05-09 14:06:47 +1000 message: when we are in recovery mode and we get a REQ_CALL from a client, defer it for one second and try again === modified file 'common/ctdb_daemon.c' --- a/common/ctdb_daemon.c 2007-05-08 23:59:23 + +++ b/common/ctdb_daemon.c 2007-05-09 21:43:18 + @@ -334,6 +334,30 @@ } +struct ctdb_client_retry { + struct ctdb_client *client; + struct ctdb_req_call *call; +}; + +static void daemon_request_call_from_client(struct ctdb_client *client, + struct ctdb_req_call *c); + +/* + triggered after a one second delay, retrying a client packet + that was deferred because of the daemon being in recovery mode + */ +static void retry_client_packet(struct event_context *ev, struct timed_event *te, + struct timeval t, void *private_data) +{ + struct ctdb_client_retry *retry = talloc_get_type(private_data, struct ctdb_client_retry); + + daemon_request_call_from_client(retry-client, retry-call); + + talloc_free(retry); +} + + + /* this is called when the ctdb daemon received a ctdb request call from a local client over the unix domain socket @@ -350,6 +374,29 @@ int ret; struct ctdb_context *ctdb = client-ctdb; + if (ctdb-recovery_mode != CTDB_RECOVERY_NORMAL) { + struct ctdb_client_retry *retry; + + DEBUG(0,(__location__ ctdb call %u from client + while we are in recovery mode. Deferring it\n, +c-hdr.reqid)); + + /* hang the event and the structure off client */ + retry = talloc(client, struct ctdb_client_retry); + CTDB_NO_MEMORY_VOID(ctdb, retry); + retry-client = client; + retry-call = c; + + /* this ensures that after the retry happens we + eventually free this request */ + talloc_steal(retry, c); + + event_add_timed(ctdb-ev, retry, timeval_current_ofs(1,0), retry_client_packet, retry); + return; + } + + + ctdb-status.total_calls++; ctdb-status.pending_calls++;
Rev 270: remove old s3 recovery code in http://samba.org/~tridge/ctdb
revno: 270 revision-id: [EMAIL PROTECTED] parent: [EMAIL PROTECTED] committer: Andrew Tridgell [EMAIL PROTECTED] branch nick: tridge timestamp: Thu 2007-05-10 08:49:57 +1000 message: remove old s3 recovery code fixed vnnmap wire format in recover daemon modified: direct/ctdb_recoverd.c recoverd.c-20070503213540-bvxuyd9jm1f7ig90-1 tools/ctdb_control.c ctdb_control.c-20070426122705-9ehj1l5lu2gn9kuj-1 tools/monitor_recovery.sh monitor_recovery.sh-20070508220533-oy7s689rcjsu7yte-1 Diff too large for email (254, the limit is 200).
Rev 267: moved the vnn_map initialisation out of the cmdline code in http://samba.org/~tridge/ctdb
revno: 267 revision-id: [EMAIL PROTECTED] parent: [EMAIL PROTECTED] committer: Andrew Tridgell [EMAIL PROTECTED] branch nick: tridge timestamp: Thu 2007-05-10 07:55:46 +1000 message: moved the vnn_map initialisation out of the cmdline code modified: common/cmdline.c cmdline.c-20070416041216-w1zvz91bkdsgjckw-1 common/ctdb.c ctdb.c-20061127094323-t50f58d65iaao5of-2 common/ctdb_daemon.c ctdb_daemon.c-20070409200331-3el1kqgdb9m4ib0g-1 === modified file 'common/cmdline.c' --- a/common/cmdline.c 2007-05-08 23:59:23 + +++ b/common/cmdline.c 2007-05-09 21:55:46 + @@ -89,7 +89,7 @@ struct ctdb_context *ctdb_cmdline_init(struct event_context *ev) { struct ctdb_context *ctdb; - int i, ret; + int ret; if (ctdb_cmdline.nlist == NULL) { printf(You must provide a node list with --nlist\n); @@ -156,26 +156,6 @@ } } - /* initialize the vnn mapping table */ -/* -XXX we currently initialize it to the maximum number of nodes to -XXX make it behave the same way as previously. -XXX Once we have recovery working we should initialize this always to -XXX generation==0 (==invalid) and let the recovery tool populate this -XXX table for the daemons. -*/ - ctdb-vnn_map = talloc_zero_size(ctdb, offsetof(struct ctdb_vnn_map, map) + 4*ctdb-num_nodes); - if (ctdb-vnn_map == NULL) { - DEBUG(0,(__location__ Unable to allocate vnn_map structure\n)); - exit(1); - } - ctdb-vnn_map-generation = 1; - ctdb-vnn_map-size = ctdb-num_nodes; - for(i=0;ictdb-vnn_map-size;i++){ - ctdb-vnn_map-map[i] = i%ctdb-num_nodes; - } - - return ctdb; } === modified file 'common/ctdb.c' --- a/common/ctdb.c 2007-05-06 19:02:48 + +++ b/common/ctdb.c 2007-05-09 21:55:46 + @@ -152,6 +152,25 @@ return -1; } } + + /* initialize the vnn mapping table now that we have num_nodes setup */ +/* +XXX we currently initialize it to the maximum number of nodes to +XXX make it behave the same way as previously. +XXX Once we have recovery working we should initialize this always to +XXX generation==0 (==invalid) and let the recovery tool populate this +XXX table for the daemons. +*/ + ctdb-vnn_map = talloc_zero_size(ctdb, offsetof(struct ctdb_vnn_map, map) + 4*ctdb-num_nodes); + if (ctdb-vnn_map == NULL) { + DEBUG(0,(__location__ Unable to allocate vnn_map structure\n)); + exit(1); + } + ctdb-vnn_map-generation = 1; + ctdb-vnn_map-size = ctdb-num_nodes; + for(i=0;ictdb-vnn_map-size;i++){ + ctdb-vnn_map-map[i] = i%ctdb-num_nodes; + } talloc_free(lines); return 0; === modified file 'common/ctdb_daemon.c' --- a/common/ctdb_daemon.c 2007-05-09 21:43:18 + +++ b/common/ctdb_daemon.c 2007-05-09 21:55:46 + @@ -721,7 +721,6 @@ close(fd[1]); - ctdb-ev = event_context_init(NULL); fde = event_add_fd(ctdb-ev, ctdb, fd[0], EVENT_FD_READ|EVENT_FD_AUTOCLOSE, ctdb_read_from_parent, fd[0]); fde = event_add_fd(ctdb-ev, ctdb, ctdb-daemon.sd, EVENT_FD_READ|EVENT_FD_AUTOCLOSE, ctdb_accept_client, ctdb);
Rev 269: fixed setvnnmap to use wire structures too in http://samba.org/~tridge/ctdb
revno: 269 revision-id: [EMAIL PROTECTED] parent: [EMAIL PROTECTED] committer: Andrew Tridgell [EMAIL PROTECTED] branch nick: tridge timestamp: Thu 2007-05-10 08:22:26 +1000 message: fixed setvnnmap to use wire structures too modified: common/ctdb_client.c ctdb_client.c-20070411010216-3kd8v37k61steeya-1 common/ctdb_recover.c ctdb_recover.c-20070503002147-admmfgt1oj6gexfo-1 === modified file 'common/ctdb_client.c' --- a/common/ctdb_client.c 2007-05-09 22:13:19 + +++ b/common/ctdb_client.c 2007-05-09 22:22:26 + @@ -990,9 +990,19 @@ int ret; TDB_DATA data, outdata; int32_t res; - - data.dsize = offsetof(struct ctdb_vnn_map, map) + 4*vnnmap-size; - data.dptr = (unsigned char *)vnnmap; + struct ctdb_vnn_map_wire *map; + size_t len; + + len = offsetof(struct ctdb_vnn_map_wire, map) + sizeof(uint32_t)*vnnmap-size; + map = talloc_size(mem_ctx, len); + CTDB_NO_MEMORY_VOID(ctdb, map); + + map-generation = vnnmap-generation; + map-size = vnnmap-size; + memcpy(map-map, vnnmap-map, sizeof(uint32_t)*map-size); + + data.dsize = len; + data.dptr = (uint8_t *)map; ret = ctdb_control(ctdb, destnode, 0, CTDB_CONTROL_SETVNNMAP, 0, data, @@ -1002,6 +1012,8 @@ return -1; } + talloc_free(map); + return 0; } === modified file 'common/ctdb_recover.c' --- a/common/ctdb_recover.c 2007-05-09 22:13:19 + +++ b/common/ctdb_recover.c 2007-05-09 22:22:26 + @@ -52,12 +52,19 @@ int ctdb_control_setvnnmap(struct ctdb_context *ctdb, uint32_t opcode, TDB_DATA indata, TDB_DATA *outdata) { - if (ctdb-vnn_map) { - talloc_free(ctdb-vnn_map); - ctdb-vnn_map = NULL; - } - - ctdb-vnn_map = (struct ctdb_vnn_map *)talloc_memdup(ctdb, indata.dptr, indata.dsize); + struct ctdb_vnn_map_wire *map = (struct ctdb_vnn_map_wire *)indata.dptr; + + talloc_free(ctdb-vnn_map); + + ctdb-vnn_map = talloc(ctdb, struct ctdb_vnn_map); + CTDB_NO_MEMORY(ctdb, ctdb-vnn_map); + + ctdb-vnn_map-generation = map-generation; + ctdb-vnn_map-size = map-size; + ctdb-vnn_map-map = talloc_array(ctdb-vnn_map, uint32_t, map-size); + CTDB_NO_MEMORY(ctdb, ctdb-vnn_map-map); + + memcpy(ctdb-vnn_map-map, map-map, sizeof(uint32_t)*map-size); return 0; }
Rev 268: separate the wire format and internal format for the vnn_map in http://samba.org/~tridge/ctdb
revno: 268 revision-id: [EMAIL PROTECTED] parent: [EMAIL PROTECTED] committer: Andrew Tridgell [EMAIL PROTECTED] branch nick: tridge timestamp: Thu 2007-05-10 08:13:19 +1000 message: separate the wire format and internal format for the vnn_map modified: common/ctdb.c ctdb.c-20061127094323-t50f58d65iaao5of-2 common/ctdb_client.c ctdb_client.c-20070411010216-3kd8v37k61steeya-1 common/ctdb_recover.c ctdb_recover.c-20070503002147-admmfgt1oj6gexfo-1 include/ctdb_private.h ctdb_private.h-20061117234101-o3qt14umlg9en8z0-13 tests/ctdbd.sh ctdbd.sh-20070411085038-phusiewluwzyqjpc-2 === modified file 'common/ctdb.c' --- a/common/ctdb.c 2007-05-09 21:55:46 + +++ b/common/ctdb.c 2007-05-09 22:13:19 + @@ -161,15 +161,16 @@ XXX generation==0 (==invalid) and let the recovery tool populate this XXX table for the daemons. */ - ctdb-vnn_map = talloc_zero_size(ctdb, offsetof(struct ctdb_vnn_map, map) + 4*ctdb-num_nodes); - if (ctdb-vnn_map == NULL) { - DEBUG(0,(__location__ Unable to allocate vnn_map structure\n)); - exit(1); - } + ctdb-vnn_map = talloc(ctdb, struct ctdb_vnn_map); + CTDB_NO_MEMORY(ctdb, ctdb-vnn_map); + ctdb-vnn_map-generation = 1; ctdb-vnn_map-size = ctdb-num_nodes; - for(i=0;ictdb-vnn_map-size;i++){ - ctdb-vnn_map-map[i] = i%ctdb-num_nodes; + ctdb-vnn_map-map = talloc_array(ctdb-vnn_map, uint32_t, ctdb-vnn_map-size); + CTDB_NO_MEMORY(ctdb, ctdb-vnn_map-map); + + for(i=0;ictdb-vnn_map-size;i++) { + ctdb-vnn_map-map[i] = i; } talloc_free(lines); === modified file 'common/ctdb_client.c' --- a/common/ctdb_client.c 2007-05-06 21:54:17 + +++ b/common/ctdb_client.c 2007-05-09 22:13:19 + @@ -808,6 +808,7 @@ int ret; TDB_DATA data, outdata; int32_t res; + struct ctdb_vnn_map_wire *map; ZERO_STRUCT(data); ret = ctdb_control(ctdb, destnode, 0, @@ -817,8 +818,22 @@ DEBUG(0,(__location__ ctdb_control for getvnnmap failed\n)); return -1; } - - *vnnmap = (struct ctdb_vnn_map *)talloc_memdup(mem_ctx, outdata.dptr, outdata.dsize); + + map = (struct ctdb_vnn_map_wire *)outdata.dptr; + if (outdata.dsize offsetof(struct ctdb_vnn_map_wire, map) || + outdata.dsize != map-size*sizeof(uint32_t) + offsetof(struct ctdb_vnn_map_wire, map)) { + DEBUG(0,(Bad vnn map size received in ctdb_ctrl_getvnnmap\n)); + return -1; + } + + (*vnnmap) = talloc(mem_ctx, struct ctdb_vnn_map); + CTDB_NO_MEMORY(ctdb, *vnnmap); + (*vnnmap)-generation = map-generation; + (*vnnmap)-size = map-size; + (*vnnmap)-map= talloc_array(*vnnmap, uint32_t, map-size); + + CTDB_NO_MEMORY(ctdb, (*vnnmap)-map); + memcpy((*vnnmap)-map, map-map, sizeof(uint32_t)*map-size); return 0; } === modified file 'common/ctdb_recover.c' --- a/common/ctdb_recover.c 2007-05-03 06:18:03 + +++ b/common/ctdb_recover.c 2007-05-09 22:13:19 + @@ -32,9 +32,19 @@ ctdb_control_getvnnmap(struct ctdb_context *ctdb, uint32_t opcode, TDB_DATA indata, TDB_DATA *outdata) { CHECK_CONTROL_DATA_SIZE(0); - - outdata-dsize = offsetof(struct ctdb_vnn_map, map) + 4*ctdb-vnn_map-size; - outdata-dptr = (unsigned char *)ctdb-vnn_map; + struct ctdb_vnn_map_wire *map; + size_t len; + + len = offsetof(struct ctdb_vnn_map_wire, map) + sizeof(uint32_t)*ctdb-vnn_map-size; + map = talloc_size(outdata, len); + CTDB_NO_MEMORY_VOID(ctdb, map); + + map-generation = ctdb-vnn_map-generation; + map-size = ctdb-vnn_map-size; + memcpy(map-map, ctdb-vnn_map-map, sizeof(uint32_t)*map-size); + + outdata-dsize = len; + outdata-dptr = (uint8_t *)map; return 0; } === modified file 'include/ctdb_private.h' --- a/include/ctdb_private.h2007-05-08 11:16:29 + +++ b/include/ctdb_private.h2007-05-09 22:13:19 + @@ -192,6 +192,15 @@ struct ctdb_vnn_map { uint32_t generation; uint32_t size; + uint32_t *map; +}; + +/* + a wire representation of the vnn map + */ +struct ctdb_vnn_map_wire { + uint32_t generation; + uint32_t size; uint32_t map[1]; }; === modified file 'tests/ctdbd.sh' --- a/tests/ctdbd.sh2007-05-04 02:18:39 + +++ b/tests/ctdbd.sh2007-05-09 22:13:19 + @@ -31,4 +31,6 @@ echo Testing getdbmap $VALGRIND bin/ctdb_control getdbmap 0 || exit 1 +echo All done + killall -q ctdbd
Build status as of Thu May 10 00:00:02 2007
URL: http://build.samba.org/ --- /home/build/master/cache/broken_results.txt.old 2007-05-09 00:01:12.0 + +++ /home/build/master/cache/broken_results.txt 2007-05-10 00:00:21.0 + @@ -1,24 +1,24 @@ -Build status as of Wed May 9 00:00:02 2007 +Build status as of Thu May 10 00:00:02 2007 Build counts: Tree Total Broken Panic SOC 0 0 0 build_farm 0 0 0 -ccache 35 6 0 +ccache 34 6 0 ctdb 0 0 0 distcc 3 0 0 ldb 34 6 0 libreplace 33 10 0 lorikeet-heimdal 29 14 0 -pidl 18 5 0 -ppp 14 0 0 +pidl 17 4 0 +ppp 13 0 0 python 0 0 0 -rsync35 18 0 +rsync35 17 0 samba0 0 0 samba-docs 0 0 0 samba-gtk4 3 0 -samba4 36 30 0 -samba_3_040 26 0 +samba4 36 32 1 +samba_3_039 23 0 smb-build31 30 0 talloc 35 1 0 tdb 34 3 0
svn commit: samba r22772 - in branches/SAMBA_3_0/source: . lib/replace
Author: derrell Date: 2007-05-10 01:27:18 + (Thu, 10 May 2007) New Revision: 22772 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=22772 Log: - Still working on the fact that readahead() is not declared (on at least one OS) but is available for linking. Instead of running configure tests with -Werror-implicit-function-declaration in developer mode (which may lead to different library functions being used in developer mode than when not in developer mode), add tests for whether readahead is declared. If not, provide a replacement declaration in lib/replace. Modified: branches/SAMBA_3_0/source/configure.in branches/SAMBA_3_0/source/lib/replace/README branches/SAMBA_3_0/source/lib/replace/libreplace.m4 branches/SAMBA_3_0/source/lib/replace/replace.h Changeset: Modified: branches/SAMBA_3_0/source/configure.in === --- branches/SAMBA_3_0/source/configure.in 2007-05-09 21:38:41 UTC (rev 22771) +++ branches/SAMBA_3_0/source/configure.in 2007-05-10 01:27:18 UTC (rev 22772) @@ -1337,19 +1337,6 @@ # implicit declaration warnings without failing the test (in developer mode) ac_no_error_on_warning_CFLAGS=${CFLAGS} -# Since --enable-developer causes warnings to be treated as errors during -# compilation, we should avoid using features that will fail to compile. -# -# We don't want to enable this earlier because the built-in functions such as -# memset fail to configure properly. - -if test x$samba_cv_HAVE_Werror_implicit_function_declaration = xyes -a \ -x$developer = xyes; then - CFLAGS=${CFLAGS} -Werror-implicit-function-declaration - ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext 5' - ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 5' -fi - echo -n checking for GPFS GPL libs... save_LIBS=$LIBS LIBS=$LIBS -lgpfs_gpl Modified: branches/SAMBA_3_0/source/lib/replace/README === --- branches/SAMBA_3_0/source/lib/replace/README2007-05-09 21:38:41 UTC (rev 22771) +++ branches/SAMBA_3_0/source/lib/replace/README2007-05-10 01:27:18 UTC (rev 22772) @@ -55,6 +55,11 @@ socketpair strptime +These external declarations are provided for those systems which lack the +declaration but provide the function: + +readahead + Types: bool socklen_t Modified: branches/SAMBA_3_0/source/lib/replace/libreplace.m4 === --- branches/SAMBA_3_0/source/lib/replace/libreplace.m4 2007-05-09 21:38:41 UTC (rev 22771) +++ branches/SAMBA_3_0/source/lib/replace/libreplace.m4 2007-05-10 01:27:18 UTC (rev 22772) @@ -155,6 +155,7 @@ AC_HAVE_DECL(setresuid, [#include unistd.h]) AC_HAVE_DECL(setresgid, [#include unistd.h]) AC_HAVE_DECL(errno, [#include errno.h]) +AC_HAVE_DECL(readahead, [#include fcntl.h]) AC_CACHE_CHECK([for secure mkstemp],samba_cv_HAVE_SECURE_MKSTEMP,[ AC_TRY_RUN([#include stdlib.h Modified: branches/SAMBA_3_0/source/lib/replace/replace.h === --- branches/SAMBA_3_0/source/lib/replace/replace.h 2007-05-09 21:38:41 UTC (rev 22771) +++ branches/SAMBA_3_0/source/lib/replace/replace.h 2007-05-10 01:27:18 UTC (rev 22772) @@ -111,6 +111,11 @@ extern int errno; #endif +#if defined(HAVE_LINUX_READAHEAD) ! defined(HAVE_READAHEAD_DECL) +ssize_t readahead(int fd, off64_t offset, size_t count); +#endif + + #ifndef HAVE_STRDUP #define strdup rep_strdup char *rep_strdup(const char *s);
svn commit: samba r22773 - in branches/SAMBA_3_0/source: .
Author: derrell Date: 2007-05-10 02:48:22 + (Thu, 10 May 2007) New Revision: 22773 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=22773 Log: - Clean up the the rest of the cruft from my earlier work on the readahead() missing declaration problem. Modified: branches/SAMBA_3_0/source/configure.in Changeset: Modified: branches/SAMBA_3_0/source/configure.in === --- branches/SAMBA_3_0/source/configure.in 2007-05-10 01:27:18 UTC (rev 22772) +++ branches/SAMBA_3_0/source/configure.in 2007-05-10 02:48:22 UTC (rev 22773) @@ -1333,10 +1333,6 @@ AC_CHECK_FUNCS(backtrace_symbols) AC_CHECK_LIB(exc, trace_back_stack) -# Save the original CFLAGS for a few tests that we want to allow -# implicit declaration warnings without failing the test (in developer mode) -ac_no_error_on_warning_CFLAGS=${CFLAGS} - echo -n checking for GPFS GPL libs... save_LIBS=$LIBS LIBS=$LIBS -lgpfs_gpl @@ -4728,8 +4724,6 @@ AC_CACHE_CHECK([whether the sys_quota interface works],samba_cv_SYSQUOTA_WORKS,[ SAVE_CPPFLAGS=$CPPFLAGS CPPFLAGS=$CPPFLAGS ${SAMBA_CONFIGURE_CPPFLAGS} -SAVE_CFLAGS=$CFLAGS -CFLAGS=${ac_no_error_on_warning_CFLAGS} AC_TRY_COMPILE([ #include confdefs.h #define NO_PROTO_H 1 @@ -4739,7 +4733,6 @@ #include ${srcdir-.}/lib/sysquotas.c ],[],samba_cv_SYSQUOTA_WORKS=yes,samba_cv_SYSQUOTA_WORKS=no) CPPFLAGS=$SAVE_CPPFLAGS -CFLAGS=$SAVE_CFLAGS ]) if test x$samba_cv_SYSQUOTA_WORKS = xyes; then AC_MSG_CHECKING(whether to use the new lib/sysquotas.c interface) @@ -4778,8 +4771,6 @@ AC_CACHE_CHECK([whether the old quota support works],samba_cv_QUOTA_WORKS,[ SAVE_CPPFLAGS=$CPPFLAGS CPPFLAGS=$CPPFLAGS ${SAMBA_CONFIGURE_CPPFLAGS} -SAVE_CFLAGS=$CFLAGS -CFLAGS=${ac_no_error_on_warning_CFLAGS} AC_TRY_COMPILE([ #include confdefs.h #define NO_PROTO_H 1 @@ -4787,7 +4778,6 @@ #include ${srcdir-.}/smbd/quotas.c ],[],samba_cv_QUOTA_WORKS=yes,samba_cv_QUOTA_WORKS=no) CPPFLAGS=$SAVE_CPPFLAGS -CFLAGS=$SAVE_CFLAGS ]) if test x$samba_cv_QUOTA_WORKS = xyes; then AC_MSG_CHECKING(whether to use the old quota support) @@ -6377,7 +6367,7 @@ dnl Merge in developer cflags from now on if test x$developer = xyes; then -CFLAGS=${ac_no_error_on_warning_CFLAGS} ${DEVELOPER_CFLAGS} +CFLAGS=${CFLAGS} ${DEVELOPER_CFLAGS} fi builddir=`pwd`