apply patch from https://github.com/davidrg/mars_nwe/issues/1#issuecomment-2259477604
This commit is contained in:
parent
37171bcc17
commit
849dbf3ead
@ -7,7 +7,7 @@ enable_language(C)
|
||||
|
||||
SET (VERSION_MAJOR "0")
|
||||
SET (VERSION_MINOR "99")
|
||||
SET (VERSION_PATCH "24")
|
||||
SET (VERSION_PATCH "25")
|
||||
SET (VERSION_SUB "0")
|
||||
SET (VERSION_DEVEL "0")
|
||||
SET (VERSION_SUFFIX ".0")
|
||||
|
@ -21,6 +21,8 @@
|
||||
#define ENV_UNXCOMM "UNXCOMM"
|
||||
|
||||
#ifdef LINUX
|
||||
# include <unistd.h>
|
||||
# include <string.h>
|
||||
# define DEFAULT_COMM "/pipes/unxcomm"
|
||||
#else
|
||||
# ifdef DEFAULT_UNC
|
||||
|
@ -12,6 +12,8 @@
|
||||
|
||||
#define ENV_UNXCOMM "UNXSENDM"
|
||||
#ifdef LINUX
|
||||
# include <unistd.h>
|
||||
# include <string.h>
|
||||
# define DEFAULT_COMM "/pipes/unxsendm"
|
||||
# else
|
||||
# define DEFAULT_COMM "p:/unxsendm"
|
||||
|
@ -8,6 +8,7 @@
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <fcntl.h>
|
||||
#include <sys/time.h>
|
||||
|
@ -5,6 +5,7 @@
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <fcntl.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/types.h>
|
||||
@ -36,7 +37,7 @@ int main(int argc, char *argv[])
|
||||
FILE *f;
|
||||
char path[MAXARGLEN+200];
|
||||
buf[size]='\0';
|
||||
sprintf(path, "/usr/sbin/sendmail %s", buf);
|
||||
sprintf(path, "/usr/bin/sendmail %s", buf);
|
||||
f=popen(path, "w");
|
||||
if (NULL != f) {
|
||||
write(1, "+++++\n", 6);
|
||||
|
@ -882,7 +882,7 @@ static int build_path( NW_PATH *path,
|
||||
if (len > 255) len = 255;
|
||||
conn_build_path_fn(vol,
|
||||
path->path,
|
||||
(only_dir) ? (uint8)NULL
|
||||
(only_dir) ? NULL
|
||||
: path->fn,
|
||||
&(path->has_wild),
|
||||
data, len, sizeof(path->fn));
|
||||
|
35
src/tools.c
35
src/tools.c
@ -21,6 +21,27 @@
|
||||
#include <stdarg.h>
|
||||
#include <syslog.h>
|
||||
|
||||
#if 0
|
||||
#ifndef LINUX
|
||||
extern int _sys_nerr;
|
||||
extern char *_sys_errlist[];
|
||||
#else
|
||||
# ifndef __USE_GNU
|
||||
# define _sys_nerr sys_nerr
|
||||
# define _sys_errlist sys_errlist
|
||||
# endif
|
||||
#endif
|
||||
#else
|
||||
# ifndef __USE_GNU
|
||||
# ifdef FREEBSD
|
||||
# define _sys_nerr sys_nerr
|
||||
# define _sys_errlist sys_errlist
|
||||
# else
|
||||
extern int _sys_nerr;
|
||||
extern char *_sys_errlist[];
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
int nw_debug=0;
|
||||
uint32 debug_mask=0; /* special debug masks */
|
||||
@ -161,6 +182,7 @@ static char *buffered=NULL;
|
||||
if (mode & 0x10) {
|
||||
int l=sprintf(pb, ", errno=%d", errnum);
|
||||
pb+=l;
|
||||
if (errnum > 0)
|
||||
l=sprintf(pb, " (%s)", strerror(errnum));
|
||||
}
|
||||
if (!(mode & 2)) {
|
||||
@ -186,7 +208,8 @@ static char *buffered=NULL;
|
||||
va_end(ap);
|
||||
}
|
||||
if (mode & 0x10) {
|
||||
fprintf(logfile, ", errno=%d", strerror(errnum));
|
||||
fprintf(logfile, ", errno=%d", errnum);
|
||||
if (errnum > 0)
|
||||
fprintf(logfile, " (%s)", strerror(errnum));
|
||||
}
|
||||
if (!(mode & 2))
|
||||
@ -213,11 +236,11 @@ void errorp(int mode, char *what, char *p, ...)
|
||||
errnum = -1;
|
||||
mode -= 10;
|
||||
}
|
||||
// if (errnum >= 0 && errnum < _sys_nerr) errstr = _sys_errlist[errnum];
|
||||
// else if (errnum > -1)
|
||||
sprintf(errbuf, "errno=%d", strerror(errnum));
|
||||
// else
|
||||
// errbuf[0] = '\0';
|
||||
if (errnum >= 0) errstr = strerror(errnum);
|
||||
else if (errnum > -1)
|
||||
sprintf(errbuf, "errno=%d", errnum);
|
||||
else
|
||||
errbuf[0] = '\0';
|
||||
|
||||
if (use_syslog) {
|
||||
int prio=(mode) ? LOG_CRIT : LOG_ERR;
|
||||
|
@ -24,6 +24,7 @@ void write_utmp(int dologin, int connection, int pid,
|
||||
#ifndef FREEBSD
|
||||
struct utmp loc_ut;
|
||||
struct utmp *ut;
|
||||
struct timeval tv;
|
||||
int fd;
|
||||
char buff[200];
|
||||
int found = 0;
|
||||
@ -67,7 +68,10 @@ void write_utmp(int dologin, int connection, int pid,
|
||||
memset(ut->ut_user, 0, sizeof(ut->ut_user));
|
||||
ut->ut_pid = 0;
|
||||
}
|
||||
(void)time(&(ut->ut_time));
|
||||
gettimeofday(&tv, NULL);
|
||||
ut->ut_tv.tv_sec=tv.tv_sec;
|
||||
ut->ut_tv.tv_usec=tv.tv_usec;
|
||||
|
||||
pututline(ut);
|
||||
endutent();
|
||||
if (NULL == fn_wtmp) return;
|
||||
|
Loading…
Reference in New Issue
Block a user