summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source4/lib/charcnv.c2
-rw-r--r--source4/lib/tdb/tdb.c4
-rw-r--r--source4/lib/tdb/tdb.h2
-rw-r--r--source4/lib/util_sock.c5
-rw-r--r--source4/lib/util_str.c3
-rw-r--r--source4/lib/util_unistr.c6
-rw-r--r--source4/lib/util_uuid.c1
-rw-r--r--source4/libcli/raw/rawtrans.c5
-rw-r--r--source4/locking/brlock.c2
-rw-r--r--source4/printing/printing.c2
-rw-r--r--source4/tdb/tdb.c4
-rw-r--r--source4/tdb/tdb.h2
-rw-r--r--source4/torture/masktest.c2
-rw-r--r--source4/torture/nbio.c4
-rw-r--r--source4/torture/raw/rename.c1
-rw-r--r--source4/torture/raw/search.c9
-rw-r--r--source4/torture/torture.c10
-rw-r--r--source4/web/neg_lang.c2
-rw-r--r--source4/wrepld/server.c2
19 files changed, 27 insertions, 41 deletions
diff --git a/source4/lib/charcnv.c b/source4/lib/charcnv.c
index 622de26ab8..72277b4f2e 100644
--- a/source4/lib/charcnv.c
+++ b/source4/lib/charcnv.c
@@ -151,7 +151,7 @@ ssize_t convert_string(charset_t from, charset_t to,
o_len=destlen;
retval = smb_iconv(descriptor, &inbuf, &i_len, &outbuf, &o_len);
if(retval==(size_t)-1) {
- const char *reason="unknown error";
+ const char *reason;
switch(errno) {
case EINVAL:
reason="Incomplete multibyte sequence";
diff --git a/source4/lib/tdb/tdb.c b/source4/lib/tdb/tdb.c
index 097209ff7a..513fbce519 100644
--- a/source4/lib/tdb/tdb.c
+++ b/source4/lib/tdb/tdb.c
@@ -166,9 +166,9 @@ struct list_struct {
a blocking lock on SIGALRM.
***************************************************************/
-static sig_atomic_t *palarm_fired;
+static SIG_ATOMIC_T *palarm_fired;
-void tdb_set_lock_alarm(sig_atomic_t *palarm)
+void tdb_set_lock_alarm(SIG_ATOMIC_T *palarm)
{
palarm_fired = palarm;
}
diff --git a/source4/lib/tdb/tdb.h b/source4/lib/tdb/tdb.h
index 6f3b1ff756..720066f1b3 100644
--- a/source4/lib/tdb/tdb.h
+++ b/source4/lib/tdb/tdb.h
@@ -127,7 +127,7 @@ int tdb_lockall(TDB_CONTEXT *tdb);
void tdb_unlockall(TDB_CONTEXT *tdb);
/* Low level locking functions: use with care */
-void tdb_set_lock_alarm(sig_atomic_t *palarm);
+void tdb_set_lock_alarm(SIG_ATOMIC_T *palarm);
int tdb_chainlock(TDB_CONTEXT *tdb, TDB_DATA key);
int tdb_chainunlock(TDB_CONTEXT *tdb, TDB_DATA key);
diff --git a/source4/lib/util_sock.c b/source4/lib/util_sock.c
index 42dc04f6c8..8362290804 100644
--- a/source4/lib/util_sock.c
+++ b/source4/lib/util_sock.c
@@ -439,7 +439,6 @@ static BOOL matchname(char *remotehost, struct in_addr addr)
char *get_socket_name(TALLOC_CTX *mem_ctx, int fd, BOOL force_lookup)
{
char *name_buf;
- char *addr_buf;
struct hostent *hp;
struct in_addr addr;
char *p;
@@ -457,8 +456,6 @@ char *get_socket_name(TALLOC_CTX *mem_ctx, int fd, BOOL force_lookup)
name_buf = talloc_strdup(mem_ctx, "UNKNOWN");
if (fd == -1) return name_buf;
- addr_buf = talloc_strdup(mem_ctx, p);
-
addr = *interpret_addr2(mem_ctx, p);
/* Look up the remote host name. */
@@ -473,7 +470,7 @@ char *get_socket_name(TALLOC_CTX *mem_ctx, int fd, BOOL force_lookup)
}
}
- alpha_strcpy(name_buf, name_buf, "_-.", sizeof(name_buf));
+ alpha_strcpy(name_buf, name_buf, "_-.", strlen(name_buf)+1);
if (strstr(name_buf,"..")) {
name_buf = talloc_strdup(mem_ctx, "UNKNOWN");
}
diff --git a/source4/lib/util_str.c b/source4/lib/util_str.c
index 19857cff86..f689ae4355 100644
--- a/source4/lib/util_str.c
+++ b/source4/lib/util_str.c
@@ -651,11 +651,8 @@ BOOL in_list(const char *s, const char *list, BOOL casesensitive)
**/
static BOOL string_init(char **dest,const char *src)
{
- size_t l;
if (!src) src = "";
- l = strlen(src);
-
(*dest) = strdup(src);
if ((*dest) == NULL) {
DEBUG(0,("Out of memory in string_init\n"));
diff --git a/source4/lib/util_unistr.c b/source4/lib/util_unistr.c
index e5d2b8c3db..71a67eb159 100644
--- a/source4/lib/util_unistr.c
+++ b/source4/lib/util_unistr.c
@@ -383,10 +383,9 @@ wide strstr()
const smb_ucs2_t *strstr_w(const smb_ucs2_t *s, const smb_ucs2_t *ins)
{
const smb_ucs2_t *r;
- size_t slen, inslen;
+ size_t inslen;
if (!s || !*s || !ins || !*ins) return NULL;
- slen = strlen_w(s);
inslen = strlen_w(ins);
r = s;
while ((r = strchr_w(r, *ins))) {
@@ -663,10 +662,9 @@ const smb_ucs2_t *strpbrk_wa(const smb_ucs2_t *s, const char *p)
const smb_ucs2_t *strstr_wa(const smb_ucs2_t *s, const char *ins)
{
const smb_ucs2_t *r;
- size_t slen, inslen;
+ size_t inslen;
if (!s || !*s || !ins || !*ins) return NULL;
- slen = strlen_w(s);
inslen = strlen(ins);
r = s;
while ((r = strchr_w(r, UCS2_CHAR(*ins)))) {
diff --git a/source4/lib/util_uuid.c b/source4/lib/util_uuid.c
index 76eb93a9b8..25b51af6ba 100644
--- a/source4/lib/util_uuid.c
+++ b/source4/lib/util_uuid.c
@@ -93,7 +93,6 @@ const char *uuid_string(TALLOC_CTX *mem_ctx, const GUID in)
char *out;
uuid_unpack(in, &uu);
- if (!out) return NULL;
out = talloc_asprintf(mem_ctx,
"%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x",
uu.time_low, uu.time_mid, uu.time_hi_and_version,
diff --git a/source4/libcli/raw/rawtrans.c b/source4/libcli/raw/rawtrans.c
index 508f920268..f8076f7133 100644
--- a/source4/libcli/raw/rawtrans.c
+++ b/source4/libcli/raw/rawtrans.c
@@ -206,7 +206,6 @@ struct cli_request *smb_raw_trans2_send(struct cli_tree *tree,
int wct = 14 + parms->in.setup_count;
struct cli_request *req;
char *outdata,*outparam;
- int data_sent, param_sent;
int i;
const int padding = 3;
@@ -216,10 +215,8 @@ struct cli_request *smb_raw_trans2_send(struct cli_tree *tree,
}
/* fill in SMB parameters */
- data_sent = parms->in.data.length;
- param_sent = parms->in.params.length;
outparam = req->out.data + padding;
- outdata = outparam + param_sent;
+ outdata = outparam + parms->in.params.length;
/* make sure we don't leak data via the padding */
memset(req->out.data, 0, padding);
diff --git a/source4/locking/brlock.c b/source4/locking/brlock.c
index 4cd885f1a6..94783b4fb8 100644
--- a/source4/locking/brlock.c
+++ b/source4/locking/brlock.c
@@ -367,7 +367,7 @@ NTSTATUS brl_lock(SMB_DEV_T dev, SMB_INO_T ino, int fnum,
#if ZERO_ZERO
/* sort the lock list */
- qsort(dbuf.dptr, dbuf.dsize/sizeof(lock), sizeof(lock), lock_compare);
+ qsort(dbuf.dptr, dbuf.dsize/sizeof(lock), sizeof(lock), QSORT_CAST lock_compare);
#endif
tdb_store(tdb, kbuf, dbuf, TDB_REPLACE);
diff --git a/source4/printing/printing.c b/source4/printing/printing.c
index 26ea52e35a..e4d9e5f785 100644
--- a/source4/printing/printing.c
+++ b/source4/printing/printing.c
@@ -2030,7 +2030,7 @@ int print_queue_status(int snum,
in hash order. */
qsort(tstruct.queue, tstruct.qcount, sizeof(print_queue_struct),
- QSORT_CAST(printjob_comp));
+ QSORT_CAST printjob_comp);
*queue = tstruct.queue;
return tstruct.qcount;
diff --git a/source4/tdb/tdb.c b/source4/tdb/tdb.c
index 097209ff7a..513fbce519 100644
--- a/source4/tdb/tdb.c
+++ b/source4/tdb/tdb.c
@@ -166,9 +166,9 @@ struct list_struct {
a blocking lock on SIGALRM.
***************************************************************/
-static sig_atomic_t *palarm_fired;
+static SIG_ATOMIC_T *palarm_fired;
-void tdb_set_lock_alarm(sig_atomic_t *palarm)
+void tdb_set_lock_alarm(SIG_ATOMIC_T *palarm)
{
palarm_fired = palarm;
}
diff --git a/source4/tdb/tdb.h b/source4/tdb/tdb.h
index 6f3b1ff756..720066f1b3 100644
--- a/source4/tdb/tdb.h
+++ b/source4/tdb/tdb.h
@@ -127,7 +127,7 @@ int tdb_lockall(TDB_CONTEXT *tdb);
void tdb_unlockall(TDB_CONTEXT *tdb);
/* Low level locking functions: use with care */
-void tdb_set_lock_alarm(sig_atomic_t *palarm);
+void tdb_set_lock_alarm(SIG_ATOMIC_T *palarm);
int tdb_chainlock(TDB_CONTEXT *tdb, TDB_DATA key);
int tdb_chainunlock(TDB_CONTEXT *tdb, TDB_DATA key);
diff --git a/source4/torture/masktest.c b/source4/torture/masktest.c
index f8d19697cb..7906684169 100644
--- a/source4/torture/masktest.c
+++ b/source4/torture/masktest.c
@@ -22,7 +22,6 @@
static fstring password;
static fstring username;
-static int got_pass;
static int max_protocol = PROTOCOL_NT1;
static BOOL showall = False;
static BOOL old_list = False;
@@ -417,7 +416,6 @@ static void usage(void)
if (p) {
*p = 0;
fstrcpy(password, p+1);
- got_pass = 1;
}
break;
case 's':
diff --git a/source4/torture/nbio.c b/source4/torture/nbio.c
index ef231478d0..e2986cf14e 100644
--- a/source4/torture/nbio.c
+++ b/source4/torture/nbio.c
@@ -258,9 +258,11 @@ void nb_findfirst(const char *mask)
void nb_flush(int fnum)
{
+ struct smb_flush io;
int i;
i = find_handle(fnum);
- /* hmmm, we don't have cli_flush() yet */
+ io.in.fnum = ftable[i].fd;
+ smb_raw_flush(c->tree, &io);
}
void nb_deltree(const char *dname)
diff --git a/source4/torture/raw/rename.c b/source4/torture/raw/rename.c
index 1766511ee6..b536b0fe1a 100644
--- a/source4/torture/raw/rename.c
+++ b/source4/torture/raw/rename.c
@@ -118,6 +118,7 @@ static BOOL test_mv(struct cli_state *cli, TALLOC_CTX *mem_ctx)
CHECK_STATUS(status, NT_STATUS_OK);
done:
+ cli_close(cli, fnum);
smb_raw_exit(cli->session);
cli_deltree(cli, BASEDIR);
return ret;
diff --git a/source4/torture/raw/search.c b/source4/torture/raw/search.c
index 6035689ec2..c9fa5d6a11 100644
--- a/source4/torture/raw/search.c
+++ b/source4/torture/raw/search.c
@@ -546,11 +546,14 @@ static BOOL test_many_files(struct cli_state *cli, TALLOC_CTX *mem_ctx)
CHECK_VALUE(result.count, num_files);
if (search_types[t].level == RAW_SEARCH_BOTH_DIRECTORY_INFO) {
- qsort(result.list, result.count, sizeof(result.list[0]), search_both_compare);
+ qsort(result.list, result.count, sizeof(result.list[0]),
+ QSORT_CAST search_both_compare);
} else if (search_types[t].level == RAW_SEARCH_STANDARD) {
- qsort(result.list, result.count, sizeof(result.list[0]), search_standard_compare);
+ qsort(result.list, result.count, sizeof(result.list[0]),
+ QSORT_CAST search_standard_compare);
} else {
- qsort(result.list, result.count, sizeof(result.list[0]), search_old_compare);
+ qsort(result.list, result.count, sizeof(result.list[0]),
+ QSORT_CAST search_old_compare);
}
for (i=0;i<num_files;i++) {
diff --git a/source4/torture/torture.c b/source4/torture/torture.c
index 1ec73e0dff..c928846f1f 100644
--- a/source4/torture/torture.c
+++ b/source4/torture/torture.c
@@ -31,7 +31,6 @@ static BOOL use_oplocks;
static BOOL use_level_II_oplocks;
static const char *client_txt = "client_oplocks.txt";
static BOOL use_kerberos;
-static BOOL bypass_io;
BOOL torture_showall = False;
@@ -4050,7 +4049,6 @@ static void usage(void)
{
int opt, i;
char *p;
- int gotuser = 0;
BOOL correct = True;
char *host, *share, *username;
@@ -4097,7 +4095,7 @@ static void usage(void)
srandom(time(NULL));
- while ((opt = getopt(argc, argv, "p:hW:U:n:N:O:o:e:m:Ld:Ac:ks:f:bs:")) != EOF) {
+ while ((opt = getopt(argc, argv, "p:hW:U:n:N:O:o:e:m:Ld:Ac:ks:f:s:")) != EOF) {
switch (opt) {
case 'p':
lp_set_cmdline("smb ports", optarg);
@@ -4148,16 +4146,12 @@ static void usage(void)
#endif
break;
case 'U':
- gotuser = 1;
parse_user(optarg);
break;
case 'f':
torture_failures = atoi(optarg);
break;
- case 'b':
- bypass_io = True;
- break;
-
+
default:
printf("Unknown option %c (%d)\n", (char)opt, opt);
usage();
diff --git a/source4/web/neg_lang.c b/source4/web/neg_lang.c
index da974f78a4..b09ab7b452 100644
--- a/source4/web/neg_lang.c
+++ b/source4/web/neg_lang.c
@@ -99,7 +99,7 @@ void web_set_lang(const char *lang_string)
}
str_list_free(&lang_list);
- qsort(pl, lang_num, sizeof(struct pri_list), &qsort_cmp_list);
+ qsort(pl, lang_num, sizeof(struct pri_list), QSORT_CAST qsort_cmp_list);
/* it's not an error to not initialise - we just fall back to
the default */
diff --git a/source4/wrepld/server.c b/source4/wrepld/server.c
index f49596dc41..c4157f710e 100644
--- a/source4/wrepld/server.c
+++ b/source4/wrepld/server.c
@@ -80,7 +80,7 @@ BOOL reload_services(BOOL test)
Catch a sighup.
****************************************************************************/
-VOLATILE sig_atomic_t reload_after_sighup = False;
+VOLATILE SIG_ATOMIC_T reload_after_sighup = False;
static void sig_hup(int sig)
{