summaryrefslogtreecommitdiff
path: root/source3/lib/util.c
AgeCommit message (Collapse)AuthorFilesLines
2007-11-08Remove more fstring/pstring bad useage. Go talloc !Jeremy Allison1-9/+10
Jeremy. (This used to be commit 2a0173743d2cf615d52278f3dd87cc804abe2d16)
2007-11-02Fix state_path to take a const string, not use pstring.Jeremy Allison1-7/+11
Jeremy. (This used to be commit 8c73e19f51d6e3f520cf44dd22f9b9584d4b460f)
2007-11-01Patch from Debian Samba package maintainers:Gerald (Jerry) Carter1-0/+33
Patch 1 of 3: - Patch 1 adds the new variables - Patch 2 makes uses of them for files belonging to the "state" path and the "code pages" path This patch seemed more easily acceptable, which explains why we separated it from patch 3 - Patch 3 reassigns files to the "cache" path. Indeed all "debatable" changes have been moved to that one The point is adding: - a path for non discardable state data: basically all TDB files that may need to be backed up - a path for shared data: mostly codepage stuff - a path for cache data to host files such as browse.dat, printers.tbd, <printer>.tdb All these are currently mixed in "libdir" (${prefix}/lib/samba by default). The patch keeps these new paths to point to ${prefix}/lib/samba by default and does therefore not change the software behaviour. Used alone, it just adds unused variables...so it can safely be used in sources without any behaviour change and no impact on Samba developers work. (This used to be commit b7d2fadbef044a89920da613b1aafc74a3d94e24)
2007-10-18RIP BOOL. Convert BOOL -> bool. I found a few interestingJeremy Allison1-42/+42
bugs in various places whilst doing this (places that assumed BOOL == int). I also need to fix the Samba4 pidl generation (next checkin). Jeremy. (This used to be commit f35a266b3cbb3e5fa6a86be60f34fe340a3ca71f)
2007-10-16Fix access control code to be IPv6/v4 protocol independent.Jeremy Allison1-23/+36
Make unix_wild_match() talloc, not pstring based. Next will be name resolution code, and client code. Jeremy. (This used to be commit f6a01b82c5a47957659df08ea84e335dfbba1826)
2007-10-15Move to protocol independent code in most of lib/util_sock.cJeremy Allison1-68/+37
We don't use gethostbyname any more except in one case where we're looking for host aliases (I don't know how to do that with getaddrinfo yet). New function should be getaddrinfo(). Next step will be fixing lib/access.c, and then changing libsmb/namequery.c to cope with IPv6 address returns. Jeremy. (This used to be commit 4a56b697b6adcf095e25895c4a9ba3192ed34124)
2007-10-10Add start of IPv6 implementation. Currently most of this is avoidingJeremy Allison1-189/+0
IPv6 in winbindd, but moves most of the socket functions that were wrongly in lib/util.c into lib/util_sock.c and provides generic IPv4/6 independent versions of most things. Still lots of work to do, but now I can see how I'll fix the access check code. Nasty part that remains is the name resolution code which is used to returning arrays of in_addr structs. Jeremy. (This used to be commit 3f6bd0e1ec5cc6670f3d08f76fc2cd94c9cd1a08)
2007-10-10[GLUE] Rsync SAMBA_3_2_0 SVN r25598 in order to create the v3-2-test branch.Gerald (Jerry) Carter1-34/+14
(This used to be commit 5c6c8e1fe93f340005110a7833946191659d88ab)
2007-10-10r25505: Add a replacement (IPv4 only) implementation of getaddrinfo/freeaddrinfoJeremy Allison1-4/+4
under the 2 clause *BSD license for future use in IPv6 code. Original code was from PostgreSQL and I've maintained their license even though I've rewritten large parts of it (I probably should donate this back to them). Jeremy. (This used to be commit 760d993340a966269d71acfb7a6b5e4d3776ac5d)
2007-10-10r25472: Fix the interfaces code to detect IPv6 interfaces, using theJeremy Allison1-13/+13
new standard getifaddrs() and freeifaddrs() interfaces. Currently we only return IPv4 af_families. Needs fixing for binds to IPv6 but this has to be careful work. Jeremy. (This used to be commit 327875182c9219aeba687e10aaea93546d9a70ea)
2007-10-10r25396: Very obvious fix from Martin Zielinski.Günther Deschner1-0/+1
Guenther (This used to be commit 1f0d05807b7fe31cc4be59c7a2e850c9ec3e3864)
2007-10-10r25117: The mega-patch Jerry was waiting for. Remove all pstrings fromJeremy Allison1-7/+9
the main server code paths. We should now be able to cope with paths up to PATH_MAX length now. Final job will be to add the TALLOC_CTX * parameter to unix_convert to make it explicit (for Volker). Jeremy. (This used to be commit 7f0db75fb0f24873577dcb758a2ecee74fdc4297)
2007-10-10r24949: Remove some static buffersVolker Lendecke1-47/+29
(This used to be commit df648d47ff3c4e24f439fda839653bda98323100)
2007-10-10r24903: One more tick in #if 0 codeVolker Lendecke1-1/+1
(This used to be commit e0b4fb55e3176785a85d66efece15d0a366a35f1)
2007-10-10r24759: Comment out the _nonnull calls for 3.2.x, as agreed with tridge.Jeremy Allison1-0/+6
Leaving the commented out code for now, in case I need to re-test some stuff. Jeremy (This used to be commit 343be0464342aac14a9592fd73a71b7589ba34d5)
2007-10-10r24000: Add message_push_blob() and message_push_string().Volker Lendecke1-0/+21
The proposed new API convention is to start with a 0 bcc length and then push things step by step. These routines reallocate the outbuf and adjust the length and bcc fields as necessary. (This used to be commit 624f1fe4f6e022d73e78fa8c9646f6f64035f3ee)
2007-10-10r23847: As Dr. Volker says, "A pstring a day....".Jeremy Allison1-7/+9
Jeremy. (This used to be commit 8adf81696aee99c5090e1b827ceb14929ec4aeda)
2007-10-10r23784: use the GPLv3 boilerplate as recommended by the FSF and the license textAndrew Tridgell1-2/+1
(This used to be commit b0132e94fc5fef936aa766fb99a306b3628e9f07)
2007-10-10r23779: Change from v2 or later to v3 or later.Jeremy Allison1-1/+1
Jeremy. (This used to be commit 407e6e695b8366369b7c76af1ff76869b45347b3)
2007-10-10r23594: Fix parsing of local pids if cluster support is compiled in but noVolker Lendecke1-0/+4
cluster is used (This used to be commit 6beaa87da938f2a530939714b732fa769a28a008)
2007-10-10r23510: Tidy calls to smb_panic by removing trailing newlines. Print theJames Peach1-10/+14
failed expression in SMB_ASSERT. (This used to be commit 171dc060e2a576d724eed1ca65636bdafffd7713)
2007-10-10r23410: Merge the core of the cluster code.Volker Lendecke1-11/+70
I'm 100% certain I've forgotten to merge something, but the main code should be in. It's mainly in dbwrap_ctdb.c, ctdbd_conn.c and messages_ctdbd.c. There should be no changes to the non-cluster case, it does survive make test on my laptop. It survives some very basic tests with ctdbd enables, I did not do the full test suite for clusters yet. Phew... Volker (This used to be commit 15553d6327a3aecdd2b0b94a3656d04bf4106323)
2007-10-10r23055: Rewrite messages.c to use auto-generated marshalling in the tdb. I'mVolker Lendecke1-1/+0
doing this because for the clustering the marshalling is needed in more than one place, so I wanted a decent routine to marshall a message_rec struct which was not there before. Tridge, this seems about the same speed as it used to be before, the librpc/ndr overhead in my tests was under the noise. Volker (This used to be commit eaefd00563173dfabb7716c5695ac0a2f7139bb6)
2007-10-10r22736: Start to merge the low-hanging fruit from the now 7000-line cluster ↵Volker Lendecke1-16/+14
patch. This changes "struct process_id" to "struct server_id", keeping both is just too much hassle. No functional change (I hope ;-)) Volker (This used to be commit 0ad4b1226c9d91b72136310d3bbb640d2c5d67b8)
2007-10-10r22564: Move the _strict -> _zeronull functions into lib/util.cJeremy Allison1-0/+99
and out of talloc at tridge's request. Jeremy. (This used to be commit da78488b86c464b6861d36398cca7524ad5906fe)
2007-10-10r22555: Ensure our paranoid malloc functions return NULL onJeremy Allison1-0/+12
size == 0 so we have a known behavior. Jeremy. (This used to be commit 27c0f2970842a6e07875c5591ded6352acf36a4e)
2007-10-10r22391: Looks bigger than it is. Make "inbuf" availableJeremy Allison1-7/+9
to all callers of smb_setlen (via set_message() calls). This will allow the server to reflect back the correct encryption context. Jeremy. (This used to be commit 2d80a96120a5fe2fe726f00746d36d85044c4bdb)
2007-10-10r22389: Start preparing for multiple encryption contexts in theJeremy Allison1-7/+13
server. Allow server to reflect back to calling client the encryption context that was sent. Jeremy. (This used to be commit b49e90335d1e589916b5ab4992e3c4a2d221ca7e)
2007-10-10r22050: Fix a couple of off-by-one errors in the rapJeremy Allison1-4/+14
call patch. Jerry, this works now for displaying shares on Win9x (and hopefully everything else as well :-). Jeremy. (This used to be commit 728a4cc71376f9cfff2578d21a47602f8b7c6531)
2007-10-10r22045: As Volker noticed, skip_string's last argument isJeremy Allison1-1/+1
redundent. Remove it. Jeremy. (This used to be commit 140881cfbb59ce4a699b5900efe02bf315be7bd5)
2007-10-10r22042: Try and clean up my own mess using the API VolkerJeremy Allison1-6/+56
suggested. I now use : BOOL is_offset_safe(const char *buf_base, size_t buf_len, char *ptr, size_t off) char *get_safe_ptr(const char *buf_base, size_t buf_len, char *ptr, size_t off) char *get_safe_str_ptr(const char *buf_base, size_t buf_len, char *ptr, size_t off) int get_safe_SVAL(const char *buf_base, size_t buf_len, char *ptr, size_t off, int failval) int get_safe_IVAL(const char *buf_base, size_t buf_len, char *ptr, size_t off, int failval) Volker, please criticize and comment. Thanks, Jeremy. (This used to be commit d47af7c9263f519e7307859b6a696d854c5dfca3)
2007-10-10r22019: Jeremy, this hopefully fixes the build farm currently. But I think ↵Volker Lendecke1-2/+2
we need another get_safe_offset call that also includes the required buffer size. Volker (This used to be commit 6138be7e4a5eb57af4a024d749cb68168b8589fb)
2007-10-10r22014: Make us pass RANDOMIPC test again :-(. This is an ugly check-in,Jeremy Allison1-0/+23
but I've no option. Jeremy. (This used to be commit c3a565081d70b209a4f9e6e8f1859bf7194a5f74)
2007-10-10r22011: As Metze suggested, use 0xFF 'E' <enc ctx> insteadJeremy Allison1-1/+1
of 0xFF 'S' <enc ctx>. Jeremy. (This used to be commit d8cd4fc91b324c9ab8d2f66ee264093763018f76)
2007-10-10r22001: change prototype of dump_data(), so that it takes unsigned char * now,Stefan Metzmacher1-4/+3
which matches what samba4 has. also fix all the callers to prevent compiler warnings metze (This used to be commit fa322f0cc9c26a9537ba3f0a7d4e4a25941317e7)
2007-10-10r21991: I hate Steve French :-). Add support for encryptionJeremy Allison1-0/+13
contexts.... Jeremy. (This used to be commit ae8f3649f773b8a8dcb55921536d038d3475322e)
2007-10-10r21854: Add gfree_interfaces() to gfree_all().Günther Deschner1-0/+1
Guenther (This used to be commit eb34ebd9e76061417200a286c2831394be04529b)
2007-10-10r21800: Check-in the DFS rewrite. I am still testing this but itJeremy Allison1-0/+3
works from smbclient and Windows, and I am promising to support and fix both client and server code moving forward. Still need to test the RPC admin support but I haven't changed that code. Jeremy. (This used to be commit 7a7862c01d07796ef206b255c676ad7dc2cc42fc)
2007-10-10r21768: Fix the client dfs code such that smbclient canJeremy Allison1-1/+14
process deep dfs links (ie. links that go to non root parts of a share). Make the directory handling conanonical in POSIX and Windows pathname processing. dfs should not be fully working in client tools. Please bug me if not. Jeremy. (This used to be commit 1c9e10569cd97ee41de39f9f012bea4e4c932b5d)
2007-10-10r21725: Fix for memalign used without test guards. WasJeremy Allison1-15/+0
breaking the build on *BSD's. Tested by Herb. Jeremy. (This used to be commit 4816af5ce9070385b292f666779a24057b39e457)
2007-10-10r21560: Convert name_to_fqdn to BOOL.Günther Deschner1-3/+6
Guenther (This used to be commit 28ce79629bc36929f508c1ccb1d27d48e8898045)
2007-10-10r21525: Go ahead and checkin the mlock() & memalign() fixes soGerald Carter1-0/+28
others don't get stuck with the winbindd hang. Still waiting on additional confirmation from Guenther that this fixes thes issues he was observing as well. But it's been running in my local tree for a day without problems. (This used to be commit 0d2b80c6c4a744b05a0efdec352cddccc430e0c4)
2007-10-10r21262: Final part of BUG 4093: fix %a with Windows XP 64bitGerald Carter1-1/+4
(This used to be commit e2681eb4be1a9bd001eed0f39e5b5d370cf71ed6)
2007-10-10r21250: Partial fix for BUG 4093: Make %a expand to "Vista"Gerald Carter1-0/+3
based on the flags2 values in the negprot request. This also includes some code for testing the dialect strings for "SMB 2.001" but this is unreliable as Vista only sends that in the 1st negprot and caches the fact that we don't support it. Restartnig the WOrkstation service on the client clears the cache. (This used to be commit d781eeb0e4362b7af1497634d26315498a5257d4)
2007-10-10r21084: Make the Samba4 files compile in Samba3, not activated yet.Volker Lendecke1-0/+13
Volker (This used to be commit c24854433a28cc066072a7107e29aa7fe2bec3c8)
2007-10-10r20394: This is a *VERY* early start of my work on notify.Volker Lendecke1-0/+31
Checking in because Jeremy was bugging me. Potentially this becomes quite intrusive, I'm not sure if I should open a temporary branch for this. Jeremy, Jerry, do you think 3_0 is the right place for this? Volker (This used to be commit bcf5c751cbe203c00814642e26440cf88f300bce)
2007-10-10r20110: Fix interaction between paranoid malloc checkerJeremy Allison1-0/+17
and lib/replace. Found by Herb - thanks ! Jeremy. (This used to be commit 67c4d5e73fe066910f7b1ca4624541a9bbbf7750)
2007-10-10r20090: Fix a class of bugs found by James Peach. EnsureJeremy Allison1-24/+12
we never mix malloc and talloc'ed contexts in the add_XX_to_array() and add_XX_to_array_unique() calls. Ensure that these calls always return False on out of memory, True otherwise and always check them. Ensure that the relevent parts of the conn struct and the nt_user_tokens are TALLOC_DESTROYED not SAFE_FREE'd. James - this should fix your crash bug in both branches. Jeremy. (This used to be commit 0ffca7559e07500bd09a64b775e230d448ce5c24)
2007-10-10r19080: Fix a potential NULL dereferenceVolker Lendecke1-0/+7
(This used to be commit 682b490c23bb88a1a570bd1fcb7d2b6aa778dd14)
2007-10-10r18707: Fix the build when you have libnscd installed (which apparently no hostGünther Deschner1-21/+0
on the buildfarm has). Guenther (This used to be commit b0bb364df0efe140780328d90ae55bb823e6b10d)