source: branches/samba-3.5.x/prog_guide4.txt

Last change on this file was 414, checked in by Herwig Bauernfeind, 15 years ago

Samba 3.5.0: Initial import

File size: 30.2 KB
Line 
1
2
3THIS IS INCOMPLETE! I'M ONLY COMMITING IT IN ORDER TO SOLICIT COMMENTS
4FROM A FEW PEOPLE. DON'T TAKE THIS AS THE FINAL VERSION YET.
5
6
7Samba4 Programming Guide
8========================
9
10.. contents::
11
12The internals of Samba4 are quite different from previous versions of
13Samba, so even if you are an experienced Samba developer please take
14the time to read through this document.
15
16This document will explain both the broad structure of Samba4, and
17some of the common coding elements such as memory management and
18dealing with macros.
19
20
21Coding Style
22------------
23
24In past versions of Samba we have basically let each programmer choose
25their own programming style. Unfortunately the result has often been
26that code that other members of the team find difficult to read. For
27Samba version 4 I would like to standardise on a common coding style
28to make the whole tree more readable. For those of you who are
29horrified at the idea of having to learn a new style, I can assure you
30that it isn't as painful as you might think. I was forced to adopt a
31new style when I started working on the Linux kernel, and after some
32initial pain found it quite easy.
33
34That said, I don't want to invent a new style, instead I would like to
35adopt the style used by the Linux kernel. It is a widely used style
36with plenty of support tools available. See Documentation/CodingStyle
37in the Linux source tree. This is the style that I have used to write
38all of the core infrastructure for Samba4 and I think that we should
39continue with that style.
40
41I also think that we should most definately *not* adopt an automatic
42reformatting system in cvs (or whatever other source code system we
43end up using in the future). Such automatic formatters are, in my
44experience, incredibly error prone and don't understand the necessary
45exceptions. I don't mind if people use automated tools to reformat
46their own code before they commit it, but please do not run such
47automated tools on large slabs of existing code without being willing
48to spend a *lot* of time hand checking the results.
49
50Finally, I think that for code that is parsing or formatting protocol
51packets the code layout should strongly reflect the packet
52format. That means ordring the code so that it parses in the same
53order as the packet is stored on the wire (where possible) and using
54white space to align packet offsets so that a reader can immediately
55map any line of the code to the corresponding place in the packet.
56
57
58Static and Global Data
59----------------------
60
61The basic rule is "avoid static and global data like the plague". What
62do I mean by static data? The way to tell if you have static data in a
63file is to use the "size" utility in Linux. For example if we run::
64
65 size libcli/raw/*.o
66
67in Samba4 then you get the following::
68
69 text data bss dec hex filename
70 2015 0 0 2015 7df libcli/raw/clikrb5.o
71 202 0 0 202 ca libcli/raw/clioplock.o
72 35 0 0 35 23 libcli/raw/clirewrite.o
73 3891 0 0 3891 f33 libcli/raw/clisession.o
74 869 0 0 869 365 libcli/raw/clisocket.o
75 4962 0 0 4962 1362 libcli/raw/clispnego.o
76 1223 0 0 1223 4c7 libcli/raw/clitransport.o
77 2294 0 0 2294 8f6 libcli/raw/clitree.o
78 1081 0 0 1081 439 libcli/raw/raweas.o
79 6765 0 0 6765 1a6d libcli/raw/rawfile.o
80 6824 0 0 6824 1aa8 libcli/raw/rawfileinfo.o
81 2944 0 0 2944 b80 libcli/raw/rawfsinfo.o
82 541 0 0 541 21d libcli/raw/rawioctl.o
83 1728 0 0 1728 6c0 libcli/raw/rawnegotiate.o
84 723 0 0 723 2d3 libcli/raw/rawnotify.o
85 3779 0 0 3779 ec3 libcli/raw/rawreadwrite.o
86 6597 0 0 6597 19c5 libcli/raw/rawrequest.o
87 5580 0 0 5580 15cc libcli/raw/rawsearch.o
88 3034 0 0 3034 bda libcli/raw/rawsetfileinfo.o
89 5187 0 0 5187 1443 libcli/raw/rawtrans.o
90 2033 0 0 2033 7f1 libcli/raw/smb_signing.o
91
92notice that the "data" and "bss" columns are all zero? That is
93good. If there are any non-zero values in data or bss then that
94indicates static data and is bad (as a rule of thumb).
95
96Lets compare that result to the equivalent in Samba3::
97
98 text data bss dec hex filename
99 3978 0 0 3978 f8a libsmb/asn1.o
100 18963 0 288 19251 4b33 libsmb/cliconnect.o
101 2815 0 1024 3839 eff libsmb/clidgram.o
102 4038 0 0 4038 fc6 libsmb/clientgen.o
103 3337 664 256 4257 10a1 libsmb/clierror.o
104 10043 0 0 10043 273b libsmb/clifile.o
105 332 0 0 332 14c libsmb/clifsinfo.o
106 166 0 0 166 a6 libsmb/clikrb5.o
107 5212 0 0 5212 145c libsmb/clilist.o
108 1367 0 0 1367 557 libsmb/climessage.o
109 259 0 0 259 103 libsmb/clioplock.o
110 1584 0 0 1584 630 libsmb/cliprint.o
111 7565 0 256 7821 1e8d libsmb/cliquota.o
112 7694 0 0 7694 1e0e libsmb/clirap.o
113 27440 0 0 27440 6b30 libsmb/clirap2.o
114 2905 0 0 2905 b59 libsmb/clireadwrite.o
115 1698 0 0 1698 6a2 libsmb/clisecdesc.o
116 5517 0 0 5517 158d libsmb/clispnego.o
117 485 0 0 485 1e5 libsmb/clistr.o
118 8449 0 0 8449 2101 libsmb/clitrans.o
119 2053 0 4 2057 809 libsmb/conncache.o
120 3041 0 256 3297 ce1 libsmb/credentials.o
121 1261 0 1024 2285 8ed libsmb/doserr.o
122 14560 0 0 14560 38e0 libsmb/errormap.o
123 3645 0 0 3645 e3d libsmb/namecache.o
124 16815 0 8 16823 41b7 libsmb/namequery.o
125 1626 0 0 1626 65a libsmb/namequery_dc.o
126 14301 0 1076 15377 3c11 libsmb/nmblib.o
127 24516 0 2048 26564 67c4 libsmb/nterr.o
128 8661 0 8 8669 21dd libsmb/ntlmssp.o
129 3188 0 0 3188 c74 libsmb/ntlmssp_parse.o
130 4945 0 0 4945 1351 libsmb/ntlmssp_sign.o
131 1303 0 0 1303 517 libsmb/passchange.o
132 1221 0 0 1221 4c5 libsmb/pwd_cache.o
133 2475 0 4 2479 9af libsmb/samlogon_cache.o
134 10768 32 0 10800 2a30 libsmb/smb_signing.o
135 4524 0 16 4540 11bc libsmb/smbdes.o
136 5708 0 0 5708 164c libsmb/smbencrypt.o
137 7049 0 3072 10121 2789 libsmb/smberr.o
138 2995 0 0 2995 bb3 libsmb/spnego.o
139 3186 0 0 3186 c72 libsmb/trustdom_cache.o
140 1742 0 0 1742 6ce libsmb/trusts_util.o
141 918 0 28 946 3b2 libsmb/unexpected.o
142
143notice all of the non-zero data and bss elements? Every bit of that
144data is a bug waiting to happen.
145
146Static data is evil as it has the following consequences:
147- it makes code much less likely to be thread-safe
148- it makes code much less likely to be recursion-safe
149- it leads to subtle side effects when the same code is called from multiple places
150- doesn't play well with shared libraries or plugins
151
152Static data is particularly evil in library code (such as our internal
153smb and rpc libraries). If you can get rid of all static data in
154libraries then you can make some fairly strong guarantees about the
155behaviour of functions in that library, which really helps.
156
157Of course, it is possible to write code that uses static data and is
158safe, it's just much harder to do that than just avoid static data in
159the first place. We have been tripped up countless times by subtle
160bugs in Samba due to the use of static data, so I think it is time to
161start avoiding it in new code. Much of the core infrastructure of
162Samba4 was specifically written to avoid static data, so I'm going to
163be really annoyed if everyone starts adding lots of static data back
164in.
165
166So, how do we avoid static data? The basic method is to use context
167pointers. When reading the Samba4 code you will notice that just about
168every function takes a pointer to a context structure as its first
169argument. Any data that the function needs that isn't an explicit
170argument to the function can be found by traversing that context.
171
172Note that this includes all of the little caches that we have lying
173all over the code in Samba3. I'm referring to the ones that generally
174have a "static int initialised" and then some static string or integer
175that remembers the last return value of the function. Get rid of them!
176If you are *REALLY* absolutely completely certain that your personal
177favourite mini-cache is needed then you should do it properly by
178putting it into the appropriate context rather than doing it the lazy
179way by putting it inside the target function. I would suggest however
180that the vast majority of those little caches are useless - don't
181stick it in unless you have really firm benchmarking results that show
182that it is needed and helps by a significant amount.
183
184Note that Samba4 is not yet completely clean of static data like
185this. I've gotten the smbd/ directory down to 24 bytes of static data,
186and libcli/raw/ down to zero. I've also gotten the ntvfs layer and all
187backends down to just 8 bytes in ntvfs_base.c. The rest still needs
188some more work.
189
190Also note that truly constant data is OK, and will not in fact show up
191in the data and bss columns in "size" anyway (it will be included in
192"text"). So you can have constant tables of protocol data.
193
194
195How to use talloc
196-----------------
197
198Please see the separate document, lib/talloc/talloc_guide.txt
199You _must_ read this if you want to program in Samba4.
200
201
202Interface Structures
203--------------------
204
205One of the biggest changes in Samba4 is the universal use of interface
206structures. Go take a look through include/smb_interfaces.h now to get
207an idea of what I am talking about.
208
209In Samba3 many of the core wire structures in the SMB protocol were
210never explicitly defined in Samba. Instead, our parse and generation
211functions just worked directly with wire buffers. The biggest problem
212with this is that is tied our parse code with our "business logic"
213much too closely, which meant the code got extremely confusing to
214read.
215
216In Samba4 we have explicitly defined interface structures for
217everything in the protocol. When we receive a buffer we always parse
218it completely into one of these structures, then we pass a pointer to
219that structure to a backend handler. What we must *not* do is make any
220decisions about the data inside the parse functions. That is critical
221as different backends will need different portions of the data. This
222leads to a golden rule for Samba4:
223
224 "don't design interfaces that lose information"
225
226In Samba3 our backends often received "condensed" versions of the
227information sent from clients, but this inevitably meant that some
228backends could not get at the data they needed to do what they wanted,
229so from now on we should expose the backends to all of the available
230information and let them choose which bits they want.
231
232Ok, so now some of you will be thinking "this sounds just like our
233msrpc code from Samba3", and while to some extent this is true there
234are extremely important differences in the approach that are worth
235pointing out.
236
237In the Samba3 msrpc code we used explicit parse structures for all
238msrpc functions. The problem is that we didn't just put all of the
239real variables in these structures, we also put in all the artifacts
240as well. A good example is the security descriptor strucrure that
241looks like this in Samba3::
242
243 typedef struct security_descriptor_info
244 {
245 uint16 revision;
246 uint16 type;
247
248 uint32 off_owner_sid;
249 uint32 off_grp_sid;
250 uint32 off_sacl;
251 uint32 off_dacl;
252
253 SEC_ACL *dacl;
254 SEC_ACL *sacl;
255 DOM_SID *owner_sid;
256 DOM_SID *grp_sid;
257 } SEC_DESC;
258
259The problem with this structure is all the off_* variables. Those are
260not part of the interface, and do not appear in any real descriptions
261of Microsoft security descriptors. They are parsing artifacts
262generated by the IDL compiler that Microsoft use. That doesn't mean
263they aren't needed on the wire - indeed they are as they tell the
264parser where to find the following four variables, but they should
265*NOT* be in the interface structure.
266
267In Samba3 there were unwritten rules about which variables in a
268structure a high level caller has to fill in and which ones are filled
269in by the marshalling code. In Samba4 those rules are gone, because
270the redundent artifact variables are gone. The high level caller just
271sets up the real variables and the marshalling code worries about
272generating the right offsets.
273
274The same rule applies to strings. In many places in the SMB and MSRPC
275protocols complex strings are used on the wire, with complex rules
276about padding, format, alighment, termination etc. None of that
277information is useful to a high level calling routine or to a backend - its
278all just so much wire fluff. So, in Samba4 these strings are
279just "char \*" and are always in our internal multi-byte format (which
280is usually UTF8). It is up to the parse functions to worry about
281translating the format and getting the padding right.
282
283The one exception to this is the use of the WIRE_STRING type, but that
284has a very good justification in terms of regression testing. Go and
285read the comment in smb_interfaces.h about that now.
286
287So, here is another rule to code by. When writing an interface
288structure think carefully about what variables in the structure can be
289left out as they are redundent. If some length is effectively defined
290twice on the wire then only put it once in the packet. If a length can
291be inferred from a null termination then do that and leave the length
292out of the structure completely. Don't put redundent stuff in
293structures!
294
295
296Async Design
297------------
298
299Samba4 has an asynchronous design. That affects *lots* of the code,
300and the implications of the asynchronous design needs to be considered
301just about everywhere.
302
303The first aspect of the async design to look at is the SMB client
304library. Lets take a look at the following three functions in
305libcli/raw/rawfile.c::
306
307 struct cli_request *smb_raw_seek_send(struct cli_tree *tree, struct smb_seek *parms);
308 NTSTATUS smb_raw_seek_recv(struct cli_request *req, struct smb_seek *parms);
309 NTSTATUS smb_raw_seek(struct cli_tree *tree, struct smb_seek *parms);
310
311Go and read them now then come back.
312
313Ok, first notice there there are 3 separate functions, whereas the
314equivalent code in Samba3 had just one. Also note that the 3rd
315function is extremely simple - its just a wrapper around calling the
316first two in order.
317
318The three separate functions are needed because we need to be able to
319generate SMB calls asynchronously. The first call, which for smb calls
320is always called smb_raw_XXXX_send(), constructs and sends a SMB
321request and returns a "struct cli_request" which acts as a handle for
322the request. The caller is then free to do lots of other calls if it
323wants to, then when it is ready it can call the smb_raw_XXX_recv()
324function to receive the reply.
325
326If all you want is a synchronous call then call the 3rd interface, the
327one called smb_raw_XXXX(). That just calls the first two in order, and
328blocks waiting for the reply.
329
330But what if you want to be called when the reply comes in? Yes, thats
331possible. You can do things like this::
332
333 struct cli_request *req;
334
335 req = smb_raw_XXX_send(tree, params);
336
337 req->async.fn = my_callback;
338 req->async.private = my_private_data;
339
340then in your callback function you can call the smb_raw_XXXX_recv()
341function to receive the reply. Your callback will receive the "req"
342pointer, which you can use to retrieve your private data from
343req->async.private.
344
345Then all you need to do is ensure that the main loop in the client
346library gets called. You can either do that by polling the connection
347using cli_transport_pending() and cli_request_receive_next() or you
348can use transport->idle.func to setup an idle function handler to call
349back to your main code. Either way, you can build a fully async
350application.
351
352In order to support all of this we have to make sure that when we
353write a piece of library code (SMB, MSRPC etc) that we build the
354separate _send() and _recv() functions. It really is worth the effort.
355
356Now about async in smbd, a much more complex topic.
357
358The SMB protocol is inherently async. Some functions (such as change
359notify) often don't return for hours, while hundreds of other
360functions pass through the socket. Take a look at the RAW-MUX test in
361the Samba4 smbtorture to see some really extreme examples of the sort
362of async operations that Windows supports. I particularly like the
363open/open/close sequence where the 2nd open (which conflicts with the
364first) succeeds because the subsequent close is answered out of order.
365
366In Samba3 we handled this stuff very badly. We had awful "pending
367request" queues that allocated full 128k packet buffers, and even with
368all that crap we got the semantics wrong. In Samba4 I intend to make
369sure we get this stuff right.
370
371So, how do we do this? We now have an async interface between smbd and
372the NTVFS backends. Whenever smbd calls into a backend the backend has
373an option of answer the request in a synchronous fashion if it wants
374to just like in Samba3, but it also has the option of answering the
375request asynchronously. The only backend that currently does this is
376the CIFS backend, but I hope the other backends will soon do this to.
377
378To make this work you need to do things like this in the backend::
379
380 req->control_flags |= REQ_CONTROL_ASYNC;
381
382that tells smbd that the backend has elected to reply later rather
383than replying immediately. The backend must *only* do this if
384req->async.send_fn is not NULL. If send_fn is NULL then it means that
385the smbd front end cannot handle this function being replied to in an
386async fashion.
387
388If the backend does this then it is up to the backend to call
389req->async.send_fn() when it is ready to reply. It the meantime smbd
390puts the call on hold and goes back to answering other requests on the
391socket.
392
393Inside smbd you will find that there is code to support this. The most
394obvious change is that smbd splits each SMB reply function into two
395parts - just like the client library has a _send() and _recv()
396function, so smbd has a _send() function and the parse function for
397each SMB.
398
399As an example go and have a look at reply_getatr_send() and
400reply_getatr() in smb_server/reply.c. Read them? Good.
401
402Notice that reply_getatr() sets up the req->async structure to contain
403the send function. Thats how the backend gets to do an async reply, it
404calls this function when it is ready. Also notice that reply_getatr()
405only does the parsing of the request, and does not do the reply
406generation. That is done by the _send() function.
407
408The only missing piece in the Samba4 right now that prevents it being
409fully async is that it currently does the low level socket calls (read
410and write on sockets) in a blocking fashion. It does use select() to
411make it somewhat async, but if a client were to send a partial packet
412then delay before sending the rest then smbd would be stuck waiting
413for the second half of the packet.
414
415To fix this I plan on making the socket calls async as well, which
416luckily will not involve any API changes in the core of smbd or the
417library. It just involves a little bit of extra code in clitransport.c
418and smbd/request.c. As a side effect I hope that this will also reduce
419the average number of system calls required to answer a request, so we
420may see a performance improvement.
421
422
423NTVFS
424-----
425
426One of the most noticeable changes in Samba4 is the introduction of
427the NTVFS layer. This provided the initial motivation for the design
428of Samba4 and in many ways lies at the heart of the design.
429
430In Samba3 the main file serving process (smbd) combined the handling
431of the SMB protocol with the mapping to POSIX semantics in the same
432code. If you look in smbd/reply.c in Samba3 you see numerous places
433where POSIX assumptions are mixed tightly with SMB parsing code. We
434did have a VFS layer in Samba3, but it was a POSIX-like VFS layer, so
435no matter how you wrote a plugin you could not bypass the POSIX
436mapping decisions that had already been made before the VFS layer was
437called.
438
439In Samba4 things are quite different. All SMB parsing is performed in
440the smbd front end, then fully parsed requests are passed to the NTVFS
441backend. That backend makes any semantic mapping decisions and fills
442in the 'out' portion of the request. The front end is then responsible
443for putting those results into wire format and sending them to the
444client.
445
446Lets have a look at one of those request structures. Go and read the
447definition of "union smb_write" and "enum write_level" in
448include/smb_interfaces.h. (no, don't just skip reading it, really go
449and read it. Yes, that means you!).
450
451Notice the union? That's how Samba4 allows a single NTVFS backend
452interface to handle the several different ways of doing a write
453operation in the SMB protocol. Now lets look at one section of that
454union::
455
456 /* SMBwriteX interface */
457 struct {
458 enum write_level level;
459
460 struct {
461 uint16 fnum;
462 SMB_BIG_UINT offset;
463 uint16 wmode;
464 uint16 remaining;
465 uint32 count;
466 const char *data;
467 } in;
468 struct {
469 uint32 nwritten;
470 uint16 remaining;
471 } out;
472 } writex;
473
474see the "in" and "out" sections? The "in" section is for parameters
475that the SMB client sends on the wire as part of the request. The smbd
476front end parse code parses the wire request and fills in all those
477parameters. It then calls the NTVFS interface which looks like this::
478
479 NTSTATUS (*write)(struct request_context *req, union smb_write *io);
480
481and the NTVFS backend does the write request. The backend then fills
482in the "out" section of the writex structure and gives the union back
483to the front end (either by returning, or if done in an async fashion
484then by calling the async send function. See the async discussion
485elsewhere in this document).
486
487The NTVFS backend knows which particular function is being requested
488by looking at io->generic.level. Notice that this enum is also
489repeated inside each of the sub-structures in the union, so the
490backend could just as easily look at io->writex.level and would get
491the same variable.
492
493Notice also that some levels (such as splwrite) don't have an "out"
494section. This happens because there is no return value apart from a
495status code from those SMB calls.
496
497So what about status codes? The status code is returned directly by
498the backend NTVFS interface when the call is performed
499synchronously. When performed asynchronously then the status code is
500put into req->async.status before the req->async.send_fn() callback is
501called.
502
503Currently the most complete NTVFS backend is the CIFS backend. I don't
504expect this backend will be used much in production, but it does
505provide the ideal test case for our NTVFS design. As it offers the
506full capabilities that are possible with a CIFS server we can be sure
507that we don't have any gaping holes in our APIs, and that the front
508end code is flexible enough to handle any advances in the NT style
509feature sets of Unix filesystems that make come along.
510
511
512Process Models
513--------------
514
515In Samba3 we supported just one process model. It just so happens that
516the process model that Samba3 supported is the "right" one for most
517users, but there are situations where this model wasn't ideal.
518
519In Samba4 you can choose the smbd process model on the smbd command
520line.
521
522
523DCERPC binding strings
524----------------------
525
526When connecting to a dcerpc service you need to specify a binding
527string.
528
529The format is:
530
531 TRANSPORT:host[flags]
532
533where TRANSPORT is either ncacn_np for SMB or ncacn_ip_tcp for RPC/TCP
534
535"host" is an IP or hostname or netbios name. If the binding string
536identifies the server side of an endpoint, "host" may be an empty
537string.
538
539"flags" can include a SMB pipe name if using the ncacn_np transport or
540a TCP port number if using the ncacn_ip_tcp transport, otherwise they
541will be auto-determined.
542
543other recognised flags are:
544
545 sign : enable ntlmssp signing
546 seal : enable ntlmssp sealing
547 spnego : use SPNEGO instead of NTLMSSP authentication
548 krb5 : use KRB5 instead of NTLMSSP authentication
549 connect : enable rpc connect level auth (auth, but no sign or seal)
550 validate : enable the NDR validator
551 print : enable debugging of the packets
552 bigendian : use bigendian RPC
553 padcheck : check reply data for non-zero pad bytes
554
555
556Here are some examples:
557
558 ncacn_np:myserver
559 ncacn_np:myserver[samr]
560 ncacn_np:myserver[\pipe\samr]
561 ncacn_np:myserver[/pipe/samr]
562 ncacn_np:myserver[samr,sign,print]
563 ncacn_np:myserver[sign,spnego]
564 ncacn_np:myserver[\pipe\samr,sign,seal,bigendian]
565 ncacn_np:myserver[/pipe/samr,seal,validate]
566 ncacn_np:
567 ncacn_np:[/pipe/samr]
568 ncacn_ip_tcp:myserver
569 ncacn_ip_tcp:myserver[1024]
570 ncacn_ip_tcp:myserver[sign,seal]
571 ncacn_ip_tcp:myserver[spnego,seal]
572
573
574IDEA: Maybe extend UNC names like this?
575
576 smbclient //server/share
577 smbclient //server/share[sign,seal,spnego]
578
579DCERPC Handles
580--------------
581The various handles that are used in the RPC servers should be created and
582fetch using the dcesrv_handle_* functions.
583
584Use dcesrv_handle_new(struct dcesrv_connection \*, uint8 handle_type) to obtain
585a new handle of the specified type. Handle types are unique within each
586pipe.
587
588The handle can later be fetched again using::
589
590 struct dcesrv_handle *dcesrv_handle_fetch(struct dcesrv_connection *dce_conn, struct policy_handle *p, uint8 handle_type)
591
592and destroyed by::
593
594 dcesrv_handle_destroy(struct dcesrv_handle *).
595
596User data should be stored in the 'data' member of the dcesrv_handle struct.
597
598
599MSRPC
600-----
601
602
603
604 - ntvfs
605 - testing
606 - command line handling
607 - libcli structure
608 - posix reliance
609 - uid/gid handling
610 - process models
611 - static data
612 - msrpc
613
614
615don't zero structures! avoid ZERO_STRUCT() and talloc_zero()
616
617
618GMT vs TZ in printout of QFILEINFO timezones
619
620put in full UNC path in tconx
621
622test timezone handling by using a server in different zone from client
623
624do {} while (0) system
625
626NT_STATUS_IS_OK() is NOT the opposite of NT_STATUS_IS_ERR()
627
628need to implement secondary parts of trans2 and nttrans in server and
629client
630
631document access_mask in openx reply
632
633check all capabilities and flag1, flag2 fields (eg. EAs)
634
635large files -> pass thru levels
636
637setpathinfo is very fussy about null termination of the file name
638
639the overwrite flag doesn't seem to work on setpathinfo RENAME_INFORMATION
640
641END_OF_FILE_INFORMATION and ALLOCATION_INFORMATION don't seem to work
642via setpathinfo
643
644on w2k3 setpathinfo DISPOSITION_INFORMATION fails, but does have an
645effect. It leaves the file with SHARING_VIOLATION.
646
647on w2k3 trans2 setpathinfo with any invalid low numbered level causes
648the file to get into a state where DELETE_PENDING is reported, and the
649file cannot be deleted until you reboot
650
651trans2 qpathinfo doesn't see the delete_pending flag correctly, but
652qfileinfo does!
653
654get rid of strtok
655
656add programming documentation note about lp_set_cmdline()
657
658need to add a wct checking function in all client parsing code,
659similar to REQ_CHECK_WCT()
660
661need to make sure that NTTIME is a round number of seconds when
662converted from time_t
663
664not using a zero next offset in SMB_FILE_STREAM_INFORMATION for last
665entry causes explorer exception under win2000
666
667
668if the server sets the session key the same for a second SMB socket as
669an initial socket then the client will not re-authenticate, it will go
670straight to a tconx, skipping session setup and will use all the
671existing parameters! This allows two sockets with the same keys!?
672
673
674removed blocking lock code, we now queue the whole request the same as
675we queue any other pending request. This allows for things like a
676close() while a pending blocking lock is being processed to operate
677sanely.
678
679disabled change notify code
680
681disabled oplock code
682
683
684
685MILESTONES
686==========
687
688
689client library and test code
690----------------------------
691
692 convert client library to new structure
693 get smbtorture working
694 get smbclient working
695 expand client library for all requests
696 write per-request test suite
697 gentest randomised test suite
698 separate client code as a library for non-Samba use
699
700server code
701-----------
702 add remaining core SMB requests
703 add IPC layer
704 add nttrans layer
705 add rpc layer
706 fix auth models (share, server, rpc)
707 get net command working
708 connect CIFS backend to server level auth
709 get nmbd working
710 get winbindd working
711 reconnect printing code
712 restore removed smbd options
713 add smb.conf macro substitution code
714 add async backend notification
715 add generic timer event mechanism
716
717clustering code
718---------------
719
720 write CIFS backend
721 new server models (break 1-1)
722 test clustered models
723 add fulcrum statistics gathering
724
725docs
726----
727
728 conference paper
729 developer docs
730
731svn instructions
732
733Ideas
734-----
735
736 - store all config in config.ldb
737
738 - load from smb.conf if modtime changes
739
740 - dump full system config with ldbsearch
741
742 - will need the ability to form a ldif difference file
743
744 - advanced web admin via a web ldb editor
745
746 - normal web admin via web forms -> ldif
747
748 - config.ldb will replace smb.conf, secrets.tdb, shares.tdb etc
749
750 - subsystems in smbd will load config parameters for a share
751 using ldbsearch at tconx time
752
753 - need a loadparm equivalent module that provides parameter defaults
754
755 - start smbd like this: "smbd -C tdb://etc/samba/config.ldb" or
756 "smbd -C ldapi://var/run/ldapi"
757
758 - write a tool that generates a template ldap schema from an existing
759 ldb+tdb file
760
761 - no need to HUP smbd to reload config
762
763 - how to handle configuration comments? same problem as SWAT
764
765
766BUGS:
767 add a test case for last_entry_offset in trans2 find interfaces
768 conn refused
769 connect -> errno
770 no 137 resolution not possible
771 should not fallback to anon when pass supplied
772 should check pass-thu cap bit, and skip lots of tests
773 possibly allow the test suite to say "allow oversized replies" for trans2 and other calls
774 handle servers that don't have the setattre call in torture
775 add max file coponent length test and max path len test
776 check for alloc failure in all core reply.c and trans2.c code where allocation size depends on client parameter
777
778case-insenstive idea:
779 all filenames on disk lowercase
780 real case in extended attribute
781 keep cache of what dirs are all lowercase
782 when searching for name, don't search if dir is definately all lowercase
783 when creating file, use dnotify to tell if someone else creates at
784 same time
785
786solve del *.* idea:
787 make mangle cache dynamic size
788 fill during a dir scan
789 setup a timer
790 destroy cache after 30 sec
791 destroy if a 2nd dir scan happens on same dir
792
Note: See TracBrowser for help on using the repository browser.