Commit 5171c0f9 5171c0f91ea69eacd76068661db628f46f267c9e by Sergey Poznyakoff

Minor fixes.

* .gitignore: Add pathdefs.h
* examples/Makefile.am (muauth_CPPFLAGS)
(muemail_CPPFLAGS): New variables.
* examples/argcv.c (main): Remove unused local.
* include/mailutils/gsasl.h [USE_GSASL]: Change to WITH_GSASL.
* include/mailutils/libcfg.h (mu_acl_cfg_init): New prototype.
* include/mailutils/mu_auth.h (mu_authenticate): Password is const.
* include/mailutils/python.h: Fix indentation.
(mu_py_script_data): module_name is const char *.
* libmu_auth/radius.c: Include radius/debug.h
* libproto/mailer/smtp.c: Include io.h and secret.h
* mail/mail.c: Fix indentation.
* mail/util.c (util_rfc2047_decode): Fix local variable declaration.
* mailbox/mu_auth.c (mu_authenticate): Password is const.
* mh/mh.h (mh_alias_get, mh_alias_get_address)
(mh_alias_get_alias): Name is const.
* mh/mh_alias.y: Likewise.
* mh/mh_list.c (print_header_value): Fix improper use of mu_toupper.
* mh/mh_whatnow.c (invoke): Add typecasts.
* python/libmu_py/nls.c (api_nls_set_locale): Remove unused automatic.
* python/libmu_py/sieve.c (_sieve_error_printer): Provide missing
return value.
(_sieve_debug_printer): Likewise.
1 parent b9aaf724
......@@ -24,4 +24,5 @@ config.status
configure
libtool
m4
pathdefs.h
stamp-h1
......
......@@ -123,12 +123,14 @@ lsf_LDADD = \
@MU_AUTHLIBS@ \
${MU_LIB_MAILUTILS}
muauth_CPPFLAGS = @MU_APP_COMMON_INCLUDES@
muauth_LDADD = \
${MU_APP_LIBRARIES}\
${MU_LIB_AUTH}\
@MU_AUTHLIBS@ \
${MU_LIB_MAILUTILS}
muemail_CPPFLAGS = @MU_APP_COMMON_INCLUDES@
muemail_LDADD = \
${MU_APP_LIBRARIES} \
${MU_LIB_MAILUTILS}
......
......@@ -28,12 +28,11 @@
#include <mailutils/errno.h>
int
main(int argc, char **argv)
main (int argc, char **argv)
{
char *delim = "";
char *comment = "#";
char buf[512];
size_t n = 0;
while (fgets (buf, sizeof buf, stdin))
{
......
......@@ -156,6 +156,7 @@ pop_session_str (enum pop_session_status stat)
case pop_session_logged_in:
return "logged in";
}
return "unknown";
}
char *
......
/* GNU Mailutils -- a suite of utilities for electronic mail
Copyright (C) 2003, 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
Copyright (C) 2003, 2004, 2005, 2007, 2008,
2009 Free Software Foundation, Inc.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
......@@ -32,7 +33,7 @@ int mu_gsasl_module_init (enum mu_gocs_op, void *);
struct mu_gsasl_module_data mu_gsasl_module_data;
#ifdef USE_GSASL
#ifdef WITH_GSASL
#include <gsasl.h>
int mu_gsasl_stream_create (mu_stream_t *stream, mu_stream_t transport,
......
/* GNU Mailutils -- a suite of utilities for electronic mail
Copyright (C) 2007, 2008 Free Software Foundation, Inc.
Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
......@@ -51,6 +51,7 @@ extern int mu_register_cfg_capa (const char *name,
extern void mu_libcfg_init (char **cnames);
extern int mu_parse_config_files (struct mu_cfg_param *param,
void *target_ptr);
extern void mu_acl_cfg_init (void);
#define __mu_common_cat2__(a,b) a ## b
#define __mu_common_cat3__(a,b,c) a ## b ## c
......
/* GNU Mailutils -- a suite of utilities for electronic mail
Copyright (C) 2002, 2005, 2007, 2008 Free Software Foundation, Inc.
Copyright (C) 2002, 2005, 2007, 2008, 2009 Free Software Foundation, Inc.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
......@@ -99,7 +99,7 @@ extern struct mu_auth_data *
mu_get_auth_by_uid (uid_t uid);
extern int
mu_authenticate (struct mu_auth_data *auth_data, char *pass);
mu_authenticate (struct mu_auth_data *auth_data, const char *pass);
extern int mu_auth_nosupport (struct mu_auth_data **return_data,
const void *key,
......
......@@ -25,107 +25,128 @@
extern "C" {
#endif
typedef struct {
typedef struct
{
PyObject_HEAD;
mu_address_t addr;
} PyAddress;
typedef struct {
typedef struct
{
PyObject_HEAD;
mu_attribute_t attr;
} PyAttribute;
typedef struct {
typedef struct
{
PyObject_HEAD;
mu_authority_t auth;
} PyAuthority;
typedef struct {
typedef struct
{
PyObject_HEAD;
mu_ticket_t ticket;
} PyTicket;
typedef struct {
typedef struct
{
PyObject_HEAD;
mu_wicket_t wicket;
} PyWicket;
typedef struct {
typedef struct
{
PyObject_HEAD;
struct mu_auth_data *auth_data;
} PyAuthData;
typedef struct {
typedef struct
{
PyObject_HEAD;
mu_body_t body;
} PyBody;
typedef struct {
typedef struct
{
PyObject_HEAD;
mu_debug_t dbg;
} PyDebug;
typedef struct {
typedef struct
{
PyObject_HEAD;
mu_envelope_t env;
} PyEnvelope;
typedef struct {
typedef struct
{
PyObject_HEAD;
mu_folder_t folder;
} PyFolder;
typedef struct {
typedef struct
{
PyObject_HEAD;
mu_header_t hdr;
} PyHeader;
typedef struct {
typedef struct
{
PyObject_HEAD;
mu_mailbox_t mbox;
} PyMailbox;
typedef struct {
typedef struct
{
PyObject_HEAD;
mu_mailcap_t mc;
} PyMailcap;
typedef struct {
typedef struct
{
PyObject_HEAD;
mu_mailcap_entry_t entry;
} PyMailcapEntry;
typedef struct {
typedef struct
{
PyObject_HEAD;
mu_mailer_t mlr;
} PyMailer;
typedef struct {
typedef struct
{
PyObject_HEAD;
mu_message_t msg;
} PyMessage;
typedef struct {
typedef struct
{
PyObject_HEAD;
mu_mime_t mime;
} PyMime;
typedef struct {
typedef struct
{
PyObject_HEAD;
mu_secret_t secret;
} PySecret;
typedef struct {
typedef struct
{
PyObject_HEAD;
mu_sieve_machine_t mach;
} PySieveMachine;
typedef struct {
typedef struct
{
PyObject_HEAD;
mu_stream_t stm;
} PyStream;
typedef struct {
typedef struct
{
PyObject_HEAD;
mu_url_t url;
} PyUrl;
......@@ -186,13 +207,15 @@ extern int PyMessage_Check (PyObject *x);
extern int PySecret_Check (PyObject *x);
extern int PyStream_Check (PyObject *x);
typedef struct {
typedef struct
{
char *name;
PyObject *obj;
} mu_py_dict;
typedef struct {
char *module_name;
typedef struct
{
const char *module_name;
mu_py_dict *attrs;
} mu_py_script_data;
......
......@@ -46,6 +46,7 @@
#ifdef ENABLE_RADIUS
#include <radius/radius.h>
#include <radius/debug.h>
static int radius_auth_enabled;
......
......@@ -50,6 +50,8 @@
#include <mailutils/url.h>
#include <mailutils/tls.h>
#include <mailutils/md5.h>
#include <mailutils/io.h>
#include <mailutils/secret.h>
#include <mailutils/cctype.h>
#include <mailutils/cstr.h>
......
......@@ -38,20 +38,24 @@ static char args_doc[] = N_("[address...]\n-f [OPTION...] [file]\n--file [OPTION
#define F_OPTION 256
static struct argp_option options[] = {
{ NULL, 'f', 0, OPTION_HIDDEN, NULL, 0 },
{"file", F_OPTION, "FILE", OPTION_ARG_OPTIONAL|OPTION_HIDDEN, 0},
{"exist", 'e', 0, 0, N_("Return true if mail exists"), 0},
{"byname", 'F', 0, 0, N_("Save messages according to sender"), 0},
{"headers", 'H', 0, 0, N_("Write a header summary and exit"), 0},
{"ignore", 'i', 0, 0, N_("Ignore interrupts"), 0},
{"norc", 'n', 0, 0, N_("Do not read the system mailrc file"), 0},
{"nosum", 'N', 0, 0, N_("Do not display initial header summary"), 0},
{"print", 'p', 0, 0, N_("Print all mail to standard output"), 0},
{"quit", 'q', 0, 0, N_("Cause interrupts to terminate program"), 0},
{"read", 'r', 0, 0, N_("Same as -p"), 0},
{"subject", 's', N_("SUBJ"), 0, N_("Send a message with a Subject of SUBJ"), 0},
{"to", 't', 0, 0, N_("Precede message by a list of addresses"), 0},
{ NULL, 'f', NULL, OPTION_HIDDEN, NULL, 0 },
{"file", F_OPTION, "FILE", OPTION_ARG_OPTIONAL|OPTION_HIDDEN, 0},
{"exist", 'e', NULL, 0, N_("Return true if mail exists"), 0},
{"byname", 'F', NULL, 0, N_("Save messages according to sender"), 0},
{"headers", 'H', NULL, 0, N_("Write a header summary and exit"), 0},
{"ignore", 'i', NULL, 0, N_("Ignore interrupts"), 0},
{"norc", 'n', NULL, 0, N_("Do not read the system mailrc file"), 0},
{"nosum", 'N', NULL, 0,
N_("Do not display initial header summary"), 0},
{"print", 'p', NULL, 0, N_("Print all mail to standard output"), 0},
{"read", 'r', NULL, OPTION_ALIAS },
{"quit", 'q', NULL, 0,
N_("Cause interrupts to terminate program"), 0},
{"subject", 's', N_("SUBJ"), 0,
N_("Send a message with the given SUBJECT"), 0},
{"to", 't', NULL, 0,
N_("Precede message by a list of addresses"), 0},
{"user", 'u', N_("USER"), 0, N_("Operate on USER's mailbox"), 0},
{"append", 'a', N_("HEADER: VALUE"), 0,
N_("Append given header to the message being sent"), 0},
......
......@@ -1084,7 +1084,7 @@ void
util_rfc2047_decode (char **value)
{
char locale[32];
char *charset = NULL;
const char *charset = NULL;
char *tmp;
int rc;
......
......@@ -296,7 +296,7 @@ mu_get_auth_by_uid (uid_t uid)
static mu_list_t mu_authenticate_list, _tmp_authenticate_list;
int
mu_authenticate (struct mu_auth_data *auth_data, char *pass)
mu_authenticate (struct mu_auth_data *auth_data, const char *pass)
{
if (!auth_data)
return EINVAL;
......@@ -305,7 +305,7 @@ mu_authenticate (struct mu_auth_data *auth_data, char *pass)
auth_data->name, auth_data->source);
if (!mu_authenticate_list)
mu_auth_begin_setup ();
return mu_auth_runlist (mu_authenticate_list, NULL, auth_data, pass);
return mu_auth_runlist (mu_authenticate_list, NULL, auth_data, (void*) pass);
}
......
......@@ -335,9 +335,9 @@ void mh_set_reply_regex (const char *str);
int mh_decode_2047 (char *text, char **decoded_text);
int mh_alias_read (char *name, int fail);
int mh_alias_get (char *name, mu_list_t *return_list);
int mh_alias_get_address (char *name, mu_address_t *addr, int *incl);
int mh_alias_get_alias (char *uname, mu_list_t *return_list);
int mh_alias_get (const char *name, mu_list_t *return_list);
int mh_alias_get_address (const char *name, mu_address_t *addr, int *incl);
int mh_alias_get_alias (const char *uname, mu_list_t *return_list);
int mh_read_aliases (void);
int mh_alias_expand (const char *str, mu_address_t *paddr, int *incl);
......
......@@ -225,7 +225,7 @@ ali_list_dup (mu_list_t src)
}
static int
ali_member (mu_list_t list, char *name)
ali_member (mu_list_t list, const char *name)
{
mu_iterator_t itr;
int found = 0;
......@@ -252,7 +252,7 @@ ali_member (mu_list_t list, char *name)
}
int
aliascmp (char *pattern, char *name)
aliascmp (const char *pattern, const char *name)
{
int len = strlen (pattern);
......@@ -281,7 +281,7 @@ _insert_list (mu_list_t list, void *prev, mu_list_t new_list)
return 0;
}
static int mh_alias_get_internal (char *name, mu_iterator_t start,
static int mh_alias_get_internal (const char *name, mu_iterator_t start,
mu_list_t *return_list, int *inclusive);
int
......@@ -311,7 +311,8 @@ alias_expand_list (mu_list_t name_list, mu_iterator_t orig_itr, int *inclusive)
/* Look up the named alias. If found, return the list of recipient
names associated with it */
static int
mh_alias_get_internal (char *name, mu_iterator_t start, mu_list_t *return_list,
mh_alias_get_internal (const char *name,
mu_iterator_t start, mu_list_t *return_list,
int *inclusive)
{
mu_iterator_t itr;
......@@ -349,13 +350,13 @@ mh_alias_get_internal (char *name, mu_iterator_t start, mu_list_t *return_list,
}
int
mh_alias_get (char *name, mu_list_t *return_list)
mh_alias_get (const char *name, mu_list_t *return_list)
{
return mh_alias_get_internal (name, NULL, return_list, NULL);
}
int
mh_alias_get_address (char *name, mu_address_t *paddr, int *incl)
mh_alias_get_address (const char *name, mu_address_t *paddr, int *incl)
{
mu_iterator_t itr;
mu_list_t list;
......@@ -403,7 +404,7 @@ mh_alias_get_address (char *name, mu_address_t *paddr, int *incl)
/* Look up the given user name in the aliases. Return the list of
alias names this user is member of */
int
mh_alias_get_alias (char *uname, mu_list_t *return_list)
mh_alias_get_alias (const char *uname, mu_list_t *return_list)
{
mu_iterator_t itr;
int rc = 1;
......
......@@ -629,7 +629,10 @@ print_header_value (struct eval_env *env, char *val)
}
if (env->bvar[B_UPPERCASE])
mu_toupper (val);
{
for (p = val; *p; p++)
*p = mu_toupper (*p);
}
if (env->bvar[B_COMPRESS])
for (p = val; *p; p++)
......
......@@ -257,13 +257,13 @@ invoke (const char *compname, const char *defval, int argc, char **argv,
return -1;
}
xargv[0] = progname;
xargv[0] = (char*) progname;
for (i = 1; i < argc; i++)
xargv[i] = argv[i];
if (extra0)
xargv[i++] = extra0;
xargv[i++] = (char*) extra0;
if (extra1)
xargv[i++] = extra1;
xargv[i++] = (char*) extra1;
xargv[i++] = NULL;
rc = mu_spawnvp (xargv[0], xargv, &status);
free (xargv);
......
......@@ -32,7 +32,6 @@ api_nls_init (PyObject *self)
static PyObject *
api_nls_set_locale (PyObject *self, PyObject *args)
{
int status;
char *lset;
const char *locale;
......
......@@ -206,7 +206,7 @@ _sieve_error_printer (void *data, const char *fmt, va_list ap)
PyObject *py_fnc = s->py_error_printer;
if (mu_vasnprintf (&buf, &buflen, fmt, ap))
return;
return 0;
PyTuple_SetItem (py_args, 0, PyString_FromString (buf ? buf : ""));
if (buf)
free (buf);
......@@ -237,7 +237,7 @@ _sieve_parse_error_printer (void *data, const char *filename, int lineno,
PyDict_SetItemString (py_dict, "lineno", PyInt_FromLong (lineno));
if (mu_vasnprintf (&buf, &buflen, fmt, ap))
return;
return 0;
PyDict_SetItemString (py_dict, "text",
PyString_FromString (buf ? buf : ""));
if (buf)
......@@ -259,6 +259,7 @@ _sieve_parse_error_printer (void *data, const char *filename, int lineno,
Py_DECREF (py_args);
}
}
return 0;
}
static int
......@@ -274,7 +275,7 @@ _sieve_debug_printer (void *data, const char *fmt, va_list ap)
PyObject *py_fnc = s->py_debug_printer;
if (mu_vasnprintf (&buf, &buflen, fmt, ap))
return;
return 0;
PyTuple_SetItem (py_args, 0, PyString_FromString (buf ? buf : ""));
if (buf)
free (buf);
......