Skip to content

Commit

Permalink
fix discarded qualifier warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
mbhangui committed May 17, 2024
1 parent 1e877f0 commit c4f96b6
Show file tree
Hide file tree
Showing 225 changed files with 838 additions and 483 deletions.
5 changes: 3 additions & 2 deletions indimail-x/AliasInLookup.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,11 @@ die_nomem()
}

char *
AliasInLookup(char *email)
AliasInLookup(const char *email)
{
static stralloc user = {0}, domain = {0}, aliasbuf = {0};
char *ptr, *real_domain;
char *ptr;
const char *real_domain;

#ifdef CLUSTERED_SITE
if (sqlOpen_user(email, 1))
Expand Down
2 changes: 1 addition & 1 deletion indimail-x/AliasInLookup.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
#ifndef ALIASINLOOKUP_H
#define ALIASINLOOKUP_H

char *AliasInLookup(char *);
char *AliasInLookup(const char *);

#endif
2 changes: 1 addition & 1 deletion indimail-x/Check_Login.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
#ifndef CHECK_LOGIN_H
#define CHECK_LOGIN_H

int Check_Login(char *, char *, char *);
int Check_Login(const char *, const char *, const char *);

#endif
2 changes: 1 addition & 1 deletion indimail-x/CopyEmailFile.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ die_nomem()
*/
int
CopyEmailFile(const char *homedir, char *fname, const char *email,
char *To, char *From, char *Subject, int setDate,
const char *To, const char *From, const char *Subject, int setDate,
int copy_method, long message_size)
{
time_t tm;
Expand Down
2 changes: 1 addition & 1 deletion indimail-x/CopyEmailFile.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
#ifndef COPYEMAILFILE_H
#define COPYEMAILFILE_H

int CopyEmailFile(const char *, char *, const char *, char *, char *, char *, int, int, long);
int CopyEmailFile(const char *, const char *, const char *, const char *, const char *, const char *, int, int, long);

#endif
7 changes: 4 additions & 3 deletions indimail-x/GetPrefix.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,10 @@ die_nomem()
}

char *
GetPrefix(char *user, char *path)
GetPrefix(const char *user, const char *path)
{
char *ptr, *suffix_ptr, *base_path;
char *ptr;
const char *base_path, *suffix_ptr;
int ch;
static stralloc PathPrefix = {0};

Expand All @@ -47,7 +48,7 @@ GetPrefix(char *user, char *path)
if (path && *path)
base_path = path;
else
getEnvConfigStr(&base_path, "BASE_PATH", BASE_PATH);
getEnvConfigStr((char **) &base_path, "BASE_PATH", BASE_PATH);
ch = tolower(*user);
if (ch >= 'a' && ch <= 'e')
suffix_ptr = "A2E";
Expand Down
2 changes: 1 addition & 1 deletion indimail-x/GetPrefix.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
#ifndef GETPREFIX_H
#define GETPREFIX_H

char *GetPrefix(char *, char *);
char *GetPrefix(const char *, const char *);

#endif
4 changes: 2 additions & 2 deletions indimail-x/GetSMTProute.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ static char sccsid[] = "$Id: GetSMTProute.c,v 1.4 2023-03-20 10:02:16+05:30
#endif

int
get_smtp_qmtp_port(char *file, char *domain, int default_port)
get_smtp_qmtp_port(const char *file, const char *domain, int default_port)
{
static stralloc line = {0};
char inbuf[512];
Expand Down Expand Up @@ -132,7 +132,7 @@ get_smtp_qmtp_port(char *file, char *domain, int default_port)
* If relay is blank, it means MX lookup should be done
*/
int
GetSMTProute(char *domain)
GetSMTProute(const char *domain)
{
char *sysconfdir, *controldir, *routes;
int default_port, relative;
Expand Down
3 changes: 2 additions & 1 deletion indimail-x/GetSMTProute.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#ifndef GETSMTPROUTE_H
#define GETSMTPROUTE_H

int GetSMTProute(char *);
int GetSMTProute(const char *);
int get_smtp_qmtp_port(const char *, const char *, int);

#endif
6 changes: 3 additions & 3 deletions indimail-x/Login_Tasks.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ static char sccsid[] = "$Id: Login_Tasks.c,v 1.6 2023-04-23 00:29:27+05:30 C
#endif

int
Login_Tasks(struct passwd *pw, const char *User, char *ServiceType)
Login_Tasks(struct passwd *pw, const char *User, const char *ServiceType)
{
char *domain, *ptr, *migrateflag, *migrateuser, *postauth;
static stralloc fqemail = {0}, Maildir = {0}, tmpbuf = {0}, pwbuf = {0},
Expand Down Expand Up @@ -196,7 +196,7 @@ Login_Tasks(struct passwd *pw, const char *User, char *ServiceType)
if (!(ptr = env_get("TCPREMOTEIP")) && !(ptr = GetPeerIPaddr()))
#endif
ptr = "unknown";
vset_lastauth(pw->pw_name, domain, (char *) ServiceType, ptr, pw->pw_gecos, quota);
vset_lastauth(pw->pw_name, domain, ServiceType, ptr, pw->pw_gecos, quota);
#else
quota = check_quota(Maildir.s);
#ifdef ENABLE_IPV6
Expand All @@ -205,7 +205,7 @@ Login_Tasks(struct passwd *pw, const char *User, char *ServiceType)
if (!(ptr = env_get("TCPREMOTEIP")) && !(ptr = GetPeerIPaddr()))
#endif
ptr = "unknown";
vset_lastauth(pw->pw_name, domain, (char *) ServiceType, ptr, pw->pw_gecos, quota);
vset_lastauth(pw->pw_name, domain, ServiceType, ptr, pw->pw_gecos, quota);
#endif /*- USE_MAILDIRQUOTA */
#endif /*- ENABLE_AUTH_LOGGING */
if ((postauth = (char *) env_get("POSTAUTH")) && !access(postauth, X_OK)) {
Expand Down
2 changes: 1 addition & 1 deletion indimail-x/Login_Tasks.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
#ifndef LOGIN_TASKS_H
#define LOGIN_TASKS_H

int Login_Tasks(struct passwd *, const char *, char *);
int Login_Tasks(struct passwd *, const char *, const char *);

#endif
2 changes: 1 addition & 1 deletion indimail-x/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ noinst_DATA = indimail-permissions.easy indimail-permissions.paranoid \
post_handle_list = vadddomain vadduser vdeldomain vaddaliasdomain vrenamedomain vmoduser vpasswd \
vdeluser vrenameuser

doc_list= ChangeLog FAQ.md README-indimail.md README-ldap.md \
doc_list= ChangeLog README-indimail.md README-ldap.md \
README-vlimits.md COPYING-indimail

MOSTLYCLEANFILES=vcaliasrev myslave controlsync bogofilter-qfe \
Expand Down
10 changes: 5 additions & 5 deletions indimail-x/ProcessInFifo.c
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ walk_entry(const void *in_data, VISIT x, int level)
}

char *
in_strdup(char *s)
in_strdup(const char *s)
{
int i;
char *p;
Expand Down Expand Up @@ -919,8 +919,8 @@ ProcessInFifo(int instNum)
static stralloc pwbuf = {0}, host_path = {0}, line = {0};
char tmp[FMT_ULONG], inbuf[512];
char *ptr, *fifoName, *fifo_path, *myFifo, *sysconfdir, *controldir,
*QueryBuf, *email, *remoteip, *local_ip, *cntrl_host,
*real_domain;
*QueryBuf, *email, *remoteip, *local_ip, *cntrl_host;
const char *real_domain;
void (*pstat) () = NULL;
void *(*search_func) (const void *key, void *const *rootp, int (*compar)(const void *, const void *));
time_t prev_time = 0l;
Expand Down Expand Up @@ -1354,7 +1354,7 @@ ProcessInFifo(int instNum)
case PWD_QUERY:
i = str_rchr(email, '@');
if (!email[i])
getEnvConfigStr(&real_domain, "DEFAULT_DOMAIN", DEFAULT_DOMAIN);
getEnvConfigStr((char **) &real_domain, "DEFAULT_DOMAIN", DEFAULT_DOMAIN);
else
real_domain = email + i + 1;
if (!use_btree || !(in = mk_in_entry(email)))
Expand Down Expand Up @@ -1490,7 +1490,7 @@ ProcessInFifo(int instNum)
if (tcpserver)
return (-1);
} else
if (bytes > 0 && timeoutwrite(writeTimeout, wfd, real_domain, bytes) == -1) {
if (bytes > 0 && timeoutwrite(writeTimeout, wfd, (char *) real_domain, bytes) == -1) {
strerr_warn1("InLookup: write-get_real_domain: ", &strerr_sys);
if (tcpserver)
return (-1);
Expand Down
4 changes: 2 additions & 2 deletions indimail-x/PwdInLookup.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ static char sccsid[] = "$Id: PwdInLookup.c,v 1.1 2019-04-18 07:56:24+05:30 C
#endif

struct passwd *
PwdInLookup(char *email)
PwdInLookup(const char *email)
{
static stralloc user = {0}, domain = {0};
char *real_domain;
const char *real_domain;
struct passwd *pw;

#ifdef CLUSTERED_SITE
Expand Down
2 changes: 1 addition & 1 deletion indimail-x/PwdInLookup.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@
#include <pwd.h>
#endif

struct passwd *PwdInLookup(char *);
struct passwd *PwdInLookup(const char *);

#endif
4 changes: 2 additions & 2 deletions indimail-x/RelayInLookup.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ die_nomem()
}

int
RelayInLookup(char *mailfrom, char *remoteip)
RelayInLookup(const char *mailfrom, const char *remoteip)
{
static stralloc user = {0}, domain = {0}, email = {0};
char *real_domain;
const char *real_domain;
int retval;

#ifdef CLUSTERED_SITE
Expand Down
2 changes: 1 addition & 1 deletion indimail-x/RelayInLookup.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
#ifndef RELAYINLOOKUP_H
#define RELAYINLOOKUP_H

int RelayInLookup(char *, char *);
int RelayInLookup(const char *, const char *);

#endif
2 changes: 1 addition & 1 deletion indimail-x/SendWelcomeMail.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ die_nomem()
}

void
SendWelcomeMail(char *homedir, char *username, char *domain, int inactFlag, char *subject)
SendWelcomeMail(const char *homedir, const char *username, const char *domain, int inactFlag, const char *subject)
{
static stralloc email = {0}, tmpbuf = {0}, bulkdir = {0};
char *ptr;
Expand Down
2 changes: 1 addition & 1 deletion indimail-x/SendWelcomeMail.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
#ifndef SENDWELCOMEMAIL_H
#define SENDWELCOMEMAIL_H

void SendWelcomeMail(char *, char *, char *, int, char *);
void SendWelcomeMail(const char *, const char *, const char *, int, const char *);

#endif
4 changes: 2 additions & 2 deletions indimail-x/SqlServer.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ die_nomem()
}

char *
SqlServer(char *mdahost, char *domain)
SqlServer(const char *mdahost, const char *domain)
{
DBINFO **rhostsptr;
char strnum[FMT_ULONG];
Expand Down Expand Up @@ -80,7 +80,7 @@ SqlServer(char *mdahost, char *domain)
}

char *
MdaServer(char *sqlhost, char *domain)
MdaServer(const char *sqlhost, const char *domain)
{
DBINFO **rhostsptr;
int total;
Expand Down
4 changes: 2 additions & 2 deletions indimail-x/SqlServer.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#ifndef SQLSERVER_H
#define SQLSERVER_H

char *SqlServer(char *, char *);
char *MdaServer(char *, char *);
char *SqlServer(const char *, const char *);
char *MdaServer(const char *, const char *);

#endif
4 changes: 2 additions & 2 deletions indimail-x/UserInLookup.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@ static char sccsid[] = "$Id: UserInLookup.c,v 1.3 2021-01-26 00:29:14+05:30
* -1: System Error
*/
int
UserInLookup(char *email)
UserInLookup(const char *email)
{
static stralloc user = {0}, domain = {0};
char *real_domain;
const char *real_domain;
char strnum1[FMT_ULONG], strnum2[FMT_ULONG];
#ifdef VALIAS
int valias_count;
Expand Down
2 changes: 1 addition & 1 deletion indimail-x/UserInLookup.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
#ifndef USERINLOOKUP_H
#define USERINLOOKUP_H

int UserInLookup(char *);
int UserInLookup(const char *);

#endif
4 changes: 2 additions & 2 deletions indimail-x/VlimitInLookup.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ static char sccsid[] = "$Id: VlimitInLookup.c,v 1.1 2019-04-18 07:56:47+05:3
#include "vlimits.h"

int
VlimitInLookup(char *email, struct vlimits *lim)
VlimitInLookup(const char *email, struct vlimits *lim)
{
static stralloc user = {0}, domain = {0};
char *real_domain;
const char *real_domain;
#ifdef ENABLE_DOMAIN_LIMITS
struct vlimits limits;
#endif
Expand Down
2 changes: 1 addition & 1 deletion indimail-x/VlimitInLookup.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#include "vlimits.h"

#ifdef ENABLE_DOMAIN_LIMITS
int VlimitInLookup(char *, struct vlimits *);
int VlimitInLookup(const char *, struct vlimits *);
#endif

#endif
2 changes: 1 addition & 1 deletion indimail-x/add_control.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ die_nomem()
}

int
add_control(char *domain, char *target)
add_control(const char *domain, const char *target)
{
int count, relative;
static stralloc filename = {0}, tmpstr = {0};
Expand Down
2 changes: 1 addition & 1 deletion indimail-x/add_control.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
#ifndef ADD_CONTROL_H
#define ADD_CONTROL_H

int add_control(char *, char *);
int add_control(const char *, const char *);

#endif
2 changes: 1 addition & 1 deletion indimail-x/add_domain_assign.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ die_nomem()
* And signal qmail
*/
int
add_domain_assign(char *domain, char *domain_base_dir, uid_t uid, gid_t gid)
add_domain_assign(const char *domain, const char *domain_base_dir, uid_t uid, gid_t gid)
{
static stralloc filename = {0}, tmpstr = {0};
int fd;
Expand Down
2 changes: 1 addition & 1 deletion indimail-x/add_domain_assign.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@
#include <sys/types.h>
#endif

int add_domain_assign(char *, char *, uid_t, gid_t);
int add_domain_assign(const char *, const char *, uid_t, gid_t);

#endif
10 changes: 5 additions & 5 deletions indimail-x/add_user_assign.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ die_nomem()
_exit(111);
}

void
do_assign1(stralloc *s, char *user, char *dir)
static void
do_assign1(stralloc *s, const char *user, const char *dir)
{
char strnum[FMT_ULONG];
char *ptr;
Expand Down Expand Up @@ -76,8 +76,8 @@ do_assign1(stralloc *s, char *user, char *dir)
return;
}

void
do_assign2(stralloc *s, char *user, char *dir)
static void
do_assign2(stralloc *s, const char *user, const char *dir)
{
char strnum[FMT_ULONG];
char *ptr;
Expand Down Expand Up @@ -113,7 +113,7 @@ do_assign2(stralloc *s, char *user, char *dir)
* add a local user to the users/assign file and compile it
*/
int
add_user_assign(char *user, char *dir)
add_user_assign(const char *user, const char *dir)
{
static stralloc filename = {0}, tmpstr1 = {0}, tmpstr2 = {0};
char *assigndir;
Expand Down
2 changes: 1 addition & 1 deletion indimail-x/add_user_assign.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
*/
#ifndef ADD_USER_ASSIGN_H
#define ADD_USER_ASSIGN_H
int add_user_assign(char *, char *dir);
int add_user_assign(const char *, const char *dir);
#endif
2 changes: 1 addition & 1 deletion indimail-x/add_vacation.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ add_vacation(char *email, char *fname)
static stralloc tmpbuf = {0}, line = {0}, user = {0}, domain = {0};
uid_t uid;
gid_t gid;
char *real_domain;
const char *real_domain;
char inbuf[512], outbuf[512];
struct passwd *pw;
int err, match, fd1, fd2;
Expand Down
Loading

0 comments on commit c4f96b6

Please sign in to comment.