summaryrefslogtreecommitdiff
path: root/source3/param
diff options
context:
space:
mode:
authorGerald (Jerry) Carter <jerry@samba.org>2007-11-01 21:30:43 -0400
committerGerald (Jerry) Carter <jerry@samba.org>2007-11-01 21:30:43 -0400
commit31286b302a4c42b9e878a9531604ea87b35dd8a9 (patch)
treee8a081f44d3d89da895902a44492a8fb8cae64da /source3/param
parent88ee61625a5de5e443d14c54eab91a90d87cda85 (diff)
parent8bad80efb016dbd1aa392bbbc2b954d4dc9e3906 (diff)
downloadsamba-31286b302a4c42b9e878a9531604ea87b35dd8a9.tar.gz
samba-31286b302a4c42b9e878a9531604ea87b35dd8a9.tar.bz2
samba-31286b302a4c42b9e878a9531604ea87b35dd8a9.zip
Merge branch 'v3-2-test' of git://git.samba.org/samba into v3-2-test
(This used to be commit 779353b86d1699324149896f1ffa237c6ebe46ec)
Diffstat (limited to 'source3/param')
-rw-r--r--source3/param/loadparm.c27
1 files changed, 15 insertions, 12 deletions
diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c
index e59aa99048..19af6aa3cf 100644
--- a/source3/param/loadparm.c
+++ b/source3/param/loadparm.c
@@ -441,7 +441,7 @@ typedef struct {
bool bStrictAllocate;
bool bStrictSync;
char magic_char;
- bool *copymap;
+ struct bitmap *copymap;
bool bDeleteReadonly;
bool bFakeOplocks;
bool bDeleteVetoFiles;
@@ -2181,7 +2181,8 @@ static const char *get_boolean(bool bool_value);
static int getservicebyname(const char *pszServiceName,
service * pserviceDest);
static void copy_service(service * pserviceDest,
- service * pserviceSource, bool *pcopymapDest);
+ service * pserviceSource,
+ struct bitmap *pcopymapDest);
static bool do_parameter(const char *pszParmName, const char *pszParmValue);
static bool do_section(const char *pszSectionName);
static void init_copymap(service * pservice);
@@ -2455,7 +2456,7 @@ static void free_service(service *pservice)
pservice->szService));
string_free(&pservice->szService);
- SAFE_FREE(pservice->copymap);
+ bitmap_free(pservice->copymap);
for (i = 0; parm_table[i].label; i++) {
if ((parm_table[i].type == P_STRING ||
@@ -3188,7 +3189,8 @@ static int getservicebyname(const char *pszServiceName, service * pserviceDest)
If pcopymapDest is NULL then copy all fields
***************************************************************************/
-static void copy_service(service * pserviceDest, service * pserviceSource, bool *pcopymapDest)
+static void copy_service(service * pserviceDest, service * pserviceSource,
+ struct bitmap *pcopymapDest)
{
int i;
bool bcopyall = (pcopymapDest == NULL);
@@ -3197,7 +3199,7 @@ static void copy_service(service * pserviceDest, service * pserviceSource, bool
for (i = 0; parm_table[i].label; i++)
if (parm_table[i].ptr && parm_table[i].p_class == P_LOCAL &&
- (bcopyall || pcopymapDest[i])) {
+ (bcopyall || bitmap_query(pcopymapDest,i))) {
void *def_ptr = parm_table[i].ptr;
void *src_ptr =
((char *)pserviceSource) + PTR_DIFF(def_ptr,
@@ -3244,9 +3246,8 @@ static void copy_service(service * pserviceDest, service * pserviceSource, bool
if (bcopyall) {
init_copymap(pserviceDest);
if (pserviceSource->copymap)
- memcpy((void *)pserviceDest->copymap,
- (void *)pserviceSource->copymap,
- sizeof(bool) * NUMPARAMETERS);
+ bitmap_copy(pserviceDest->copymap,
+ pserviceSource->copymap);
}
data = pserviceSource->param_opt;
@@ -3985,15 +3986,17 @@ static bool handle_printing(int snum, const char *pszParmValue, char **ptr)
static void init_copymap(service * pservice)
{
int i;
- SAFE_FREE(pservice->copymap);
- pservice->copymap = SMB_MALLOC_ARRAY(bool,NUMPARAMETERS);
+ if (pservice->copymap) {
+ bitmap_free(pservice->copymap);
+ }
+ pservice->copymap = bitmap_allocate(NUMPARAMETERS);
if (!pservice->copymap)
DEBUG(0,
("Couldn't allocate copymap!! (size %d)\n",
(int)NUMPARAMETERS));
else
for (i = 0; i < NUMPARAMETERS; i++)
- pservice->copymap[i] = True;
+ bitmap_set(pservice->copymap, i);
}
/***************************************************************************
@@ -4095,7 +4098,7 @@ bool lp_do_parameter(int snum, const char *pszParmName, const char *pszParmValue
the same data pointer */
for (i = 0; parm_table[i].label; i++)
if (parm_table[i].ptr == parm_table[parmnum].ptr)
- ServicePtrs[snum]->copymap[i] = False;
+ bitmap_clear(ServicePtrs[snum]->copymap, i);
}
/* if it is a special case then go ahead */