1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-13 13:18:06 +03:00
Commit Graph

813 Commits

Author SHA1 Message Date
Luke Leighton
b925b3d20c added frag field to make_rpc_hdr() function
(This used to be commit 6b0e519294)
1997-10-29 01:05:46 +00:00
Luke Leighton
fe0a702322 byteorder.h :
added mode for printing debug array data as chars not uint8/16/32s.
	only really useful for (uint8) strings or (uint16) unicode strings

lsaparse.c smbparse.c smb.h :

	rpc bind and rpc bind ack structures and parsing and creation functions.

ipc.c pipes.c pipenetlog.c pipentlsa.c pipesrvsvc.c :

	using rpc bind / bind ack parsing routines instead of incorrect use of
	api_LsarpcTNP1 function.

ntclient.c :

	creation of do_rpc_bind() function.

THAT'S IT, FOLKS!
(This used to be commit 21c89e2f17)
1997-10-29 00:04:14 +00:00
Jeremy Allison
ecb952f913 Utility code to produce printer definition files from MS files.
Part of code to support Windows 95 automated printer driver installs.
Written by Jean-Francois Micouleau <Jean-Francois.Micouleau@utc.fr>.
(This used to be commit 6e9f817414)
1997-10-28 23:58:31 +00:00
Jeremy Allison
8f0316bdbc Adding Windows 95 printer driver code donated by Jean-Francois.Micouleau@utc.fr.
New program, make_printerdef, plus two new parameters :

[global] "printer driver file"
[local] "printer driver location"

Jeremy.
(This used to be commit 9a5b42e6b3)
1997-10-28 19:32:59 +00:00
Luke Leighton
d8e79427c9 smb.h smbparse.c pipeutil.c :
added bind and bind ack structures and parsing functions.  restructured
	rpc header stuff.

ntclient.c pipenetlog.c pipentlsa.c pipesrvsvc.c :

	having to deal with restructuring above.
(This used to be commit 9f2c4f1fee)
1997-10-28 17:54:10 +00:00
Andrew Tridgell
79f670128f enable sysv ipc and fast share modes on OSF1
(This used to be commit 3480524e15)
1997-10-28 15:07:01 +00:00
Andrew Tridgell
f320197654 need includes.h to compile on some systems (eg. sunos4)
(This used to be commit 7d80e25bb4)
1997-10-28 15:02:15 +00:00
Andrew Tridgell
9c717c285a fix for broken sunos4 includes (doesn't have SHM_R)
(This used to be commit 6ca96782ac)
1997-10-28 14:59:06 +00:00
Andrew Tridgell
c79e0abdd7 fix cast
(This used to be commit af13f5e178)
1997-10-28 14:55:47 +00:00
Andrew Tridgell
d6739a10d0 define semun for broken solaris sysvipc
(This used to be commit 4db076e08b)
1997-10-28 14:55:22 +00:00
Andrew Tridgell
e75de8adc6 lower the default hash size if SEMMSL isn't defined
(This used to be commit 9f0be847fd)
1997-10-28 14:40:31 +00:00
Andrew Tridgell
ba4d965fc0 define USE_SYSV_IPC on sunos4
(This used to be commit 6388da22eb)
1997-10-28 14:25:26 +00:00
Andrew Tridgell
e06da92b37 define USE_SYSV_IPC on a bunch more systems.
Needs some testing though.
(This used to be commit 8f2366e57d)
1997-10-28 14:22:50 +00:00
Andrew Tridgell
c9fa24b7a8 SYSV IPC implementation of fast share modes.
It will try sysv IPC first, then if that fails it will try mmap(),
then after that it will try share files.

I have defined USE_SYSV_IPC for Linux, Solaris and HPUX at the
moment. Probably a lot more could have it defined. In fact, the vast
majority of systems support it. Need autoconf again :-)

It should actually be faster than the mmap() version, and doesn't need
any lock files. This means the problem of the share mem file being on
a NFS drive will be gone.
(This used to be commit cc8fe0f062)
1997-10-28 14:19:54 +00:00
Andrew Tridgell
7c20ee083f refuse pathworks type R connect (patch from Stephen Tweedie)
(This used to be commit c63fee2b28)
1997-10-28 06:07:07 +00:00
Luke Leighton
aee261e784 added LSA_Q_CLOSE and LSA_R_CLOSE (also to smb.h). implemented in smbclient.
updated Query Info Policy to report domain name and domain sid for info levels
3 and 5.
fixed bug in dom_sid_to_string (idauths decoded wrong).  fixed bug in DOM_SID:
subauths are 32 bit not 16.
(This used to be commit 2f3cca23e2)
1997-10-27 19:00:38 +00:00
Jeremy Allison
6fc83d5c36 Fixed bug where we are a WINS server but not a domain master
browser. We were doing a name query instead of a name status.
Jeremy.
(This used to be commit 4021a1bf55)
1997-10-27 18:28:06 +00:00
Jeremy Allison
a030c93878 Fixed ntclient.c so it would compile.
Jeremy.
(This used to be commit 598e98e561)
1997-10-27 18:07:36 +00:00
Samba Release Account
e6ee5fc2d9 preparing for release of 1.9.18alpha6
(This used to be commit 28ef0df30e)
1997-10-27 17:18:51 +00:00
Luke Leighton
13291ce01d added LSA Query Info Policy.
fixed a problem with byte ordering (doing an SIVAL of the setup parameters
which was _also_ being done in the creation of the SMB header.  oops).
(This used to be commit 541fb82895)
1997-10-27 17:04:15 +00:00
Luke Leighton
f868196c1d checks against file handle in api_fd_reply(). i don't know what error
message should be returned, so i just let it fall through to sending an
"api_unsupported"
(This used to be commit 85d132da67)
1997-10-27 16:14:29 +00:00
Luke Leighton
8586dda29b added LSA Open Policy query and response processing to smbclient
(This used to be commit 16cc27852b)
1997-10-27 15:09:23 +00:00
Andrew Tridgell
71d648cdb4 change the default file permissions on the SHARE_MEM_FILE* to
0644. smbstatus now gets only read permission on the share files and
does no locking.

also get rid of some unnecessary umask(0) calls. smbd always runs with
umask(0)
(This used to be commit c6ac10170d)
1997-10-27 14:27:17 +00:00
Andrew Tridgell
464dc54336 also disable read prediction in 1.9.18
(This used to be commit 0f15558efb)
1997-10-27 13:38:07 +00:00
Andrew Tridgell
8047228db4 Fixed 2 oplock bugs:
1) the oplock macros in smb.h used | where they should have used
&. This means that smbd thought that all clients were always
requesting oplocks. This would have _really_ confused smbclient
and smbfs when they started receiving async oplock break requests when
they don't even know what an oplock is!

2) an oplock break request from a client can be embedded in a normal
lockingX request, and will be if the client has batched any lock
requests internally. The smbd code assumed that all oplock break
requests had num_locks==num_ulocks==0 which is not true. The only
thing special about a oplock break request with
num_locks==num_ulocks==0 is that no reply is sent. Otherwise it is
processed as a normal locking request in addition to the oplock break
processing.

These two fixes get the MS mail system in Win98 working on a Samba
1.9.18 network drive.

Andrew
(This used to be commit ed71534df5)
1997-10-27 12:02:34 +00:00
Luke Leighton
95b3b1473f hooray. hooray some more. hooray a lot. got the client-side working.
Q/R LSA_REQ_CHAL; Q/R LSA_AUTH2; Q/R LSA_SAMLOGON; Q/R LSA_SAMLOGOFF.
the last (non-essential right now) bit is the LSA_SRV_PWSET.

the next stage is to do LSA_OPENPOLICY; add the pipe binds (missing right
now); then we can test against an NT Server.
(This used to be commit 0a549e62fb)
1997-10-26 18:42:47 +00:00
Andrew Tridgell
2058763455 added -U option to nmblookup. This is similar to -B except that it
forces the client to send a unicast instead of a broadcast netbios
packet. This is useful for diagnostics.
(This used to be commit 57e0fac614)
1997-10-26 07:50:28 +00:00
Andrew Tridgell
f8c059517a fix some casting errors in smbencrypt and some multiply-defined errors
in clientutil.c (Luke, you can't just copy a global variable
declaration from one file to another, you need to declare one of them
extern)
(This used to be commit 944ecbcbd4)
1997-10-26 07:45:36 +00:00
Andrew Tridgell
a342ff5bf4 The browse synchronisation code in nmbsync.c now uses the clientgen.c
code, which means we don't have to link with a fake getpass routine
and we don't have a whole pile of global variables that really have
nothing to do with nmbd and were there to keep the client code happy.

The code should function identically to what it did before (hopefully
it was correct)

The only thing that now uses the horrible clientutil.c code is
smbclient.
(This used to be commit 4bf5c03b18)
1997-10-26 07:32:02 +00:00
Samba Release Account
326da272da preparing for release of 1.9.18alpha5
(This used to be commit 1b17455066)
1997-10-25 19:13:07 +00:00
Luke Leighton
11ff512ed6 oops!
(This used to be commit 2119624010)
1997-10-25 17:58:53 +00:00
Luke Leighton
7e56b5a173 added correct client-side credential generation / checking to the LSA SAM
Logon query.  i think i even got the client-side checking of the response
credentials right!
(This used to be commit f14c111835)
1997-10-25 17:38:37 +00:00
Luke Leighton
5493293442 got the SAM logon request generated, and received a SAM logon response back.
YEAH!

need to add:

	- client-side credential calculation
	- client-side parsing of the SAM logon response.
(This used to be commit 349677de3f)
1997-10-25 15:49:27 +00:00
Luke Leighton
027630f9ff sam logon query creation functions. written twice because i deleted it.
(This used to be commit 9eee8c2007)
1997-10-25 13:15:52 +00:00
Luke Leighton
390c1f3c4d Makefile :
adding bits for new nt domain code

byteorder.h :

	trying to get macros right, and not to crash on SUNOS5...

client.c :

	added #ifdef NTDOMAIN, and created do_nt_login() function.  don't
	want to have to recompile client.c unless absolutely necessary.

credentials.c :

	moved deal_with_creds() [possibly inappropriately] into credentials.c

ipc.c reply.c server.c uid.c :

	attempting to make (un)become_root() functions calleable from smbclient.
	this is a little tricky: smbclient might have to be another setuid
	root program, immediately setuid'ing to non-root, so that we can
	reset-uid to root to get at the smbpasswd file.  or, have a secure
	pipe mechanism to smbd to grab smbpasswd entries.  or the like.

smbdes.c smbencrypt.c :

	created a function to generate lm and nt owf hashes.

lsaparse.c ntclient.c smbparse.c :

	added nt client LSA_AUTH2 code.  it works, too!

pipenetlog.c pipentlsa.c pipesrvsvc.c :

	simplification.  code-shuffling.  getting that damn offset right
	for the opcode in RPC_HDR.

smb.h :

	changed dcinfo xxx_creds to DOM_CRED structures instead of DOM_CHAL.
	we might need to store the server times as well.

proto.h :

	the usual.
(This used to be commit 82436a3d99)
1997-10-25 10:58:18 +00:00
Samba Release Account
1bdf2d8fa5 preparing for release of 1.9.18alpha4
(This used to be commit bf5b060bd9)
1997-10-24 14:40:37 +00:00
Samba Release Account
78095482be preparing for release of samba-1.9.18alpha4
(This used to be commit e24465890a)
1997-10-24 14:39:28 +00:00
Luke Leighton
a60ad7bef3 default server_name if NIS server is unavailable should be the local
machine, not a NULL string.
(This used to be commit 5b15b17fc6)
1997-10-24 13:58:21 +00:00
Luke Leighton
be0f2e14b5 nmblib.c :
adding some debug info

pipenetlog.c pipentlsa.c pipesrvsvc.c :

	using unistrn2 instead of unistr2 in the SAM logon username.
	wrong offset for command in request (use "reserved" field
	not cancel_count.  AGH i'll get there)
(This used to be commit 6d301d2cfd)
1997-10-24 13:51:17 +00:00
Luke Leighton
a12f047533 nterr.c :
added a structure that wraps nt errors as strings and enums, so we
	can do a smb_nt_error() function.

Makefile ntclient.c :

	added ntclient.c, broken out nt domain stuff into a separate file.
	getting fed up of compile-times and size of client.c.

	fixed the do_lsa_req_chal() function.  made it read the response,
	and return the challenge credentials received from the server.

	next stop: do_lsa_auth_2().

client.c :

	removed nt domain logon functions into a separate file.

pipenetlog.c pipentlsa.c pipesrvsvc.c smbparse.c :

	i'd broken the offsets of the RPC_HDR while trying to sort out the
	nt client code.  fixed it again.  added some robustness stuff.

util.c :

	the unistrn2() function was null-terminating the string at one
	character too many.
(This used to be commit 39cec7f698)
1997-10-24 13:15:34 +00:00
Jeremy Allison
abb255cfe6 Big change to make nmbd code more readable/understandable.
Main change is removal of find_name_search() confusion.
This has been replaced with find_name_on_subnet() which
makes it explicit what is being searched.

Also changed wins_subnet to be wins_client_subnet in
preparation for splitting the wins subnet into client
and server pieces.

This is a big nmbd change and I'd appreciate any
bug reports.

Specific changes follow :

asyncdns.c:
     Removed wins entry from add_netbios_entry(). This is now
     explicit in the subnet_record parameter.

interface.c:
     iface_bcast(), iface_nmask(), iface_ip() return the
     default interface if none can be found. Made this
     behavior explicit - some code in nmbd incorrectly
     depended upon this (reply_name_status() for instance).

nameannounce.c:
     find_name_search changes to find_name_on_subnet.

namebrowse.c:
     wins_subnet renamed to wins_client_subnet.

namedbname.c:
     find_name_search removed. find_name_on_subnet added.
     add_netbios_entry - wins parameter removed.

namedbsubnet.c:
     find_req_subnet removed - not explicit enough.

nameelect.c:
     wins_subnet renamed to wins_client_subnet.

namepacket.c:
     listening() simplified.

nameresp.c:
     wins_subnet renamed to wins_client_subnet.

nameserv.c:
     find_name_search moved to find_name_on_subnet.

nameserv.h:
     FIND_XXX  -> changed to FIND_SELF_NAME, FIND_ANY_NAME.

nameservreply.c:
     find_name_search moved to find_name_on_subnet.
     Debug entries changed.

nameservresp.c:
     wins_subnet renamed to wins_client_subnet.

namework.c:
     wins_subnet renamed to wins_client_subnet.

nmbd.c:
     wins parameter removed from add_netbios_entry.

nmbsync:
     wins_subnet renamed to wins_client_subnet.

proto.h: The usual.

server.c:
     remove accepted fd from fd_set.

Jeremy (jallison@whistle.com)
(This used to be commit 2c97b33fc0)
1997-10-23 22:30:57 +00:00
Luke Leighton
5557ab3c00 renamed static cli_setup_pkt() to static cli_setup_packet() because it
clashed with the currently-used cli_setup_pkt() in clientutil.c
(This used to be commit 25560cf40b)
1997-10-23 19:27:53 +00:00
Luke Leighton
56214b5089 commas in the wrong places...
(This used to be commit 0ca7a64515)
1997-10-23 19:24:58 +00:00
Luke Leighton
310536a709 missed nmbsync.c when adding setup count and setup pointer arguments to
cli_call_api().  sorting this for jeremy.

there is a discrepancy between the client.c list_servers() and the nmbsync.c
add_info() calls to cli_call_api() - one has an mdrcount of 1024, the other
of zero.

i don't know what difference this makes.
(This used to be commit d8c265c515)
1997-10-23 17:54:21 +00:00
Luke Leighton
203c93e922 general sorting out, from crashes generated by do_lsa_req_chal() in client.c
trying to set up the data parameters etc and not understanding what's going on.

in api_netlogTNP, added smb_io_rpc_hdr() call to decode the header received
(and in this instance, generated by do_lsa_req_chal()).  and then noticed
that it's two bytes out.  but i don't know how to do "byte parameters"
and it's not the same format as the LSA_REQCHAL received from nt workstations.

agh!
(This used to be commit 0cc8ce43e1)
1997-10-23 16:17:07 +00:00
Luke Leighton
5cd52a56a4 playing about, trying to SMBopenX a \PIPE\NETLOGON (should be a SMBopen)
and then send a LSA_REQ_CHAL down it.
(This used to be commit 473f21071f)
1997-10-23 13:38:46 +00:00
Luke Leighton
d38aba33af client.c :
send to \PIPE\ not \PIPE\NETLOGON.

ipc.c :

	fstring name not being bzero'd caused problems when calling named_pipe().
(This used to be commit 2393c49b05)
1997-10-22 18:37:43 +00:00
Luke Leighton
a947dff4c0 Makefile client.c :
adding start of undocumented options to do NT domain logons, client-side.
	starting with LSA_REQCHAL.

	the code here happily crashes smbd: i'll investigate this further... :-)

smbparse.c pipeutil.c lsaparse.c :

	moved some of the common make_xxxx() functions out of pipeutil.c
	so that the make_xxxx and (smb/lsa)_io_xxxx functions now sit
	together.  makes sense, really...

	added a make_q_req_chal() function.

	restructured make_rpc_reply() and called it make_rpc_hdr().  created
	functions create_rpc_reply() and create_rpc_response().

pipenetlog.c pipentlsa.c pipesrvsvc.c

	calling new create_rpc_reply() function instead of old make_rpc_reply().

proto.h :

	usual.

smb.h:

	added enum for RPC_PACKET_TYPE
(This used to be commit b88ee3e16c)
1997-10-22 17:51:02 +00:00
Luke Leighton
5897f0493d Makefile client.c clientutil.c clitar.c nmbsync.c :
redid the split that i did a year ago, taking the functions in client.c
	out into clientutil.c.  guess what?  we could now do encrypted password
	NetServerEnum2 calls in nmbd, if we wanted to.

	i can now use cli_call_api() to send to different pipes.  i hope.

pipenetlog.c:

	allow adding to users group _and_ to admin group.  if adding to
	guest group, don't allow adding to users or admin as well.

smb.h :

	added some pipe #defines (\PIPE\NETLOGON \PIPE\srvsvc ...)

proto.h :

	usual.
(This used to be commit 6ee065ce6e)
1997-10-22 14:28:19 +00:00
Luke Leighton
2e8cedba64 loadparm.c :
added "domain other sids" parameter

pipenetlog.c :

	using "domain other sids" parameter in SAM Logon response.
	using new name_to_rid() function for r_uid and r_gid.

pipentlsa.c :

	minor mods to do with new name_to_rid() function.

pipesrvsvc.c :

	in the "net share enum" response, allocate some more space for the buffer.
	there can be only 32 share entries in the response anyway.  this needs
	to be dealt with.

pipeutil.c :

	modified name_to_rid() function to use new parameters "domain admin users"
	and "domain guest users", but will otherwise do unix uid + 1000.

	moved make_dom_gids() here.

proto.h:

	the usual.

smb.h smbparse.c :

	renamed sid_no to sid_rev_num in DOM_SID, and gid to r_gid in DOM_GID.

util.c :

	moved make_dom_gids() from here.
	created char *unistrn2(uint16* uni_buffer, int max_len)
(This used to be commit ec60e48d79)
1997-10-22 11:31:37 +00:00
Andrew Tridgell
f20e6f6b26 shared memory code cleanups (partly preparing for a possible sysV
shared memory implementation)
(This used to be commit 8d1993c71a)
1997-10-22 11:15:14 +00:00
Andrew Tridgell
e5c319186d Implemented asynchronous DNS lookups in nmbd.
I realised this afternoon just how easy it is to add this, so I
thought I'd implement it while the idea was fresh.

nmbd forks at startup and uses a pipe to talk to its child. The child
does the DNS lookups and the file descriptor of the child is added to
the main select loop.

While I was doing this I discovered a bug in nmbd that explains why
the dns proxy option has been so expensive. The DNS cache entries in
the WINS list were never being checked, which means we always did a
DNS lookup even if we have done it before and it is in cache. I'm sure
this used to work (I tested the DNS cache when I added it) so someone
broke it :-(

Anyway, the async DNS gets rid of the problem completely. I'll commit
just the fix to the DNS cache bug to the 1.9.17 tree.

You can disable async DNS by adding -DSYNC_DNS to the compile flags.
(This used to be commit 178e27de07)
1997-10-22 11:02:00 +00:00
Andrew Tridgell
988c73b623 don't send any statistics in the node status reply
(This used to be commit a5f52340a4)
1997-10-22 03:16:35 +00:00
Jeremy Allison
325738bd27 WHATSNEW.txt: Updated for alpha3.
server.c: int16 -> uint16 fix for port comparisons in oplock code.
          Needed for Solaris.
version.h: Updated to alpha3.
Jeremy (jallison@whistle.com)
(This used to be commit 2d9645e99b)
1997-10-21 22:51:21 +00:00
Jeremy Allison
7985bcfe0c WHATSNEW.txt: Preparing for 1.9.18alpha2 release.
smb.conf.5: Added 'bind interfaces only' parameter.
version.h: Updated to 1.9.18alpha2.
Jeremy (jallison@whistle.com)
(This used to be commit 7221e19d5e)
1997-10-21 19:55:34 +00:00
Jeremy Allison
79b314447b chgpasswd.c:
includes.h: SCO changes.
server.c: Added code in open_sockets to allow 'bind interfaces only' to
          work as documented.
Jeremy (jallison@whistle.com)
(This used to be commit 46ac5928d9)
1997-10-21 18:27:55 +00:00
Luke Leighton
efe9b26a7b loadparm.c :
added "domain admin users" parameter
	added "domain guest users" parameter

	these two complement the "domain groups" parameter.  the "domain groups"
	parameter should be for your own groups, and well-known aliases.

util.c :

	added ability to do "domain groups = power_users admin_users backup_ops"
	which are well-known RID aliases, not well-known RID groups.

pipenetlog.c :

	combine the "domain admin users"; "domain guest users" and "domain groups"
	parameters to give an array of RID groups to include in the SAM Logon
	response.

ipc.c smb.h :

	moved REALLOC() into smb.h
	added RID #defines.

proto.h:

	usual.
(This used to be commit f2554f231d)
1997-10-21 18:25:14 +00:00
Andrew Tridgell
0083afc90e damn, I spelt EACCES wrong.
actually it's wrong in the linux man page for utime ...
(This used to be commit 267b56de10)
1997-10-21 13:15:20 +00:00
Andrew Tridgell
bb9ca7fd64 check for EPERM or EACCESS in file_utime()
(This used to be commit afd7592ffd)
1997-10-21 13:03:46 +00:00
Andrew Tridgell
8f13fb0bdc don't check lp_alternate_permissions() in the new utime workaround
code. lp_alternate_permissions() is intended only to affect the
display of file permissions, not what you can actually do with the
files.
(This used to be commit 454802d592)
1997-10-21 12:55:49 +00:00
Andrew Tridgell
0aa3935917 fix the order of become_uid() and become_gid() in become_root(). This
was a harmless bug but left log entries

code cleanup in reply_lanman2()
(This used to be commit 8e90e1ef27)
1997-10-21 11:54:57 +00:00
Andrew Tridgell
c9ab32cebb prototype updates
(This used to be commit 2b976cb7ec)
1997-10-21 09:39:45 +00:00
Andrew Tridgell
6032872209 some cleanups in the clientutil.c code.
I'm actually hoping to remove this module completely once we convert
nmbd to using the new (much cleaner) clientgen.c

smbclient now also reports if it connects as a guest user
(This used to be commit 3af8d855fa)
1997-10-21 09:39:08 +00:00
Andrew Tridgell
0891bb6a91 rewrote the password server code using the new clientgen.c client
interface

The new code uses a source netbios name equal to the Samba servers
name, not the client name. It also uses NetWkstaUserLogon to do a full
network logon. This means it will honour the servers logon
restrictions (such as login times etc).
(This used to be commit 11de90f972)
1997-10-21 09:34:33 +00:00
Andrew Tridgell
8adc95a55a This is a set of generic SMB client routines. I needed this in a hurry
to fix the password server code, so I didn't use SMBlib. This code is
fairly generic and uses a "struct cli_state" to hold the client
state.
(This used to be commit 3a0b5f06f4)
1997-10-21 09:12:41 +00:00
Andrew Tridgell
ac21902178 get rid of the KEEP_PASSWORD_SERVER_OPEN define
(This used to be commit ed484d4501)
1997-10-21 09:11:19 +00:00
Andrew Tridgell
ea92c8d3f1 add some debug info
(This used to be commit b22fa0d7e3)
1997-10-21 09:09:55 +00:00
Jeremy Allison
79f4fb52c1 loadparm.c: Changed 'interfaces only' parameter to 'bind interfaces only'. Added
'dos filetimes' parameter for UTIME fix.
locking_shm.c: Fixed typo (sorry Andrew :-).
namepacket.c: Changed lp_interfaces_only() to lp_bind_interfaces_only().
proto.h: The usual.
reply.c: Made filetime calls use new file_utime call (wrapper for sys_utime).
server.c: Made filetime calls use new file_utime call (wrapper for sys_utime).
system.c: Added Andrew's sanity checks to times in sys_utime().
time.c: Moved set_filetime() to server.c. Made null_mtime()global.
trans2.c: Made filetime calls use new file_utime call (wrapper for sys_utime).
Jeremy (jallison@whistle.com)
(This used to be commit 41a1d81c11)
1997-10-20 18:52:04 +00:00
Luke Leighton
77a9385525 added "domain groups" parameter, allowing you to specify the groups that
the user belongs to.

it would be nice to know exactly what the domain groups _are_....
(This used to be commit c6e37d8db0)
1997-10-20 16:25:19 +00:00
Luke Leighton
dc9999ebd0 removed home_share from user_info structure.
(This used to be commit c59b8cee47)
1997-10-20 12:13:04 +00:00
Luke Leighton
423a7c4171 util.c password.c :
added automount_server() function which, if -DAUTOMOUNT is in use,
	returns the server name of the NIS auto.map entry.  otherwise,
	it returns local_server.

	added use of automount_server() for a new substitution %N for NIS
	home server.  this defaults, via automount_server(), to the same
	functionality as %L if -DAUTOMOUNT is not used.

	removed vuser->home_share.  moved code that grabbed the servername
	into the separate function automount_server().

loadparm.c :

	created "logon drive" (default of "")
	created "logon home"  (default of "\\%N\%U")
	changed default of "logon path" from NULL to "\\%N\%U\profile".

ipc.c pipenetlog.c :

	use lp_logon_drive(), lp_logon_home() and lp_logon_path() in their
	now easier-to-use form (don't have to check if *lp_logon_path() and
	manually substitute a default of \\%L\%U and do a standard_sub_basic()
	on the result, because the default automatically does this.
(This used to be commit c6c28a4c3c)
1997-10-20 12:10:58 +00:00
Andrew Tridgell
3e670e4057 a major share modes reorganisation.
The shares modes code is now split into separate files. The shared
memory implementation is in locking_shm.c. The slow implementation is
in locking_slow.c

It is all controlled by a struct share_ops structure that has function
pointers to the implementation of all the functions needed by a share
modes implementation. An initialisation function sets up this
structure. This will make adding new implementations easy and clean.

This also allowed me to get rid of the ugly code in smbstatus. Now
status.c links to the locking code and calls methods in share_ops.

I also renamed some things and generally organised things in a much
cleaner fashion. Defines and structures specific to each
implementation have been moved to the appropriate file and out of
smb.h.
(This used to be commit 65ab9adaa0)
1997-10-20 08:46:00 +00:00
Andrew Tridgell
f4b4b3e6e3 casting cleanups
(This used to be commit ab849a9782)
1997-10-20 02:50:12 +00:00
Andrew Tridgell
7d711a6d0d I am removing these from the source code in preparation for an
upcoming 1.9.18alpha release. We can't release with this code in there
as it currently stands as it might breach ITAR export restrictions in
the US.

I've discussed ways around this with Jeremy and we can put the code
back in with appropriate modifications once it is needed.

Note that this code isn't actually used in Samba yet, so removing it
has no effect.

If anyone wants the code then look in ~samba-bugs/arcfour/ or grab it
from the CVS attic.
(This used to be commit 426cd6b2de)
1997-10-20 01:10:45 +00:00
Andrew Tridgell
62b73f0913 move calls to smbhash() inside smbdes.c (for legal reasons)
(This used to be commit 9dfab27da3)
1997-10-20 01:00:08 +00:00
Andrew Tridgell
02674ea801 update the timestamp on config files in our linked list when we notice
they have changed, otherwise we keep reading them again and again
(This used to be commit 38c07fa932)
1997-10-19 23:22:03 +00:00
Luke Leighton
0c1d45dfa4 debugging the srvsvc Net Share Enum. some padding issues; some string length
issues.  it works!
(This used to be commit 80523a3e83)
1997-10-19 17:54:13 +00:00
Luke Leighton
7aa5495c18 creating NetShareEnum parsing / reply creation. compiles, but untested.
(This used to be commit 0a191ee504)
1997-10-19 17:01:06 +00:00
Luke Leighton
54ffd7f5c9 Makefile :
added srvparse.o and pipesrvsvc.o

smb.h :

	mods to the Net Share Enum stuff

srvparse.c :

	Net Share Enum parsing support.  more srvsvc pipe parsing to go here...

pipenetlog.c util.c:

	modified standard_sub_basic() so that you can set a global boolean
	and use a different string for the %U username substitution.

proto.h:

	the usual.
(This used to be commit 22b86b6499)
1997-10-19 15:33:25 +00:00
Luke Leighton
b0c148793b added the following structures:
SH_INFO_1
	SH_INFO_1_STR
	SHARE_INFO_1_CTR
	SRV_Q_NET_SHARE_ENUM
	SRV_R_NET_SHARE_ENUM

the share info1 container can handle a maximum of 32 shares.  the share info1
string structures contain two unicode strings, with 1024 uint16 characters
_each_.  we're going to _have_ to dynamically allocate the unicode strings,
else we'll run out of stack space.  rapidly.
(This used to be commit e8bedb18bf)
1997-10-19 14:36:27 +00:00
Luke Leighton
30ed3b5c77 pipes.c pipesrvsvc.c :
moved stub srvsvc pipe function into separate file, in preparation for
	further work.
(This used to be commit 2f2d18cc94)
1997-10-19 12:24:23 +00:00
Luke Leighton
0225c88104 put the NT_STATUS_ALLOTTED_SPACE_EXCEEDED error in instead of 0x99.
whatever that means.
(This used to be commit ce54f3a7a9)
1997-10-18 15:01:01 +00:00
Jeremy Allison
07c507728b After talking with Andrew added "interfaces only" parameter that
turns off the filtering on the broadcast socket by default.
Jeremy (jallison@whistle.com)
(This used to be commit db9aad0748)
1997-10-18 00:22:04 +00:00
Jeremy Allison
c336a2f081 .cvsignore: Added make_smbcodepage
interface.c: Added is_local_net().
locking.c: Added Fix for zero length share files from Gerald Werner <wernerg@mfldclin.edu>
           plus a race condition fix for the fix.
nameannounce.c: Made function static.
namedbresp.c: extern int ClientDGRAM removed - not used.
namedbserver.c: extern int ClientDGRAM removed - not used.
namedbsubnet.c: Added code to make sockets per subnet.
namepacket.c: Added code to read from all sockets & filter.
nameresp.c: extern int ClientDGRAM removed - not used.
nameserv.c: Indentation tidyup :-).
nameserv.h: Added sockets to struct subnet.
nameservresp.c: Improved debug message.
nmbd.c: Changed to terminte on listen_for_packets exiting.
nmbsync.c: extern int ClientDGRAM & ClientNMB removed - not used.
proto.h: The usual.
util.c: Fixed debug message.
Jeremy (jallison@whistle.com)
(This used to be commit 6904c2de08)
1997-10-17 23:08:07 +00:00
Christopher R. Hertel
10087a663b Simply moved the #include for ubi_dLinkList.h from within dir.c to
includes.h.  More consistent with current practice.
(This used to be commit cb51c860b3)
1997-10-17 21:06:20 +00:00
Luke Leighton
545d6e5a30 make_unihdr() was setting the length to 1/2 the required value.
(This used to be commit 4c99a083b9)
1997-10-17 17:59:38 +00:00
Luke Leighton
9e4626593f pipenetlog.c lsaparse.c smb.h :
SAM logon sorting.  too many buffer pointers.  added in the missing
	switch value (value of 3).  dealing with the buffer pointers to the
	user info structure in a slightly different way.
(This used to be commit 7993e17c9a)
1997-10-17 16:46:56 +00:00
Luke Leighton
f3c37f925e smbparse.c smb.h :
uni_max_len and uni_str_len are the other way round, in UNIHDR.

util.c :

	increased the show_msg() data size from 256 bytes to 512 bytes:
	the LSA SAM Logon response can be about 500 bytes long.

pipenetlog.c :

	forgot to set the authoritative field to 1.
(This used to be commit 71c6678cd7)
1997-10-17 13:43:01 +00:00
Luke Leighton
f657f37b3a set the wrong info level (0x0C00 0000 instead of 0xC000 0000) so that
nt got confused and thought that the server password had been set instead
of refused.  this is for the SRV_PWSET response.
(This used to be commit f9fbcad42e)
1997-10-17 11:54:30 +00:00
Andrew Tridgell
34e2b0132e remove a spurious error message from nmbd. The message was:
WINS server did not respond to name registration!

this messages should only be produced when we are trying to register
our own names, not when we are the one with the name database and we
are doing a NAME_REGISTER_CHALLENGE on behalf of another host (for
secured wins registration)
(This used to be commit 42cb21d725)
1997-10-17 03:09:03 +00:00
Andrew Tridgell
008b773834 fix the handling of negative name query responses and the handling of
packets with no answer section in general.

The fix has 2 parts:

1) set ans_name to the name we queried if nmb->answers == NULL

2) check for nmb->answers == NULL in several other places where we
currently check for nmb->answers->data

While doing this, I noticed there are lots of places in our nmbd code
where we make assumptions about the packets being well formed. Someone
could easily implement a denial of service attack on nmbd by sending a
packet that causes a null pointer dereference. Does anyone feel like
going through the code and adding checks? Probably the best solution
is to have a single function that "validates" a packet, making sure
that all the required fields are there. This will be a bit tricky as
what fields are required varies a lot between packets. A first pass
would be a function that prints "SUSPECT PACKET" when it hits a packet
that it suspects does not have a required field (or the field is badly
formatted), then we could use this on a live system to find any cases
we've missed.

Any takers?
(This used to be commit e02c21b0b8)
1997-10-17 02:56:23 +00:00
Andrew Tridgell
4fe23997bf added -a "append log" option
(This used to be commit 4b7d51ffb8)
1997-10-17 01:46:16 +00:00
Luke Leighton
eb7f4cb0e2 smb.h :
id_info_1 has a pointer at the front of it.  so does return credentials,
	and so does the client credentials.  these are all from the sam logon.
	auth_level is 16 bytes not 32 and is actually called a switch_level.

smbparse.c :

	smb_io_unihdr() - uni_max_len and uni_str_len are 16 bytes not 32.
	this may have a knock-on effect on smb_in_unihdr2() but we'll see...
(This used to be commit ce36bfb3e4)
1997-10-16 16:01:25 +00:00
Luke Leighton
820b7045fc dealing with some stack overflow bug somewhere around the use of
deal_with_credentials() by moving important code to the beginning
of the function :-) :-) :-).

the new seed (old_cred + time + 1) was getting corrupted.
(This used to be commit dab35ce5d6)
1997-10-16 13:38:16 +00:00
Luke Leighton
0d7bdcb6a1 inside the auth 2 response bits, i wasn't storing the received client
credentials for the calculation of the next credentials: i was storing
the auth 2 calculated credentials.

oops.
(This used to be commit eb81fae874)
1997-10-16 12:59:40 +00:00
Andrew Tridgell
ae9b654a6b add ERRDOS/67 ERRnosuchshare to the client.c list of error strings
(This used to be commit 1cccd7c519)
1997-10-16 08:01:00 +00:00
John Terpstra
b676826bec Added Michael Johnsons' PAM modifications <johnsonm@redhat.com>
This patch has been checked over. JHT
(This used to be commit c84a043f89)
1997-10-16 05:33:24 +00:00
Andrew Tridgell
69eea4fcf8 fixed the problem that browsing breaks if you put quote marks around
the server string option.

I fixed it by adding: trim_string(ret, "\"", "\"") to lp_string()
which means that it removes leading and trailing quotes from _all_
strings in smb.conf. I think this is what we want as I can't actually
think of any case where quoted strings are needed.

I suspect that this fix will actually fix browsing at quite a few
sites. It's not uncommon to see people putting "" marks around the
workgroup name or other essential strings.

The real reason it was causing browsing to fail is that the browse.dat
file uses " to delimit fields, which means that it wasn't being parsed
correctly. It would be nice to use a proper database format in
browse.dat sometime. In fact, we really need a generic database type
subsystem in Samba to replace the mish-mash we currrently use
(browse.dat, wins.dat, smbpasswd etc)
(This used to be commit ac50a88e11)
1997-10-16 03:53:07 +00:00
Christopher R. Hertel
c3ceabce3a Moved the LGPL from the ubiqx directory into the samba root directory
and renamed it COPYING.LGPL.  This is because the ubi_* files are under
LGPL, not regular GPL.
Removed the last few things from the ubiqx directory and deleted it.
(This used to be commit 31d50db98b)
1997-10-16 01:13:09 +00:00
Christopher R. Hertel
98f6293297 Don't need it any more.
(This used to be commit 905b2b9562)
1997-10-16 01:06:12 +00:00
Christopher R. Hertel
50147ca41c Made changes to the dir cache functions:
- They now use the ubi_dLinkList linked list code.
  This is not a big gain, I suppose.  It would be significant if there
  were lots of doubly-linked lists in the code and I replaced them all.
  The only other advantage is that the code is more modular, which
  appeals to my own sense of order, if no one elses.  :-}
- I allocate space for the entry structure and the strings in one go,
  instead of using malloc() and separate strdup() calls.  This should
  be more efficient, and allows for a single call to free() to free the
  whole thing.
These are very minor changes, but they do serve to make me more familiar
with the code overall.
(This used to be commit 1dafef8887)
1997-10-16 01:03:18 +00:00
Christopher R. Hertel
b525c17026 This code manages a simple doubly-linked list.
(This used to be commit a88ae60fc3)
1997-10-16 00:55:11 +00:00
Christopher R. Hertel
4aedb4ac5d I got fed up trying to put the tree and list stuff into a subdirectory,
so I've started to move them into the main directory.
(This used to be commit 4691a94d3c)
1997-10-16 00:46:21 +00:00
Jeremy Allison
359d42c08d ipc.c: Adding Andrews become_root code to the main branch.
locking.c: Adding Andrews become_root code to the main branch.
pipes.c: Fixing the close_file issue.
proto.h: The usual.
reply.c: Move smb_pass into NTDOMAIN defined code. Fixing the close_file issue.
server.c: Fixing the close_file issue.
trans2.c: Fixing the close_file issue.
uid.c: Adding Andrews become_root code to the main branch.
Jeremy (jallison@whistle.com)
(This used to be commit 16fd4337f7)
1997-10-15 21:53:59 +00:00
Luke Leighton
d838452413 smb.h smbparse.c pipenetlog.c :
whoops, the SAM Logon structure was wrong.  updated this, and
	cifsntdomain.txt.  more debug info in pipenetlog.c.  the crash
	is somewhere around deal_with_credentials().

byteorder.h :

	put in uint8, uint16 and uint32 typecasts around debug info, because
	sign extending was resulting in ffffffe8 being displayed instead of e8.

credentials.c :

	some debugging info, because i'm tracking a coredump.  without gdb.
	nothing like making things difficult.

reply.c :

	whoops, missed this (important) bit from paul's code, which tells
	the NT workstation that the MACHINE$ entry doesn't already exist,
	and we're going to create a default entry with a password "machine"
	right now.

proto.h:

	the usual.
(This used to be commit ed606bc7d4)
1997-10-15 19:16:38 +00:00
Christopher R. Hertel
5619b53921 Added ubi_sLinkList module which manages simple singly-linked lists.
(This used to be commit e55a3dc94a)
1997-10-15 17:59:58 +00:00
Luke Leighton
df4afea583 added srvsvc basic pipe, straight from paul's code. does NETSHAREENUM
and NETSERVERGETINFO.
(This used to be commit 96b17b829f)
1997-10-15 16:51:03 +00:00
Andrew Tridgell
1860d62d0d the usual proto.h update
(This used to be commit bdf3155418)
1997-10-15 09:18:39 +00:00
Andrew Tridgell
54c3f7bbb0 add the port number to a debug statement
(This used to be commit 97d06dd05e)
1997-10-15 09:17:21 +00:00
Andrew Tridgell
cc0f55bd5b added loopback_ip. This is used to detect packets from ourselves
(This used to be commit eb76fea411)
1997-10-15 09:16:30 +00:00
Andrew Tridgell
9d3cce7c68 fixed the freeze on logout bug. The fix has several parts:
1) add a new parameter to queue_netbios_packet(), the "reply_id", this
is the id that should be used when sending a further response to the
packet (such as a response after we get back a reply to a name query
after senidnga  WACK). reply_id is 0 (meaning unused) in most cases.

2) fix the id used in the reply in add_name_respond() from
response_name_query_register()

3) remember to remove the response record at the end of
response_name_query_register()

4) get the right IP address (it was 0.0.0.0) in
response_name_query_register()

5) add a new field reply_id to struct response_record
(This used to be commit e1e86c1a16)
1997-10-15 09:15:45 +00:00
Andrew Tridgell
be73ce8321 fixed a stack overflow bug in api_lsa_req_chal()
changed the order of arguments to smbhash() in credentials.c. Luke,
when you changed from E1() to smbhash() you didn't notice that the
arguments are in a different order. This is why your new code was
failing.

NT logon still fails, but now gets to SAMLOGON. It shouldn't take much
to get it working now.
(This used to be commit 708edc348f)
1997-10-15 04:51:23 +00:00
Andrew Tridgell
91e56c7b7b force the salt to be a maximum of 2 characters long in calls
to crypt()

This might solve some password problems, particulary on HPUX
(This used to be commit 45f4ae4327)
1997-10-15 04:04:38 +00:00
Christopher R. Hertel
4a9e9a40dc These are the ubiqx modules, as included with the Samba distribution.
Updated the linked list module, which has new and changed macros.
(This used to be commit 2181d929d1)
1997-10-15 03:11:46 +00:00
Christopher R. Hertel
e3d56eb181 First draft of a README file to explain the origins of the "ubiqx" code.
(This used to be commit df3bafd0c4)
1997-10-15 01:16:37 +00:00
Christopher R. Hertel
f9151159b8 Added a very small piece of documentation to describe the binary tree
modules.
(This used to be commit 781be1daac)
1997-10-14 19:32:30 +00:00
Luke Leighton
5ca38bab49 pipentlsa.c :
lsa close odd bug.

smbparse.c :

	smb_io_dom_sid() _does_ need 4-byte alignment before it.
(This used to be commit 93879ac8a5)
1997-10-14 19:31:07 +00:00
Christopher R. Hertel
d4605d5b95 Added a copy of the LGPL to the samba/ubiqx/ directory.
(This used to be commit 28de393878)
1997-10-14 19:30:07 +00:00
Luke Leighton
8fe499f775 byteorder.h:
created a RW_PIVAL macro which was missing.

smbparse.c:

	smb_io_dom_sid() was storing its sub-authorities as uint16s instead
	of uint32s.  used the DBG_RW_PIVAL macro instead of DBG_RW_PSVAL.

pipentlsa.c:

	not sure.  something to do with the Query Info reply.

pipeutil.c:

	make_rpc_reply() had the packed representation field set to 0x0100 0000
	instead of 0x1000 0000, which had the interesting result of turning all
	uint32 and uint16 field byte ordering the other way round!
(This used to be commit eafd6e9e79)
1997-10-14 18:37:55 +00:00
Luke Leighton
6084046eed credentials, query info reply.
(This used to be commit 9b095887df)
1997-10-14 17:01:43 +00:00
Luke Leighton
657fc8882e changed *(uint32*)(clnt_cred) to SIVAL(clnt_cred, ....)
(This used to be commit 0056b15443)
1997-10-14 10:17:12 +00:00
Jeremy Allison
9f6a10d173 Broke my own rule about checking in uncompiled source :-(.
Jeremy.
(This used to be commit 9fd056c911)
1997-10-14 00:36:57 +00:00
Jeremy Allison
cdd01aa4dd Added fixes for become_user braindamage.
Jeremy (jallison@whistle.com)
(This used to be commit 08afa51f5c)
1997-10-14 00:16:37 +00:00
Luke Leighton
23c448b250 another alignment of client challenge: this one in lsa_io_q_auth_2().
there are going to be a few of these...
(This used to be commit 3db1fe79c3)
1997-10-13 19:37:43 +00:00
Luke Leighton
8c3fedf612 lsa_io_r_req_chal() - challenge is not 4-byte aligned after the unicode
strings.
(This used to be commit 717bcd6e34)
1997-10-13 18:11:20 +00:00
Luke Leighton
c87abfc565 put a check around become_user(). doesn't authenticate the user, but doesn't
quit the whole pipe, either...
(This used to be commit 14f0c2ddb0)
1997-10-13 17:11:07 +00:00
Luke Leighton
106410a376 resolving some of the confusion over credentials.
(This used to be commit 9d1f45ca6b)
1997-10-13 16:32:43 +00:00
Luke Leighton
1035aa9c73 split pipes.c down into util, netlog and ntlsa.
(This used to be commit 8fe02c239d)
1997-10-13 15:55:54 +00:00
Luke Leighton
fcc885e016 debugging... no idea what i'm doing.
(This used to be commit d7a9a02e0a)
1997-10-13 14:19:17 +00:00
Andrew Tridgell
a25205bfc5 reverted a change made by Luke at his request.
Luke, when you don't know what has been changed in the CVS tree I
highly recommend you point your browser at:

	http://samba.anu.edu.au/cgi-bin/cvsweb/samba/source

If you click on a filename you can then see all the commits and
changes that have been made to it over time. You can also download any
version of the file or find the differences between any two versions.

All of this is not dependent on the state of your local CVS sandbox,
so it can be used to find out the "true" state of the tree at any
time.

If you suspect some sort of CVS problem (like a change getting
reverted) then please use the above URL to work out what has
happened. You should be able to see exactly who made what changes and
when.
(This used to be commit 3fc48246ee)
1997-10-13 13:49:50 +00:00
Luke Leighton
2225fe1376 debug info added
(This used to be commit a3f96555b4)
1997-10-13 13:35:37 +00:00
Luke Leighton
081dcc7e8b checked in a file with a compile error. oops!
(This used to be commit 28d96c7e6d)
1997-10-13 12:55:07 +00:00
Luke Leighton
2259e56a94 byteorder.h :
debugging output wasn't (still isn't) perfect.

credentials.c lsaparse.c smbparse.c :

	added DEBUG strings.

pipes.c :

	lost some changes, to do with setup of RPC headers.  arg.
(This used to be commit 9fdd697d17)
1997-10-13 12:21:56 +00:00
John Terpstra
6032ec8a01 JHT ==> Removed linefeed that caused problems.
(This used to be commit 534b4c6d37)
1997-10-13 12:13:11 +00:00
Luke Leighton
0b04310b8a align_offset() adjusted pointer to wrong location. oops.
(This used to be commit ba28678e3f)
1997-10-13 11:15:46 +00:00
Luke Leighton
db20ab9bbd getting somewhere.
ipc.c :

	removed srvsvc pipe reference: have to do that.

pipes.c lsaparse.c smbparse.c :

	more debugging info.  looks a bit like netmon output.
(This used to be commit e02aa88e25)
1997-10-12 19:02:55 +00:00
Luke Leighton
78f6bc4eba updated rpc header reply: callid wrong; alloc hint a uint32 not a uint16.
still doesn't get rid of the netlogon trans2 request with zero data.
(This used to be commit 0cf67955f0)
1997-10-12 17:07:35 +00:00
Luke Leighton
60575a888a ipc.c:
debugging info.  found that data = NULL because of short packet length
	indicated from the ntlsaRPC pipe _royally_ stuffs NT's packet handling.
	maybe this should go down as a service denial bug to the ntbugtraq list.

pipes.c lsaparse.c smbparse.c :

	added more debug stuff.  added length of header to data_len in MSRPC
	fragment_length field (0x18 bytes short) which caused the above bug
	from NT 4.0.  oops.
(This used to be commit a6f8de6815)
1997-10-12 14:17:55 +00:00
Luke Leighton
a26037ac7c added debugging macros (suitable eventually for use in tcpdump, hopefully)
(This used to be commit 946d73cf83)
1997-10-12 11:46:42 +00:00
Andrew Tridgell
b6dd030b45 remove { and } from the list of illegal characters in filenames. The
CIFS3 spec does not list them as illegal.

This allows things like the control panel icon to be placed on a Samba
drive.
(This used to be commit d2ac9e6fb6)
1997-10-12 03:48:47 +00:00
Luke Leighton
9160c85a78 namelogon.c :
added NTLOGON.  (fixed the case 0:)

namepacket.c:

	call to NTLOGON mailslot

nameserv.h

	defines for NETLOGON and NTLOGON mailslot

util.c:

	added andrew's dump_data() function.
(This used to be commit 1eaad1c994)
1997-10-11 15:10:57 +00:00
Luke Leighton
7fcc737ae9 the usual
(This used to be commit 2ade5b2706)
1997-10-10 19:49:17 +00:00
Luke Leighton
422c54ff38 added api_lsa_sam_logon() and api_sam_logoff(). that's it. lots of
run-time debugging, now.
(This used to be commit 75f32987d8)
1997-10-10 19:48:51 +00:00
Luke Leighton
7f296a8f90 added lsa_reply_srv_pwset()
(This used to be commit 0d043cfef2)
1997-10-10 18:03:30 +00:00
Luke Leighton
b94ddf082d ipc.c :
#if NTDOMAIN
		call to api_netlogRPC
	#endif

lsaparse.c :

	renamed lsa_io_q_auth2 to lsa_io_q_auth_2.

pipes.c :

	added api_lsa_reply_auth_2() and api_netlogRPC.

proto.h :

	the usual.
(This used to be commit e2e1979b62)
1997-10-10 16:40:23 +00:00
Christopher R. Hertel
23cac105fd I have to admit that I'm not very good at writing Makefiles.
This one will simply create an object file from each of the .c files
in the directory.  These could be linked into a static library, but
I'm not sure that this is worthwhile.  If anyone wants to improved on
what I've got here, please do!  crh -)-----
(This used to be commit 5e52143829)
1997-10-10 16:12:27 +00:00
Luke Leighton
c5e739febe Makefile:
added credentials.c to smbd

credentials.c:

	using credential structures instead of char*

password.c uid.c server.c:

	added sid and attr to user_struct.

smbdes.c:

	smbhash and str_to_key make public instead of private.

pipes.c smb.h:

	lsa structures, sub-functions.

proto.h:

	usual.
(This used to be commit 87a0a94485)
1997-10-10 14:48:05 +00:00
Christopher R. Hertel
33d8f5ecbb This is the ubiqx binary tree and linked list library.
This library is being included as part of the Samba distribution.
(Hurray!)
(This used to be commit 3590a78333)
1997-10-10 14:46:43 +00:00
Christopher R. Hertel
aaeb11af0e After generating some discussion, listening to the opinions, and thinking
about it for a while, I've decided to move the tree & list code into a
separate subdirectory.
(This used to be commit 6fffcff57d)
1997-10-10 14:13:48 +00:00
Christopher R. Hertel
ced71f2fad After generating some discussion, listening to the opinions, and thinking
it over, I've decided to move the tree & list code into a subdirectory.
CRH
(This used to be commit d8d063d29b)
1997-10-10 14:12:22 +00:00
Andrew Tridgell
1ece349db5 fixed the log wrapping bug.
This is a very nasty bug that I think explains quite a few
intermittent problems people have been having with Samba.

It may be worth checking on other cases where errno can be overwritten
by seemingly innocuous things (in this case a DEBUG() line)
(This used to be commit 1448f528b6)
1997-10-10 02:32:01 +00:00
Jeremy Allison
805749baab nmblookup.c: Added -A ability to do status on ip address.
smb.h: Added defines we will need for NT SMB calls.
trans2.c: Fixed SMB_QUERY_FILE_ALT_NAME_INFO return - this is only
for short name returns (and only used when you negotiate NT SMB calls
to boot !).
Jeremy (jallison@whistle.com)
(This used to be commit 53915bd160)
1997-10-10 01:32:26 +00:00
Jeremy Allison
f3f44f7dbb local.h: Fix spelling mistake :-).
namedbsubnet.c: Stop registering 1x name unless we can be a local master.
reply.c: Remove ERRbaddirectory code.
server.c: Remove abort() - use exit_server() instead.
trans2.c: Remove ERRbaddirectory code.
Jeremy (jallison@whistle.com)
(This used to be commit 7624722889)
1997-10-09 18:40:52 +00:00
Luke Leighton
3dd03e4bb7 added #ifdef NTDOMAIN. added call to api_ntLsarpc instead of api_Lsarpc
in ipc.c iff NTDOMAIN is defined.
(This used to be commit 7bc4c4c27b)
1997-10-09 16:14:53 +00:00
Luke Leighton
7d82c240e2 moved the array macros outside of the CAREFUL_ALIGNMENT define.
(This used to be commit d9fcf11aa0)
1997-10-09 15:51:43 +00:00
Luke Leighton
5a3ea52d4a pipes.c:
added api_ntlsarpcTNP() function.  hooray!

smb.h:

	added LSA #defines needed by above function.
(This used to be commit 5437f66698)
1997-10-09 15:48:40 +00:00
Luke Leighton
ad54a56714 credentials.c:
use UTIME structure (defined and commented in smb.h to be time, secs,
                         since 01jan1970)

pipes.c:

	another sub-function.

util.c:

	added char *unistr2(uint16 *buff) function.  same as unistr except
    it takes uint16* instead of char*.

smbparse.c smb.h:

	more structure sorting.

proto.h:

	the usual.
(This used to be commit 72a86f514f)
1997-10-09 14:40:46 +00:00
John Terpstra
228cef8d01 JHT ===> Added smbadduser contributed by Mike Zakharoff.
(This used to be commit 135d054e83)
1997-10-09 11:24:39 +00:00
Andrew Tridgell
f726e5517d an implementation of the NT domain credentials protocol
(This used to be commit dd6ac9b1ee)
1997-10-09 10:01:12 +00:00
Andrew Tridgell
e5494e2c09 bracket some macros
change MAX_PASSWORD_LENGTH to MAX_PASS_LEN to prevent conflict on some
systems

add #ifdef around soft link dependent code (for systems that don't
have soft links)
(This used to be commit e10ba4b97a)
1997-10-09 06:36:04 +00:00
Christopher R. Hertel
1cb2d37d5d This is my library of lists and trees. My hope is to replace all of the
hard coded linked lists that are currently used in Samba with calls to
these modules.  This should make the code simpler, smaller, and (I hope)
faster.  The tree code, in particular, should speed up processing where
large lists are involved.

Chris -)-----
(This used to be commit e789179dfd)
1997-10-09 04:09:56 +00:00
Jeremy Allison
10424272be Put in fix for read-prediction extending files bug. Hard to test, can't
get read-prediction to happen :-).
Jeremy (jallison@whistle.com)
(This used to be commit fa69b3dda4)
1997-10-08 22:23:47 +00:00
Luke Leighton
f40427291e added a dummy function (space in front so make proto doesn't pick it up)
to call the unused static functions in pipes.c.  avoids need to move
#if UNDEFINED_NTDOMAIN about, to stop compiler warnings while code is
being developed, but might be released as-is.
(This used to be commit d7f41e3815)
1997-10-08 21:36:42 +00:00
Jeremy Allison
74113cd60e Makefile: Split definitions for SGI4,5,6.
includes.h: Split definitions for SGI4,5,6.
pipes.c: Moved Luke's #ifdef to remove warnings.
quotas.c: Two changes for FreeBSD and SGI.
server.c: Quota changes for large filesystems.
Jeremy (jallison@whistle.com)
(This used to be commit b8ff5543b9)
1997-10-08 20:34:13 +00:00
Luke Leighton
b270732424 added api_lsa_lookup_sids() function
(This used to be commit 35dd48740d)
1997-10-08 18:36:34 +00:00
Luke Leighton
8871297885 loadparm.c proto.h:
added lp_domainsid()

lsaparse.c smb.h:

	debugging structures and parsing functions

pipes.c:

	finally got to the functions that will go into the RPC switch statement.
(This used to be commit d15aed8a9c)
1997-10-08 17:12:07 +00:00
Luke Leighton
827aa6bc6a updating lsaparse.c and smbparse.c in line with changes to pipes.c and smb.h
from yesterday.
(This used to be commit 0b7049fae2)
1997-10-08 11:47:46 +00:00
Jeremy Allison
b0bdb42bd1 ipc.c: Added ERROR_MORE_DATA error if client buffer too small.
server.c: Allow admin_user on read only shares. I think this is
safe but it needs looking at.
Jeremy (jallison@whistle.com)
(This used to be commit cc50955a27)
1997-10-08 00:21:39 +00:00
Christopher R. Hertel
ed61181f29 I rewrote the name_mangle() and name_len().
The interface is the same, but I've simplified the code a bit and added
a few comments.  I tested the changes and the output is the same as that
produced by the original (at least, it was in all of my tests).  CRH
(This used to be commit 707d0ec388)
1997-10-07 22:04:05 +00:00
Jeremy Allison
fb27bc139f locking.c: Added fix for race condition in slow share mode code.
lsaparse.c: #ifdef'ed out code so this will compile - LUKE PLEASE CHECK THIS.
pipes.c: #ifdef'ed out code so this will compile - LUKE PLEASE CHECK THIS.
server.c: Fixed last known oplock race condition.
smb.h: Re-removed USE_OPLOCK defines - someone checked in an old version.
smbparse.c: #ifdef'ed out code so this will compile - LUKE PLEASE CHECK THIS.
Jeremy (jallison@whistle.com)
(This used to be commit 1e1366ddc5)
1997-10-07 18:46:19 +00:00
Luke Leighton
577ae65ca5 pipes.c:
more static unused functions in pipes.c for the LSA RPC stream.

smb.h:

	corrections and altercations over the documentation

lsaparse.c:

	reflecting alterations in LSA structures...
(This used to be commit bef12478d2)
1997-10-07 18:18:10 +00:00
John Terpstra
a9e1efc1ad JHT ==> Fixing blocksize argument. Patch by: Llyod Whiteman
<lwhitman@stm2.nrl.navy.mil>
(This used to be commit 67c1e87e8f)
1997-10-07 16:01:08 +00:00
Luke Leighton
a3b7bdd7b9 pipes.c:
some routines to create LSA RPC packets.  none of them are used.

lsaparse.c:
smbparse.c:
smb.h:

	more tidy-up.
(This used to be commit b37e21273e)
1997-10-07 14:58:07 +00:00
Andrew Tridgell
0235299ea5 increase the debug level in the "added interface" debug line
(This used to be commit b12b3626fd)
1997-10-07 14:36:22 +00:00
Andrew Tridgell
89042c146e get rid of SIGCLD_IGNORE for HPUX. A user reported it causing lots
of defunct smbd processes.

Andrew
(This used to be commit bf1f8b1567)
1997-10-07 11:14:27 +00:00
Jeremy Allison
1f7a84bc9c Finally ! Found & fixed crash bug with logging message when deleting
invalid share mode entries. Thanks to berg@wienrg.aut.alcatel.at (Dietmar Berg)
for the stack backtrace.
Jeremy (jallison@whistle.com)
(This used to be commit db4c2cb50e)
1997-10-06 19:50:51 +00:00
Jeremy Allison
2e92be3aaf client.c: Changed shadowed variable.
locking.c: Removed USE_OPLOCKS - now the default.
params.c: Removed unused variable.
proto.h: Updated.
reply.c: Removed USE_OPLOCKS - now the default.
server.c: Removed USE_OPLOCKS - now the default.
smb.h: Removed USE_OPLOCKS - now the default.
smbparse.c: Changed shadowed variable.
status.c: Removed USE_OPLOCKS - now the default.
util.c: Removed USE_OPLOCKS - now the default.
Jeremy (jallison@whistle.com)
(This used to be commit b93509846d)
1997-10-06 17:52:25 +00:00
Luke Leighton
8429cec72f lsaparse.c smb.h: added 32 bit "return status" to the response structures.
(This used to be commit 5bc75c6c62)
1997-10-06 14:52:26 +00:00
Luke Leighton
0e151792c3 Makefile: added lsaparse.c and smbparse.c
lsaparse.c, smbparse.c, smb.h: more functions / structures.
proto.h:                       the usual.
(This used to be commit a1c718728c)
1997-10-06 13:30:54 +00:00
Luke Leighton
84e362dd13 updating lsa and smb parsing routines and structures.
(This used to be commit 2f722fe289)
1997-10-05 14:17:53 +00:00
Luke Leighton
5e4bc79c6e processes LSA queries and responses to/from RPC data stream into structures.
(This used to be commit 369f7d41d6)
1997-10-05 12:39:51 +00:00
Luke Leighton
29dfcb86e0 smb.h:
added more structures, this time for the use in the query and response
of the LSA_XXXX functions.  next target: the NTLOGON mailslots (10 minutes
work).


smbparse.c:

tidying.  adding some more sub-structure functions.
(This used to be commit 095edfca78)
1997-10-05 11:56:08 +00:00
Luke Leighton
07cc8fd8e8 proto.h:
- recreated, as usual.

smb.h:

- added RPC_HDR structure - the 18 byte MSRPC header

smbparse.c:

- added smb_io_rpc_hdr() function to read/write the RPC_HDR structure.

util.c:

- added align2, align4, align_offset functions.
- added skip_unicode_string, unistrcpy, unistrncpy functions.
- modified unistrcpy and unistrncpy to return the number of unicode
  characters returned, effectively making skip_unicode_string redundant.
(This used to be commit b0ad811cda)
1997-10-04 16:51:43 +00:00
Luke Leighton
a193401384 added some RW_XXXX wrapper macros with an extra i/o argument, to call XXXX
or SXXXX as appropriate.

added some for-loop pointer macros that will do a batch of data into a
(fixed length) buffer.  no length validation is done in the macro itself.

note: there are some CAREFUL_ALIGNMENT macros missing.  i think.
(This used to be commit b0ffd75acf)
1997-10-04 16:42:09 +00:00
Luke Leighton
87a3971233 added structures readable and writeable by smbparse.c routines into and out
of SMB or Mailslot packets.
(This used to be commit 4b3f9b281b)
1997-10-04 16:26:02 +00:00
Luke Leighton
8ebb7bbfcf packet parsing routines. for use in SMB and Mailslots
(This used to be commit 297d5ef46c)
1997-10-04 16:10:21 +00:00
Andrew Tridgell
5059fbf44f fix some "shadows global" errors.
(This used to be commit 25b7ada358)
1997-10-04 05:24:02 +00:00
Andrew Tridgell
b6a3fd6777 a bit of bounds checking
(This used to be commit d40199f4fe)
1997-10-04 05:21:47 +00:00
Andrew Tridgell
c549112d4b a little hack to smbclient to support extracting NT error codes
(This used to be commit 0eb9a59043)
1997-10-04 05:21:14 +00:00
Andrew Tridgell
553093c344 This is all the NT error codes less than 1000. I extracted them using
smbclient+netmon

If we want to start supporting NT error codes in Samba (which may be
forced upon us by buggy apps) then this is a good start.
(This used to be commit 20bfde40b2)
1997-10-04 05:19:24 +00:00
Christopher R. Hertel
e722d70776 nmblookup.c:
I've added a -r option.  When specified, nmblookup will attempt to bind
  to port 137.  In order for this to work, the user must be root and the
  port must be available (i.e., nmbd not running).  If either condition is
  not met, nmblookup will default to normal behavior; it will try to bind
  to a free port above 7999.  I also removed an artifact.  The -p <port>
  option was being accepted but falling through to the default, which was
  the usage message.  I removed "p:" from the getopt() list.

params.c:
  Rewritten.  The scanning is much more linear, and I found and fixed a
  few bugs.  I don't like the way that the scratch buffer is handled,
  but I believe that it is an improvement over the previous version.

Chris -)-----
(This used to be commit 09dc951f2a)
1997-10-04 01:07:47 +00:00
Jeremy Allison
3c5998e29b Race condition with multiple oplock break requests happens
more often than you might think (reproduced here with 4 clients
and netbench :-).
Raising debug log level for report from 1 to 3.
Jeremy (jallison@whistle.com)
(This used to be commit 23eeab7aa2)
1997-10-04 00:23:57 +00:00
Jeremy Allison
c89eaa20d1 Making it harder for share_mode_entries to be left with
non-zero op_type fields. Paranoia code really.
Jeremy (jallison@whistle.com)
(This used to be commit 21ecb46f56)
1997-10-03 23:45:34 +00:00
Jeremy Allison
2f7b04061e locking.c: Fixed incorrect parameter count in debug statements. May explain
solaris crashes.
reply.c: Added NT specific error code. Put oplock break code in correct place
         in reply_lockingX.
server.c: Removed unneeded error mapping stuff.
          Fixed race condition in oplock code.
trans2.c: Added NT specific error code.
util.c: Added paranoia check in interpret_addr. Some core dumps
        reported here. Upped fcntl debug levels.

Andrew. Please check the NT specific error code handling (search
for the string "/* Ugly - NT specific hack - but needed (JRA) */",
this makes NT and 95 clients behave correctly here - please check
your Visual Basic apps with this code.

Jeremy (jallison@whistle.com).
(This used to be commit 97ee4a5f69)
1997-10-03 20:36:06 +00:00
Andrew Tridgell
2534e0688b add "static" to a couple of functions that are only used locally.
set granted_oplock=False at the start of open_file(). This is
paranoia.
(This used to be commit c7f09ffd4a)
1997-10-03 03:34:19 +00:00
Jeremy Allison
4438d7b57e proto.h: Updated.
server.c: Updated after netbench observation. Oplocks must be
broken *before* share modes are checked, not after. Netbench seems
to be working now.
smb.h: Added offsets for oplock break time fields.
trans2.c: Upped debug messages.
util.c: Upped debug messages.
Jeremy (jallison@whistle.com)
(This used to be commit bc4b70c566)
1997-10-03 03:15:24 +00:00
Andrew Tridgell
a69125bae9 change a debug level in reply.c
change from ERRbaddirectory to ERRbadpath for ENOTDIR errors. This
reverts to the old Samba code. I've done quite a bit of testing
against NT4 and have yet to get it to produce the ERRbaddirectory
error code. Producing ERRbaddirectory made a visual basic application
that was sent to me not run. This might explain some of the "it
doesn't work any more" complaints we've got about 1.9.17.

Jeremy, can you remember how you got NT to produce ERRbaddirectory?
There might be some specific circumstances we need to cover.
(This used to be commit 1ed901ddff)
1997-10-02 14:11:34 +00:00
Jeremy Allison
fbd5dded7d Added debug message for oplock_break().
Jeremy (jallison@whistle.com)
(This used to be commit 4f29dfbc79)
1997-10-02 03:26:07 +00:00
Andrew Tridgell
85097a7c17 change the semantics of hosts allow/hosts deny so that a global
setting applies to all shares regardless of any settings on other
shares. This allows us to immediately drop a connection if it does not
come from a allowed host, without even parsing the first SMB
packet. The next time we get a nasty security hole we can offer people
the option of just setting their hosts allow line.

If we drop a connection in this way we generate a "Not listening for
calling name" response and then exit.


add a per share "oplocks" option in smb.conf. I think its important to
be able to disable oplocks on a per-share basis as there are occasions
then they are definately not wanted, for example when sharing data
between a windows box and a unix application. This also allows us to
tell people "try disabling oplocks" when diagnosing problems.


fix a bug in process_smb(). It was taking the length of the packet
from outbuf, not inbuf (this bug was introduced with the oplocks
code). Jeremy, I assume this wasn't deliberate?
(This used to be commit 44bc9f239a)
1997-10-02 03:14:32 +00:00
Jeremy Allison
c9cf77a6bb Modified some debug messages, moved from 5 -> 8.
Jeremy (jallison@whistle.com)
(This used to be commit cb83c74a6c)
1997-10-02 02:36:11 +00:00
Jeremy Allison
c557bb0517 Fixed problem with oplock_type being set with no port.
Jeremy (jallison@whistle.com)
(This used to be commit 90484db0bf)
1997-10-02 00:57:59 +00:00
Jeremy Allison
5864551aef OPLOCK CHECK-IN - oplocks are now *OPERATIONAL* !!!!
Yipeee. At least as far as I can check in a short time :-).

local.h: Changed OPLOCK_BREAK_TIMEOUT to 30 seconds.
locking.c: Big changes to delete oplocks on a share mode entry.
proto.h: updated.
reply.c: Added oplock break code in lockingX reply & readbraw reply.
server.c: Add batch oplock code. Force server shutdown if client fails
          to respond to oplock break.
smb.h: Fix silly slow share mode oplock define bug.
status.c: Add oplock status info.

Jeremy (jallison@whistle.com)
(This used to be commit 4c83d37239)
1997-10-01 23:32:22 +00:00
Jeremy Allison
a0cd12e221 dir.c: more pstrcpys.
local.h: Add OPLOCK_BREAK_TIMEOUT.
password.c: Fix for paranoia password server security bug.
proto.h: Updated.
reply.c: Oplock changes.
server.c: Massive oplock changes - nearly there....
smb.h: oplock definitions.
util.c: Add local message processing queues for oplocks.
Jeremy (jallison@whistle.com)
(This used to be commit 92f1553db2)
1997-09-30 02:38:19 +00:00
Jeremy Allison
a5af479e5d Fixed you're -> your text that some pedant complained about :-).
Jeremy (jallison@whistle.com).
(This used to be commit b11833f1bd)
1997-09-26 19:40:12 +00:00
Jeremy Allison
dff16872ca Syncing up current oplock work in progress. #ifdef'ed out
so should have no effect on other work.
Jeremy (jallison@whistle.com)
(This used to be commit 7e3d4c8b21)
1997-09-26 19:26:56 +00:00
Jeremy Allison
d939350de4 Correctly rolled back interface.c (I was working on an older
revision). This will now be the current revision.
Jeremy (jallison@whistle.com)
(This used to be commit eb55ddd5bf)
1997-09-26 19:23:26 +00:00
Jeremy Allison
cef59090bb Adding Andrews buffer overflow fixes into the main branch.
Jeremy (jallison@whistle.com)
(This used to be commit e7eb1f044d)
1997-09-26 18:55:29 +00:00
Andrew Tridgell
5a7b3294db add error string reporting to clitar
(This used to be commit 2c5587a6fe)
1997-09-26 09:06:51 +00:00
Jeremy Allison
776674812b Added missing slow share mode offset defines. Somehow
they got lost.
Jeremy (jallison@whistle.com).
(This used to be commit ce9cdc2f61)
1997-09-25 17:36:21 +00:00
Jeremy Allison
6dd6b1383c Makefile: Removed earlier errors.
includes.h: Added INADDR_LOOPBACK define.
locking.c: More code to support oplocks.
proto.h: Updated.
server.c: More code to support oplocks. Moved processing of an SMB out of
process() into a separate function so it is easier to call from an oplock
break.
smb.h: Added oplock fields.
Jeremy (jallison@whistle.com)
(This used to be commit f46dbaf08e)
1997-09-25 00:25:44 +00:00
Jeremy Allison
81eb442e88 Checkin to sync up oplock development code so that NT
domain development code won't diverge.

Makefile: Fixed make proto (again). Added GLIBC2 fixes for Linux.
includes.h: Added GLIBC2 fixes for Linux.
proto.h: Much tidier.
quotas.c: OSF/1 quota fix.
reply.c: Fix from Ray Frush <frush@engr.colostate.edu> for zero NT timestamps.
server.c util.c: First oplock checkin - nowhere near finished so bracketed
with #ifdef USE_OPLOCKS. Done to make sync with NT domain code easier.
Jeremy (jallison@whistle.com)
(This used to be commit 7dce7d8447)
1997-09-23 19:19:06 +00:00
Luke Leighton
b3c610541b added code from Philip A Prindeville <philipp@enteka.com> which expands
the interfaces option to this:

"interfaces = le0 le1" or "interfaces = all".

it uses SIOCGIFxxxx ioctl calls.
(This used to be commit 39071415ba)
1997-09-23 16:09:12 +00:00
Jeremy Allison
a2d2206cc9 Makefile: Changed proto: target to not include c files not used currently.
Caused proto.h to be from a sorted list of C files.
arcfour.h: Added prototypes.
client.c: Added username%password in environment patch from John Blair <jdblair@frodo.tucc.uab.edu>
loadparm.c: Added username manipulation code from Peter McCool [SMTP:peter@qimr.edu.au]
username.c: Added username manipulation code from Peter McCool [SMTP:peter@qimr.edu.au]
mkproto.awk: Added arc4_key type.
proto.h: Updated & sorted.
Jeremy (jallison@whistle.com)
(This used to be commit 97ed4fea67)
1997-09-19 17:12:08 +00:00
Jeremy Allison
501755a87c Added arcfour code needed for SMB password changing.
Jeremy (jallison@whistle.com)
(This used to be commit 8bc3d13b3d)
1997-09-18 19:56:57 +00:00
Luke Leighton
563cf6f4aa added timestamp to "Denied connection" message.
(This used to be commit f28b14a86c)
1997-09-18 12:47:55 +00:00
Andrew Tridgell
570a5becfc added some debug stuff
(This used to be commit 95184fd1ec)
1997-09-18 07:05:43 +00:00
Andrew Tridgell
102fb71537 John asked the other day about using the tar feature in smbclient to
handle file paths longer than 100 characters (the limit of the normal
tar format).

This patch adds support for producing GNU tar files (which have no
real limit on the path length) in smbclient.

Note that I have only added support for producing GNU tar files, I
haven't added support for accepting them when restoring. I thought I'd
leave that up to John :-)
(This used to be commit d5daf85162)
1997-09-18 06:52:49 +00:00
John Terpstra
a8064b0f00 JHT ===> Changed behaviour of logon script processing so that all macros
can be used in the logon script parameter definition in the smb.conf
         Globals section. This fixes a problem reported by Jacco de Leeuw
         where OS/2 does not see the %u variable. Jacco suggested using %U
         but we really do want the user for the netlogon share session.
         If this does not do the trick - well we eat our hat! Yeh!
(This used to be commit a7716b2e70)
1997-09-17 13:53:59 +00:00
Jeremy Allison
1590983eb0 Added 'delete veto files' paremeter. Ugly - but the only
way to allow Samba client users to delete directories
containing Mac metafile information (.AppleDouble directories).

Needed for clean integration with netatalk.

Jeremy (jallison@whistle.com)
(This used to be commit 29c6c037dc)
1997-09-17 01:29:53 +00:00
Jeremy Allison
6449fc3b22 Fixing assumtions that malloced memory is zero filled - making
sure it is.
Jeremy (jallison@whistle.com)
(This used to be commit 59ee0d0c7e)
1997-09-16 17:40:17 +00:00
Andrew Tridgell
cda707f917 add a cast
(This used to be commit e712c6ed61)
1997-09-16 08:26:33 +00:00
Andrew Tridgell
57c2578cb2 - change generate_challenge() to use md4 instead of des
- move routines about a bit between smbencrypt.c and smbdes.c. Ensure
that there is no entry point for normal DES operation

- add the following comment:

   This code is NOT a complete DES implementation. It implements only
   the minimum necessary for SMB authentication, as used by all SMB
   products (including every copy of Microsoft Windows95 ever sold)

   In particular, it can only do a unchained forward DES pass. This
   means it is not possible to use this code for encryption/decryption
   of data, instead it is only useful as a "hash" algorithm.

   There is no entry point into this code that allows normal DES operation.

   I believe this means that this code does not come under ITAR
   regulations but this is NOT a legal opinion. If you are concerned
   about the applicability of ITAR regulations to this code then you
   should confirm it for yourself (and maybe let me know if you come
   up with a different answer to the one above)
(This used to be commit 35b92e725f)
1997-09-16 04:41:16 +00:00
Andrew Tridgell
72b02acd7e bug fix in the new des code.
I had one of the sbox[] constants wrong, which interestingly gave a
20% chance of the whole algorithm failing.
(This used to be commit 9a42f88a09)
1997-09-16 03:53:54 +00:00
Luke Leighton
9ae8fbdae0 unbecome_domain_master and unbecome_logon_master were announcing
as "dead".  removed this.
(This used to be commit d1f298cd52)
1997-09-15 12:13:16 +00:00
Andrew Tridgell
d55427c85f - if the user already exists then ignore the -add command
- change the way the smbpasswd file is auto-created if it doesn't
exist. It didn't work under IRIX for some unknown reason

The smbpasswd.c code is really a bit of a mess. We should probably
rewrite it sometime.
(This used to be commit 6e3697ad12)
1997-09-15 06:36:55 +00:00
Andrew Tridgell
552818e60e - change a lot of occurances of errno to use strerror(errno). We can't
assume all our users are programmers :-)

- automatically create the smbpasswd file if it doesn't exist when
running smbpasswd.
(This used to be commit 1d2361bd2d)
1997-09-15 05:43:37 +00:00
Andrew Tridgell
ddb2ce9d81 rewrote md4.c from scratch. This implementation should be portable and
doesn't have any worries about RSA copyright.
(This used to be commit a156997166)
1997-09-15 02:49:38 +00:00
Andrew Tridgell
5137b86072 no longer needed
(This used to be commit b04bc7f75e)
1997-09-15 02:47:59 +00:00
Andrew Tridgell
33a003de40 This commit does 3 main things:
1) put the encryption code in by default, with no #ifdef. It is still
disabled by default so you need to add "encrypt passwords = yes" in
smb.conf but at least all binaries will have it.

2) cleanup the kanji code so it compiles with no warnings

3) get rid of lots of uses of ugly non-portable C code. The main
offender being things like "register" but also remove uses of the
"const" keyword as there are compilers out there that don't support it
and even those that do often complain about its usage. Users don't
like warnings :-(

There is still some work to do. We need to replace the md4 code with
our own implementation. The current code (from rfc1186) is PD but is
not very portable. The new RFC (rfc1320) is more portable but adds
copyright restrictions. I'll do a from-scratch MD4 soon.

We also need to test that what I've implemented is portable. It should
be, but I'm too tired right now to test it on anything other than
intel linux.
(This used to be commit db917c62c1)
1997-09-14 16:37:18 +00:00
Andrew Tridgell
58ec10049b This is a written from scratch DES implementation. I couldn't find a
GPLd implementation so I decided to write one.

This version only does DES ecb encryption and isn't very general, so
it may in fact be exempt from ITAR regulations. ITAR regulations do
not prohibit the distribution of code that can be used for
authentication purposes only. This code has no decrypt function so it
would be useless for a normal encryption application and thus may be
ITAR exempt.

It is also very slow, but we don't need it to be fast. It is a literal
implementation from the standard and treats each bit as one byte to
make the code easy to write.
(This used to be commit c2bc073a87)
1997-09-14 16:19:49 +00:00
Jeremy Allison
3469592833 Added fix that means if connecting user sends guest account
with no password they are seen as guest. Previous patch
broke this.

Jeremy (jallison@whistle.com)
(This used to be commit 9a55c49626)
1997-09-12 16:29:36 +00:00
Jeremy Allison
30416c0b8a charcnv.c client.c clitar.c kanji.c kanji.h loadparm.c
mangle.c smb.h util.c:

  Big merge to allow KANJI support to be in the main
binary without explicitly compiling with it.

locking.c: Fix for smbstatus not being able to read files.
namepacket.c: Removed unneccesary debug statement.
trans2.c: Added Luke's proposed fix (ifdefed out until further testing).
nmblookup.c: Fixed bug where query fails and status is done on bogus IP.

Jeremy (jallison@whistle.com)
(This used to be commit 9196255022)
1997-09-11 20:17:32 +00:00
Andrew Tridgell
77df5c87c6 fix a couple of "declaration shadows previous local" warnings.
(This used to be commit c30f6a74d0)
1997-09-11 02:30:00 +00:00
Andrew Tridgell
6da700d77c prototype updates for new functions
(This used to be commit dbf6624360)
1997-09-11 02:19:35 +00:00
Andrew Tridgell
646a721960 add the stdout parameter to lp_dump()
(This used to be commit 77f5bc8705)
1997-09-11 02:19:23 +00:00
Andrew Tridgell
c6d4477628 some minor modifications to loadparm.c to support the necessary
functions for wsmbconf. In particular added some more support routines
(like lp_rename_service()) and make the dump routines take a FILE
pointer rather than assuming stdout
(This used to be commit 6d16501606)
1997-09-11 02:19:04 +00:00
Andrew Tridgell
926f4d9125 cgi.c is a simple set of CGI manipulation routines
wsmbconf.c is a rudimentary web based smb.conf editor. Its really
there just to demonstrate how such an editor can hook into loadparm.c,
I don't expect anyone to actually use it as is.

wsmbstatus.c is a simple web based smbstatus. Its probably broken.
(This used to be commit ced5205f72)
1997-09-11 02:17:16 +00:00
Luke Leighton
a26b54cbaa samba servers forcing local elections if they are not a local master.
added check for "preferred master" to ensure not forcing an election.
(This used to be commit f8afd4c4c1)
1997-09-07 17:26:26 +00:00
John Terpstra
e81c4e902d JHT ===> Just setting version to 1.9.18alpha1
(This used to be commit e462cf2f1b)
1997-09-05 22:18:16 +00:00
Jeremy Allison
e7e49a6e6a client.c: Made sure myhostname was initialised before substitutions.
status.c: Made sure myhostname was initialised before substitutions.
server.c
trans2.c: Moved OS/2 WPS fix.
Jeremy (jallison@whistle.com)
(This used to be commit 8a12b6a4f0)
1997-09-05 21:32:32 +00:00
Luke Leighton
72af2c1831 added debug reporting to file listing / mod_time() checking routine.
lp_file_list_changed().
(This used to be commit 727fcfae1b)
1997-09-05 17:16:21 +00:00
Jeremy Allison
ab68ac375e Fix from Frank Varnavas <varnavas@ny.ubs.com>.
We cannot use the same name as the client to
the NT password server, as NT will drop client
connections if the same client name connects
twice. Instead, synthesize a name from our pid.
and the remote machine name.
Jeremy (jallison@whistle.com)
(This used to be commit ebf9487a9a)
1997-09-04 21:23:27 +00:00
Jeremy Allison
f5302af621 Fixed up determination of client type for PROTOCOL_NT1. Uses client
capabilities bits in session_setup_and_X to decide. Made remote_arch
an enum as well as a string, for easier use.
Jeremy (jallison@whistle.com)
(This used to be commit 99080705a2)
1997-09-04 20:26:07 +00:00
Jeremy Allison
82290216ad nameannounce.c
nameresp.c
nameserv.c
nameservreply.c
proto.h : Removed broadcast and recurse parameters in the
queue_netbios_pkt_wins() call - they are not needed as they
should always be 'false' and 'true' respectively.
Also fixed a bug with secure name registration (WINS
server code).
server.c: Finally fixed problem with error 267 being
returned to Win95. It is needed by NT. This is a horrid
fix and I would appreciate a better one :-).

Jeremy (jallison@whistle.com)
(This used to be commit fa1305d189)
1997-09-03 20:15:40 +00:00
Jeremy Allison
e1e4b37ac7 reply.c: Removed unused variables. Caught by gcc -Wall -Werror
server.c: Fix for old DOS clients not understanding ERRbaddirectory - map to ERRbadpath.
util.c: Fix for systems with no LOG_DAEMON facility.
Jeremy (jallison@whistle.com)
(This used to be commit dadb1ffb4c)
1997-09-02 22:21:38 +00:00
Luke Leighton
918cc5f033 use of recursion_available and recursion_desired flag in netbios responses.
(This used to be commit 8235db6b4f)
1997-09-01 18:34:00 +00:00
Luke Leighton
3fc24dc9ed added word count 3 support into reply_tcon_and_X (see cifs6.txt). the
only thing i couldn't do was get the chaining word count to point to
the end of the smb reply, for the next and_X (not that there is one).
(This used to be commit 54f11999d2)
1997-08-31 14:14:22 +00:00
Andrew Tridgell
f434139087 fixed a bug in the printjob encoding/decoding. We weren't doing it for
the print_ functions in reply.c, with the effect that you couldn't
cancel print jobs from smbclient or from older dos clients.

we now use a couple of utility functions printjob_encode() and
printjob_decode() rather than sticking the bitops inline in each
place.

also fixed a bunch of places that used foo%0xFF rather than foo&0xFF

Note that this isn't really me doing the commit, it can't be as I'm
working on my thesis ...
(This used to be commit 3556763be3)
1997-08-31 02:18:59 +00:00
Jeremy Allison
06dc98f220 Makefile: New program and support for dynamic codepage loading.
charset.c: Dynamic codepage loading code.
charset.h: Defines for file format.
proto.h:   Updated.
Jeremy (jallison@whistle.com)
(This used to be commit 550e98f2d4)
1997-08-30 01:30:25 +00:00
Jeremy Allison
57408548f3 Adding codepage definition files and codepage file compiler/decompiler.
Adding install/uninstall scripts for compiled codepage files.
Preparing for dynamic codepage loading.
Jeremy (jallison@whistle.com)
(This used to be commit e3fc9533bd)
1997-08-30 01:13:39 +00:00