Update to pld patches and integrate koan patch

This commit is contained in:
Mario Fetka 2013-11-05 11:54:31 +01:00
parent be2d60525a
commit 35d12ee7aa
16 changed files with 70 additions and 323 deletions

View File

@ -7,7 +7,7 @@ enable_language(C)
SET (VERSION_MAJOR "0")
SET (VERSION_MINOR "99")
SET (VERSION_PATCH "22")
SET (VERSION_PATCH "23")
SET (VERSION_SUB "0")
SET (VERSION_DEVEL "0")
SET (VERSION_SUFFIX ".0")

View File

@ -1,101 +0,0 @@
# Makefile mars_nwe: 10-Feb-96
VPATH=
.EXPORT_ALL_VARIABLES:
# defaults, can be overwritten in mk.li
V_VPATH=..
OBJDIR=obj
all: rmeflag mk.li config.h nw.ini
@if [ -r .eflag ] ; then \
echo ""; \
echo "********************************************************"; \
cat .eflag; rm -f .eflag; \
echo "";\
echo "Please make your changes and run make again"; \
echo "********************************************************"; \
echo "";\
echo ""; else ./mk.li && (\
if [ -r .mk.notes ] ; then echo "" ; \
echo ""; \
echo "********************************************************" ; \
echo ""; \
cat .mk.notes; rm -f .mk.notes ; \
echo ""; \
echo "********************************************************" ; \
echo ""; echo "" ; fi ) fi
routed:
./mk.li $@
install:
./mk.li $@
reboot:
./mk.li $@
install_ini: nw.ini
./mk.li $@
clean: mk.li nw.ini
./mk.li $@
rm -f .mk.notes
rm -f .eflag
distrib: mk.li nw.ini
./mk.li $@
distrib_bin: mk.li nw.ini
./mk.li $@
bintgz:
./mk.li $@
diff:
./mk.li $@
showconf:
./mk.li -s $@
mk.li: examples/mk.li
@if [ -r $@ ] ; then \
cp -f $@ $@.org && ( \
echo "********************************************************"; \
echo "";\
echo "saved: $@ -> $@.org, there is a new examples/$@"; \
echo "";\
echo "********************************************************"; \
echo "" ) ; fi
@ echo ""
@ echo ""
@- cp -i examples/$@ .
@ touch -c $@
@ echo ""
@ echo "********************************************************"
@ echo ""
@ echo "perhaps $@ is new and you need to edit it."
@ echo ""
@ echo "********************************************************"
@ echo ""
@ echo "" > .eflag
config.h: examples/config.h
@if [ -r $@ ] ; then echo "note:examples/$@ is newer then $@" >> .eflag ;\
echo "$@ will be touched now" >> .eflag; touch -c $@ ; \
else cp examples/$@ . ; \
echo "$@ created (from examples/$@) Please edit $@" >> .eflag;\
echo "and change it to your requirements." >> .eflag ; fi
rmeflag:
@- rm -f .eflag
nw.ini: examples/nw.ini
@rm -f .mk.notes
@if [ -r $@ ] ; then echo "NOTE:examples/$@ is newer then $@" > .mk.notes ; \
echo "please compare examples/$@ with $@" >> .mk.notes; \
echo "make the changes you need and touch $@" >> .mk.notes; \
else cp examples/$@ . ; \
echo "$@ created (from examples/$@) Please edit $@" > .mk.notes;\
echo "and change it to your requirements." >> .mk.notes ; fi

View File

@ -11,10 +11,10 @@
# define PATHNAME_PROGS "." /* where to find the executables */
# define PATHNAME_BINDERY "." /* directory for bindery-files */
#else
# define FILENAME_NW_INI "/etc/nwserv.conf"
# define FILENAME_NW_INI "/etc/nwserv/nwserv.conf"
/* full name of ini (conf) file */
# define PATHNAME_PROGS "/usr/sbin" /* where to find the executables */
# define PATHNAME_BINDERY "/var/nwserv/db" /* directory for bindery-files */
# define PATHNAME_BINDERY "/var/lib/nwserv/bindery" /* directory for bindery-files */
#endif
#define PATHNAME_PIDFILES "/var/run" /* directory for 'pidfiles' */
@ -82,7 +82,7 @@
/* <--------------- next is for linux only ----------------------------> */
#define INTERNAL_RIP_SAP 1 /* use internal/own rip/sap routines */
#define SHADOW_PWD 0 /* change to '1' for shadow passwds */
#define SHADOW_PWD 1 /* change to '1' for shadow passwds */
#define QUOTA_SUPPORT 0 /* change to '1' for quota support */
/* for sending 'Request being serviced' replys, /lenz */

View File

@ -1 +0,0 @@
make unxcomm && mv unxcomm /u3/pipes/.

View File

@ -1,143 +0,0 @@
#!/bin/sh
# mk.li 15-Dec-99
# please edit this file !
mk()
{
MYBASE=`pwd`;
ERRFILE=$TMP/`basename $MYBASE`.err;
rm -f $ERRFILE;
if [ $V_VPATH = '..' ] ; then
if [ ! -d $OBJDIR ] ; then mkdir $OBJDIR; fi
cd $OBJDIR;
fi
if $MAKE -f $V_VPATH/makefile.unx $@ 2>&1;then true;else kill -HUP $MK_PPID;fi | tee $ERRFILE
if [ $V_VPATH = '..' ] ; then
cd ..;
fi
if [ -f $ERRFILE ] ; then
chmod 666 $ERRFILE
fi
}
print_error()
{
echo ""
echo "The errors are also reported in '$ERRFILE'"
echo "============================================================="
}
TOLOWER='tr "[A-Z]" "[a-z]"'
UNX=`uname -s | $TOLOWER`
MASCHINE=`uname -m`
MK_PPID=$$
export MK_PPID
trap 'print_error; exit 1' 1
case $UNX in
linux)
V_VPATH=".."
OBJDIR="obj"
CC=cc
CPP="cc -E"
# CFLAGS="-pipe -O2 -fomit-frame-pointer"
# problems gcc2.5.8 ^^^^^^^^^^^^^^^^^^^^^
# CFLAGS="-pipe -Wall -Dsignal=sysv_signal"
CFLAGS="$RPM_OPT_FLAGS -pipe -Wall -D_GNU_SOURCE"
case $MASCHINE in
sparc)
HOSTCFLAGS="-DLINUX -DSPARC"
;;
*)
HOSTCFLAGS="-DLINUX"
;;
esac
if [ -f /usr/lib/libgdbm.a ] || [ -f /usr/lib/libgdbm.so ] ; then
NDBMLIB="-lgdbm"
else
NDBMLIB="-ldbm"
fi
if [ -f /usr/lib/libcrypt.so ] ; then
CRYPTLIB="-lcrypt"
else
CRYPTLIB=""
fi
if [ -f /usr/include/sys/quota.h ] ; then
HOSTCFLAGS="$HOSTCFLAGS -DQTAINSYS"
fi
NSLLIB=""
MAKE=make
TMP=/tmp
INSTALL=install
;;
########### SYSV (UnixWare) ##############
unix_sv)
V_VPATH="."
OBJDIR="."
CC=cc
CPP="cc -E"
CFLAGS=
HOSTCFLAGS=""
NDBMLIB="/usr/ucblib/libucb.a"
CRYPTLIB="-lgen"
NSLLIB="-lnsl"
MAKE=make
TMP=/tmp
INSTALL=/usr/ucb/install
;;
########## FreeBSD ############
# created by Boris Popov
freebsd)
V_VPATH=".."
OBJDIR="obj"
CC=gcc
CPP="gcc -E"
if [ "x$CFLAGS" = "x" ]; then
CFLAGS="native"
fi
HOSTCFLAGS="-DFREEBSD -DLINUX"
CRYPTLIB="-lcrypt -lipx"
NSLLIB=""
MAKE=make
TMP="./"
INSTALL="install -c"
;;
*) echo "mk.li: Unknown or not supported OS, probably you must set \$UNX"
;;
esac
## BEGIN try to pass around what the dbm is to the compiler (acli 19970709)
case "$NDBMLIB" in
*gdbm*)
HOSTCFLAGS="$HOSTCFLAGS -DUSE_GDBM"
;;
esac
## END
export CC
export CPP
if [ "X$CFLAGS" != "Xnative" ]; then
export CFLAGS
fi
export HOSTCFLAGS
export NDBMLIB
export CRYPTLIB
export NSLLIB
export TMP
export INSTALL
export V_VPATH
export OBJDIR
mk $@

View File

@ -158,9 +158,10 @@
# 1 PRIVAT ~/privat kO 700 600
# 1 WORLD /var/world kiO 777 666
# 1 FAXQ /var/spool/fax/faxqueue k
1 SYS /u3/SYS/ kt 711 600
1 SYS /var/lib/nwserv/sys kt -1
1 PIPE /var/lib/nwserv/pipe kp
1 CDROM /mnt/cdrom kmnor
1 HOME ~ k -1
# =========================================================================
# Section 2: servername (optional)
@ -310,7 +311,7 @@
4 0x22 eth0 ethernet_ii 1
4 0x0 * AUTO 1
# 4 0x0 * AUTO 1
# Section 5: special device flags
# =========================================================================
@ -465,7 +466,7 @@
# Volumes depended values can be set in section 1.
# 9 -1 0640
#
9 0751 0640
9 0755 0664
# Section 10: UID and GID with minimal rights
# =========================================================================
@ -499,8 +500,8 @@
# 10 65534
# 11 65534
10 65534
11 65534
10 99
11 99
# =========================================================================
@ -549,7 +550,7 @@
# Example:
# 12 SUPERVISOR nw-adm top-secret
12 SUPERVISOR root
12 SUPERVISOR root top-secret
# =========================================================================
@ -632,6 +633,8 @@
15 0 top-secret
13 GUEST nobody - 0x1
# =========================================================================
# Section 16: Tests on startup
@ -715,9 +718,8 @@
# 21 OCTOPUSS
# 21 FAXPRINT - /usr/bin/psfaxprn /var/spool/fax/faxqueue
# -------------------------------------------------------------------------
21 LP - lpr -
#21 LP_PS
21 LP SYS:/PRINT/LP lpr
21 LP_PS
# =========================================================================
@ -735,7 +737,7 @@
# Examples:
# 22 PS1 OCTOPUSS
#22 PS_NWE LP_PS 1
22 PS_NWE LP_PS 1
# =========================================================================
@ -769,11 +771,11 @@
#
#
# 45 = path for bindery file's
45 /var/nwserv/db
45 /var/lib/nwserv/bindery
# 46 = path for attribute handling
46 /var/nwserv/attrib
46 /var/lib/nwserv/attrib
# 47 = path for trustee handling
47 /var/nwserv/trustees
47 /var/lib/nwserv/trustees
# =========================================================================
# Section 50: Conversion tables by Victor Khimenko <khim@mccme.ru>
# Tables for DOS->Unix names translation & upper/lowercase translations
@ -791,6 +793,7 @@
# Examples:
# 50 /etc/nwserv.cnv
50 /etc/nwserv/nwserv.cnv
# Changing defaults from config.h
# more information in config.h
@ -835,7 +838,7 @@
#201 syslog # if filename == syslog then syslogd will be used for
# all messages
202 0x1 # flag in hex notation
202 0x0 # flag in hex notation
# 0x0=append all messages to logfile.
# & 0x1=creat new logfile instead of appending.
#202 0x3 # & 0x2=use syslogd for error messages instead of logfile.
@ -845,7 +848,7 @@
# Sections 210,211: timing
210 10 # 1 .. 600 (default 10) seconds after server
210 5 # 1 .. 600 (default 10) seconds after server
# really goes down after a down command
211 60 # 10 .. 600 (default 60) broadcasts every x seconds
@ -856,7 +859,7 @@
# ( normally minutes )
301 /var/log/nw.routes # filename of logfile
302 0x1 # flags will be interpreted as hex value.
302 0x0 # flags will be interpreted as hex value.
# 0 = append to this file
# & 0x1 = creat new routing info file
# & 0x2 = split info into several files
@ -870,7 +873,7 @@
# Section 400:
# station file for special handling of stations.
400 /etc/nwserv.stations # for syntax see file in the examples directory.
400 /etc/nwserv/nwserv.stations # for syntax see file in the examples directory.
# Section 401: nearest server

View File

@ -1,33 +0,0 @@
#!/bin/sh
yesno()
{
echo ""
echo $@
while true; do
echo "please answer with (Y)es or (N)o and <Return>."
read X
case "$X" in
('y'|'Y')
return 0
;;
('n'|'N')
return 1
;;
*)
;;
esac
done
}
COMMAND=$1
shift
case "$COMMAND" in
'yesno')
if yesno $@ ; then exit 0; fi
;;
esac
exit 1

View File

@ -35,19 +35,13 @@
#else
# include <linux/types.h>
# include <netinet/in.h>
# ifdef _GNU_SOURCE_
# include <netipx/ipx.h>
# else
# include <linux/ipx.h>
# endif
#endif
typedef unsigned char uint8;
typedef unsigned short int uint16;
/* amd64 not working
/* typedef unsigned long int uint32; */
typedef unsigned int uint32;
*/
typedef unsigned long int uint32;
#define IPX_NET_SIZE 4
#define IPX_NODE_SIZE 6

View File

@ -173,11 +173,11 @@ extern int errno;
#endif
#ifndef MAX_CONNECTIONS
# define MAX_CONNECTIONS 5 /* maximum Number of connections */
# define MAX_CONNECTIONS 50 /* maximum Number of connections */
#endif
#ifndef MAX_NW_VOLS
# define MAX_NW_VOLS 10 /* maximum Number of volumes */
# define MAX_NW_VOLS 20 /* maximum Number of volumes */
#endif
#ifndef MAX_FILE_HANDLES_CONN

View File

@ -27,6 +27,7 @@
#define NWBIND 5
#define NWROUTED 6
/* extern FILE *logfile; */
extern void x_x_xfree(char **p);
extern int x_x_xnewstr(uint8 **p, uint8 *s);

View File

@ -56,6 +56,11 @@ install(FILES nwserv.stations DESTINATION ${MARS_NWE_INSTALL_FULL_CONFDIR})
install(FILES nw.ini.cnv.437 DESTINATION ${MARS_NWE_INSTALL_FULL_CONFDIR} RENAME nwserv.cnv.437)
install(FILES nw.ini.cnv.cyr DESTINATION ${MARS_NWE_INSTALL_FULL_CONFDIR} RENAME nwserv.cnv.cyr)
install(FILES nw.ini.cnv.min DESTINATION ${MARS_NWE_INSTALL_FULL_CONFDIR} RENAME nwserv.cnv.min)
install(FILES nw.ini.cnv.pl.852-iso2 DESTINATION ${MARS_NWE_INSTALL_FULL_CONFDIR} RENAME nwserv.cnv.pl.852-iso2)
install(FILES nw.ini.cnv.pl.852-none DESTINATION ${MARS_NWE_INSTALL_FULL_CONFDIR} RENAME nwserv.cnv.pl.852-none)
install(FILES nw.ini.cnv.pl.cp1250-iso2 DESTINATION ${MARS_NWE_INSTALL_FULL_CONFDIR} RENAME nwserv.cnv.pl.cp1250-iso2)
install(FILES nw.ini.cnv.pl.mazovia-iso2 DESTINATION ${MARS_NWE_INSTALL_FULL_CONFDIR} RENAME nwserv.cnv.pl.mazovia-iso2)
install(FILES nwopt DESTINATION ${MARS_NWE_INSTALL_FULL_FILEDIR}/SYS RENAME .nwopt.vol)
install(FILES nwopt DESTINATION ${CMAKE_INSTALL_FULL_SYSCONFDIR}/skel RENAME .nwopt)
@ -65,3 +70,8 @@ install(TARGETS unxcomm DESTINATION ${MARS_NWE_INSTALL_FULL_LIBEXECDIR})
install(TARGETS unxsendm DESTINATION ${MARS_NWE_INSTALL_FULL_LIBEXECDIR})
# install(TARGETS xsockrt DESTINATION ${MARS_NWE_INSTALL_FULL_LIBEXECDIR})
install(FILES prn DESTINATION ${MARS_NWE_INSTALL_FULL_LIBEXECDIR})
install(FILES prn-clr DESTINATION ${MARS_NWE_INSTALL_FULL_LIBEXECDIR})
install(FILES uptime DESTINATION ${MARS_NWE_INSTALL_FULL_LIBEXECDIR})

View File

@ -8,19 +8,12 @@
# Dependencies
##############
if (CMAKE_SYSTEM_NAME MATCHES Linux)
add_definitions(
-pipe -Wall -DLINUX -D_GNU_SOURCE
)
endif (CMAKE_SYSTEM_NAME MATCHES Linux)
IF(UNIX)
IF(CMAKE_COMPILER_IS_GNUCC)
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall")
ENDIF(CMAKE_COMPILER_IS_GNUCC)
ENDIF(UNIX)
add_definitions(
-D_VERS_H_=${VERSION_MAJOR}
-D_VERS_L_=${VERSION_MINOR}

View File

@ -339,7 +339,7 @@ int init_ipx(uint32 network, uint32 node, int ipx_debug, int flags)
errorp(10, "Problem", "probably kernel-IPX is not setup correctly");
exit(1);
} else {
struct ipx_config_data cfgdata;
ipx_config_data cfgdata;
struct sockaddr_ipx ipxs;
ioctl(sock, SIOCIPXCFGDATA, &cfgdata);
org_auto_interfaces =

View File

@ -1868,6 +1868,15 @@ static int nw_open_creat_file_or_dir(
creatmode = 1;
}
/*
* 18/10/2007 - pascalek (pascalek@pld-linux.org):
* If file is opened just in truncate mode (at least windows XP Client is
* affected) its opencreatemode equals 0x2. Opening it with creatmode == 0
* corrupt files.
*/
if (opencreatmode == 0x2)
creatmode = 1;
if ((result = file_creat_open(dbe->nwpath.volume,
nwpath_2_unix(&dbe->nwpath, 2), &(dbe->nwpath.statb),
attrib, access_rights, creatmode, task)) > -1) {
@ -2040,9 +2049,18 @@ static int nw_delete_file_dir(int namespace, int searchattrib,
DIR_BASE_ENTRY *dbe=dir_base[result];
if (get_volume_options(dbe->nwpath.volume) &
VOL_OPTION_READONLY) result = -0x8a;
else result=func_search_entry(dbe, namespace,
else {
result=func_search_entry(dbe, namespace,
search_entry, strlen(search_entry), searchattrib,
delete_file_dir, NULL);
/* ncpfs deletes file with file handle and NAME_DOS so we have
to try NAME_OS2 too while deleting files */
if ((result == -255) && (namespace == NAME_DOS)) {
result=func_search_entry(dbe, NAME_OS2,
search_entry, strlen(search_entry), searchattrib,
delete_file_dir, NULL);
}
}
}
return(result);
}

View File

@ -1238,7 +1238,7 @@ static int server_is_down=0;
static int usage(char *prog)
{
fprintf(stderr, "============== mars_nwe by Koan ===============\n\n") ; // (M@)
fprintf(stderr, "============== mars_nwe by Geos One ===============\n\n") ; // (M@)
#if IN_NWROUTED || INTERNAL_RIP_SAP
@ -1330,7 +1330,7 @@ int main(int argc, char **argv)
case 'f' : init_mode = 5; break;
case 'q' : if (init_mode == 2) init_mode=4; break;
case 'v' :
case 'V' : fprintf(stderr, "\n%s:Version %d.%d.pl%d [ KOAN ]\n",
case 'V' : fprintf(stderr, "\n%s:Version %d.%d.pl%d [ GEOS_ONE ]\n",
argv[0], _VERS_H_, _VERS_L_, _VERS_P_ );
return(0);
default : return(usage(argv[0]));

View File

@ -51,7 +51,7 @@ int act_ncpsequence=0; /* for debugging */
int act_connection=0; /* which connection (nwconn, nwbind) */
time_t act_time=0L; /* actual time */
static FILE *logfile=NULL;
FILE *logfile=NULL;
static int use_syslog=0; /* 1 = use syslog for all loggings
* 2 = only for errors
*/
@ -160,6 +160,7 @@ void xdprintf(int dlevel, int mode, char *p, ...)
va_list ap;
static char *buffered=NULL;
int errnum = errno;
if (!logfile) logfile = stderr;
if (nw_debug >= dlevel) {
if (use_syslog==1) {
char *buf;
@ -227,6 +228,10 @@ void errorp(int mode, char *what, char *p, ...)
FILE *lologfile = logfile;
char errbuf[200];
const char *errstr = errbuf;
if (!logfile) {
lologfile = stderr;
logfile = stderr;
}
if (mode > 9) {
errnum = -1;
mode -= 10;
@ -277,6 +282,7 @@ FILE *open_nw_ini(void)
char *fname=FILENAME_NW_INI;
FILE *f=fopen(fname, "r");
int uid=geteuid();
if (!logfile) logfile = stderr;
if (f == (FILE*)NULL && uid > 0) {
seteuid(0);
f=fopen(fname, "r");