Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix discarded qualifier warnings #37

Merged
merged 2 commits into from
May 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions indimail-x/AliasInLookup.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
/*
* $Log: AliasInLookup.c,v $
* Revision 1.3 2024-05-17 16:25:48+05:30 mbhangui
* fix discarded-qualifier compiler warnings
*
* Revision 1.2 2019-07-04 09:15:20+05:30 Cprogrammer
* BUG - aliasbuffer wasn't initialized
*
Expand All @@ -12,7 +15,7 @@
#endif

#ifndef lint
static char sccsid[] = "$Id: AliasInLookup.c,v 1.2 2019-07-04 09:15:20+05:30 Cprogrammer Exp mbhangui $";
static char sccsid[] = "$Id: AliasInLookup.c,v 1.3 2024-05-17 16:25:48+05:30 mbhangui Exp mbhangui $";
#endif

#ifdef VALIAS
Expand Down Expand Up @@ -42,10 +45,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
5 changes: 4 additions & 1 deletion indimail-x/AliasInLookup.h
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
/*
* $Log: AliasInLookup.h,v $
* Revision 1.2 2024-05-17 16:25:48+05:30 mbhangui
* fix discarded-qualifier compiler warnings
*
* Revision 1.1 2019-04-13 23:39:26+05:30 Cprogrammer
* AliasInLookup.h
*
*/
#ifndef ALIASINLOOKUP_H
#define ALIASINLOOKUP_H

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

#endif
5 changes: 4 additions & 1 deletion indimail-x/Check_Login.h
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
/*
* $Log: Check_Login.h,v $
* Revision 1.2 2024-05-17 16:25:48+05:30 mbhangui
* fix discarded-qualifier compiler warnings
*
* Revision 1.1 2019-04-13 23:39:26+05:30 Cprogrammer
* Check_Login.h
*
*/
#ifndef CHECK_LOGIN_H
#define CHECK_LOGIN_H

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

#endif
7 changes: 5 additions & 2 deletions indimail-x/CopyEmailFile.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
/*
* $Log: CopyEmailFile.c,v $
* Revision 1.3 2024-05-17 16:25:48+05:30 mbhangui
* fix discarded-qualifier compiler warnings
*
* Revision 1.2 2022-10-20 11:56:57+05:30 Cprogrammer
* converted function prototype to ansic
*
Expand Down Expand Up @@ -36,7 +39,7 @@
#include "variables.h"

#ifndef lint
static char sccsid[] = "$Id: CopyEmailFile.c,v 1.2 2022-10-20 11:56:57+05:30 Cprogrammer Exp mbhangui $";
static char sccsid[] = "$Id: CopyEmailFile.c,v 1.3 2024-05-17 16:25:48+05:30 mbhangui Exp mbhangui $";
#endif

static void
Expand All @@ -53,7 +56,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
5 changes: 4 additions & 1 deletion indimail-x/CopyEmailFile.h
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
/*
* $Log: CopyEmailFile.h,v $
* Revision 1.2 2024-05-17 16:25:48+05:30 mbhangui
* fix discarded-qualifier compiler warnings
*
* Revision 1.1 2019-04-13 23:39:26+05:30 Cprogrammer
* CopyEmailFile.h
*
*/
#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
12 changes: 8 additions & 4 deletions indimail-x/GetPrefix.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
/*
* $Log: GetPrefix.c,v $
* Revision 1.3 2024-05-17 16:25:48+05:30 mbhangui
* fix discarded-qualifier compiler warnings
*
* Revision 1.2 2020-04-01 18:54:56+05:30 Cprogrammer
* moved authentication functions to libqmail
*
Expand All @@ -25,7 +28,7 @@
#include "pathToFilesystem.h"

#ifndef lint
static char sccsid[] = "$Id: GetPrefix.c,v 1.2 2020-04-01 18:54:56+05:30 Cprogrammer Exp mbhangui $";
static char sccsid[] = "$Id: GetPrefix.c,v 1.3 2024-05-17 16:25:48+05:30 mbhangui Exp mbhangui $";
#endif

static void
Expand All @@ -36,9 +39,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 +51,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
5 changes: 4 additions & 1 deletion indimail-x/GetPrefix.h
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
/*
* $Log: GetPrefix.h,v $
* Revision 1.2 2024-05-17 16:25:48+05:30 mbhangui
* fix discarded-qualifier compiler warnings
*
* Revision 1.1 2019-04-13 23:39:27+05:30 Cprogrammer
* GetPrefix.h
*
*/
#ifndef GETPREFIX_H
#define GETPREFIX_H

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

#endif
9 changes: 6 additions & 3 deletions indimail-x/GetSMTProute.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
/*
* $Log: GetSMTProute.c,v $
* Revision 1.5 2024-05-17 16:25:48+05:30 mbhangui
* fix discarded-qualifier compiler warnings
*
* Revision 1.4 2023-03-20 10:02:16+05:30 Cprogrammer
* standardize getln handling
*
Expand Down Expand Up @@ -40,11 +43,11 @@
#include "indimail.h"

#ifndef lint
static char sccsid[] = "$Id: GetSMTProute.c,v 1.4 2023-03-20 10:02:16+05:30 Cprogrammer Exp mbhangui $";
static char sccsid[] = "$Id: GetSMTProute.c,v 1.5 2024-05-17 16:25:48+05:30 mbhangui Exp mbhangui $";
#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 +135,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
6 changes: 5 additions & 1 deletion indimail-x/GetSMTProute.h
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
/*
* $Log: GetSMTProute.h,v $
* Revision 1.2 2024-05-17 16:25:48+05:30 mbhangui
* fix discarded-qualifier compiler warnings
*
* Revision 1.1 2019-04-13 23:39:27+05:30 Cprogrammer
* GetSMTProute.h
*
*/
#ifndef GETSMTPROUTE_H
#define GETSMTPROUTE_H

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

#endif
11 changes: 7 additions & 4 deletions indimail-x/Login_Tasks.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
/*
* $Log: Login_Tasks.c,v $
* Revision 1.7 2024-05-17 16:25:48+05:30 mbhangui
* fix discarded-qualifier compiler warnings
*
* Revision 1.6 2023-04-23 00:29:27+05:30 Cprogrammer
* record IPv6 address if present in lastauth table
*
Expand Down Expand Up @@ -73,11 +76,11 @@
#include "vset_default_domain.h"

#ifndef lint
static char sccsid[] = "$Id: Login_Tasks.c,v 1.6 2023-04-23 00:29:27+05:30 Cprogrammer Exp mbhangui $";
static char sccsid[] = "$Id: Login_Tasks.c,v 1.7 2024-05-17 16:25:48+05:30 mbhangui Exp mbhangui $";
#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 +199,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 +208,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
5 changes: 4 additions & 1 deletion indimail-x/Login_Tasks.h
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
/*
* $Log: Login_Tasks.h,v $
* Revision 1.2 2024-05-17 16:25:48+05:30 mbhangui
* fix discarded-qualifier compiler warnings
*
* Revision 1.1 2019-04-13 23:39:27+05:30 Cprogrammer
* Login_Tasks.h
*
*/
#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
15 changes: 9 additions & 6 deletions indimail-x/ProcessInFifo.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
/*
* $Log: ProcessInFifo.c,v $
* Revision 1.19 2024-05-17 16:25:48+05:30 mbhangui
* fix discarded-qualifier compiler warnings
*
* Revision 1.18 2023-06-08 17:48:50+05:30 Cprogrammer
* renamed fifo directory from FIFODIR to INFIFODIR.
*
Expand Down Expand Up @@ -131,7 +134,7 @@
#include "FifoCreate.h"

#ifndef lint
static char sccsid[] = "$Id: ProcessInFifo.c,v 1.18 2023-06-08 17:48:50+05:30 Cprogrammer Exp mbhangui $";
static char sccsid[] = "$Id: ProcessInFifo.c,v 1.19 2024-05-17 16:25:48+05:30 mbhangui Exp mbhangui $";
#endif

int user_query_count, relay_query_count, pwd_query_count, alias_query_count;
Expand Down Expand Up @@ -245,7 +248,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 +922,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 +1357,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 +1493,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
9 changes: 6 additions & 3 deletions indimail-x/PwdInLookup.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
/*
* $Log: PwdInLookup.c,v $
* Revision 1.2 2024-05-17 16:25:48+05:30 mbhangui
* fix discarded-qualifier compiler warnings
*
* Revision 1.1 2019-04-18 07:56:24+05:30 Cprogrammer
* Initial revision
*
Expand All @@ -24,14 +27,14 @@
#include "variables.h"

#ifndef lint
static char sccsid[] = "$Id: PwdInLookup.c,v 1.1 2019-04-18 07:56:24+05:30 Cprogrammer Exp mbhangui $";
static char sccsid[] = "$Id: PwdInLookup.c,v 1.2 2024-05-17 16:25:48+05:30 mbhangui Exp mbhangui $";
#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
5 changes: 4 additions & 1 deletion indimail-x/PwdInLookup.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
/*
* $Log: PwdInLookup.h,v $
* Revision 1.2 2024-05-17 16:25:48+05:30 mbhangui
* fix discarded-qualifier compiler warnings
*
* Revision 1.1 2019-04-13 23:39:27+05:30 Cprogrammer
* PwdInLookup.h
*
Expand All @@ -13,6 +16,6 @@
#include <pwd.h>
#endif

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

#endif
Loading
Loading