static int free_gssapi_creds(struct gssapi_creds_container *gcc)
{
- OM_uint32 min_stat, maj_stat;
- maj_stat = gss_release_cred(&min_stat, &gcc->creds);
+ OM_uint32 min_stat;
+ (void)gss_release_cred(&min_stat, &gcc->creds);
return 0;
}
const char *machine_account;
const char *password;
- const char *old_password;
const char *domain;
const char *realm;
enum netr_SchannelType sct;
}
password = ldb_msg_find_attr_as_string(msg, "secret", NULL);
- old_password = ldb_msg_find_attr_as_string(msg, "priorSecret", NULL);
machine_account = ldb_msg_find_attr_as_string(msg, "samAccountName", NULL);
_start_timer();
do {
long int r = random();
- TDB_DATA key, dbuf;
+ TDB_DATA key;
key.dptr = discard_const_p(uint8_t, str);
key.dsize = strlen((char *)key.dptr);
- dbuf.dptr = (uint8_t *) &r;
- dbuf.dsize = sizeof(r);
tdb_fetch(tdb, key);
t = _end_timer();
ops++;
struct samba_runcmd_state *state;
int p1[2], p2[2];
char **argv;
- int ret;
va_list ap;
req = tevent_req_create(mem_ctx, &state,
}
va_end(ap);
- ret = execvp(state->arg0, argv);
+ (void)execvp(state->arg0, argv);
fprintf(stderr, "Failed to exec child - %s\n", strerror(errno));
_exit(255);
return NULL;
size_t size;
time_t c_time, a_time, m_time;
- uint16_t orig_vuid;
NTSTATUS result;
smbcli_unlink(cli->tree, fname);
fnum = smbcli_open(cli->tree, fname,
O_RDWR | O_CREAT | O_TRUNC, DENY_NONE);
- orig_vuid = cli->session->vuid;
-
cli->session->vuid += 1234;
torture_comment(tctx, "Testing qfileinfo with wrong vuid\n");
struct smbcli_state *cli,
struct smbcli_state *cli2)
{
- union smb_fileinfo finfo0, finfo1, finfo2, finfo3, finfo4;
- union smb_fileinfo pinfo0, pinfo1, pinfo2, pinfo3, pinfo4, pinfo5;
+ union smb_fileinfo finfo0, finfo1, finfo2, finfo3;
+ union smb_fileinfo pinfo0, pinfo1, pinfo2, pinfo3, pinfo4;
const char *fname = BASEDIR "\\torture_file3.txt";
int fnum1 = -1;
bool ret = true;
finfo1 = finfo0;
finfo2 = finfo0;
finfo3 = finfo0;
- finfo4 = finfo0;
pinfo0.basic_info.level = RAW_FILEINFO_BASIC_INFO;
pinfo0.basic_info.in.file.path = fname;
pinfo1 = pinfo0;
pinfo2 = pinfo0;
pinfo3 = pinfo0;
pinfo4 = pinfo0;
- pinfo5 = pinfo0;
/* get the initial times */
GET_INFO_BOTH(finfo0,pinfo0);
struct smbcli_state *cli,
struct smbcli_state *cli2)
{
- union smb_fileinfo finfo0, finfo1, finfo2, finfo3, finfo4;
- union smb_fileinfo pinfo0, pinfo1, pinfo2, pinfo3, pinfo4, pinfo5;
+ union smb_fileinfo finfo0, finfo1, finfo2, finfo3;
+ union smb_fileinfo pinfo0, pinfo1, pinfo2, pinfo3, pinfo4;
const char *fname = BASEDIR "\\torture_file3a.txt";
int fnum1 = -1;
bool ret = true;
finfo1 = finfo0;
finfo2 = finfo0;
finfo3 = finfo0;
- finfo4 = finfo0;
pinfo0.basic_info.level = RAW_FILEINFO_BASIC_INFO;
pinfo0.basic_info.in.file.path = fname;
pinfo1 = pinfo0;
pinfo2 = pinfo0;
pinfo3 = pinfo0;
pinfo4 = pinfo0;
- pinfo5 = pinfo0;
/* get the initial times */
GET_INFO_BOTH(finfo0,pinfo0);
struct smbcli_state *cli,
struct smbcli_state *cli2)
{
- union smb_fileinfo finfo0, finfo1, finfo2, finfo3, finfo4;
- union smb_fileinfo pinfo0, pinfo1, pinfo2, pinfo3, pinfo4, pinfo5;
+ union smb_fileinfo finfo0, finfo1, finfo2, finfo3;
+ union smb_fileinfo pinfo0, pinfo1, pinfo2, pinfo3, pinfo4;
const char *fname = BASEDIR "\\torture_file3b.txt";
int fnum1 = -1;
bool ret = true;
finfo1 = finfo0;
finfo2 = finfo0;
finfo3 = finfo0;
- finfo4 = finfo0;
pinfo0.basic_info.level = RAW_FILEINFO_BASIC_INFO;
pinfo0.basic_info.in.file.path = fname;
pinfo1 = pinfo0;
pinfo2 = pinfo0;
pinfo3 = pinfo0;
pinfo4 = pinfo0;
- pinfo5 = pinfo0;
/* get the initial times */
GET_INFO_BOTH(finfo0,pinfo0);
struct smbcli_state *cli,
struct smbcli_state *cli2)
{
- union smb_fileinfo finfo0, finfo1, finfo2, finfo3, finfo4;
- union smb_fileinfo pinfo0, pinfo1, pinfo2, pinfo3, pinfo4, pinfo5;
+ union smb_fileinfo finfo0, finfo1, finfo2, finfo3;
+ union smb_fileinfo pinfo0, pinfo1, pinfo2, pinfo3, pinfo4;
const char *fname = BASEDIR "\\torture_file4.txt";
int fnum1 = -1;
bool ret = true;
finfo1 = finfo0;
finfo2 = finfo0;
finfo3 = finfo0;
- finfo4 = finfo0;
pinfo0.basic_info.level = RAW_FILEINFO_BASIC_INFO;
pinfo0.basic_info.in.file.path = fname;
pinfo1 = pinfo0;
pinfo2 = pinfo0;
pinfo3 = pinfo0;
pinfo4 = pinfo0;
- pinfo5 = pinfo0;
/* get the initial times */
GET_INFO_BOTH(finfo0,pinfo0);
int dnum1 = -1;
int dnum2 = -1;
bool correct = true;
- NTSTATUS status;
del_clean_area(cli1, cli2);
__location__);
/* Set delete on close */
- status = smbcli_nt_delete_on_close(cli1->tree, dnum1, true);
+ (void)smbcli_nt_delete_on_close(cli1->tree, dnum1, true);
/* Attempt opening the directory again. It should fail. */
dnum2 = smbcli_nt_create_full(cli1->tree, dname, 0,
static bool test_disconnect_open(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
{
union smb_open io;
- NTSTATUS status;
struct smbcli_request *req1, *req2;
+ NTSTATUS status;
printf("trying open/disconnect\n");
io.ntcreatex.in.share_access = 0;
req1 = smb_raw_open_send(cli->tree, &io);
req2 = smb_raw_open_send(cli->tree, &io);
+ if (!req1 || !req2) {
+ printf("test_disconnect_open: smb_raw_open_send() "
+ "returned NULL\n");
+ return false;
+ }
status = smbcli_chkpath(cli->tree, "\\");
CHECK_STATUS(status, NT_STATUS_OK);
lock[0].pid = 2;
io.lockx.in.timeout = 3000;
req = smb_raw_lock_send(cli->tree, &io);
+ if (!req) {
+ printf("test_disconnect_lock: smb_raw_lock_send() "
+ "returned NULL\n");
+ return false;
+ }
status = smbcli_chkpath(cli->tree, "\\");
CHECK_STATUS(status, NT_STATUS_OK);
NTSTATUS status;
bool ret = true;
int fnum = -1;
- int fnum1 = -1;
io.chkpath.in.path = BASEDIR;
/* We expect this open to fail with the same error code as the chkpath below. */
printf("Testing Open on %s\n", "\\.\\\\\\\\\\\\.");
/* findfirst seems to fail with a different error. */
- fnum1 = smbcli_nt_create_full(cli->tree, "\\.\\\\\\\\\\\\.",
+ (void)smbcli_nt_create_full(cli->tree, "\\.\\\\\\\\\\\\.",
0, SEC_RIGHTS_FILE_ALL,
FILE_ATTRIBUTE_NORMAL,
NTCREATEX_SHARE_ACCESS_DELETE|
/* We expect this open to fail with the same error code as the chkpath below. */
printf("Testing Open on %s\n", BASEDIR".\\.\\.\\.\\foo\\..\\.\\");
/* findfirst seems to fail with a different error. */
- fnum1 = smbcli_nt_create_full(cli->tree, BASEDIR".\\.\\.\\.\\foo\\..\\.\\",
+ (void)smbcli_nt_create_full(cli->tree, BASEDIR".\\.\\.\\.\\foo\\..\\.\\",
0, SEC_RIGHTS_FILE_ALL,
FILE_ATTRIBUTE_NORMAL,
NTCREATEX_SHARE_ACCESS_DELETE|
/* We expect this open to fail with the same error code as the chkpath below. */
/* findfirst seems to fail with a different error. */
printf("Testing Open on %s\n", BASEDIR "\\nt\\V S\\VB98\\vb6.exe\\3");
- fnum1 = smbcli_nt_create_full(cli->tree, BASEDIR "\\nt\\V S\\VB98\\vb6.exe\\3",
+ (void)smbcli_nt_create_full(cli->tree, BASEDIR "\\nt\\V S\\VB98\\vb6.exe\\3",
0, SEC_RIGHTS_FILE_ALL,
FILE_ATTRIBUTE_NORMAL,
NTCREATEX_SHARE_ACCESS_DELETE|
int fnum1;
const char *fname = BASEDIR "\\stacking.txt";
struct smb_lock_entry lock1;
- struct smb_lock_entry lock2;
torture_comment(tctx, "Testing stacking:\n");
lock1.pid = cli->session->pid;
lock1.offset = 0;
lock1.count = 10;
- lock2.pid = cli->session->pid - 1;
- lock2.offset = 0;
- lock2.count = 10;
/**
* Try to take a shared lock, then stack an exclusive.
NTSTATUS status;
union smb_notify notify;
union smb_open io;
- int fnum, fnum2;
+ int fnum;
struct smbcli_request *req;
extern int torture_numops;
struct smbcli_tree *tree = NULL;
status = smb_raw_open(cli->tree, torture, &io);
CHECK_STATUS(status, NT_STATUS_OK);
- fnum2 = io.ntcreatex.out.file.fnum;
/* ask for a change notify,
on file or directory name changes */
/*int fname, f;*/
bool ret = true;
uint8_t buf[1000];
- bool correct = true;
union smb_open io;
NTSTATUS status;
uint16_t fnum=0;
sizeof(buf))
{
torture_comment(tctx, "Failed to create file\n");
- correct = false;
goto done;
}
/*int fname, f;*/
bool ret = true;
uint8_t buf[1000];
- bool correct = true;
union smb_open io;
NTSTATUS status;
uint16_t fnum=0;
sizeof(buf))
{
torture_comment(tctx, "Failed to create file\n");
- correct = false;
goto done;
}
const char *fname = BASEDIR "\\test_batch_brl.dat";
bool ret = true;
uint8_t buf[1000];
- bool correct = true;
union smb_open io;
NTSTATUS status;
uint16_t fnum = 0;
sizeof(buf))
{
torture_comment(tctx, "Failed to create file\n");
- correct = false;
goto done;
}
sfinfo.disposition_info.in.file.fnum = fnum;
sfinfo.disposition_info.in.delete_on_close = 1;
req = smb_raw_setfileinfo_send(ud_cli_state->cli1->tree, &sfinfo);
+ if (!req) {
+ torture_comment(ud_cli_state->tctx, "smb_raw_setfileinfo_send "
+ "failed.");
+ }
smbcli_close(ud_cli_state->cli1->tree, fnum);
bool ret = true;
union smb_open io;
union smb_unlink unl;
- uint16_t fnum=0;
struct unlink_defer_cli_state ud_cli_state = {};
if (!torture_setup_dir(cli1, BASEDIR)) {
status = smb_raw_open(cli1->tree, tctx, &io);
CHECK_STATUS(status, NT_STATUS_OK);
- fnum = io.ntcreatex.out.file.fnum;
/* cli2: Try to unlink it, but block on the oplock */
torture_comment(tctx, "Try an unlink (should defer the open\n");