diff options
author | Jeremy Allison <jra@samba.org> | 2007-12-03 18:48:41 -0800 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2007-12-03 18:48:41 -0800 |
commit | adf6d848de8ae32a83c7271d8ccd24d2cf8b47f7 (patch) | |
tree | a6b9ac6f4175a10b4e71829d61db9e076aad969e /source3/utils/testparm.c | |
parent | 328a57e1ca5fc0e0206fdb565d5951912e84dc5e (diff) | |
download | samba-adf6d848de8ae32a83c7271d8ccd24d2cf8b47f7.tar.gz samba-adf6d848de8ae32a83c7271d8ccd24d2cf8b47f7.tar.bz2 samba-adf6d848de8ae32a83c7271d8ccd24d2cf8b47f7.zip |
Getting to the home stretch for elimination of pstrings...
Jeremy.
(This used to be commit 041163551194102ca67fef52c57d87020a1d09bc)
Diffstat (limited to 'source3/utils/testparm.c')
-rw-r--r-- | source3/utils/testparm.c | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/source3/utils/testparm.c b/source3/utils/testparm.c index 30e6b2f502..aa519565ad 100644 --- a/source3/utils/testparm.c +++ b/source3/utils/testparm.c @@ -82,18 +82,19 @@ cannot be set in the smb.conf file. nmbd will abort with this setting.\n"); */ if((lp_security() == SEC_SERVER || lp_security() >= SEC_DOMAIN) && !lp_passwordserver()) { - pstring sec_setting; + const char *sec_setting; if(lp_security() == SEC_SERVER) - pstrcpy(sec_setting, "server"); + sec_setting = "server"; else if(lp_security() == SEC_DOMAIN) - pstrcpy(sec_setting, "domain"); + sec_setting = "domain"; + else + sec_setting = ""; fprintf(stderr, "ERROR: The setting 'security=%s' requires the 'password server' parameter be set \ to a valid password server.\n", sec_setting ); ret = 1; } - /* * Password chat sanity checks. */ @@ -113,16 +114,17 @@ to a valid password server.\n", sec_setting ); parameter.\n" ); ret = 1; } else { - pstring passwd_prog; - pstring truncated_prog; + const char *passwd_prog; + char *truncated_prog = NULL; const char *p; - pstrcpy( passwd_prog, lp_passwd_program()); + passwd_prog = lp_passwd_program(); p = passwd_prog; *truncated_prog = '\0'; - next_token(&p, truncated_prog, NULL, sizeof(pstring)); - - if(access(truncated_prog, F_OK) == -1) { + next_token_talloc(talloc_tos(), + &p, + &truncated_prog, NULL); + if (truncated_prog && access(truncated_prog, F_OK) == -1) { fprintf(stderr, "ERROR: the 'unix password sync' parameter is set and the 'passwd program' (%s) \ cannot be executed (error was %s).\n", truncated_prog, strerror(errno) ); ret = 1; |