Skip to content

Commit 5b223fe

Browse files
committed
cosmetic: milter: consistently use unsigned
1 parent d023a89 commit 5b223fe

File tree

7 files changed

+55
-54
lines changed

7 files changed

+55
-54
lines changed

openarc/config.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
struct config
2828
{
2929
bool cfg_bool;
30-
u_int cfg_type;
30+
unsigned int cfg_type;
3131
int cfg_int;
3232
char *cfg_name;
3333
char *cfg_string;
@@ -36,9 +36,9 @@ struct config
3636

3737
struct configdef
3838
{
39-
char *cd_name;
40-
u_int cd_type;
41-
bool cd_req;
39+
char *cd_name;
40+
unsigned int cd_type;
41+
bool cd_req;
4242
};
4343

4444
/* prototypes */

openarc/openarc-config.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ struct configdef arcf_config[] = {
5050
{"TestKeys", CONFIG_TYPE_STRING, false},
5151
{"UMask", CONFIG_TYPE_INTEGER, false},
5252
{"UserID", CONFIG_TYPE_STRING, false},
53-
{NULL, (u_int) -1, false}
53+
{NULL, (unsigned int) -1, false}
5454
};
5555

5656
#endif /* _ARC_CONFIG_H_ */

openarc/openarc-test.c

+3-2
Original file line numberDiff line numberDiff line change
@@ -530,7 +530,8 @@ arcf_testfile(ARC_LIB *libopenarc,
530530

531531
if (len + buflen >= (int) sizeof buf - 3)
532532
{
533-
ms = mlfi_body((SMFICTX *) tctx, (u_char *) buf, strlen(buf));
533+
ms = mlfi_body((SMFICTX *) tctx, (unsigned char *) buf,
534+
strlen(buf));
534535
if (MLFI_OUTPUT(ms, tverbose))
535536
{
536537
fprintf(stderr, "%s: %s: mlfi_body() returned %s\n",
@@ -618,7 +619,7 @@ arcf_testfile(ARC_LIB *libopenarc,
618619
/* some body left */
619620
if (!inheaders && buf[0] != '\0')
620621
{
621-
ms = mlfi_body((SMFICTX *) tctx, (u_char *) buf, strlen(buf));
622+
ms = mlfi_body((SMFICTX *) tctx, (unsigned char *) buf, strlen(buf));
622623
if (MLFI_OUTPUT(ms, tverbose))
623624
{
624625
fprintf(stderr, "%s: %s: mlfi_body() returned %s\n", progname, file,

openarc/openarc.c

+43-43
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,8 @@ struct arcf_config
113113
bool conf_finalreceiver; /* act as final receiver */
114114
bool conf_overridecv; /* allow A-R to override CV */
115115
bool conf_authresip; /* include remote IP in A-R */
116-
u_int conf_refcnt; /* reference count */
117-
u_int conf_mode; /* mode flags */
116+
unsigned int conf_refcnt; /* reference count */
117+
unsigned int conf_mode; /* mode flags */
118118
arc_canon_t conf_canonhdr; /* canonicalization for header */
119119
arc_canon_t conf_canonbody; /* canonicalization for body */
120120
arc_alg_t conf_signalg; /* signing algorithm */
@@ -130,7 +130,7 @@ struct arcf_config
130130
const char **conf_signhdrs; /* headers to sign (array) */
131131
char *conf_oversignhdrs_raw; /* fields to over-sign (raw) */
132132
const char **conf_oversignhdrs; /* fields to over-sign (array) */
133-
u_char *conf_keydata; /* binary key data */
133+
unsigned char *conf_keydata; /* binary key data */
134134
size_t conf_keylen; /* key length */
135135
int conf_maxhdrsz; /* max. header size */
136136
struct config *conf_data; /* configuration data */
@@ -149,7 +149,7 @@ struct msgctx
149149
{
150150
bool mctx_peer; /* peer source? */
151151
ssize_t mctx_hdrbytes; /* count of header bytes */
152-
u_char *mctx_jobid; /* job ID */
152+
unsigned char *mctx_jobid; /* job ID */
153153
struct Header *mctx_hqhead; /* header queue head */
154154
struct Header *mctx_hqtail; /* header queue tail */
155155
ARC_MESSAGE *mctx_arcmsg; /* libopenarc message */
@@ -231,7 +231,7 @@ sfsistat mlfi_close(SMFICTX *);
231231
sfsistat mlfi_connect(SMFICTX *, char *, _SOCK_ADDR *);
232232
sfsistat mlfi_envfrom(SMFICTX *, char **);
233233
sfsistat mlfi_eoh(SMFICTX *);
234-
sfsistat mlfi_body(SMFICTX *, u_char *, size_t);
234+
sfsistat mlfi_body(SMFICTX *, unsigned char *, size_t);
235235
sfsistat mlfi_eom(SMFICTX *);
236236
sfsistat mlfi_header(SMFICTX *, char *, char *);
237237
sfsistat mlfi_negotiate(SMFICTX *,
@@ -1669,13 +1669,13 @@ arcf_config_load(struct config *data,
16691669
/* load the secret key, if one was specified */
16701670
if (conf->conf_keyfile != NULL)
16711671
{
1672-
int status;
1673-
int fd;
1674-
ssize_t rlen;
1675-
ino_t ino = -1;
1676-
uid_t asuser = (uid_t) -1;
1677-
u_char *s33krit;
1678-
struct stat s;
1672+
int status;
1673+
int fd;
1674+
ssize_t rlen;
1675+
ino_t ino = -1;
1676+
uid_t asuser = (uid_t) -1;
1677+
unsigned char *s33krit;
1678+
struct stat s;
16791679

16801680
fd = open(conf->conf_keyfile, O_RDONLY, 0);
16811681
if (fd < 0)
@@ -1815,11 +1815,11 @@ arcf_config_load(struct config *data,
18151815
if (conf->conf_dolog)
18161816
{
18171817
syslog(LOG_ERR, "%s: read() wrong size (%lu)",
1818-
conf->conf_keyfile, (u_long) rlen);
1818+
conf->conf_keyfile, (unsigned long) rlen);
18191819
}
18201820

18211821
snprintf(err, errlen, "%s: read() wrong size (%lu)",
1822-
conf->conf_keyfile, (u_long) rlen);
1822+
conf->conf_keyfile, (unsigned long) rlen);
18231823
close(fd);
18241824
ARC_FREE(s33krit);
18251825
return -1;
@@ -1861,9 +1861,9 @@ arcf_config_load(struct config *data,
18611861
static bool
18621862
arcf_config_setlib(struct arcf_config *conf, char **err)
18631863
{
1864-
ARC_STAT status;
1865-
u_int opts;
1866-
ARC_LIB *lib;
1864+
ARC_STAT status;
1865+
unsigned int opts;
1866+
ARC_LIB *lib;
18671867
assert(conf != NULL);
18681868

18691869
lib = conf->conf_libopenarc;
@@ -2024,7 +2024,7 @@ arcf_config_reload(void)
20242024
else
20252025
{
20262026
bool err = false;
2027-
u_int line;
2027+
unsigned int line;
20282028
struct config *cfg;
20292029
char *missing;
20302030
char *errstr = NULL;
@@ -2430,7 +2430,7 @@ arcf_checkip(struct conflist *list, struct sockaddr *ip)
24302430
dst_len = sizeof ipbuf - 1;
24312431

24322432
inet_ntop(AF_INET6, &addr, dst, dst_len);
2433-
arcf_lowercase((u_char *) dst);
2433+
arcf_lowercase((unsigned char *) dst);
24342434
iplen = strlen(dst);
24352435

24362436
LIST_FOREACH(node, list, entries)
@@ -2473,7 +2473,7 @@ arcf_checkip(struct conflist *list, struct sockaddr *ip)
24732473
dst_len = sizeof ipbuf - 1;
24742474

24752475
inet_ntop(AF_INET6, &addr, dst, dst_len);
2476-
arcf_lowercase((u_char *) dst);
2476+
arcf_lowercase((unsigned char *) dst);
24772477
iplen = strlen(dst);
24782478

24792479
sz = strlcat(ipbuf, "/", sizeof ipbuf);
@@ -2817,7 +2817,7 @@ mlfi_connect(SMFICTX *ctx, char *host, _SOCK_ADDR *ip)
28172817
arcf_setpriv(ctx, cc);
28182818
}
28192819

2820-
arcf_lowercase((u_char *) host);
2820+
arcf_lowercase((unsigned char *) host);
28212821

28222822
if (host != NULL)
28232823
{
@@ -3164,15 +3164,15 @@ mlfi_header(SMFICTX *ctx, char *headerf, char *headerv)
31643164
sfsistat
31653165
mlfi_eoh(SMFICTX *ctx)
31663166
{
3167-
char last;
3168-
u_int mode;
3169-
ARC_STAT status;
3170-
connctx cc;
3171-
msgctx afc;
3172-
char *p;
3173-
const u_char *err = NULL;
3174-
struct arcf_config *conf;
3175-
Header hdr;
3167+
char last;
3168+
unsigned int mode;
3169+
ARC_STAT status;
3170+
connctx cc;
3171+
msgctx afc;
3172+
char *p;
3173+
const unsigned char *err = NULL;
3174+
struct arcf_config *conf;
3175+
Header hdr;
31763176

31773177
assert(ctx != NULL);
31783178

@@ -3186,10 +3186,10 @@ mlfi_eoh(SMFICTX *ctx)
31863186
** Determine the message ID for logging.
31873187
*/
31883188

3189-
afc->mctx_jobid = (u_char *) arcf_getsymval(ctx, "i");
3189+
afc->mctx_jobid = (unsigned char *) arcf_getsymval(ctx, "i");
31903190
if (afc->mctx_jobid == NULL || afc->mctx_jobid[0] == '\0')
31913191
{
3192-
afc->mctx_jobid = (u_char *) JOBIDUNKNOWN;
3192+
afc->mctx_jobid = (unsigned char *) JOBIDUNKNOWN;
31933193
}
31943194

31953195
/* if requested, verify RFC5322-required headers (RFC5322 3.6) */
@@ -3496,7 +3496,7 @@ mlfi_eoh(SMFICTX *ctx)
34963496
*/
34973497

34983498
sfsistat
3499-
mlfi_body(SMFICTX *ctx, u_char *bodyp, size_t bodylen)
3499+
mlfi_body(SMFICTX *ctx, unsigned char *bodyp, size_t bodylen)
35003500
{
35013501
int status;
35023502
msgctx afc;
@@ -3655,15 +3655,15 @@ mlfi_eom(SMFICTX *ctx)
36553655

36563656
if (strcmp((char *) afc->mctx_jobid, JOBIDUNKNOWN) == 0)
36573657
{
3658-
afc->mctx_jobid = (u_char *) arcf_getsymval(ctx, "i");
3658+
afc->mctx_jobid = (unsigned char *) arcf_getsymval(ctx, "i");
36593659
if (afc->mctx_jobid == NULL || afc->mctx_jobid[0] == '\0')
36603660
{
36613661
if (no_i_whine && conf->conf_dolog)
36623662
{
36633663
syslog(LOG_WARNING, "WARNING: symbol 'i' not available");
36643664
no_i_whine = false;
36653665
}
3666-
afc->mctx_jobid = (u_char *) JOBIDUNKNOWN;
3666+
afc->mctx_jobid = (unsigned char *) JOBIDUNKNOWN;
36673667
}
36683668
}
36693669

@@ -3924,7 +3924,7 @@ mlfi_eom(SMFICTX *ctx)
39243924
snprintf(xfhdr, ARC_MAXHEADER, "%s%s v%s %s %s",
39253925
cc->cctx_noleadspc ? " " : "", ARCF_PRODUCT, VERSION, hostname,
39263926
afc->mctx_jobid != NULL ? afc->mctx_jobid
3927-
: (u_char *) JOBIDUNKNOWN);
3927+
: (unsigned char *) JOBIDUNKNOWN);
39283928

39293929
if (arcf_insheader(ctx, 0, SWHEADERNAME, xfhdr) != MI_SUCCESS)
39303930
{
@@ -4087,9 +4087,9 @@ main(int argc, char **argv)
40874087
int filemask = -1;
40884088
int mdebug = 0;
40894089
#ifdef HAVE_SMFI_VERSION
4090-
u_int mvmajor;
4091-
u_int mvminor;
4092-
u_int mvrelease;
4090+
unsigned int mvmajor;
4091+
unsigned int mvminor;
4092+
unsigned int mvrelease;
40934093
#endif /* HAVE_SMFI_VERSION */
40944094
time_t now;
40954095
gid_t gid = (gid_t) -1;
@@ -4267,10 +4267,10 @@ main(int argc, char **argv)
42674267

42684268
if (conffile != NULL)
42694269
{
4270-
u_int line = 0;
4271-
char *missing;
4272-
char *deprecated = NULL;
4273-
char path[MAXPATHLEN + 1];
4270+
unsigned int line = 0;
4271+
char *missing;
4272+
char *deprecated = NULL;
4273+
char path[MAXPATHLEN + 1];
42744274

42754275
cfg = config_load(conffile, arcf_config, &line, path, sizeof path,
42764276
&deprecated);

openarc/openarc.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ extern sfsistat mlfi_envfrom(SMFICTX *, char **);
8181
extern sfsistat mlfi_envrcpt(SMFICTX *, char **);
8282
extern sfsistat mlfi_header(SMFICTX *, char *, char *);
8383
extern sfsistat mlfi_eoh(SMFICTX *);
84-
extern sfsistat mlfi_body(SMFICTX *, u_char *, size_t);
84+
extern sfsistat mlfi_body(SMFICTX *, unsigned char *, size_t);
8585
extern sfsistat mlfi_eom(SMFICTX *);
8686
extern sfsistat mlfi_abort(SMFICTX *);
8787
extern sfsistat mlfi_close(SMFICTX *);

openarc/util.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -246,9 +246,9 @@ arcf_socket_cleanup(char *sockspec)
246246
*/
247247

248248
void
249-
arcf_lowercase(u_char *str)
249+
arcf_lowercase(unsigned char *str)
250250
{
251-
u_char *p;
251+
unsigned char *p;
252252

253253
assert(str != NULL);
254254

openarc/util.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
/* PROTOTYPES */
2020
extern const char **arcf_mkarray(char *);
2121
extern size_t arcf_inet_ntoa(struct in_addr, char *, size_t);
22-
extern void arcf_lowercase(u_char *);
22+
extern void arcf_lowercase(unsigned char *);
2323
extern void arcf_optlist(FILE *);
2424
extern void arcf_setmaxfd(void);
2525
extern int arcf_socket_cleanup(char *);

0 commit comments

Comments
 (0)