1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-05 20:58:40 +03:00

Merge branch 'v3-2-test' of git://git.samba.org/samba into v3-2-test

This commit is contained in:
Gerald (Jerry) Carter 2007-11-01 21:30:43 -04:00
commit 779353b86d
4 changed files with 23 additions and 15 deletions

View File

@ -741,6 +741,7 @@ struct profile_stats {
unsigned syscall_read_bytes; unsigned syscall_read_bytes;
unsigned syscall_write_bytes; unsigned syscall_write_bytes;
unsigned syscall_sendfile_bytes; unsigned syscall_sendfile_bytes;
unsigned syscall_recvfile_bytes;
/* stat cache counters */ /* stat cache counters */
unsigned statcache_lookups; unsigned statcache_lookups;

View File

@ -2671,7 +2671,11 @@ smbc_opendir_ctx(SMBCCTX *context,
return NULL; return NULL;
} }
ip_list = &server_addr; ip_list = memdup(&server_addr, sizeof(server_addr));
if (ip_list == NULL) {
errno = ENOMEM;
return NULL;
}
count = 1; count = 1;
} }

View File

@ -441,7 +441,7 @@ typedef struct {
bool bStrictAllocate; bool bStrictAllocate;
bool bStrictSync; bool bStrictSync;
char magic_char; char magic_char;
bool *copymap; struct bitmap *copymap;
bool bDeleteReadonly; bool bDeleteReadonly;
bool bFakeOplocks; bool bFakeOplocks;
bool bDeleteVetoFiles; bool bDeleteVetoFiles;
@ -2181,7 +2181,8 @@ static const char *get_boolean(bool bool_value);
static int getservicebyname(const char *pszServiceName, static int getservicebyname(const char *pszServiceName,
service * pserviceDest); service * pserviceDest);
static void copy_service(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_parameter(const char *pszParmName, const char *pszParmValue);
static bool do_section(const char *pszSectionName); static bool do_section(const char *pszSectionName);
static void init_copymap(service * pservice); static void init_copymap(service * pservice);
@ -2455,7 +2456,7 @@ static void free_service(service *pservice)
pservice->szService)); pservice->szService));
string_free(&pservice->szService); string_free(&pservice->szService);
SAFE_FREE(pservice->copymap); bitmap_free(pservice->copymap);
for (i = 0; parm_table[i].label; i++) { for (i = 0; parm_table[i].label; i++) {
if ((parm_table[i].type == P_STRING || 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 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; int i;
bool bcopyall = (pcopymapDest == NULL); 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++) for (i = 0; parm_table[i].label; i++)
if (parm_table[i].ptr && parm_table[i].p_class == P_LOCAL && 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 *def_ptr = parm_table[i].ptr;
void *src_ptr = void *src_ptr =
((char *)pserviceSource) + PTR_DIFF(def_ptr, ((char *)pserviceSource) + PTR_DIFF(def_ptr,
@ -3244,9 +3246,8 @@ static void copy_service(service * pserviceDest, service * pserviceSource, bool
if (bcopyall) { if (bcopyall) {
init_copymap(pserviceDest); init_copymap(pserviceDest);
if (pserviceSource->copymap) if (pserviceSource->copymap)
memcpy((void *)pserviceDest->copymap, bitmap_copy(pserviceDest->copymap,
(void *)pserviceSource->copymap, pserviceSource->copymap);
sizeof(bool) * NUMPARAMETERS);
} }
data = pserviceSource->param_opt; 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) static void init_copymap(service * pservice)
{ {
int i; int i;
SAFE_FREE(pservice->copymap); if (pservice->copymap) {
pservice->copymap = SMB_MALLOC_ARRAY(bool,NUMPARAMETERS); bitmap_free(pservice->copymap);
}
pservice->copymap = bitmap_allocate(NUMPARAMETERS);
if (!pservice->copymap) if (!pservice->copymap)
DEBUG(0, DEBUG(0,
("Couldn't allocate copymap!! (size %d)\n", ("Couldn't allocate copymap!! (size %d)\n",
(int)NUMPARAMETERS)); (int)NUMPARAMETERS));
else else
for (i = 0; i < NUMPARAMETERS; i++) 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 */ the same data pointer */
for (i = 0; parm_table[i].label; i++) for (i = 0; parm_table[i].label; i++)
if (parm_table[i].ptr == parm_table[parmnum].ptr) 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 */ /* if it is a special case then go ahead */

View File

@ -2738,8 +2738,8 @@ cBytesSector=%u, cUnitTotal=%u, cUnitAvail=%d\n", (unsigned int)bsize, (unsigned
CIFS_UNIX_EXTATTR_CAP| CIFS_UNIX_EXTATTR_CAP|
CIFS_UNIX_POSIX_PATH_OPERATIONS_CAP| CIFS_UNIX_POSIX_PATH_OPERATIONS_CAP|
CIFS_UNIX_LARGE_READ_CAP| CIFS_UNIX_LARGE_READ_CAP|
large_write ? (large_write ?
CIFS_UNIX_LARGE_WRITE_CAP : 0))); CIFS_UNIX_LARGE_WRITE_CAP : 0))));
break; break;
} }