home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 20 NDrivers
/
20-NDrivers.zip
/
samba193.zip
/
patches.os2
< prev
next >
Wrap
Text File
|
1996-04-17
|
10KB
|
359 lines
diff -u orig-source/client.c source/client.c
--- orig-source/client.c Mon Jan 15 21:56:44 1996
+++ source/client.c Wed Apr 17 11:41:06 1996
@@ -2076,6 +2076,8 @@
pstring rname;
file_info finfo;
fstring buf;
+ pstring quest;
+
char *p=buf;
finfo = def_finfo;
@@ -2084,6 +2086,19 @@
while (next_token(NULL,p,NULL))
{
struct stat st;
+ int i ;
+
+#ifdef USE_GLOB
+ /* No recursion using GLOB, but faster, and portable (POSIX.2) */
+ glob_t filelist ;
+ /* GLOB_NOESCAPE included in case user uses \ for path seperator on OS/2 */
+ if (glob(p,GLOB_NOESCAPE|GLOB_NOSORT,NULL,&filelist ) != 0)
+ continue ;
+
+ for (i=0; i<filelist.gl_pathc; i++)
+ {
+ strcpy( lname, filelist.gl_pathv[i] ) ;
+#else
pstring cmd;
pstring tmpname;
FILE *f;
@@ -2100,9 +2115,10 @@
while (!feof(f))
{
- pstring quest;
-
if (fscanf(f,"%s",lname) != 1) break;
+
+#endif /* USE_GLOB */
+
trim_string(lname,"./",NULL);
again1:
@@ -2115,8 +2131,10 @@
if (prompt && !yesno(quest))
{
strcat(lname,"/");
+#ifndef USE_GLOB
if (!seek_list(f,lname))
break;
+#endif
goto again1;
}
@@ -2125,8 +2143,10 @@
if (!do_mkdir(rname))
{
strcat(lname,"/");
+#ifndef USE_GLOB
if (!seek_list(f,lname))
break;
+#endif
goto again1;
}
@@ -2150,8 +2170,13 @@
do_put(rname,lname,&finfo);
}
+
+#ifdef USE_GLOB
+ globfree(&filelist) ;
+#else
fclose(f);
unlink(tmpname);
+#endif
}
}
@@ -3091,7 +3116,11 @@
memcpy(p,pword,passlen); p += SVAL(outbuf,smb_vwv7);
strcpy(p,username);p = skip_string(p,1);
strcpy(p,workgroup);p = skip_string(p,1);
+#ifdef OS2
+ strcpy(p,"OS/2");p = skip_string(p,1);
+#else
strcpy(p,"Unix");p = skip_string(p,1);
+#endif
strcpy(p,"Samba");p = skip_string(p,1);
set_message(outbuf,13,PTR_DIFF(p,smb_buf(outbuf)),False);
}
@@ -4025,6 +4054,17 @@
extern char *optarg;
pstring query_host;
BOOL message = False;
+
+#ifdef STDIN_NEEDS_UNIX_SETUP
+ /* OS/2 stdin is different, but EMX allows us to set it up to be more
+ * Unix-like. Still not perfect, but bearable
+ */
+ struct termio tio ;
+
+ ioctl( fileno(stdin), TCGETA, &tio ) ;
+ tio.c_lflag ^= IDEFAULT ;
+ ioctl( fileno(stdin), TCSETA, &tio ) ;
+#endif
*query_host = 0;
diff -u orig-source/includes.h source/includes.h
--- orig-source/includes.h Mon Jan 15 21:15:36 1996
+++ source/includes.h Mon Mar 18 10:42:06 1996
@@ -102,6 +102,7 @@
#ifdef OS2
#define NO_SYSMOUNTH
#define NO_NETIFH
+#define PAGER "more <"
#endif
@@ -816,11 +817,15 @@
#ifdef OS2
#include <dirent.h>
#include <sys/statfs.h>
+#include <sys/termio.h>
#include <string.h>
#include <limits.h>
+#include <glob.h>
#define SIGNAL_CAST (void (*)())
#define HAVE_FCNTL_LOCK 0
#define USE_WAITPID
+#define USE_GETCWD
+#define getcwd _getcwd2
#define NO_GET_BROADCAST
#define NO_EID
#define NO_SETGROUPS
@@ -829,6 +834,15 @@
#define NO_STATFS
#define NO_CHROOT
#define NO_CHOWN
+#define BUGGY_OS2_SELECT
+#define STDIN_NEEDS_UNIX_SETUP
+#define HAVE_DRIVE_LETTERS
+#define NO_SMBRUN
+#define USE_GLOB
+#define SYSV
+#define SYSV_TERMIO
+#define DEFAULT_PRINTING PRINT_BSD
+#define NULL_DEVICE "nul"
#define strcasecmp stricmp
#define strncasecmp strnicmp
#endif
@@ -837,6 +851,10 @@
/*******************************************************************
end of the platform specific sections
********************************************************************/
+
+#ifndef NULL_DEVICE
+#define NULL_DEVICE "/dev/null"
+#endif
#ifdef REPLACE_GETPASS
extern char *getsmbpass(char *);
diff -u orig-source/Makefile source/Makefile
--- orig-source/Makefile Mon Jan 15 21:02:02 1996
+++ source/Makefile Sun Feb 11 17:38:48 1996
@@ -437,7 +437,7 @@
# This is for OS/2 using EMX 0.9b
# Contributed by jasonr@pec.co.nz (Jason Rumney)
# FLAGSM = -DOS2
-# LIBSM = -Zexe -lsocket
+# LIBSM = -Zexe -Zbin-files -lsocket
######################################################################
@@ -493,7 +493,7 @@
@echo Linking nmblookup
@$(CC) $(CFLAGS) -o nmblookup nmblookup.o nmblib.o $(UTILOBJ) $(LIBS)
-nmbd: nameserv.o nmblib.o nmbsync.o $(UTILOBJ)
+nmbd: nameserv.o nmblib.o nmbsync.o $(PARAMOBJ)
@echo Linking nmbd
@$(CC) $(CFLAGS) -o nmbd nameserv.o nmblib.o nmbsync.o $(PARAMOBJ) $(LIBS)
diff -u orig-source/nameserv.c source/nameserv.c
--- orig-source/nameserv.c Mon Jan 15 20:38:56 1996
+++ source/nameserv.c Sun Feb 11 17:51:22 1996
@@ -497,7 +497,7 @@
strcat(fname,"/");
strcat(fname,SERVER_LIST);
strcpy(fnamenew,fname);
- strcat(fnamenew,".");
+ strcat(fnamenew,".new");
f = fopen(fnamenew,"w");
diff -u orig-source/nmblib.c source/nmblib.c
--- orig-source/nmblib.c Mon Jan 15 20:39:22 1996
+++ source/nmblib.c Tue Feb 13 11:40:30 1996
@@ -592,6 +592,7 @@
{
fd_set fds;
struct timeval timeout;
+ int selrtn ;
FD_ZERO(&fds);
FD_SET(fd,&fds);
@@ -598,9 +599,9 @@
timeout.tv_sec = t/1000;
timeout.tv_usec = 1000*(t%1000);
- sys_select(&fds,&timeout);
+ selrtn = sys_select(&fds,&timeout);
- if (FD_ISSET(fd,&fds))
+ if (FD_ISSET(fd,&fds))
return(read_packet(fd,type));
return(NULL);
diff -u orig-source/printing.c source/printing.c
--- orig-source/printing.c Mon Jan 15 14:29:50 1996
+++ source/printing.c Wed Apr 17 12:50:08 1996
@@ -590,7 +590,6 @@
}
-
char *stat0_strings[] = { "enabled", "online", "idle", "no entries", "free", "ready", NULL };
char *stat1_strings[] = { "offline", "disabled", "down", "off", "waiting", "no daemon", NULL };
char *stat2_strings[] = { "jam", "paper", "error", "responding", "not accepting", "not running", "turned off", NULL };
diff -u orig-source/reply.c source/reply.c
--- orig-source/reply.c Tue Jan 16 22:28:28 1996
+++ source/reply.c Wed Apr 17 11:40:10 1996
@@ -413,7 +413,11 @@
char *p;
outsize = set_message(outbuf,3,3,True);
p = smb_buf(outbuf);
+#ifdef OS2
+ strcpy(p,"OS/2"); p = skip_string(p,1);
+#else
strcpy(p,"Unix"); p = skip_string(p,1);
+#endif
strcpy(p,"Samba "); strcat(p,VERSION); p = skip_string(p,1);
strcpy(p,my_workgroup()); p = skip_string(p,1);
outsize = set_message(outbuf,3,PTR_DIFF(p,smb_buf(outbuf)),False);
diff -u orig-source/smbrun.c source/smbrun.c
--- orig-source/smbrun.c Thu Jun 29 21:20:06 1995
+++ source/smbrun.c Sun Feb 25 17:36:52 1996
@@ -33,8 +33,8 @@
/* try and use up these file descriptors, so silly
library routines writing to stdout etc won't cause havoc */
for (i=0;i<3;i++) {
- fd = open("/dev/null",O_RDWR,0);
- if (fd < 0) fd = open("/dev/null",O_WRONLY,0);
+ fd = open(NULL_DEVICE,O_RDWR,0);
+ if (fd < 0) fd = open(NULL_DEVICE,O_WRONLY,0);
if (fd != i) return;
}
}
diff -u orig-source/status.c source/status.c
--- orig-source/status.c Mon Jan 15 20:40:10 1996
+++ source/status.c Sun Feb 25 17:38:00 1996
@@ -62,7 +62,7 @@
charset_initialise();
DEBUGLEVEL = 0;
- dbf = fopen("/dev/null","w");
+ dbf = fopen(NULL_DEVICE,"w");
if (getuid() != geteuid()) {
printf("smbstatus should not be run setuid\n");
diff -u orig-source/system.c source/system.c
--- orig-source/system.c Mon Jan 15 15:12:04 1996
+++ source/system.c Sun Feb 25 17:20:28 1996
@@ -20,7 +20,9 @@
*/
#include "includes.h"
+extern int DEBUGLEVEL ;
+
/*
The idea is that this file will eventually have wrappers around all
important system calls in samba. The aim is twofold:
@@ -81,7 +83,7 @@
return(found);
}
- if (tval && tval.tv_sec < counter) return(0);
+ if (tval && tval->tv_sec < counter) return(0);
sleep(1);
counter++;
}
@@ -99,6 +101,13 @@
selrtn = select(FD_SETSIZE,SELECT_CAST fds,NULL,NULL,tval?&t2:NULL);
} while (selrtn<0 && errno == EINTR);
+#ifdef BUGGY_OS2_SELECT
+ if ( selrtn == 0 ) {
+ /* EMX select() does not reset fds */
+ FD_ZERO( fds ) ;
+ }
+#endif
+
return(selrtn);
}
#endif
@@ -171,7 +180,11 @@
********************************************************************/
int sys_chdir(char *dname)
{
+#if defined(HAVE_DRIVE_LETTERS)
+ return(_chdir2(dos_to_unix(dname,False)));
+#else
return(chdir(dos_to_unix(dname,False)));
+#endif
}
diff -u orig-source/util.c source/util.c
--- orig-source/util.c Tue Jan 16 12:14:44 1996
+++ source/util.c Mon Feb 26 09:44:52 1996
@@ -2030,8 +2030,8 @@
/* try and use up these file descriptors, so silly
library routines writing to stdout etc won't cause havoc */
for (i=0;i<3;i++) {
- fd = open("/dev/null",O_RDWR,0);
- if (fd < 0) fd = open("/dev/null",O_WRONLY,0);
+ fd = open(NULL_DEVICE,O_RDWR,0);
+ if (fd < 0) fd = open(NULL_DEVICE,O_WRONLY,0);
if (fd < 0) {
DEBUG(0,("Can't open /dev/null\n"));
return;
@@ -3975,7 +3975,9 @@
{
int ret;
pstring syscmd;
-
+#ifdef NO_SMBRUN
+ sprintf(syscmd,"%s >%s 2>&1", cmd, outfile?outfile:NULL_DEVICE) ;
+#else
if (!file_exist(smbrun_path,NULL))
{
DEBUG(0,("SMBRUN ERROR: Can't find %s. Installation problem?\n",smbrun_path));
@@ -3984,9 +3986,10 @@
sprintf(syscmd,"%s \"(%s 2>&1) > %s\"",
smbrun_path,cmd,
- outfile?outfile:"/dev/null");
+ outfile?outfile:NULL_DEVICE);
DEBUG(5,("smbrun - running %s ",syscmd));
+#endif
ret = system(syscmd);
DEBUG(5,("gave %d\n",ret));
return(ret);