1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-11 05:18:09 +03:00

s3: Fix some nonempty blank lines

This commit is contained in:
Volker Lendecke 2009-11-21 16:17:16 +01:00
parent 97525d0a0e
commit b79bcd972c
3 changed files with 75 additions and 77 deletions

View File

@ -3,17 +3,17 @@
string substitution functions string substitution functions
Copyright (C) Andrew Tridgell 1992-2000 Copyright (C) Andrew Tridgell 1992-2000
Copyright (C) Gerald Carter 2006 Copyright (C) Gerald Carter 2006
This program is free software; you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or the Free Software Foundation; either version 3 of the License, or
(at your option) any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
@ -276,12 +276,12 @@ static char * realloc_expand_env_var(char *str, char *p)
r = p + 3; r = p + 3;
copylen = q - r; copylen = q - r;
/* reserve space for use later add %$() chars */ /* reserve space for use later add %$() chars */
if ( (envname = (char *)SMB_MALLOC(copylen + 1 + 4)) == NULL ) { if ( (envname = (char *)SMB_MALLOC(copylen + 1 + 4)) == NULL ) {
return NULL; return NULL;
} }
strncpy(envname,r,copylen); strncpy(envname,r,copylen);
envname[copylen] = '\0'; envname[copylen] = '\0';
@ -301,7 +301,7 @@ static char * realloc_expand_env_var(char *str, char *p)
envname[copylen] = '\0'; envname[copylen] = '\0';
r = realloc_string_sub(str, envname, envval); r = realloc_string_sub(str, envname, envval);
SAFE_FREE(envname); SAFE_FREE(envname);
return r; return r;
} }
@ -313,17 +313,17 @@ static char *longvar_domainsid( void )
DOM_SID sid; DOM_SID sid;
fstring tmp; fstring tmp;
char *sid_string; char *sid_string;
if ( !secrets_fetch_domain_sid( lp_workgroup(), &sid ) ) { if ( !secrets_fetch_domain_sid( lp_workgroup(), &sid ) ) {
return NULL; return NULL;
} }
sid_string = SMB_STRDUP( sid_to_fstring( tmp, &sid ) ); sid_string = SMB_STRDUP( sid_to_fstring( tmp, &sid ) );
if ( !sid_string ) { if ( !sid_string ) {
DEBUG(0,("longvar_domainsid: failed to dup SID string!\n")); DEBUG(0,("longvar_domainsid: failed to dup SID string!\n"));
} }
return sid_string; return sid_string;
} }
@ -343,15 +343,15 @@ static struct api_longvar longvar_table[] = {
static char *get_longvar_val( const char *varname ) static char *get_longvar_val( const char *varname )
{ {
int i; int i;
DEBUG(7,("get_longvar_val: expanding variable [%s]\n", varname)); DEBUG(7,("get_longvar_val: expanding variable [%s]\n", varname));
for ( i=0; longvar_table[i].name; i++ ) { for ( i=0; longvar_table[i].name; i++ ) {
if ( strequal( longvar_table[i].name, varname ) ) { if ( strequal( longvar_table[i].name, varname ) ) {
return longvar_table[i].fn(); return longvar_table[i].fn();
} }
} }
return NULL; return NULL;
} }
@ -515,13 +515,12 @@ void standard_sub_basic(const char *smb_name, const char *domain_name,
char *str, size_t len) char *str, size_t len)
{ {
char *s; char *s;
if ( (s = alloc_sub_basic( smb_name, domain_name, str )) != NULL ) { if ( (s = alloc_sub_basic( smb_name, domain_name, str )) != NULL ) {
strncpy( str, s, len ); strncpy( str, s, len );
} }
SAFE_FREE( s ); SAFE_FREE( s );
} }
/**************************************************************************** /****************************************************************************
@ -533,7 +532,7 @@ char *talloc_sub_basic(TALLOC_CTX *mem_ctx, const char *smb_name,
const char *domain_name, const char *str) const char *domain_name, const char *str)
{ {
char *a, *t; char *a, *t;
if ( (a = alloc_sub_basic(smb_name, domain_name, str)) == NULL ) { if ( (a = alloc_sub_basic(smb_name, domain_name, str)) == NULL ) {
return NULL; return NULL;
} }
@ -555,12 +554,12 @@ char *alloc_sub_basic(const char *smb_name, const char *domain_name,
TALLOC_CTX *tmp_ctx = NULL; TALLOC_CTX *tmp_ctx = NULL;
/* workaround to prevent a crash while looking at bug #687 */ /* workaround to prevent a crash while looking at bug #687 */
if (!str) { if (!str) {
DEBUG(0,("alloc_sub_basic: NULL source string! This should not happen\n")); DEBUG(0,("alloc_sub_basic: NULL source string! This should not happen\n"));
return NULL; return NULL;
} }
a_string = SMB_STRDUP(str); a_string = SMB_STRDUP(str);
if (a_string == NULL) { if (a_string == NULL) {
DEBUG(0, ("alloc_sub_basic: Out of memory!\n")); DEBUG(0, ("alloc_sub_basic: Out of memory!\n"));
@ -722,11 +721,11 @@ char *talloc_sub_specified(TALLOC_CTX *mem_ctx,
DEBUG(0, ("talloc_sub_specified: Out of memory!\n")); DEBUG(0, ("talloc_sub_specified: Out of memory!\n"));
goto done; goto done;
} }
for (b = s = a_string; (p = strchr_m(s, '%')); s = a_string + (p - b)) { for (b = s = a_string; (p = strchr_m(s, '%')); s = a_string + (p - b)) {
b = a_string; b = a_string;
switch (*(p+1)) { switch (*(p+1)) {
case 'U' : case 'U' :
a_string = talloc_string_sub( a_string = talloc_string_sub(
@ -802,11 +801,11 @@ static char *alloc_sub_advanced(const char *servicename, const char *user,
DEBUG(0, ("alloc_sub_advanced: Out of memory!\n")); DEBUG(0, ("alloc_sub_advanced: Out of memory!\n"));
return NULL; return NULL;
} }
for (b = s = a_string; (p = strchr_m(s, '%')); s = a_string + (p - b)) { for (b = s = a_string; (p = strchr_m(s, '%')); s = a_string + (p - b)) {
b = a_string; b = a_string;
switch (*(p+1)) { switch (*(p+1)) {
case 'N' : case 'N' :
a_string = realloc_string_sub(a_string, "%N", automount_server(user)); a_string = realloc_string_sub(a_string, "%N", automount_server(user));
@ -830,7 +829,7 @@ static char *alloc_sub_advanced(const char *servicename, const char *user,
case 'u': case 'u':
a_string = realloc_string_sub(a_string, "%u", user); a_string = realloc_string_sub(a_string, "%u", user);
break; break;
/* Patch from jkf@soton.ac.uk Left the %N (NIS /* Patch from jkf@soton.ac.uk Left the %N (NIS
* server name) in standard_sub_basic as it is * server name) in standard_sub_basic as it is
* a feature for logon servers, hence uses the * a feature for logon servers, hence uses the
@ -842,7 +841,7 @@ static char *alloc_sub_advanced(const char *servicename, const char *user,
a_string = realloc_string_sub(a_string, "%p", a_string = realloc_string_sub(a_string, "%p",
automount_path(servicename)); automount_path(servicename));
break; break;
default: default:
break; break;
} }

View File

@ -11,12 +11,12 @@
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or the Free Software Foundation; either version 3 of the License, or
(at your option) any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
@ -532,7 +532,7 @@ bool file_exist_stat(const char *fname,SMB_STRUCT_STAT *sbuf)
SMB_STRUCT_STAT st; SMB_STRUCT_STAT st;
if (!sbuf) if (!sbuf)
sbuf = &st; sbuf = &st;
if (sys_stat(fname,sbuf) != 0) if (sys_stat(fname,sbuf) != 0)
return(False); return(False);
@ -626,7 +626,7 @@ void show_msg(char *buf)
if (!DEBUGLVL(5)) if (!DEBUGLVL(5))
return; return;
DEBUG(5,("size=%d\nsmb_com=0x%x\nsmb_rcls=%d\nsmb_reh=%d\nsmb_err=%d\nsmb_flg=%d\nsmb_flg2=%d\n", DEBUG(5,("size=%d\nsmb_com=0x%x\nsmb_rcls=%d\nsmb_reh=%d\nsmb_err=%d\nsmb_flg=%d\nsmb_flg2=%d\n",
smb_len(buf), smb_len(buf),
(int)CVAL(buf,smb_com), (int)CVAL(buf,smb_com),
@ -645,7 +645,7 @@ void show_msg(char *buf)
for (i=0;i<(int)CVAL(buf,smb_wct);i++) for (i=0;i<(int)CVAL(buf,smb_wct);i++)
DEBUGADD(5,("smb_vwv[%2d]=%5d (0x%X)\n",i, DEBUGADD(5,("smb_vwv[%2d]=%5d (0x%X)\n",i,
SVAL(buf,smb_vwv+2*i),SVAL(buf,smb_vwv+2*i))); SVAL(buf,smb_vwv+2*i),SVAL(buf,smb_vwv+2*i)));
bcc = (int)SVAL(buf,smb_vwv+2*(CVAL(buf,smb_wct))); bcc = (int)SVAL(buf,smb_vwv+2*(CVAL(buf,smb_wct)));
DEBUGADD(5,("smb_bcc=%d\n",bcc)); DEBUGADD(5,("smb_bcc=%d\n",bcc));
@ -896,7 +896,7 @@ void smb_msleep(unsigned int t)
GetTimeOfDay(&t1); GetTimeOfDay(&t1);
t2 = t1; t2 = t1;
while (tdiff < t) { while (tdiff < t) {
tval.tv_sec = (t-tdiff)/1000; tval.tv_sec = (t-tdiff)/1000;
tval.tv_usec = 1000*((t-tdiff)%1000); tval.tv_usec = 1000*((t-tdiff)%1000);
@ -1217,9 +1217,9 @@ int interpret_protocol(const char *str,int def)
return(PROTOCOL_COREPLUS); return(PROTOCOL_COREPLUS);
if (strequal(str,"CORE+")) if (strequal(str,"CORE+"))
return(PROTOCOL_COREPLUS); return(PROTOCOL_COREPLUS);
DEBUG(0,("Unrecognised protocol level %s\n",str)); DEBUG(0,("Unrecognised protocol level %s\n",str));
return(def); return(def);
} }
@ -1577,7 +1577,7 @@ libunwind_failed:
DEBUG(0, ("BACKTRACE: %lu stack frames:\n", DEBUG(0, ("BACKTRACE: %lu stack frames:\n",
(unsigned long)backtrace_size)); (unsigned long)backtrace_size));
if (backtrace_strings) { if (backtrace_strings) {
int i; int i;
@ -1641,7 +1641,7 @@ const char *readdirname(SMB_STRUCT_DIR *p)
if (!p) if (!p)
return(NULL); return(NULL);
ptr = (SMB_STRUCT_DIRENT *)sys_readdir(p); ptr = (SMB_STRUCT_DIRENT *)sys_readdir(p);
if (!ptr) if (!ptr)
return(NULL); return(NULL);
@ -1715,7 +1715,7 @@ bool is_in_path(const char *name, name_compare_entry *namelist, bool case_sensit
remove a potentially expensive call to mask_match remove a potentially expensive call to mask_match
if possible. if possible.
********************************************************************/ ********************************************************************/
void set_namearray(name_compare_entry **ppname_array, const char *namelist) void set_namearray(name_compare_entry **ppname_array, const char *namelist)
{ {
char *name_end; char *name_end;
@ -1791,7 +1791,7 @@ void set_namearray(name_compare_entry **ppname_array, const char *namelist)
nameptr = name_end + 1; nameptr = name_end + 1;
i++; i++;
} }
(*ppname_array)[i].name = NULL; (*ppname_array)[i].name = NULL;
return; return;
@ -1851,7 +1851,7 @@ bool fcntl_getlock(int fd, SMB_OFF_T *poffset, SMB_OFF_T *pcount, int *ptype, pi
*poffset = lock.l_start; *poffset = lock.l_start;
*pcount = lock.l_len; *pcount = lock.l_len;
*ppid = lock.l_pid; *ppid = lock.l_pid;
DEBUG(3,("fcntl_getlock: fd %d is returned info %d pid %u\n", DEBUG(3,("fcntl_getlock: fd %d is returned info %d pid %u\n",
fd, (int)lock.l_type, (unsigned int)lock.l_pid)); fd, (int)lock.l_type, (unsigned int)lock.l_pid));
return True; return True;
@ -2310,7 +2310,7 @@ bool parent_dirname(TALLOC_CTX *mem_ctx, const char *dir, char **parent,
{ {
char *p; char *p;
ptrdiff_t len; ptrdiff_t len;
p = strrchr_m(dir, '/'); /* Find final '/', if any */ p = strrchr_m(dir, '/'); /* Find final '/', if any */
if (p == NULL) { if (p == NULL) {
@ -2390,7 +2390,7 @@ bool mask_match(const char *string, const char *pattern, bool is_case_sensitive)
string = "."; string = ".";
if (ISDOT(pattern)) if (ISDOT(pattern))
return False; return False;
return ms_fnmatch(pattern, string, Protocol <= PROTOCOL_LANMAN2, is_case_sensitive) == 0; return ms_fnmatch(pattern, string, Protocol <= PROTOCOL_LANMAN2, is_case_sensitive) == 0;
} }
@ -2406,7 +2406,7 @@ bool mask_match_search(const char *string, const char *pattern, bool is_case_sen
string = "."; string = ".";
if (ISDOT(pattern)) if (ISDOT(pattern))
return False; return False;
return ms_fnmatch(pattern, string, True, is_case_sensitive) == 0; return ms_fnmatch(pattern, string, True, is_case_sensitive) == 0;
} }

View File

@ -10,17 +10,17 @@
Copyright (C) Stefan (metze) Metzmacher 2002 Copyright (C) Stefan (metze) Metzmacher 2002
Copyright (C) Jim McDonough <jmcd@us.ibm.com> 2003 Copyright (C) Jim McDonough <jmcd@us.ibm.com> 2003
Copyright (C) Michael Adam 2008 Copyright (C) Michael Adam 2008
This program is free software; you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or the Free Software Foundation; either version 3 of the License, or
(at your option) any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
@ -5713,16 +5713,16 @@ static struct param_opt_struct *get_parametrics(int snum, const char *type,
bool global_section = False; bool global_section = False;
char* param_key; char* param_key;
struct param_opt_struct *data; struct param_opt_struct *data;
if (snum >= iNumServices) return NULL; if (snum >= iNumServices) return NULL;
if (snum < 0) { if (snum < 0) {
data = Globals.param_opt; data = Globals.param_opt;
global_section = True; global_section = True;
} else { } else {
data = ServicePtrs[snum]->param_opt; data = ServicePtrs[snum]->param_opt;
} }
if (asprintf(&param_key, "%s:%s", type, option) == -1) { if (asprintf(&param_key, "%s:%s", type, option) == -1) {
DEBUG(0,("asprintf failed!\n")); DEBUG(0,("asprintf failed!\n"));
return NULL; return NULL;
@ -5750,7 +5750,7 @@ static struct param_opt_struct *get_parametrics(int snum, const char *type,
} }
string_free(&param_key); string_free(&param_key);
return NULL; return NULL;
} }
@ -5797,7 +5797,7 @@ static bool lp_bool(const char *s)
MISSING_PARAMETER(lp_bool); MISSING_PARAMETER(lp_bool);
return False; return False;
} }
if (!set_boolean(s, &ret)) { if (!set_boolean(s, &ret)) {
DEBUG(0,("lp_bool(%s): value is not boolean!\n",s)); DEBUG(0,("lp_bool(%s): value is not boolean!\n",s));
return False; return False;
@ -5817,7 +5817,7 @@ static int lp_enum(const char *s,const struct enum_list *_enum)
MISSING_PARAMETER(lp_enum); MISSING_PARAMETER(lp_enum);
return (-1); return (-1);
} }
for (i=0; _enum[i].name; i++) { for (i=0; _enum[i].name; i++) {
if (strequal(_enum[i].name,s)) if (strequal(_enum[i].name,s))
return _enum[i].value; return _enum[i].value;
@ -5847,7 +5847,7 @@ static int lp_enum(const char *s,const struct enum_list *_enum)
char *lp_parm_talloc_string(int snum, const char *type, const char *option, const char *def) char *lp_parm_talloc_string(int snum, const char *type, const char *option, const char *def)
{ {
struct param_opt_struct *data = get_parametrics(snum, type, option); struct param_opt_struct *data = get_parametrics(snum, type, option);
if (data == NULL||data->value==NULL) { if (data == NULL||data->value==NULL) {
if (def) { if (def) {
return lp_string(def); return lp_string(def);
@ -5864,10 +5864,10 @@ char *lp_parm_talloc_string(int snum, const char *type, const char *option, cons
const char *lp_parm_const_string(int snum, const char *type, const char *option, const char *def) const char *lp_parm_const_string(int snum, const char *type, const char *option, const char *def)
{ {
struct param_opt_struct *data = get_parametrics(snum, type, option); struct param_opt_struct *data = get_parametrics(snum, type, option);
if (data == NULL||data->value==NULL) if (data == NULL||data->value==NULL)
return def; return def;
return data->value; return data->value;
} }
@ -5880,7 +5880,7 @@ const char **lp_parm_string_list(int snum, const char *type, const char *option,
if (data == NULL||data->value==NULL) if (data == NULL||data->value==NULL)
return (const char **)def; return (const char **)def;
if (data->list==NULL) { if (data->list==NULL) {
data->list = str_list_make_v3(talloc_autofree_context(), data->value, NULL); data->list = str_list_make_v3(talloc_autofree_context(), data->value, NULL);
} }
@ -5894,7 +5894,7 @@ const char **lp_parm_string_list(int snum, const char *type, const char *option,
int lp_parm_int(int snum, const char *type, const char *option, int def) int lp_parm_int(int snum, const char *type, const char *option, int def)
{ {
struct param_opt_struct *data = get_parametrics(snum, type, option); struct param_opt_struct *data = get_parametrics(snum, type, option);
if (data && data->value && *data->value) if (data && data->value && *data->value)
return lp_int(data->value); return lp_int(data->value);
@ -5907,7 +5907,7 @@ int lp_parm_int(int snum, const char *type, const char *option, int def)
unsigned long lp_parm_ulong(int snum, const char *type, const char *option, unsigned long def) unsigned long lp_parm_ulong(int snum, const char *type, const char *option, unsigned long def)
{ {
struct param_opt_struct *data = get_parametrics(snum, type, option); struct param_opt_struct *data = get_parametrics(snum, type, option);
if (data && data->value && *data->value) if (data && data->value && *data->value)
return lp_ulong(data->value); return lp_ulong(data->value);
@ -5920,7 +5920,7 @@ unsigned long lp_parm_ulong(int snum, const char *type, const char *option, unsi
bool lp_parm_bool(int snum, const char *type, const char *option, bool def) bool lp_parm_bool(int snum, const char *type, const char *option, bool def)
{ {
struct param_opt_struct *data = get_parametrics(snum, type, option); struct param_opt_struct *data = get_parametrics(snum, type, option);
if (data && data->value && *data->value) if (data && data->value && *data->value)
return lp_bool(data->value); return lp_bool(data->value);
@ -5934,7 +5934,7 @@ int lp_parm_enum(int snum, const char *type, const char *option,
const struct enum_list *_enum, int def) const struct enum_list *_enum, int def)
{ {
struct param_opt_struct *data = get_parametrics(snum, type, option); struct param_opt_struct *data = get_parametrics(snum, type, option);
if (data && data->value && *data->value && _enum) if (data && data->value && *data->value && _enum)
return lp_enum(data->value, _enum); return lp_enum(data->value, _enum);
@ -6024,7 +6024,7 @@ static void free_service_byindex(int idx)
if (ServicePtrs[idx]->szService) { if (ServicePtrs[idx]->szService) {
char *canon_name = canonicalize_servicename( char *canon_name = canonicalize_servicename(
ServicePtrs[idx]->szService ); ServicePtrs[idx]->szService );
dbwrap_delete_bystring(ServiceHash, canon_name ); dbwrap_delete_bystring(ServiceHash, canon_name );
TALLOC_FREE(canon_name); TALLOC_FREE(canon_name);
} }
@ -6066,7 +6066,7 @@ static int add_a_service(const struct service *pservice, const char *name)
if (i == iNumServices) { if (i == iNumServices) {
struct service **tsp; struct service **tsp;
int *tinvalid; int *tinvalid;
tsp = SMB_REALLOC_ARRAY_KEEP_OLD_ON_ERROR(ServicePtrs, struct service *, num_to_alloc); tsp = SMB_REALLOC_ARRAY_KEEP_OLD_ON_ERROR(ServicePtrs, struct service *, num_to_alloc);
if (tsp == NULL) { if (tsp == NULL) {
DEBUG(0,("add_a_service: failed to enlarge ServicePtrs!\n")); DEBUG(0,("add_a_service: failed to enlarge ServicePtrs!\n"));
@ -6099,14 +6099,14 @@ static int add_a_service(const struct service *pservice, const char *name)
copy_service(ServicePtrs[i], &tservice, NULL); copy_service(ServicePtrs[i], &tservice, NULL);
if (name) if (name)
string_set(&ServicePtrs[i]->szService, name); string_set(&ServicePtrs[i]->szService, name);
DEBUG(8,("add_a_service: Creating snum = %d for %s\n", DEBUG(8,("add_a_service: Creating snum = %d for %s\n",
i, ServicePtrs[i]->szService)); i, ServicePtrs[i]->szService));
if (!hash_a_service(ServicePtrs[i]->szService, i)) { if (!hash_a_service(ServicePtrs[i]->szService, i)) {
return (-1); return (-1);
} }
return (i); return (i);
} }
@ -6289,7 +6289,7 @@ bool lp_add_printer(const char *pszPrintername, int iDefaultService)
ServicePtrs[i]->bOpLocks = False; ServicePtrs[i]->bOpLocks = False;
/* Printer services must be printable. */ /* Printer services must be printable. */
ServicePtrs[i]->bPrint_ok = True; ServicePtrs[i]->bPrint_ok = True;
DEBUG(3, ("adding printer service %s\n", pszPrintername)); DEBUG(3, ("adding printer service %s\n", pszPrintername));
return (True); return (True);
@ -6779,7 +6779,7 @@ static void copy_service(struct service *pserviceDest, struct service *pserviceS
bitmap_copy(pserviceDest->copymap, bitmap_copy(pserviceDest->copymap,
pserviceSource->copymap); pserviceSource->copymap);
} }
data = pserviceSource->param_opt; data = pserviceSource->param_opt;
while (data) { while (data) {
set_param_opt(&pserviceDest->param_opt, data->key, data->value); set_param_opt(&pserviceDest->param_opt, data->key, data->value);
@ -7161,17 +7161,17 @@ static bool handle_charset(int snum, const char *pszParmValue, char **ptr)
static bool handle_workgroup(int snum, const char *pszParmValue, char **ptr) static bool handle_workgroup(int snum, const char *pszParmValue, char **ptr)
{ {
bool ret; bool ret;
ret = set_global_myworkgroup(pszParmValue); ret = set_global_myworkgroup(pszParmValue);
string_set(&Globals.szWorkgroup,lp_workgroup()); string_set(&Globals.szWorkgroup,lp_workgroup());
return ret; return ret;
} }
static bool handle_netbios_scope(int snum, const char *pszParmValue, char **ptr) static bool handle_netbios_scope(int snum, const char *pszParmValue, char **ptr)
{ {
bool ret; bool ret;
ret = set_global_scope(pszParmValue); ret = set_global_scope(pszParmValue);
string_set(&Globals.szNetbiosScope,global_scope()); string_set(&Globals.szNetbiosScope,global_scope());
@ -7852,7 +7852,7 @@ static void dump_globals(FILE *f)
{ {
int i; int i;
struct param_opt_struct *data; struct param_opt_struct *data;
fprintf(f, "[global]\n"); fprintf(f, "[global]\n");
for (i = 0; parm_table[i].label; i++) for (i = 0; parm_table[i].label; i++)
@ -7897,7 +7897,7 @@ static void dump_a_service(struct service *pService, FILE * f)
{ {
int i; int i;
struct param_opt_struct *data; struct param_opt_struct *data;
if (pService != &sDefault) if (pService != &sDefault)
fprintf(f, "[%s]\n", pService->szService); fprintf(f, "[%s]\n", pService->szService);
@ -7909,7 +7909,6 @@ static void dump_a_service(struct service *pService, FILE * f)
(*parm_table[i].label != '-') && (*parm_table[i].label != '-') &&
(i == 0 || (parm_table[i].ptr != parm_table[i - 1].ptr))) (i == 0 || (parm_table[i].ptr != parm_table[i - 1].ptr)))
{ {
int pdiff = PTR_DIFF(parm_table[i].ptr, &sDefault); int pdiff = PTR_DIFF(parm_table[i].ptr, &sDefault);
if (pService == &sDefault) { if (pService == &sDefault) {
@ -8046,7 +8045,7 @@ struct parm_struct *lp_next_parameter(int snum, int *i, int allparameters)
&& (parm_table[*i].ptr == && (parm_table[*i].ptr ==
parm_table[(*i) - 1].ptr)) parm_table[(*i) - 1].ptr))
continue; continue;
if (is_default(*i) && !allparameters) if (is_default(*i) && !allparameters)
continue; continue;
@ -9293,11 +9292,11 @@ int lp_servicenumber(const char *pszServiceName)
{ {
int iService; int iService;
fstring serviceName; fstring serviceName;
if (!pszServiceName) { if (!pszServiceName) {
return GLOBAL_SECTION_SNUM; return GLOBAL_SECTION_SNUM;
} }
for (iService = iNumServices - 1; iService >= 0; iService--) { for (iService = iNumServices - 1; iService >= 0; iService--) {
if (VALID(iService) && ServicePtrs[iService]->szService) { if (VALID(iService) && ServicePtrs[iService]->szService) {
/* /*
@ -9447,7 +9446,7 @@ const char *volume_label(int snum)
if (!*label) { if (!*label) {
label = lp_servicename(snum); label = lp_servicename(snum);
} }
/* This returns a 33 byte guarenteed null terminated string. */ /* This returns a 33 byte guarenteed null terminated string. */
ret = talloc_strndup(talloc_tos(), label, 32); ret = talloc_strndup(talloc_tos(), label, 32);
if (!ret) { if (!ret) {
@ -9820,7 +9819,7 @@ int lp_min_receive_file_size(void)
const char *lp_socket_address(void) const char *lp_socket_address(void)
{ {
char *sock_addr = Globals.szSocketAddress; char *sock_addr = Globals.szSocketAddress;
if (sock_addr[0] == '\0'){ if (sock_addr[0] == '\0'){
string_set(&Globals.szSocketAddress, "0.0.0.0"); string_set(&Globals.szSocketAddress, "0.0.0.0");
} }