From: Kern S. <ke...@si...> - 2004-08-01 10:31:57
|
I'm copying the devel list, please do the same (thanks). Rather than snipping, I'll top answer: - I'm rethinking the "address" keyword issue. I had never informed users of the new names ... maybe now is the time to do it. - I've reindented several of the files using my latest .indent.pro (a bit different from what I sent you). It still screws up a lot of things, but is better than what we had. - I've created a branch so that we can synchronize -- see next email. - Thanks for the free_resource patch -- applied, but there is still a problem in the FD. Regards, Kern On Sun, 2004-08-01 at 08:35, Meno Abels wrote: > Kern Sibbald wrote: > > >Hell Meno, > > > >On Sat, 2004-07-31 at 22:48, Meno Abels wrote: > > > > > >>Hello Kern, > >> > >>So I have a look to the problem it is pretty easy you modified my > >>orignal code > >>to bstrncpy to prefend buffer overflows, but inet_ntop has also no > >>buffer limiting > >>value -:(. > >>You mix the parameter order > >>from (char *, const char*, size_t) -> (char *, size_t, const char *) so > >>fix it -:) > >> > >> > > > >Silly me -- sorry. > > > > > > > >>In the standard config -Wall isn't enable which should? > >> > >> > > > >I *always* add it to my ./configure line: > >CFLAGS="-g -O2 -Wall" ./configure \ > >... > > > > > > > > > >>-Wall related thinks: > >>* delete line 58 in src/store/stored_conf.h and src/store/stored_conf.c > >> it is a nested comment (it is really in both 58) > >> > >> > > > >This is going to cause a problem that we need to fix. We cannot delete > >Address. It will break too many .conf files, which is against my > >philosophy of programming. It will probably also make my regression > >scripts fail. > > > > > > > You never used the address anywhere so i deleted it infact of nothings > happend. But your > philosophy is welcome so we put these lines back: > > int static RES_ITEM store_items[] = { > {"address", store_str, ITEM(res_store.address), 0, 0, 0}, /* deprecated */ > > > in > free_resource > if (res->res_dir.address) { > free(res->res_dir.address); > } > > >>- To the indenting do you use tab or spaces and what are the rules? > >>012456789012345 > >>void foo() > >>{ > >> i = 4; > >> if (foo) { > >> if (foo++) { > >> call_to(foo, foo+1, foo++, > >> moo, moo+1); > >> } > >> } > >>} > >> > >> > > > >The indenting is 3 spaces for everything. Multiple spaces can be > >replaced by a tab using the normal standards for a tab -- i.e. the tab > >inserts spaces up to the next multiple of 8. > > > > > thanks i will apply to it in future. > > > > > > >>- I compiled the stuff also now on linux it compiles fine-:) you need > >>this patch > >>linux doesn't have sa_len in sockaddr. > >>--- src/dird/ua_cmds.c.orig 2004-07-31 22:43:23.000000000 +0200 > >>+++ src/dird/ua_cmds.c 2004-07-31 22:44:02.000000000 +0200 > >>@@ -581,7 +581,9 @@ > >> } > >> #ifdef HAVE_INET_NTOP > >> inet_ntop(ua->UA_sock->client_addr.sa_family, > >>- &(ua->UA_sock->client_addr), buf, > >>ua->UA_sock->client_addr.sa_len); > >>+ &(ua->UA_sock->client_addr), buf, > >>+ ua->UA_sock->client_addr.sa_family == AF_INET ? > >>+ sizeof(sockaddr_in) : sizeof(sockaddr_in6)); > >> #else > >> buf = inet_ntoa(((struct sockaddr_in > >>*)&(ua->UA_sock->client_addr))->sin_addr); > >> #endif > >> > >> > > > >Thanks. > > > >The was also a problem with inet_ntoa() in bnet_server.c. > > > >OK, now it compiles, but there are two problems: > > > >1. It doesn't connect here. I get: > > > >rufus-dir: ERROR in bnet_server.c:103 Cannot open stream socket: Address > >family not supported by protocol. Retrying ... > > > > > my source is out of sync so there is no way to dig in that-:( > > >This may be caused by a change I made to eliminate serious compiler > >warning. I'll try to look at this in the morning ... > > > >2. There are two buffers that are not released when the SD terminates: > >Orphaned buffer: 24 bytes allocated at line 154 of rufus-sd > >address_conf.c > >Orphaned buffer: 16 bytes allocated at line 94 of rufus-sd > >bnet_server.c > > > > > the line numbers are not matching to mine so it is difficult to me, but > one i found > that is in store_conf.c in free_resource case R_STORAGE i miss to release: > if (res->res_store.sddaddrs) { > free_addresses(res->res_store.sddaddrs); > } > > > morning > > kern |