diff options
author | Gerald Carter <jerry@samba.org> | 2003-09-09 04:07:32 +0000 |
---|---|---|
committer | Gerald Carter <jerry@samba.org> | 2003-09-09 04:07:32 +0000 |
commit | 4093bf7ff8c8861cf7b941945ede53a8ec5bb6c8 (patch) | |
tree | dd0a9f32d9933e1f75d919b5083e007d7453f9c4 /source3/torture | |
parent | 3d7cb49747a9a7f5cdec0ee05c6270ec3604202f (diff) | |
download | samba-4093bf7ff8c8861cf7b941945ede53a8ec5bb6c8.tar.gz samba-4093bf7ff8c8861cf7b941945ede53a8ec5bb6c8.tar.bz2 samba-4093bf7ff8c8861cf7b941945ede53a8ec5bb6c8.zip |
sync 3.0 into HEAD for the last time
(This used to be commit c17a7dc9a190156a069da3e861c18fd3f81224ad)
Diffstat (limited to 'source3/torture')
-rw-r--r-- | source3/torture/cmd_vfs.c | 15 | ||||
-rw-r--r-- | source3/torture/masktest.c | 2 | ||||
-rw-r--r-- | source3/torture/rpctorture.c | 4 | ||||
-rw-r--r-- | source3/torture/smbiconv.c | 16 |
4 files changed, 20 insertions, 17 deletions
diff --git a/source3/torture/cmd_vfs.c b/source3/torture/cmd_vfs.c index d91dbf50e0..8317a57a20 100644 --- a/source3/torture/cmd_vfs.c +++ b/source3/torture/cmd_vfs.c @@ -490,8 +490,8 @@ static NTSTATUS cmd_stat(struct vfs_state *vfs, TALLOC_CTX *mem_ctx, int argc, c int ret; const char *user; const char *group; - struct passwd *pwd; - struct group *grp; + struct passwd *pwd = NULL; + struct group *grp = NULL; SMB_STRUCT_STAT st; if (argc != 2) { @@ -533,6 +533,7 @@ static NTSTATUS cmd_stat(struct vfs_state *vfs, TALLOC_CTX *mem_ctx, int argc, c printf(" Access: %s", ctime(&(st.st_atime))); printf(" Modify: %s", ctime(&(st.st_mtime))); printf(" Change: %s", ctime(&(st.st_ctime))); + SAFE_FREE(pwd); SAFE_FREE(grp); return NT_STATUS_OK; @@ -544,8 +545,8 @@ static NTSTATUS cmd_fstat(struct vfs_state *vfs, TALLOC_CTX *mem_ctx, int argc, int fd; const char *user; const char *group; - struct passwd *pwd; - struct group *grp; + struct passwd *pwd = NULL; + struct group *grp = NULL; SMB_STRUCT_STAT st; if (argc != 2) { @@ -596,6 +597,7 @@ static NTSTATUS cmd_fstat(struct vfs_state *vfs, TALLOC_CTX *mem_ctx, int argc, printf(" Access: %s", ctime(&(st.st_atime))); printf(" Modify: %s", ctime(&(st.st_mtime))); printf(" Change: %s", ctime(&(st.st_ctime))); + SAFE_FREE(pwd); SAFE_FREE(grp); return NT_STATUS_OK; @@ -606,8 +608,8 @@ static NTSTATUS cmd_lstat(struct vfs_state *vfs, TALLOC_CTX *mem_ctx, int argc, { const char *user; const char *group; - struct passwd *pwd; - struct group *grp; + struct passwd *pwd = NULL; + struct group *grp = NULL; SMB_STRUCT_STAT st; if (argc != 2) { @@ -647,6 +649,7 @@ static NTSTATUS cmd_lstat(struct vfs_state *vfs, TALLOC_CTX *mem_ctx, int argc, printf(" Access: %s", ctime(&(st.st_atime))); printf(" Modify: %s", ctime(&(st.st_mtime))); printf(" Change: %s", ctime(&(st.st_ctime))); + SAFE_FREE(pwd); SAFE_FREE(grp); return NT_STATUS_OK; diff --git a/source3/torture/masktest.c b/source3/torture/masktest.c index fa901e3d63..8c44f35f95 100644 --- a/source3/torture/masktest.c +++ b/source3/torture/masktest.c @@ -140,7 +140,7 @@ static BOOL reg_match_one(struct cli_state *cli, const char *pattern, const char if (strcmp(file,"..") == 0) file = "."; - return ms_fnmatch(pattern, file, cli->protocol)==0; + return ms_fnmatch(pattern, file, cli->protocol, False /* not case sensitive */)==0; } static char *reg_test(struct cli_state *cli, char *pattern, char *long_name, char *short_name) diff --git a/source3/torture/rpctorture.c b/source3/torture/rpctorture.c index 8dfaebd64f..d95c0cee0f 100644 --- a/source3/torture/rpctorture.c +++ b/source3/torture/rpctorture.c @@ -193,7 +193,7 @@ static void usage(char *pname) fprintf(out_hnd, "Usage: %s service <password> [-d debuglevel] [-l log] ", pname); - fprintf(out_hnd, "\nVersion %s\n",VERSION); + fprintf(out_hnd, "\nVersion %s\n",SAMBA_VERSION_STRING); fprintf(out_hnd, "\t-d debuglevel set the debuglevel\n"); fprintf(out_hnd, "\t-l log basename. Basename for log/debug files\n"); fprintf(out_hnd, "\t-n netbios name. Use this name as my netbios name\n"); @@ -489,7 +489,7 @@ enum client_action strupper_m(global_myname); fstrcpy(cli_info.myhostname, global_myname); - DEBUG(3,("%s client started (version %s)\n",timestring(False),VERSION)); + DEBUG(3,("%s client started (version %s)\n",timestring(False),SAMBA_VERSION_STRING)); if (*smb_cli->domain == 0) { diff --git a/source3/torture/smbiconv.c b/source3/torture/smbiconv.c index 3524136fb1..1dd168b0bb 100644 --- a/source3/torture/smbiconv.c +++ b/source3/torture/smbiconv.c @@ -24,7 +24,7 @@ #include "includes.h" static int -process_block (smb_iconv_t cd, char *addr, size_t len, FILE *output) +process_block (smb_iconv_t cd, const char *addr, size_t len, FILE *output) { #define OUTBUF_SIZE 32768 const char *start = addr; @@ -37,7 +37,7 @@ process_block (smb_iconv_t cd, char *addr, size_t len, FILE *output) { outptr = outbuf; outlen = OUTBUF_SIZE; - n = smb_iconv (cd, &addr, &len, &outptr, &outlen); + n = smb_iconv (cd, &addr, &len, &outptr, &outlen); if (outptr != outbuf) { @@ -171,7 +171,7 @@ int main(int argc, char *argv[]) char *from = ""; char *to = ""; char *output = NULL; - char *preload = NULL; + const char *preload_modules[] = {NULL, NULL}; FILE *out = stdout; int fd; smb_iconv_t cd; @@ -184,7 +184,7 @@ int main(int argc, char *argv[]) { "from-code", 'f', POPT_ARG_STRING, &from, 0, "Encoding of original text" }, { "to-code", 't', POPT_ARG_STRING, &to, 0, "Encoding for output" }, { "output", 'o', POPT_ARG_STRING, &output, 0, "Write output to this file" }, - { "preload-modules", 'p', POPT_ARG_STRING, &preload, 0, "Modules to load" }, + { "preload-modules", 'p', POPT_ARG_STRING, &preload_modules[0], 0, "Modules to load" }, POPT_COMMON_SAMBA POPT_TABLEEND }; @@ -202,12 +202,12 @@ int main(int argc, char *argv[]) facilities. See lib/debug.c */ setup_logging("smbiconv", True); - if(preload)smb_load_modules(str_list_make(preload, NULL)); + if (preload_modules[0]) smb_load_modules(preload_modules); if(output) { - output = fopen(output, "w"); + out = fopen(output, "w"); - if(!output) { + if(!out) { DEBUG(0, ("Can't open output file '%s': %s, exiting...\n", output, strerror(errno))); return 1; } @@ -231,7 +231,7 @@ int main(int argc, char *argv[]) } /* Loop thru all arguments */ - process_fd(cd, fd, stdout); + process_fd(cd, fd, out); close(fd); } |