summaryrefslogtreecommitdiff
path: root/source3/nmbd
AgeCommit message (Collapse)AuthorFilesLines
2001-01-04I need a callback arg for cli_NetServerEnum and cli_RNetShareEnum, so I hadRichard Sharpe1-4/+5
to modifiy any routine that calls it to pass NULL and so forth. Should have no impact. It compiles OK. (This used to be commit 7f862e387f935a2125481338eee850afcb8d82ba)
2001-01-03We only want to mark mailslot packets as loopback packets if they are toRichard Sharpe1-1/+1
the DGRAM_PORT, since we want to actually send those to other ports. They might be for the client library running on the Samba server! (This used to be commit 05e2dd5e85d4aca1ccb9f6991e1415f85cbbdc1a)
2001-01-02Make the use of generate_name_trn_id conform to the usage elsewhere ...Richard Sharpe1-1/+1
(This used to be commit 46a3a56ecf411eb885aee2892e12d3846ce32ad6)
2001-01-02Comment out unused generate_name_trn_id ...Richard Sharpe1-1/+1
(This used to be commit fb5798e1d9eb518f85e30680883c0460141b245d)
2000-11-17John Reillys fix for de-registering broadcast names (NT doesn't do this).Jeremy Allison1-0/+4
Jeremy. (This used to be commit 245907f2affb530237809b81b8748f7f0a1e4502)
2000-10-12Ignore SIGUSR2. Terminate nmbd if we have no interfaces.Jeremy Allison1-5/+19
Jeremy. (This used to be commit 580e2e044cfd1d011d9f28f0f49ef60ca6ba8d32)
2000-10-07Ensure browse.dat is written and read in UNIX character set format.Jeremy Allison1-3/+13
Jeremy. (This used to be commit 279d0ec656b03f9266e38b013f16b69e7571c0d5)
2000-09-12- changed the msg_type to be an int instead of an enum so that it isAndrew Tridgell3-14/+25
easier to add new message types to messages.h without breaking old binaries - added a MSG_FORCE_ELECTION message to force nmbd to hold an election (This used to be commit f1c49ca7ce56bc39259041a71479e84ebf53eeca)
2000-09-11debug messages now work for nmbdAndrew Tridgell2-82/+79
(This used to be commit 6a503f95b10f6661b089f30f2b5ffebead32685c)
2000-09-11the first cut of the internal messaging system.Andrew Tridgell2-31/+0
The motivation for this system is to replace the UDP message for oplocks, but this commit only does the "set debug level" message. (This used to be commit 2a34ee95f3929cff131db6c5a2b4820194c05b2d)
2000-08-30Fix for bind interfaces only sometimes picking the wrong IP addressJeremy Allison1-2/+24
for a name query. From Steve Langasek <vorlon@netexpress.net>. Jeremy. (This used to be commit 9890740121ae7bd7a0196bbf946c6f8c82aa7f6e)
2000-07-19Instead of handing back a string (which might be a DNS name or an IPChristopher R. Hertel1-8/+9
string), the wins_srv module now hands back a struct in_addr when it's called. It caches the IP address once it has been looked up. The IP is cleared (and must be looked up again) if the 'wins server' parameter is reread, or if the node is marked 'dead'. A dead node will not be re-tried for 10 minutes (per a #define in wins_srv.c). As it was, the code was reading the WINS server name or IP directly from lp_wins_server. That's okay, except that if the value was expressed as a name, then a DNS lookup would be done every time the client wanted to talk to the server. I still need to work out the implications of failover regarding the 'unicast subnet' list. Chris -)----- (This used to be commit 73aa188320fd3bf10b5dfc057323f40aff2c13bd)
2000-07-19First cut toward adding WINS server failover.Christopher R. Hertel1-1/+5
*Note: failover doesn't actually work yet!* It's just that the code I'm adding provides all of the pieces necessary. I do have one big question. Something that I'll have to ask Jeremy, I'm thinkin'. In nmbd/nmbd_subnetdb.c the IP of the WINS server is used to set up the Unicast subnet. ...so what happens if the WINS server changes? My guess is either: a) nothing. b) I'd have to change the unicast subnet entry whenever the WINS server changes. Urq. BTW, the lp_wins_server() function no longer returns the WINS server name or IP. It returns the list of WINS servers entered in smb.conf. To get the currently 'live' WINS server, use the wins_srv() function. Fun, eh? Chris -)----- (This used to be commit cc08bdc74f4cd111fdc582ee7babef47ed8a950d)
2000-06-11Linux kernel oplocks now seem to work, but need a _lot_ of testingAndrew Tridgell1-1/+1
I had to modify sys_select() to not loop on EINTR. I added a wrapper called sys_select_intr() which gives the old behaviour. (This used to be commit b28cc4163bc2faaa80c5782fc02c8f03c410cdeb)
2000-05-10more mergingAndrew Tridgell1-2/+1
it is now at the stage that winbindd can compile in the head branch, but not link (This used to be commit d178c00aae77710ae6ff20a7f54a30e3bd8232bb)
2000-05-02Fixed wild pointer diff found by insure.Jeremy Allison1-1/+1
Jeremy. (This used to be commit 158d9cada8c12725981d495faf8ed9f5d4306e23)
2000-05-02Added sys_fork() and sys_getpid() functions to stop the overheadJeremy Allison5-6/+6
of doing a system call every time we want to just get our pid. Jeremy. (This used to be commit 148628b616b5c29ba6340d65fc3ddbcabba6e67a)
2000-04-25don't qsort a list less than 2 entriesAndrew Tridgell1-1/+3
(This used to be commit 6faa3c23ae6d8aab52f8d6689e04bde9b3029804)
2000-04-24fixed a parameter bug found by insureAndrew Tridgell1-1/+1
(This used to be commit a559a8066fb162c4da0a5046c49a105eabf131d9)
2000-04-22This is a *big* checkin that may break some things, but implements theJeremy Allison1-3/+8
new open mechanism Andrew & I discussed. config.sub: configure: Included the QNX patch. include/vfs.h: smbd/vfs-wrap.c: smbd/vfs.c: Added ftruncate vfs call (needed). Note that we will also need locking calls in the vfs (to be added). lib/util_unistr.c: nmbd/nmbd_processlogon.c: Fix for NT domain logons causing nmbd to core dump. Also fix for sidsize DOS bug. locking/locking.c: Check value of ret before using it for memdup. printing/printing.c: Convert print_fsp_open to return an allocated fsp. rpc_server/srv_lsa.c: Fix for NT domain logons. I have removed all use of lp_share_modes() from the code (although I left the parameter in the table for backwards compatibility). It no longer makes sense for this to exist. smbd/close.c: Removed lp_share_modes(). smbd/fileio.c: Fixed parameters to unlock_share_entry call in panic code. smbd/files.c: Correctly set the unix_ERR_code to ERRnofids on fsp allocation fail. smbd/nttrans.c: smbd/reply.c: smbd/trans2.c: Changed all occurrences of open_file_shared/open_directory/ open_file_stat to return an fsp from the call. smbd/open.c: Changed all occurrences of open_file_shared/open_directory/ open_file_stat to return an fsp from the call. In addition I have fixed a long standing race condition in the deny mode processing w.r.t. two smbd's creating a file. Andrew, please note that your original idea of using open with O_EXCL in this case would not work (I went over the races very carefully) and so we must re-check deny modes *after* the open() call returns. This is because there is a race between the open with O_EXCL and the lock of the share mode entry. Imagine the case where the first smbd does the open with O_EXCL and a deny mode of DENY_ALL, but is pre-empted before it locks the share modes and creates the deny mode entry for DENY_ALL. A second smbd could then come in with O_RDONLY and a deny mode of DENY_NONE and the two opens would be allowed. The *only* way to fix this race is to lock the share modes after the open and then do the deny mode checks *after* this lock in the case where the file did not originally exist. This code will need extensive testing but seems to initially work. Jeremy. (This used to be commit ab0ecc39d688f16b9692fe90b991f0b89287070a)
2000-04-18updates from the TNG branchAndrew Tridgell1-10/+6
(This used to be commit 36fb5bc72fc6c0de719205ea34f497bfa0c4082f)
2000-04-12logic for domainsidsize is if size is zero, there's no sid, so don'tLuke Leighton1-1/+0
advance over it and 4-byte align. this _used_ to be "regardless of domainsidsize, advance by domainsidsize+3" which is wrong. (This used to be commit 5086e6425f3630d8f5ca1e25a333eb97fdf86e93)
2000-04-11include/byteorder.h: ALIGN4/ALIGN2 macros.Jeremy Allison1-3/+3
include/includes.h: Added SMB_BIG_UINT_BITS. lib/util.c: Removed align2/align4 - use macros. libsmb/namequery.c: Use ALIGN2. locking/locking.c: Replace do_lock, do_unlock, args with SMB_BIG_UINT, not SMB_OFF_T. Needed to move to hiding POSIX locks at a lower layer. nmbd/nmbd_processlogon.c: Use ALIGN2/ALIGN4 macros. smbd/blocking.c: Replace do_lock, do_unlock, args with SMB_BIG_UINT, not SMB_OFF_T. smbd/reply.c: Replace do_lock, do_unlock, args with SMB_BIG_UINT, not SMB_OFF_T. Jeremy. (This used to be commit 491eea8a20bf80d426625479326211dc975857a6)
2000-04-11add a commentAndrew Tridgell1-1/+1
(This used to be commit 0da440c8fe365fd53c313e9dc62dda7e40916d62)
2000-04-11some updates to the process logon code to reflect lukes latestAndrew Tridgell1-20/+38
research plus some cleanups (This used to be commit 1682faa1b0e95fc5acdf9b10da80a6515f8772cd)
2000-04-11finally got sick of the "extern int Client" code and the stupidAndrew Tridgell1-1/+0
assumption that we have one socket everywhere while doing so I discovered a few bugs! 1) the clientgen session retarget code if used from smbd or nmbd would cause a crash as it called close_sockets() which closed our main socket! fixed by removing close_sockets() completely - it is unnecessary 2) the caching in client_addr() and client_name() was bogus - it could easily get fooled and give the wrong result. fixed. 3) the retarget could could recurse, allowing an easy denial of service attack on nmbd. fixed. (This used to be commit 5937ab14d222696e40a3fc6f0e6a536f2d7305d3)
2000-04-03Additional fix for nmbd and 127.0.0.1 interface.Jeremy Allison1-0/+12
Jeremy. (This used to be commit 715fa7ea8cf00d72c868bed420c28a29011f53a1)
2000-03-29Cause nmbd to ignore loopback interface when constructing its interface ↵Jeremy Allison1-0/+14
list. This is done by default when interfaces are probed, but if someone explicitly adds 127.0.0.1 to the interfaces line for smbd, then nmbd would start to try and register names on it. This was not good :-(. Jeremy. (This used to be commit cc3ad825214686ad03dd4176d0c55290d1de6221)
2000-03-28damn, the test was the wrong way around for short_resuestAndrew Tridgell1-1/+1
(This used to be commit 1ac46c40118fce9443141ce19506d124a873b73d)
2000-03-27changed the definition of dos_PutUniCodeAndrew Tridgell1-9/+4
the previous definition could result is us overflowing a buffer. The null termination was always added yet the size returned did not include the null termination. the new function takes a BOOL null_terminate, and always returns the total number of bytes consumed by the string. (This used to be commit 426c90433396a95033eefcc4af97603abc934221)
2000-03-27the final part of the nmbd merge between head and tng - this gets theAndrew Tridgell2-30/+38
GETDC stuff sorted out (This used to be commit f6b56ae93e47a54317f2711533ec8208d5cbc8a9)
2000-03-27fixed the hanlding of recursion desired when sending packets fromAndrew Tridgell1-23/+22
nmbd. It does NOT follow the rule that packets to the wins server have rec_des set (I know that we have postulated this in the past). Please don't screw with this unless you do careful testing from WinXX clients. Luke and I spent a couple of hours today getting this right (it was wrong in both TNG and HEAD) (This used to be commit 9eda2e27b74d95975e481d92930ef87de7006919)
2000-03-27rename static reload_services function to reload_nmbd_services becauseLuke Leighton1-6/+6
it clashes with other reload_services definitions. (This used to be commit affaf9c5411e533a77621574d356e886eea93465)
2000-03-26when doing a "secure nbns" wack response and check with owner for aAndrew Tridgell1-1/+4
multihomed registration we were sending the packet to the wrong host! We sent it to the person trying to register rather than to the person who currently holds the name. That means we were not secure and we could allow two people to register the same name. Jeremy, you may wish to merge this change into 2.0.X (This used to be commit 94ca1d1250d12918311a402cc689050ba1d06e24)
2000-03-26merge from tng ...Andrew Tridgell1-1/+1
reload services can be static (This used to be commit b13a903720a6ef789ee7d688c05be2e77584580e)
2000-02-23lib/system.c: Fixed gcc warnings.Jeremy Allison1-2/+2
nmbd/nmbd_processlogon.c: Use "True" and "False" instead of 1 and 0. Others - preparing for multiple pdu write code. Jeremy. (This used to be commit 9f879ec396230deba34fbe5e82d8a65f92137c54)
2000-02-22richard got the short request for GETDC right (hooray!) win9x _and_ ntLuke Leighton1-11/+24
now work. (This used to be commit 27ef1789267c7af70071ac9b1d216b4dd745578a)
2000-01-28Modified auto alignment of ud[] struct on stack to be declared as anJeremy Allison2-4/+4
array of pointers. This should cause alignment on a correct boundary.. Spotted by Darren Reed <darrenr@telnetmedia.com>. Jeremy. (This used to be commit 91f4d0675333d7c5d7bb5ff077faaf83e1fd9bfe)
2000-01-07this looks like a big commit, but it isn't really :)Andrew Tridgell15-63/+38
This fixes our netbios scope handling. We now have a 'netbios scope' option in smb.conf and the scope option is removed from make_nmb_name() this was prompted by a bug in our PDC finding code where it didn't append the scope to the query of the '*' name. (This used to be commit b563be824b8c3141c49558eced7829b48d4ab26f)
2000-01-05implemented talloc() as described on samba-technical. This fixes theAndrew Tridgell1-0/+3
lp_string() bug properly. we still need to add lp_talloc_free() calls in all the main event loops, I've only put it in smbd and nmbd thus far. (This used to be commit aa7f81552540f5dca2c146f5edd805611d5b390f)
2000-01-03added suppport for unexpected udp/138 packetsAndrew Tridgell1-9/+12
I also fixed up the lookup_pdc_name() code so that it now works, even with a NT server that insists on replying to udp/138. The method I used to match packets was to use the mailslot string as a datagram ID. The true dgm_id doesn't work as NT doesn't set it correctly. uggh. PS: Jeremy, I had to change your code quite a bit, are you sure this worked with a Samba PDC?? The code looked broken, it got the offsets wrong in the SMB portion of the packet and filled in the IP incorrectly. (This used to be commit 32f66f4ea63038cb4b3785bdf1762abdde076f5d)
2000-01-03got rid of mem_manAndrew Tridgell1-2/+0
yamd is much better, and doesn't require any source code changes if you haven't seen yamd then take a look at http://www3.hmc.edu/~neldredge/yamd/ its excellent! (This used to be commit 25b13f8b79d648188036f027f45bc78ec117cc88)
2000-01-03added the unexpected packet database (unexpected.tdb)Andrew Tridgell2-1/+7
this means "nmblookup -S" now always works, even with broken servers the database stores all unexpected replies and these can be accessed by any client. while doing this I cleaned up a couple of functions, and put in place a better trn_id generator. in most places the code got quite a bit simpler due to the addition of simple helper functions. I haven't yet put the code in to take advantage of this for pdc replies - that will be next. Jeremys pdc finding code will then work :) (This used to be commit 280e6359d36c9bc8dcded302f15c3a1db8e3feeb)
2000-01-02- added tdb_flags option to tdb_open()Andrew Tridgell2-16/+4
- added TDB_CLEAR_IF_FIRST flag to clear the database if this is the first attached process. Useful for non-persistent databases like our locking area (this will also make upgrades to new database layouts easier) - use lock_path() in a couple of places - leave connections database open while smbd running - cleaned up some tdb code a little, using macros for constants (This used to be commit 00e9da3ca577527db392aced62f02c69cfee8f4f)
1999-12-13first pass at updating head branch to be to be the same as the SAMBA_2_0 branchAndrew Tridgell22-261/+484
(This used to be commit 453a822a76780063dff23526c35408866d0c0154)
1999-12-01more cli_session_setup() calls. what the heck are these doing???Luke Leighton1-1/+1
they should all be replaced with cli_establish_connection(). created cli_use_wait_keyboard() which waits on multiple cli_states and swallows session keepalives. (This used to be commit fcc39b3f4f2f8d04d3fab09db048b4f3dc1e97d5)
1999-12-01sys_select added one more argument (read, write selectors).Luke Leighton1-1/+1
(This used to be commit e4d92ff9dfc51735e6932748f66a7c20b2c1cb6a)
1999-11-19- bug in nmbd registering DOMAIN_NAME<1c> to WINS server; recursionLuke Leighton2-8/+19
desired flag MUST be set in any NBT UDP packets sent to a WINS server, else they will go to the WINS client side of the NT NetBIOS kernel instead, and will get trashed. - added \PIPE\browser server-side code. (This used to be commit 8e406c1fa296c3f97b1cd7ddde7b5aeb9232b26e)
1999-11-18responses to UDP samquery go back to SERVER<00> not DOMAIN<1c>, theLuke Leighton2-9/+9
request name. modified createuser rpcclient command to examine name being added. if it ends in a $, assume that a workstation trust account is being added. (This used to be commit 4aea261cb0e5f34255ff83271eb5cadb0eb78bc9)
1999-11-18added regqueryval command (experimental) to get reg_io_q_info() andLuke Leighton1-0/+2
reg_io_r_info() working properly. previously they weren't well understood (well, they were the first of the registry functions i did, back in december 97, ok??? :-) set ntversion to 0x1 in SAMQUERY, so that we reply same as NT4 srv. (This used to be commit 98ddeaf442cb30972cb281bf0489a6e5f7eb2883)