X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=lib-src%2Fmovemail.c;h=9a1a3c6f5447126dce370534d60402724b46fc60;hb=ea1ea793fe6e244ef5555ed983423a204101af13;hp=f34502072d899cf6d270fe1446cb25436661fc8b;hpb=fc475e6669a613cd6d98eb5511c749a23b63c7ac;p=chise%2Fxemacs-chise.git.1 diff --git a/lib-src/movemail.c b/lib-src/movemail.c index f345020..9a1a3c6 100644 --- a/lib-src/movemail.c +++ b/lib-src/movemail.c @@ -55,27 +55,30 @@ Boston, MA 02111-1307, USA. */ */ #define NO_SHORTNAMES /* Tell config not to load remap.h */ +#define DONT_ENCAPSULATE #include <../src/config.h> #include #include -#include #include #include +#include "../src/sysfile.h" #include "../src/syswait.h" +#ifndef WINDOWSNT #include "../src/systime.h" +#endif #include #include #include "getopt.h" #ifdef MAIL_USE_POP #include "pop.h" -#include +#include "../src/regex.h" #endif extern char *optarg; extern int optind, opterr; #ifndef HAVE_STRERROR -static char * strerror (int errnum); +char * strerror (int errnum); #endif /* HAVE_STRERROR */ #ifdef MSDOS @@ -147,7 +150,8 @@ static char *concat (char *, char *, char *); static long *xmalloc (unsigned int); #ifdef MAIL_USE_POP static int popmail (char *, char *, char *); -static int pop_retr (popserver server, int msgno, int (*action)(), void *arg); +static int pop_retr (popserver server, int msgno, + int (*action)(char *, FILE *), void *arg); static int mbx_write (char *, FILE *); static int mbx_delimit_begin (FILE *); static int mbx_delimit_end (FILE *); @@ -305,7 +309,9 @@ main (int argc, char *argv[]) exit (retcode); } +#ifndef WINDOWSNT setuid (getuid ()); +#endif #endif /* MAIL_USE_POP */ #ifndef DISABLE_DIRECT_ACCESS @@ -632,7 +638,7 @@ popmail (char *user, char *outfile, char *password) error ("Error in open: %s, %s", strerror (errno), outfile); return (1); } -#ifndef __CYGWIN32__ +#if !defined(__CYGWIN32__) && !defined(WINDOWSNT) fchown (mbfi, getuid (), -1); #endif @@ -725,7 +731,7 @@ popmail (char *user, char *outfile, char *password) } static int -pop_retr (popserver server, int msgno, int (*action)(), void *arg) +pop_retr (popserver server, int msgno, int (*action)(char *, FILE *), void *arg) { char *line; int ret; @@ -847,7 +853,7 @@ mbx_delimit_end (FILE *mbf) /* Turn a name, which is an ed-style (but Emacs syntax) regular expression, into a real regular expression by compiling it. */ static struct re_pattern_buffer* -compile_regex (char* regexp_pattern) +compile_regex (char* pattern) { char *err; struct re_pattern_buffer *patbuf=0; @@ -858,7 +864,7 @@ compile_regex (char* regexp_pattern) patbuf->buffer = NULL; patbuf->allocated = 0; - err = (char*) re_compile_pattern (regexp_pattern, strlen (regexp_pattern), patbuf); + err = (char*) re_compile_pattern (pattern, strlen (pattern), patbuf); if (err != NULL) { error ("%s while compiling pattern", err, NULL); @@ -873,7 +879,7 @@ compile_regex (char* regexp_pattern) #endif /* MAIL_USE_POP */ #ifndef HAVE_STRERROR -static char * +char * strerror (int errnum) { extern char *sys_errlist[];