summaryrefslogtreecommitdiff
path: root/source3/utils/testparm.c
diff options
context:
space:
mode:
authorRusty Russell <rusty@rustcorp.com.au>2012-07-18 15:07:23 +0930
committerRusty Russell <rusty@rustcorp.com.au>2012-07-18 15:07:23 +0930
commitfe72740e8221575921c22030d6d4fcb19201b03b (patch)
tree0b1bb254e23d6541eede8f2ff4494af477fd5566 /source3/utils/testparm.c
parentc809eec53fb1d2a36909e4934dff349f91e3359e (diff)
downloadsamba-fe72740e8221575921c22030d6d4fcb19201b03b.tar.gz
samba-fe72740e8221575921c22030d6d4fcb19201b03b.tar.bz2
samba-fe72740e8221575921c22030d6d4fcb19201b03b.zip
loadparm: make the source3/ lp_ functions take an explicit TALLOC_CTX *.
They use talloc_tos() internally: hoist that up to the callers, some of whom don't want to us talloc_tos(). A simple patch, but hits a lot of files. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Diffstat (limited to 'source3/utils/testparm.c')
-rw-r--r--source3/utils/testparm.c44
1 files changed, 22 insertions, 22 deletions
diff --git a/source3/utils/testparm.c b/source3/utils/testparm.c
index b75fc61b6e..105f1c5746 100644
--- a/source3/utils/testparm.c
+++ b/source3/utils/testparm.c
@@ -170,8 +170,8 @@ cannot be set in the smb.conf file. nmbd will abort with this setting.\n");
if (!lp_pam_password_change()) {
#endif
- if((lp_passwd_program() == NULL) ||
- (strlen(lp_passwd_program()) == 0))
+ if((lp_passwd_program(talloc_tos()) == NULL) ||
+ (strlen(lp_passwd_program(talloc_tos())) == 0))
{
fprintf( stderr, "ERROR: the 'unix password sync' parameter is set and there is no valid 'passwd program' \
parameter.\n" );
@@ -181,7 +181,7 @@ parameter.\n" );
char *truncated_prog = NULL;
const char *p;
- passwd_prog = lp_passwd_program();
+ passwd_prog = lp_passwd_program(talloc_tos());
p = passwd_prog;
next_token_talloc(talloc_tos(),
&p,
@@ -197,18 +197,18 @@ cannot be executed (error was %s).\n", truncated_prog, strerror(errno) );
}
#endif
- if(lp_passwd_chat() == NULL) {
+ if(lp_passwd_chat(talloc_tos()) == NULL) {
fprintf(stderr, "ERROR: the 'unix password sync' parameter is set and there is no valid 'passwd chat' \
parameter.\n");
ret = 1;
}
- if ((lp_passwd_program() != NULL) &&
- (strlen(lp_passwd_program()) > 0))
+ if ((lp_passwd_program(talloc_tos()) != NULL) &&
+ (strlen(lp_passwd_program(talloc_tos())) > 0))
{
/* check if there's a %u parameter present */
- if(strstr_m(lp_passwd_program(), "%u") == NULL) {
- fprintf(stderr, "ERROR: the 'passwd program' (%s) requires a '%%u' parameter.\n", lp_passwd_program());
+ if(strstr_m(lp_passwd_program(talloc_tos()), "%u") == NULL) {
+ fprintf(stderr, "ERROR: the 'passwd program' (%s) requires a '%%u' parameter.\n", lp_passwd_program(talloc_tos()));
ret = 1;
}
}
@@ -219,9 +219,9 @@ parameter.\n");
*/
if(lp_encrypted_passwords()) {
- if(strstr_m( lp_passwd_chat(), "%o")!=NULL) {
+ if(strstr_m( lp_passwd_chat(talloc_tos()), "%o")!=NULL) {
fprintf(stderr, "ERROR: the 'passwd chat' script [%s] expects to use the old plaintext password \
-via the %%o substitution. With encrypted passwords this is not possible.\n", lp_passwd_chat() );
+via the %%o substitution. With encrypted passwords this is not possible.\n", lp_passwd_chat(talloc_tos()) );
ret = 1;
}
}
@@ -283,7 +283,7 @@ static void do_per_share_checks(int s)
char *hasquery = strchr_m(deny_list[i], '?');
if(hasstar || hasquery) {
fprintf(stderr,"Invalid character %c in hosts deny list (%s) for service %s.\n",
- hasstar ? *hasstar : *hasquery, deny_list[i], lp_servicename(s) );
+ hasstar ? *hasstar : *hasquery, deny_list[i], lp_servicename(talloc_tos(), s) );
}
}
}
@@ -294,7 +294,7 @@ static void do_per_share_checks(int s)
char *hasquery = strchr_m(allow_list[i], '?');
if(hasstar || hasquery) {
fprintf(stderr,"Invalid character %c in hosts allow list (%s) for service %s.\n",
- hasstar ? *hasstar : *hasquery, allow_list[i], lp_servicename(s) );
+ hasstar ? *hasstar : *hasquery, allow_list[i], lp_servicename(talloc_tos(), s) );
}
}
}
@@ -302,7 +302,7 @@ static void do_per_share_checks(int s)
if(lp_level2_oplocks(s) && !lp_oplocks(s)) {
fprintf(stderr,"Invalid combination of parameters for service %s. \
Level II oplocks can only be set if oplocks are also set.\n",
- lp_servicename(s) );
+ lp_servicename(talloc_tos(), s) );
}
if (!lp_store_dos_attributes(s) && lp_map_hidden(s)
@@ -310,34 +310,34 @@ static void do_per_share_checks(int s)
{
fprintf(stderr,"Invalid combination of parameters for service "
"%s. Map hidden can only work if create mask includes "
- "octal 01 (S_IXOTH).\n", lp_servicename(s));
+ "octal 01 (S_IXOTH).\n", lp_servicename(talloc_tos(), s));
}
if (!lp_store_dos_attributes(s) && lp_map_hidden(s)
&& (lp_force_create_mode(s) & S_IXOTH))
{
fprintf(stderr,"Invalid combination of parameters for service "
"%s. Map hidden can only work if force create mode "
- "excludes octal 01 (S_IXOTH).\n", lp_servicename(s));
+ "excludes octal 01 (S_IXOTH).\n", lp_servicename(talloc_tos(), s));
}
if (!lp_store_dos_attributes(s) && lp_map_system(s)
&& !(lp_create_mask(s) & S_IXGRP))
{
fprintf(stderr,"Invalid combination of parameters for service "
"%s. Map system can only work if create mask includes "
- "octal 010 (S_IXGRP).\n", lp_servicename(s));
+ "octal 010 (S_IXGRP).\n", lp_servicename(talloc_tos(), s));
}
if (!lp_store_dos_attributes(s) && lp_map_system(s)
&& (lp_force_create_mode(s) & S_IXGRP))
{
fprintf(stderr,"Invalid combination of parameters for service "
"%s. Map system can only work if force create mode "
- "excludes octal 010 (S_IXGRP).\n", lp_servicename(s));
+ "excludes octal 010 (S_IXGRP).\n", lp_servicename(talloc_tos(), s));
}
#ifdef HAVE_CUPS
- if (lp_printing(s) == PRINT_CUPS && *(lp_printcommand(s)) != '\0') {
+ if (lp_printing(s) == PRINT_CUPS && *(lp_printcommand(talloc_tos(), s)) != '\0') {
fprintf(stderr,"Warning: Service %s defines a print command, but \
rameter is ignored when using CUPS libraries.\n",
- lp_servicename(s) );
+ lp_servicename(talloc_tos(), s) );
}
#endif
}
@@ -424,7 +424,7 @@ rameter is ignored when using CUPS libraries.\n",
for (s=0;s<1000;s++) {
if (VALID_SNUM(s))
- if (strlen(lp_servicename(s)) > 12) {
+ if (strlen(lp_servicename(talloc_tos(), s)) > 12) {
fprintf(stderr, "WARNING: You have some share names that are longer than 12 characters.\n" );
fprintf(stderr, "These may not be accessible to some older clients.\n" );
fprintf(stderr, "(Eg. Windows9x, WindowsMe, and smbclient prior to Samba 3.0.)\n" );
@@ -489,10 +489,10 @@ rameter is ignored when using CUPS libraries.\n",
if (allow_access(lp_hostsdeny(-1), lp_hostsallow(-1), cname, caddr)
&& allow_access(lp_hostsdeny(s), lp_hostsallow(s), cname, caddr)) {
fprintf(stderr,"Allow connection from %s (%s) to %s\n",
- cname,caddr,lp_servicename(s));
+ cname,caddr,lp_servicename(talloc_tos(), s));
} else {
fprintf(stderr,"Deny connection from %s (%s) to %s\n",
- cname,caddr,lp_servicename(s));
+ cname,caddr,lp_servicename(talloc_tos(), s));
}
}
}