copy trunk to buildroot-ng branch
[openwrt.git] / package / samba / patches / 100-samba.patch
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
4 @@ -115,6 +115,22 @@
5 * Usage:
6 * DEBUGADD( 2, ("Some additional text.\n") );
7 */
8 +
9 +#ifdef NDEBUG
10 +
11 +#define DEBUGLVL( level ) \
12 + ( (0 == (level)) \
13 + && dbghdr( level, FILE_MACRO, FUNCTION_MACRO, (__LINE__) ) )
14 +
15 +#define DEBUG( level, body ) \
16 + (void)( (0 == (level)) \
17 + && (dbghdr( level, FILE_MACRO, FUNCTION_MACRO, (__LINE__) )) \
18 + && (dbgtext body) )
19 +
20 +#define DEBUGADD( level, body ) \
21 + (void)( (0 == (level)) && (dbgtext body) )
22 +
23 +#else
24 #define DEBUGLVL( level ) \
25 ( (DEBUGLEVEL >= (level)) \
26 && dbghdr( level, FILE_MACRO, FUNCTION_MACRO, (__LINE__) ) )
27 @@ -140,7 +156,7 @@
28 (void)( (DEBUGLEVEL >= (level)) && (dbgtext body) )
29
30 #endif
31 -
32 +#endif
33 /* End Debugging code section.
34 * -------------------------------------------------------------------------- **
35 */
36 @@ -1612,7 +1628,9 @@
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
44
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
49 @@ -37,8 +37,8 @@
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
60 @@ -55,7 +55,7 @@
61 LOCKDIR = @lockdir@
62
63 # The directory where code page definition files go
64 -CODEPAGEDIR = $(LIBDIR)/codepages
65 +CODEPAGEDIR = $(BASEDIR)/codepages
66
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
69 @@ -82,6 +82,7 @@
70 PROGS2 = bin/rpcclient bin/smbpasswd bin/make_smbcodepage bin/make_unicodemap @WRAP@ @WRAP32@
71 MPROGS = @MPROGS@
72 PROGS = $(PROGS1) $(PROGS2) $(MPROGS) bin/nmblookup bin/make_printerdef
73 +SHAREDPROGS = bin/smbd.shared bin/nmbd.shared bin/smbpasswd.shared
74
75 SCRIPTS = $(srcdir)/script/smbtar $(srcdir)/script/addtosmbpass $(srcdir)/script/convert_smbpasswd
76
77 @@ -159,6 +160,8 @@
78 $(RPC_SERVER_OBJ) $(RPC_CLIENT_OBJ) $(RPC_PARSE_OBJ) \
79 $(LOCKING_OBJ) $(PASSDB_OBJ) $(PRINTING_OBJ) $(PROFILE_OBJ) $(LIB_OBJ)
80
81 +SMBDSHARED_OBJ = $(SMBD_OBJ1) $(RPC_SERVER_OBJ) \
82 + $(LOCKING_OBJ) $(PROFILE_OBJ) #$(PRINTING_OBJ)
83
84 NMBD_OBJ1 = nmbd/asyncdns.o nmbd/nmbd.o nmbd/nmbd_become_dmb.o \
85 nmbd/nmbd_become_lmb.o nmbd/nmbd_browserdb.o \
86 @@ -176,6 +179,8 @@
87 NMBD_OBJ = $(NMBD_OBJ1) $(PARAM_OBJ) $(LIBSMB_OBJ) $(UBIQX_OBJ) \
88 $(LIB_OBJ)
89
90 +NMBDSHARED_OBJ = $(NMBD_OBJ1)
91 +
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) \
95 @@ -207,6 +212,8 @@
96 SMBPASSWD_OBJ = utils/smbpasswd.o $(PARAM_OBJ) $(LIBSMB_OBJ) $(PASSDB_OBJ) \
97 $(UBIQX_OBJ) $(RPC_CLIENT_OBJ) $(RPC_PARSE_OBJ) $(LIB_OBJ)
98
99 +SMBPASSWDSHARED_OBJ = utils/smbpasswd.o
100 +
101 RPCCLIENT_OBJ = rpcclient/rpcclient.o \
102 rpcclient/display.o \
103 rpcclient/cmd_lsarpc.o \
104 @@ -265,6 +272,11 @@
105 PROTO_OBJ = $(SMBD_OBJ) $(NMBD_OBJ) $(SWAT_OBJ) $(CLIENT_OBJ) \
106 $(RPCCLIENT_OBJ) $(SMBWRAPPER_OBJ) $(SMBTORTURE_OBJ)
107
108 +LIBSMBSHARED_OBJ = $(LIB_OBJ) $(LIBSMB_OBJ) $(PARAM_OBJ) $(UBIQX_OBJ) \
109 + $(PASSDB_OBJ) $(RPC_PARSE_OBJ) #$(RPC_CLIENT_OBJ)
110 +
111 +LIBSMB_PICOBJS = $(LIBSMBSHARED_OBJ:.o=.po)
112 +
113 PICOBJS = $(SMBWRAPPER_OBJ:.o=.po)
114 PICOBJS32 = $(SMBWRAPPER_OBJ:.o=.po32)
115
116 @@ -274,6 +286,8 @@
117
118 all : CHECK $(SPROGS) $(PROGS)
119
120 +shared : CHECK $(SHAREDPROGS)
121 +
122 smbwrapper : CHECK bin/smbsh bin/smbwrapper.@SHLIBEXT@ @WRAP32@
123
124 smbtorture : CHECK bin/smbtorture
125 @@ -359,10 +373,18 @@
126 @echo Linking $@
127 @$(CC) $(FLAGS) -o $@ $(SMBD_OBJ) $(LDFLAGS) $(LIBS)
128
129 +bin/smbd.shared: $(SMBDSHARED_OBJ) bin/libsmb.@SHLIBEXT@ bin/.dummy
130 + @echo Linking $@
131 + @$(CC) $(FLAGS) -o $@ $(SMBDSHARED_OBJ) $(LDFLAGS) $(LIBS) -Lbin -lsmb
132 +
133 bin/nmbd: $(NMBD_OBJ) bin/.dummy
134 @echo Linking $@
135 @$(CC) $(FLAGS) -o $@ $(NMBD_OBJ) $(LDFLAGS) $(LIBS)
136
137 +bin/nmbd.shared: $(NMBDSHARED_OBJ) bin/libsmb.@SHLIBEXT@ bin/.dummy
138 + @echo Linking $@
139 + @$(CC) $(FLAGS) -o $@ $(NMBDSHARED_OBJ) $(LDFLAGS) $(LIBS) -Lbin -lsmb
140 +
141 bin/swat: $(SWAT_OBJ) bin/.dummy
142 @echo Linking $@
143 @$(CC) $(FLAGS) -o $@ $(SWAT_OBJ) $(LDFLAGS) $(LIBS)
144 @@ -411,6 +433,10 @@
145 @echo Linking $@
146 @$(CC) $(FLAGS) -o $@ $(SMBPASSWD_OBJ) $(LDFLAGS) $(LIBS)
147
148 +bin/smbpasswd.shared: $(SMBPASSWDSHARED_OBJ) bin/libsmb.@SHLIBEXT@ bin/.dummy
149 + @echo Linking $@
150 + @$(CC) $(FLAGS) -o $@ $(SMBPASSWDSHARED_OBJ) $(LDFLAGS) $(LIBS) -Lbin -lsmb
151 +
152 bin/make_smbcodepage: $(MAKE_SMBCODEPAGE_OBJ) bin/.dummy
153 @echo Linking $@
154 @$(CC) $(FLAGS) -o $@ $(MAKE_SMBCODEPAGE_OBJ) $(LDFLAGS) $(LIBS)
155 @@ -459,6 +485,10 @@
156 @echo Linking $@
157 @$(CC) $(FLAGS) -o $@ $(SMBSH_OBJ) $(LDFLAGS) $(LIBS)
158
159 +bin/libsmb.@SHLIBEXT@: $(LIBSMB_PICOBJS) bin/.dummy
160 + @echo Linking shared library $@
161 + @$(LD) @LDSHFLAGS@ -o $@ $(LIBSMB_PICOBJS) $(LIBS)
162 +
163 install: installbin installman installscripts installcp installswat
164
165 installdirs:
166 @@ -518,7 +548,7 @@
167 ctags `find . -name "*.[ch]" | grep -v /CVS/`
168
169 realclean: clean
170 - -rm -f config.log $(PROGS) $(SPROGS) bin/.dummy
171 + -rm -f config.log $(PROGS) $(SPROGS) $(SHAREDPROGS) bin/.dummy
172 -rmdir bin
173
174 distclean: realclean
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
178 @@ -215,8 +215,8 @@
179 */
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);
186 }
187 }
188 }
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;
194
195 fsp->fd_ptr = NULL;
196 -
197 +#ifdef PRINTING
198 /* NT uses smbclose to start a print - weird */
199 if (normal_close && fsp->print_file)
200 print_file(conn, fsp);
201 -
202 +#endif
203 /* check for magic scripts */
204 if (normal_close) {
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
209 @@ -472,7 +472,7 @@
210 PACK(desc,t,v);
211 }
212
213 -
214 +#ifdef PRINTING
215 /****************************************************************************
216 get a print queue
217 ****************************************************************************/
218 @@ -1004,7 +1004,7 @@
219
220 return True;
221 }
222 -
223 +#endif
224 /****************************************************************************
225 get info level for a server list query
226 ****************************************************************************/
227 @@ -1834,7 +1834,7 @@
228
229 return(True);
230 }
231 -
232 +#ifdef PRINTING
233 /****************************************************************************
234 delete a print job
235 Form: <W> <>
236 @@ -2091,7 +2091,7 @@
237
238 return(True);
239 }
240 -
241 +#endif
242
243 /****************************************************************************
244 get info about the server
245 @@ -2756,7 +2756,7 @@
246
247 return(True);
248 }
249 -
250 +#ifdef PRINTING
251 /****************************************************************************
252 api_WPrintJobEnumerate
253 ****************************************************************************/
254 @@ -3189,7 +3189,7 @@
255 DEBUG(4,("WPrintPortEnum: errorcode %d\n",desc.errcode));
256 return(True);
257 }
258 -
259 +#endif
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},
267 +#ifdef PRINTING
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},
275 +#endif
276 {"NetRemoteTOD", 91, api_NetRemoteTOD,0},
277 +#ifdef PRINTING
278 {"WPrintQueuePurge", 103, api_WPrintQueuePurge,0},
279 +#endif
280 {"NetServerEnum", 104, api_RNetServerEnum,0},
281 {"WAccessGetUserPerms",105, api_WAccessGetUserPerms,0},
282 {"SetUserPassword", 115, api_SetUserPassword,0},
283 {"WWkstaUserLogon", 132, api_WWkstaUserLogon,0},
284 +#ifdef PRINTING
285 {"PrintJobInfo", 147, api_PrintJobInfo,0},
286 {"WPrintDriverEnum", 205, api_WPrintDriverEnum,0},
287 {"WPrintQProcEnum", 206, api_WPrintQProcEnum,0},
288 {"WPrintPortEnum", 207, api_WPrintPortEnum,0},
289 +#endif
290 {"SamOEMChangePassword", 214, api_SamOEMChangePassword,0},
291 {NULL, -1, api_Unsupported,0}};
292
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
296 @@ -160,7 +160,7 @@
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);
302
303
304 /*
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 @@
309
310 return(True);
311 }
312 -
313 +#ifdef RPCCLIENT
314 /***********************************************************************
315 Connect to a remote machine for domain security authentication
316 given a name or IP address.
317 @@ -1504,3 +1504,4 @@
318 cli_shutdown(&cli);
319 return True;
320 }
321 +#endif
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 },
329 +#ifdef PRINTING
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},
334 +#endif
335 {SMBlock,"SMBlock",reply_lock,AS_USER},
336 {SMBunlock,"SMBunlock",reply_unlock,AS_USER},
337
338 @@ -908,7 +910,7 @@
339 DEBUG(2,("Closing idle connection 2.\n"));
340 return False;
341 }
342 -
343 +#ifdef RPCLIENT
344 if(global_machine_password_needs_changing)
345 {
346 unsigned char trust_passwd_hash[16];
347 @@ -954,7 +956,7 @@
348 trust_password_unlock();
349 global_machine_password_needs_changing = False;
350 }
351 -
352 +#endif
353 /*
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 @@
360
361 if (!check_domain_match(orig_user, domain))
362 return False;
363 -
364 +#ifdef RPCCLIENT
365 ret = domain_client_validate(orig_user, domain,
366 smb_apasswd, smb_apasslen,
367 smb_ntpasswd, smb_ntpasslen,
368 &user_exists);
369 -
370 +#endif
371 if(ret) {
372 /*
373 * User validated ok against Domain controller.
374 @@ -2991,7 +2991,7 @@
375 return -1;
376 }
377
378 -
379 +#ifdef PRINTING
380 /****************************************************************************
381 reply to a printopen
382 ****************************************************************************/
383 @@ -3176,7 +3176,7 @@
384
385 return(outsize);
386 }
387 -
388 +#endif
389
390 /****************************************************************************
391 reply to a mkdir
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
395 @@ -300,9 +300,9 @@
396 lp_killunused(conn_snum_used);
397
398 ret = lp_load(servicesf,False,False,True);
399 -
400 +#ifdef PRINTING
401 load_printers();
402 -
403 +#endif
404 /* perhaps the config filename is now set */
405 if (!test)
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
410 @@ -121,7 +121,7 @@
411 }
412 }
413 }
414 -
415 +#ifdef PRINTING
416 /* If we still don't have a service, attempt to add it as a printer. */
417 if (iService < 0)
418 {
419 @@ -146,7 +146,7 @@
420 DEBUG(3,("%s is not a valid printer name\n", service));
421 }
422 }
423 -
424 +#endif
425 /* just possibly it's a default service? */
426 if (iService < 0)
427 {
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
431 @@ -71,7 +71,7 @@
432 }
433 exit(1);
434 }
435 -
436 +#ifdef RPCCLIENT
437 /*********************************************************
438 Join a domain.
439 **********************************************************/
440 @@ -143,7 +143,7 @@
441
442 return (int)ret;
443 }
444 -
445 +#endif
446
447 static void set_line_buffering(FILE *f)
448 {
449 @@ -335,13 +335,13 @@
450 if((local_flags & (LOCAL_ADD_USER|LOCAL_DELETE_USER)) && ((remote_machine != NULL) || joining_domain)) {
451 usage();
452 }
453 -
454 +#ifdef RPCCLIENT
455 if(joining_domain) {
456 if (argc != 0)
457 usage();
458 return join_domain(new_domain, remote_machine);
459 }
460 -
461 +#endif
462 /*
463 * Deal with root - can add a user, but only locally.
464 */
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
468 @@ -357,8 +357,9 @@
469 return 0;
470 }
471 iNumNonAutoPrintServices = lp_numservices();
472 +#ifdef PRINTING
473 load_printers();
474 -
475 +#endif
476 return 1;
477 }
478
479 @@ -997,8 +998,9 @@
480 charset_initialise();
481 load_config(True);
482 iNumNonAutoPrintServices = lp_numservices();
483 +#ifdef PRINTING
484 load_printers();
485 -
486 +#endif
487 cgi_setup(SWATDIR, !demo_mode);
488
489 print_header();
This page took 0.057394 seconds and 5 git commands to generate.