Update to pld patches and integrate koan patch
This commit is contained in:
@@ -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}
|
||||
|
||||
@@ -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 =
|
||||
|
||||
@@ -1867,6 +1867,15 @@ static int nw_open_creat_file_or_dir(
|
||||
#endif
|
||||
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),
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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]));
|
||||
|
||||
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user