1 diff -ruN samba-2.0.10.orig/source/include/smb.h samba-2.0.10/source/include/smb.h
2 --- samba-2.0.10.orig/source/include/smb.h 2001-06-23 10:52:20.000000000 +0200
3 +++ samba-2.0.10/source/include/smb.h 2006-03-06 22:21:12.000000000 +0100
6 * DEBUGADD( 2, ("Some additional text.\n") );
11 +#define DEBUGLVL( level ) \
13 + && dbghdr( level, FILE_MACRO, FUNCTION_MACRO, (__LINE__) ) )
15 +#define DEBUG( level, body ) \
16 + (void)( (0 == (level)) \
17 + && (dbghdr( level, FILE_MACRO, FUNCTION_MACRO, (__LINE__) )) \
20 +#define DEBUGADD( level, body ) \
21 + (void)( (0 == (level)) && (dbgtext body) )
24 #define DEBUGLVL( level ) \
25 ( (DEBUGLEVEL >= (level)) \
26 && dbghdr( level, FILE_MACRO, FUNCTION_MACRO, (__LINE__) ) )
28 (void)( (DEBUGLEVEL >= (level)) && (dbgtext body) )
33 /* End Debugging code section.
34 * -------------------------------------------------------------------------- **
37 #define CAP_LOCK_AND_READ 0x0100
38 #define CAP_NT_FIND 0x0200
39 #define CAP_DFS 0x1000
40 +#define CAP_W2K_SMBS 0x2000
41 #define CAP_LARGE_READX 0x4000
42 +#define CAP_LARGE_WRITEX 0x8000
43 #define CAP_EXTENDED_SECURITY 0x80000000
45 /* protocol types. It assumes that higher protocols include lower protocols
46 diff -ruN samba-2.0.10.orig/source/Makefile.in samba-2.0.10/source/Makefile.in
47 --- samba-2.0.10.orig/source/Makefile.in 2000-03-16 23:57:08.000000000 +0100
48 +++ samba-2.0.10/source/Makefile.in 2006-03-06 22:21:12.000000000 +0100
50 # set these to where to find various files
51 # These can be overridden by command line switches (see smbd(8))
52 # or in smb.conf (see smb.conf(5))
53 -SMBLOGFILE = $(VARDIR)/log.smb
54 -NMBLOGFILE = $(VARDIR)/log.nmb
55 +SMBLOGFILE = $(VARDIR)/smb
56 +NMBLOGFILE = $(VARDIR)/nmb
57 CONFIGFILE = $(LIBDIR)/smb.conf
58 LMHOSTSFILE = $(LIBDIR)/lmhosts
59 DRIVERFILE = $(LIBDIR)/printers.def
63 # The directory where code page definition files go
64 -CODEPAGEDIR = $(LIBDIR)/codepages
65 +CODEPAGEDIR = $(BASEDIR)/codepages
67 # The current codepage definition list.
68 CODEPAGELIST= 437 737 775 850 852 861 932 866 949 950 936 1251 ISO8859-1 ISO8859-2 ISO8859-5 ISO8859-7 KOI8-R
70 PROGS2 = bin/rpcclient bin/smbpasswd bin/make_smbcodepage bin/make_unicodemap @WRAP@ @WRAP32@
72 PROGS = $(PROGS1) $(PROGS2) $(MPROGS) bin/nmblookup bin/make_printerdef
73 +SHAREDPROGS = bin/smbd.shared bin/nmbd.shared bin/smbpasswd.shared
75 SCRIPTS = $(srcdir)/script/smbtar $(srcdir)/script/addtosmbpass $(srcdir)/script/convert_smbpasswd
78 $(RPC_SERVER_OBJ) $(RPC_CLIENT_OBJ) $(RPC_PARSE_OBJ) \
79 $(LOCKING_OBJ) $(PASSDB_OBJ) $(PRINTING_OBJ) $(PROFILE_OBJ) $(LIB_OBJ)
81 +SMBDSHARED_OBJ = $(SMBD_OBJ1) $(RPC_SERVER_OBJ) \
82 + $(LOCKING_OBJ) $(PROFILE_OBJ) #$(PRINTING_OBJ)
84 NMBD_OBJ1 = nmbd/asyncdns.o nmbd/nmbd.o nmbd/nmbd_become_dmb.o \
85 nmbd/nmbd_become_lmb.o nmbd/nmbd_browserdb.o \
87 NMBD_OBJ = $(NMBD_OBJ1) $(PARAM_OBJ) $(LIBSMB_OBJ) $(UBIQX_OBJ) \
90 +NMBDSHARED_OBJ = $(NMBD_OBJ1)
92 SWAT_OBJ = web/cgi.o web/diagnose.o web/startstop.o web/statuspage.o \
93 web/swat.o $(LIBSMB_OBJ) $(LOCKING_OBJ) \
94 $(PARAM_OBJ) $(PASSDB_OBJ) $(RPC_CLIENT_OBJ) $(RPC_PARSE_OBJ) \
96 SMBPASSWD_OBJ = utils/smbpasswd.o $(PARAM_OBJ) $(LIBSMB_OBJ) $(PASSDB_OBJ) \
97 $(UBIQX_OBJ) $(RPC_CLIENT_OBJ) $(RPC_PARSE_OBJ) $(LIB_OBJ)
99 +SMBPASSWDSHARED_OBJ = utils/smbpasswd.o
101 RPCCLIENT_OBJ = rpcclient/rpcclient.o \
102 rpcclient/display.o \
103 rpcclient/cmd_lsarpc.o \
105 PROTO_OBJ = $(SMBD_OBJ) $(NMBD_OBJ) $(SWAT_OBJ) $(CLIENT_OBJ) \
106 $(RPCCLIENT_OBJ) $(SMBWRAPPER_OBJ) $(SMBTORTURE_OBJ)
108 +LIBSMBSHARED_OBJ = $(LIB_OBJ) $(LIBSMB_OBJ) $(PARAM_OBJ) $(UBIQX_OBJ) \
109 + $(PASSDB_OBJ) $(RPC_PARSE_OBJ) #$(RPC_CLIENT_OBJ)
111 +LIBSMB_PICOBJS = $(LIBSMBSHARED_OBJ:.o=.po)
113 PICOBJS = $(SMBWRAPPER_OBJ:.o=.po)
114 PICOBJS32 = $(SMBWRAPPER_OBJ:.o=.po32)
118 all : CHECK $(SPROGS) $(PROGS)
120 +shared : CHECK $(SHAREDPROGS)
122 smbwrapper : CHECK bin/smbsh bin/smbwrapper.@SHLIBEXT@ @WRAP32@
124 smbtorture : CHECK bin/smbtorture
125 @@ -359,10 +373,18 @@
127 @$(CC) $(FLAGS) -o $@ $(SMBD_OBJ) $(LDFLAGS) $(LIBS)
129 +bin/smbd.shared: $(SMBDSHARED_OBJ) bin/libsmb.@SHLIBEXT@ bin/.dummy
131 + @$(CC) $(FLAGS) -o $@ $(SMBDSHARED_OBJ) $(LDFLAGS) $(LIBS) -Lbin -lsmb
133 bin/nmbd: $(NMBD_OBJ) bin/.dummy
135 @$(CC) $(FLAGS) -o $@ $(NMBD_OBJ) $(LDFLAGS) $(LIBS)
137 +bin/nmbd.shared: $(NMBDSHARED_OBJ) bin/libsmb.@SHLIBEXT@ bin/.dummy
139 + @$(CC) $(FLAGS) -o $@ $(NMBDSHARED_OBJ) $(LDFLAGS) $(LIBS) -Lbin -lsmb
141 bin/swat: $(SWAT_OBJ) bin/.dummy
143 @$(CC) $(FLAGS) -o $@ $(SWAT_OBJ) $(LDFLAGS) $(LIBS)
146 @$(CC) $(FLAGS) -o $@ $(SMBPASSWD_OBJ) $(LDFLAGS) $(LIBS)
148 +bin/smbpasswd.shared: $(SMBPASSWDSHARED_OBJ) bin/libsmb.@SHLIBEXT@ bin/.dummy
150 + @$(CC) $(FLAGS) -o $@ $(SMBPASSWDSHARED_OBJ) $(LDFLAGS) $(LIBS) -Lbin -lsmb
152 bin/make_smbcodepage: $(MAKE_SMBCODEPAGE_OBJ) bin/.dummy
154 @$(CC) $(FLAGS) -o $@ $(MAKE_SMBCODEPAGE_OBJ) $(LDFLAGS) $(LIBS)
157 @$(CC) $(FLAGS) -o $@ $(SMBSH_OBJ) $(LDFLAGS) $(LIBS)
159 +bin/libsmb.@SHLIBEXT@: $(LIBSMB_PICOBJS) bin/.dummy
160 + @echo Linking shared library $@
161 + @$(LD) @LDSHFLAGS@ -o $@ $(LIBSMB_PICOBJS) $(LIBS)
163 install: installbin installman installscripts installcp installswat
167 ctags `find . -name "*.[ch]" | grep -v /CVS/`
170 - -rm -f config.log $(PROGS) $(SPROGS) bin/.dummy
171 + -rm -f config.log $(PROGS) $(SPROGS) $(SHAREDPROGS) bin/.dummy
175 diff -ruN samba-2.0.10.orig/source/nmbd/nmbd_mynames.c samba-2.0.10/source/nmbd/nmbd_mynames.c
176 --- samba-2.0.10.orig/source/nmbd/nmbd_mynames.c 2000-03-16 23:59:24.000000000 +0100
177 +++ samba-2.0.10/source/nmbd/nmbd_mynames.c 2006-03-06 22:21:12.000000000 +0100
180 if( !is_refresh_already_queued( subrec, namerec) )
181 refresh_name( subrec, namerec, NULL, NULL, NULL );
182 - namerec->data.death_time += lp_max_ttl();
183 - namerec->data.refresh_time += MIN(lp_max_ttl(), MAX_REFRESH_TIME);
184 + namerec->data.death_time = t + lp_max_ttl();
185 + namerec->data.refresh_time = t + MIN(lp_max_ttl(), MAX_REFRESH_TIME);
189 diff -ruN samba-2.0.10.orig/source/smbd/close.c samba-2.0.10/source/smbd/close.c
190 --- samba-2.0.10.orig/source/smbd/close.c 2000-04-21 19:43:13.000000000 +0200
191 +++ samba-2.0.10/source/smbd/close.c 2006-03-06 22:21:12.000000000 +0100
192 @@ -122,11 +122,11 @@
193 last_reference = True;
198 /* NT uses smbclose to start a print - weird */
199 if (normal_close && fsp->print_file)
200 print_file(conn, fsp);
203 /* check for magic scripts */
205 check_magic(fsp,conn);
206 diff -ruN samba-2.0.10.orig/source/smbd/ipc.c samba-2.0.10/source/smbd/ipc.c
207 --- samba-2.0.10.orig/source/smbd/ipc.c 2000-03-30 00:20:06.000000000 +0200
208 +++ samba-2.0.10/source/smbd/ipc.c 2006-03-06 22:21:12.000000000 +0100
215 /****************************************************************************
217 ****************************************************************************/
218 @@ -1004,7 +1004,7 @@
224 /****************************************************************************
225 get info level for a server list query
226 ****************************************************************************/
227 @@ -1834,7 +1834,7 @@
233 /****************************************************************************
236 @@ -2091,7 +2091,7 @@
243 /****************************************************************************
244 get info about the server
245 @@ -2756,7 +2756,7 @@
251 /****************************************************************************
252 api_WPrintJobEnumerate
253 ****************************************************************************/
254 @@ -3189,7 +3189,7 @@
255 DEBUG(4,("WPrintPortEnum: errorcode %d\n",desc.errcode));
260 /****************************************************************************
261 Start the first part of an RPC reply which began with an SMBtrans request.
262 ****************************************************************************/
263 @@ -3407,6 +3407,7 @@
264 {"RNetUserGetInfo", 56, api_RNetUserGetInfo,0},
265 {"NetUserGetGroups", 59, api_NetUserGetGroups,0},
266 {"NetWkstaGetInfo", 63, api_NetWkstaGetInfo,0},
268 {"DosPrintQEnum", 69, api_DosPrintQEnum,0},
269 {"DosPrintQGetInfo", 70, api_DosPrintQGetInfo,0},
270 {"WPrintQueuePause", 74, api_WPrintQueuePurge,0},
271 @@ -3418,16 +3419,21 @@
272 {"RDosPrintJobResume",83, api_RDosPrintJobDel,0},
273 {"WPrintDestEnum", 84, api_WPrintDestEnum,0},
274 {"WPrintDestGetInfo", 85, api_WPrintDestGetInfo,0},
276 {"NetRemoteTOD", 91, api_NetRemoteTOD,0},
278 {"WPrintQueuePurge", 103, api_WPrintQueuePurge,0},
280 {"NetServerEnum", 104, api_RNetServerEnum,0},
281 {"WAccessGetUserPerms",105, api_WAccessGetUserPerms,0},
282 {"SetUserPassword", 115, api_SetUserPassword,0},
283 {"WWkstaUserLogon", 132, api_WWkstaUserLogon,0},
285 {"PrintJobInfo", 147, api_PrintJobInfo,0},
286 {"WPrintDriverEnum", 205, api_WPrintDriverEnum,0},
287 {"WPrintQProcEnum", 206, api_WPrintQProcEnum,0},
288 {"WPrintPortEnum", 207, api_WPrintPortEnum,0},
290 {"SamOEMChangePassword", 214, api_SamOEMChangePassword,0},
291 {NULL, -1, api_Unsupported,0}};
293 diff -ruN samba-2.0.10.orig/source/smbd/negprot.c samba-2.0.10/source/smbd/negprot.c
294 --- samba-2.0.10.orig/source/smbd/negprot.c 2000-03-16 23:59:47.000000000 +0100
295 +++ samba-2.0.10/source/smbd/negprot.c 2006-03-06 22:21:12.000000000 +0100
297 /* dual names + lock_and_read + nt SMBs + remote API calls */
298 int capabilities = CAP_NT_FIND|CAP_LOCK_AND_READ|
299 (lp_nt_smb_support() ? CAP_NT_SMBS | CAP_RPC_REMOTE_APIS : 0) |
300 - (SMB_OFF_T_BITS == 64 ? CAP_LARGE_FILES : 0);
301 + (SMB_OFF_T_BITS == 64 ? CAP_LARGE_FILES | CAP_LARGE_READX | CAP_LARGE_WRITEX /*| CAP_W2K_SMBS*/ : 0);
305 diff -ruN samba-2.0.10.orig/source/smbd/password.c samba-2.0.10/source/smbd/password.c
306 --- samba-2.0.10.orig/source/smbd/password.c 2000-03-16 23:59:48.000000000 +0100
307 +++ samba-2.0.10/source/smbd/password.c 2006-03-06 22:21:12.000000000 +0100
308 @@ -1149,7 +1149,7 @@
314 /***********************************************************************
315 Connect to a remote machine for domain security authentication
316 given a name or IP address.
317 @@ -1504,3 +1504,4 @@
322 diff -ruN samba-2.0.10.orig/source/smbd/process.c samba-2.0.10/source/smbd/process.c
323 --- samba-2.0.10.orig/source/smbd/process.c 2000-04-15 02:21:27.000000000 +0200
324 +++ samba-2.0.10/source/smbd/process.c 2006-03-06 22:21:12.000000000 +0100
325 @@ -343,10 +343,12 @@
326 {SMBlseek,"SMBlseek",reply_lseek,AS_USER},
327 {SMBflush,"SMBflush",reply_flush,AS_USER},
328 {SMBctemp,"SMBctemp",reply_ctemp,AS_USER | QUEUE_IN_OPLOCK },
330 {SMBsplopen,"SMBsplopen",reply_printopen,AS_USER | QUEUE_IN_OPLOCK },
331 {SMBsplclose,"SMBsplclose",reply_printclose,AS_USER},
332 {SMBsplretq,"SMBsplretq",reply_printqueue,AS_USER},
333 {SMBsplwr,"SMBsplwr",reply_printwrite,AS_USER},
335 {SMBlock,"SMBlock",reply_lock,AS_USER},
336 {SMBunlock,"SMBunlock",reply_unlock,AS_USER},
339 DEBUG(2,("Closing idle connection 2.\n"));
344 if(global_machine_password_needs_changing)
346 unsigned char trust_passwd_hash[16];
348 trust_password_unlock();
349 global_machine_password_needs_changing = False;
354 * Check to see if we have any blocking locks
355 * outstanding on the queue.
356 diff -ruN samba-2.0.10.orig/source/smbd/reply.c samba-2.0.10/source/smbd/reply.c
357 --- samba-2.0.10.orig/source/smbd/reply.c 2001-06-23 10:51:24.000000000 +0200
358 +++ samba-2.0.10/source/smbd/reply.c 2006-03-06 22:21:12.000000000 +0100
359 @@ -597,12 +597,12 @@
361 if (!check_domain_match(orig_user, domain))
365 ret = domain_client_validate(orig_user, domain,
366 smb_apasswd, smb_apasslen,
367 smb_ntpasswd, smb_ntpasslen,
373 * User validated ok against Domain controller.
374 @@ -2991,7 +2991,7 @@
380 /****************************************************************************
382 ****************************************************************************/
383 @@ -3176,7 +3176,7 @@
390 /****************************************************************************
392 diff -ruN samba-2.0.10.orig/source/smbd/server.c samba-2.0.10/source/smbd/server.c
393 --- samba-2.0.10.orig/source/smbd/server.c 2000-03-16 23:59:52.000000000 +0100
394 +++ samba-2.0.10/source/smbd/server.c 2006-03-06 22:21:12.000000000 +0100
396 lp_killunused(conn_snum_used);
398 ret = lp_load(servicesf,False,False,True);
404 /* perhaps the config filename is now set */
406 reload_services(True);
407 diff -ruN samba-2.0.10.orig/source/smbd/service.c samba-2.0.10/source/smbd/service.c
408 --- samba-2.0.10.orig/source/smbd/service.c 2000-03-16 23:59:52.000000000 +0100
409 +++ samba-2.0.10/source/smbd/service.c 2006-03-06 22:21:12.000000000 +0100
416 /* If we still don't have a service, attempt to add it as a printer. */
420 DEBUG(3,("%s is not a valid printer name\n", service));
425 /* just possibly it's a default service? */
428 diff -ruN samba-2.0.10.orig/source/utils/smbpasswd.c samba-2.0.10/source/utils/smbpasswd.c
429 --- samba-2.0.10.orig/source/utils/smbpasswd.c 2000-03-16 23:59:57.000000000 +0100
430 +++ samba-2.0.10/source/utils/smbpasswd.c 2006-03-06 22:21:12.000000000 +0100
437 /*********************************************************
439 **********************************************************/
447 static void set_line_buffering(FILE *f)
449 @@ -335,13 +335,13 @@
450 if((local_flags & (LOCAL_ADD_USER|LOCAL_DELETE_USER)) && ((remote_machine != NULL) || joining_domain)) {
458 return join_domain(new_domain, remote_machine);
463 * Deal with root - can add a user, but only locally.
465 diff -ruN samba-2.0.10.orig/source/web/swat.c samba-2.0.10/source/web/swat.c
466 --- samba-2.0.10.orig/source/web/swat.c 2000-04-11 19:36:36.000000000 +0200
467 +++ samba-2.0.10/source/web/swat.c 2006-03-06 22:21:12.000000000 +0100
471 iNumNonAutoPrintServices = lp_numservices();
480 charset_initialise();
482 iNumNonAutoPrintServices = lp_numservices();
487 cgi_setup(SWATDIR, !demo_mode);