1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-14 19:24:43 +03:00

311 Commits

Author SHA1 Message Date
Luke Leighton
80d714e75b close socket issues:
- ssl close from cli_reestablish_connection() not called.
- ntlmv2 fall-back to ntlmv1 failed.
(This used to be commit fdc275353de85fde0c348320e4d64ba66365b73b)
1999-08-03 17:21:34 +00:00
Luke Leighton
50429f6056 anon passwd connection: passlen=1; ntpasslen=0.
(This used to be commit 12ee037d44a603ce50982d5b90e08c30339de750)
1999-07-11 19:26:27 +00:00
Tim Potter
6919a92aee When making anonymous connections, must pass pointers to real nt
password and password length variables not constants.
(This used to be commit 236022071f2f6df0c583fd88d9802d9b3ea6f73e)
1999-07-09 03:55:15 +00:00
Luke Leighton
820c382211 fixed problem with NULL ntpasswd parameters causing crash in
static cli_calc_session_pwds().  this code used to be inside cli_session_setup()
itself and worked on non-NULL local variables.
(This used to be commit 7aff19ba57fd91572da7cbe16f118d11226590e3)
1999-07-08 19:44:06 +00:00
Luke Leighton
8e14594798 smbclient modified to use cli_establish_connection(). smbclient therefore
now uses improved authentication.  smbclient now "broken" for "scripts"
based on DEBUG() output.  cli_establish_connection() requires modification
to support old scripts.
(This used to be commit b0539d43407cb2b0bab7977908de09b21b145218)
1999-06-29 19:39:23 +00:00
Luke Leighton
73891ca8e4 improving authentication code (tidyup).
(This used to be commit ab1a6aa42db5217f025941fb5107436556bc23b7)
1999-06-29 18:47:06 +00:00
Luke Leighton
1dc6c6c7ca use nmb_safe_namestr.
(This used to be commit de9a38b0bcb5adcb6e502f2200d3e84bdcbdfc48)
1999-06-24 19:09:03 +00:00
Luke Leighton
cae3620b2e safe string error reporting functions (found a potential buffer overflow
of a pstrcpy into an fstring).
(This used to be commit ac0060443de800fec9042b69b299ff2e9128a31c)
1999-06-24 18:58:08 +00:00
Matthew Chapman
99020c9b09 ERRmoredata is informational and should not be treated as a hard error
anywhere.
(This used to be commit 71b861f7468d7950bedb61dd18a4b9d830bf8628)
1999-03-23 14:58:26 +00:00
Luke Leighton
236cea4efa Benjamin Kuit's MYSQL SAM Database implementation.
Copyright (C) Benjamin Kuit <bj@mcs.uts.edu.au> 1999.
(This used to be commit fdf61e1dabc2c977ee5cf1e9d60e3380f19840da)
1999-03-01 16:31:14 +00:00
Luke Leighton
c6d16eea43 the UNICODE issue...
(This used to be commit 73db80f34183324845407b00f58462ff2d7b47ea)
1999-02-11 18:50:13 +00:00
Matthew Chapman
1cf9521b2d Must set password length to 24 after we encrypt a password.
(This used to be commit af83778abc5fae0df53ed1874181e33bc8de8d94)
1999-02-01 05:25:54 +00:00
Luke Leighton
deb61cb44b returned cli_session_setup to previous behaviour. added a couple of
validation checks and also added capability to send plaintext passwords.
send "ntpasslen" of zero to do this.  sending same plaintext password
for pass and ntpass arguments will result in previous behaviour of
encrypting password if server supports it.
(This used to be commit 17f4c5a785cf20901bcb76510e5ea9b0a6928115)
1999-01-28 18:40:53 +00:00
Luke Leighton
4af8d7aa29 - got client code cleartext passwords working again in cli_session_setup.
needed this for some tests.

- removed code that said "if lm password is not encrypted then encrypt both
  lm and nt passwords".  actually it said "if lm password length is not 24
  bytes and we're in security=user mode..."

  it didn't bother to check whether the nt password was NULL or not, and
  doing the encryption inside cli_session_setup is the wrong place.

- checked all instances where cli_session_setup is called with cleartext
  passwords that are expected to then be encrypted (see above) with the
  test "if pwlen != 24...".  there was only one: all the others either
  provide encrypted passwords, do null sessions or use
  cli_establish_connection.

* recommendation: use cli_establish_connection() in smbwrapper/smbw.c
(This used to be commit 2a509e9606f8aefbefa6e7b49878726464dbed44)
1999-01-27 00:08:33 +00:00
Richard Sharpe
f5f913b001 Putting back the -p flag in smbclient.
However, it seems that the -s flag
in smbclient is also ignored :-(
(This used to be commit f6c78192664d611d4663ed7459a2789315861eec)
1999-01-25 01:46:14 +00:00
Matthew Chapman
b4e34006e8 In security=user mode we must allow cli_connect_serverlist to connect to our
own smbd process, rather than complaining about a password server loop.
(This used to be commit 63d7822b9d87d085194de6895d3e271cedcd3c9a)
1999-01-18 01:35:43 +00:00
Matthew Chapman
2cc786548b eclass != ERRDOS && num != ERRmoredata
is not the same as
!(eclass == ERRDOS && num == ERRmoredata)

This was causing smbclient to segfault on receiving certain errors.
(This used to be commit 15bd172530af360cf16ad626330dfe2ea92100df)
1999-01-15 05:09:36 +00:00
Luke Leighton
e67a8d9d98 server_cryptkey() now calling cli_connectserverlist(). stupid microsoft
idiotic *SMBSERVER connectionism added to cli_connect_serverlist().
also added check for protocol < LANMAN2.
(This used to be commit c2bcb3a286f22ed4f0f55da2a3eb2bff17906fb1)
1998-12-14 21:22:59 +00:00
Luke Leighton
90ce7b9288 ERRmoredata is an acceptable error code, it is not an error.
(This used to be commit 9bce7340d60a49594f67cc3c6cc6119b33a5358a)
1998-12-02 20:03:08 +00:00
Luke Leighton
b31c528146 another attempt at a fix on connect_serverlist()...
(This used to be commit 603c5f6df8c525f30d00da912d408b98378ea538)
1998-11-30 16:00:27 +00:00
Luke Leighton
7f63a31062 andrej spotted problem with connect_serverlist (starts off assuming
a connection succeeds...).
(This used to be commit c0efc35b27d50c40bc04bfd9fb1d61ea5d32bde5)
1998-11-30 15:32:15 +00:00
Tim Potter
b70700dba2 Replaced ZERO_STRUCT() with ZERO_STRUCTP() in cli_connect_serverlist().
Fix by Matt Chapman <m.chapman@student.unsw.edu.au>
(This used to be commit c44b418d6fd16a257af21f6b5b29b1cdf26015b7)
1998-11-26 06:35:25 +00:00
Luke Leighton
74d539f557 - group database API. oops and oh dear, the threat has been carried out:
the pre-alpha "domain group" etc parameters have disappeared.

- interactive debug detection

- re-added mem_man (andrew's memory management, detects memory corruption)

- american spellings of "initialise" replaced with english spelling of
  "initialise".

- started on "lookup_name()" and "lookup_sid()" functions.  proper ones.

- moved lots of functions around.  created some modules of commonly used
  code.  e.g the password file locking code, which is used in groupfile.c
  and aliasfile.c and smbpass.c

- moved RID_TYPE_MASK up another bit.  this is really unfortunate, but
  there is no other "fast" way to identify users from groups from aliases.
  i do not believe that this code saves us anything (the multipliers)
  and puts us at a disadvantage (reduces the useable rid space).
  the designers of NT aren't silly: if they can get away with a user-
  interface-speed LsaLookupNames / LsaLookupSids, then so can we.  i
  spoke with isaac at the cifs conference, the only time for example that
  they do a security context check is on file create.  certainly not on
  individual file reads / writes, which would drastically hit their
  performance and ours, too.

- renamed myworkgroup to global_sam_name, amongst other things, when used
  in the rpc code.  there is also a global_member_name, as we are always
  responsible for a SAM database, the scope of which is limited by the role
  of the machine (e.g if a member of a workgroup, your SAM is for _local_
  logins only, and its name is the name of your server.  you even still
  have a SID.  see LsaQueryInfoPolicy, levels 3 and 5).

- updated functionality of groupname.c to be able to cope with names
  like DOMAIN\group and SERVER\alias.  used this code to be able to
  do aliases as well as groups.  this code may actually be better
  off being used in username mapping, too.

- created a connect to serverlist function in clientgen.c and used it
  in password.c

- initialisation in server.c depends on the role of the server.  well,
  it does now.

- rpctorture.  smbtorture.  EXERCISE EXTREME CAUTION.
(This used to be commit 0d21e1e6090b933f396c764af535ca3388a562db)
1998-11-17 16:19:04 +00:00
Andrew Tridgell
3ba68d045c automatically uppercase server and share names (win95 won't handle
lowercase share names!)
(This used to be commit dddf1d8522707b828cac466c4a9ab2807d098573)
1998-11-14 04:16:07 +00:00
Jeremy Allison
24ca89bfb0 Removed acconfig.h configure configure.in include/config.h.in: Made smbwrapper not made
by default.
nmbd*: Changed all calls to namestr() to nmbd_namestr() to fix broken FreeBSD include
	   file problem...sigh.
Jeremy.
(This used to be commit 9ee8f39aed8772a05c203161b4ae6b7d90d67481)
1998-11-14 01:04:13 +00:00
Herb Lewis
d30b6ab548 .cvsignore: Removed old entries.
client/client.c:
include/client.h: Added some debug messages that the old client used to
		  generate. These are needed to make scripts such as
		  'findsmb' work - there may be other changes to keep
		  backwards output compatibility. Do we need a -old-client-compat
		  argument ?
libsmb/clientgen.c: Fixed crash bug where malloc'ed data wasn't being
		    cleared - corrupted malloc chains.
web/swat.c: John's changes to get rid of "ghost" table entries.
(This used to be commit 3c45a3503ea57d17e98eb3e57514161a5c82e45e)
1998-11-12 22:17:51 +00:00
Andrew Tridgell
d85dcf86d5 largely rewrote smbpasswd so that the code is understandable. This
should allow us to call a function in swat rather than piping to
smbpasswd.

while doing this I also fixed quite a few "const char *" versus "char *" issues
that cropped up while using const to track down bugs in the code. This
led to changes in several generic functions.

The smbpasswd changes should be correct but they have not been
extensively tested. At least if I have introduced bugs then we should
be able to fix them more easily than before.
(This used to be commit 713864dd0322ae2ae2d83e333d85be35a7eed4ec)
1998-11-12 06:12:19 +00:00
Jeremy Allison
e4f974c611 Makefile.in: Removed rpc_server/srv_ldap_helpers.c per J.F.'s instructions.
client/client.c:
client/clitar.c:
include/client.h:
smbwrapper/smbw_dir.c:
smbwrapper/smbw_stat.c:
smbwrapper/smbw.c:
lib/util.c: Converted all use of 'mode' to uint16.
smbd/quotas.c: Fixed stupid comment bug I put in there :-(.
printing/printing.c: Fix from J.F. to new code.
Jeremy.
(This used to be commit bacd3e9d2036a804e73644a28fc498f229c8446c)
1998-11-09 20:33:37 +00:00
Andrew Tridgell
8c62b28e0e converted smbclient to use clientgen.c rather than clientutil.c
I did this when I saw yet another bug report complaining about
smbclient intermittently missing files. Rather than applying more
patches to smbclient it was better to move to the more robust
clientgen.c code.

The conversion wasn't perfect, I probably lost some features of
smbclient while doing it, but at least smbclient should be consistent
now. It if fails it should _always_ fail rather than giving people the
false impression of a reliable utility.

the tar stuff seems to work, but hasn't had much testing as I never
use it myself. I'm sure someone will find bugs in my conversion of
smbtar.c. It was quite tricky as it did a lot of its own SMB calls. It
now uses clientgen.c exclusively.

smbclient is still quite messy, but at least it doesn't build its own
SMB packets.

I haven't touched smbmount as I never use it. Mike, do you want to
convert smbmount to use clientgen.c?
(This used to be commit e14ca7765ace1b721dad8eca4a527a4e4a8f1ab8)
1998-11-09 03:45:49 +00:00
Andrew Tridgell
099dae54dc don't bother trying QFILEINFO/QUERY_FILE_ALL_INFO with win95 as it
totally screws it up, giving garbage for the size fields.
(This used to be commit 86f98e0607e8a05ec026b919cc974c1c934b6882)
1998-11-05 12:42:16 +00:00
Andrew Tridgell
4f2a6adb7c added a couple more error codes to cli_error()
(This used to be commit b2a7f85d597d4d2a71fd38d76aac0464d53df626)
1998-10-26 03:31:00 +00:00
Andrew Tridgell
fb556e14f3 volker was concerned about unique inode numbers and smbsh. This set of
changes uses the unique index number from a SMB_QUERY_FILE_ALL_INFO to
try to provide inode numbers. If it is 0 then use the hash of the
filename as before.
(This used to be commit 2565ccf9de9d5e80fdb5bcadbc7130faba386d95)
1998-10-24 08:08:05 +00:00
Luke Leighton
01de603084 - dce/rpc code
- removed debug info in struni2 and unistr2 (security risk)

- rpc_pipe function was getting pointer to data then calling realloc *dur*

- password check function, the start of "credential checking",
  user, wks, domain, pass as the credentials (not just user,pass which
  is incorrect in a domain context)

- cli_write needs to return ssize_t not size_t, because total can be -1
  if the write fails.

- fixed signed / unsigned warnings (how come i don't get those any more
  when i compile with gcc???)

- nt password change added in smbd.  yes, jeremy, i verified that the
  SMBtrans2 version still works.
(This used to be commit fcfb40d2b0fc565ee4f66b3a3761c246366a2ef3)
1998-10-19 17:32:10 +00:00
Andrew Tridgell
9debf0b1ee improved session reestablishment
(This used to be commit 5f96328d32e76785474ffd5cd73f8ddefc46d4f5)
1998-10-19 02:48:57 +00:00
Andrew Tridgell
d5c190bae8 return the resolved IP on a cli_connect() call so it can be cached
(This used to be commit 4e3f8ef41b8de25dec4c01d5532dca1b567be55a)
1998-10-19 01:05:11 +00:00
Andrew Tridgell
62811de4e8 - use large buffers for netshareenum
- handle errmoredata a bit better
- fix dev type from tconx for smbw
(This used to be commit 2f39409dc1ef012a8a7d315572a489d15df186f7)
1998-10-16 17:40:01 +00:00
Jeremy Allison
070b334891 trans2.h: Added Thursby MAC extension.
smbd/trans2.c: Added Thursby MAX extension.
libsmb/clientgen.c: Fixed smbtorture lock code.
Jeremy.
(This used to be commit 514e52e4b4d6c7db7ebe2265e60c77b4f18d11b3)
1998-10-16 00:54:16 +00:00
Luke Leighton
c404bb7754 rpcclient interactive login (with trust account changing if you are root)
cli_session_setup handles null sessions correctly
(This used to be commit 60c0f22a4e84703467006dfe1971384a6294a9aa)
1998-10-15 23:51:07 +00:00
Luke Leighton
827a9d862e dce/rpc
(This used to be commit dfb48aab6153e53a5efd1f8ee518375cc584b101)
1998-10-10 00:46:28 +00:00
Luke Leighton
78c1fd054f dce/rpc
(This used to be commit 8a7ac4a25d177235a98c0f84f97ee50432fb6359)
1998-10-09 23:31:50 +00:00
Luke Leighton
8158620124 dce/rpc.
(This used to be commit e0445419b2d50ae6efef36f4f295ebcfdbf1ad82)
1998-10-09 20:17:11 +00:00
Luke Leighton
4e004a0b5e basic client-side ntcreateX function (hard-wired values except filename)
(This used to be commit caeb99201a1471bd709b4e8f07c57e5caabf0795)
1998-10-09 19:34:57 +00:00
Luke Leighton
6909350ed9 dce/rpc
(This used to be commit 62fdeef1b79c5c4c9bf0e860881651711bb80b9a)
1998-10-08 23:57:46 +00:00
Andrew Tridgell
a813f38e2d - don't generate 0 params in torture
- handle 0 params in ipc.c
(This used to be commit c0dc8e87f0d56444a8ddff0817a94065ca295847)
1998-10-08 06:49:00 +00:00
Andrew Tridgell
788263ba2f - fixed a bunch of warnings and minor errors
- got smbtorture to compile
- removed %D from some of lukes code - Luke, what is %D? it ain't
  portable anyway
(This used to be commit 91597c12fb593f49b23c7cea5b64dbb89a0428b3)
1998-10-08 06:21:33 +00:00
Andrew Tridgell
4750ce1760 use 1 second resolution calls if possible
(This used to be commit 349469221a84658048790d7567b4fcea43c0b759)
1998-10-08 02:28:21 +00:00
Andrew Tridgell
029144cd8c do an anonymous login if the username/password is rejected.
(This used to be commit 0ee3e0c62378bdf7a8e145de0727ea85763af95a)
1998-10-07 00:40:18 +00:00
Andrew Tridgell
cbb25c71d0 fixed rename error code from NT servers
(This used to be commit e7516901270a4a790a3e346065eb2be8ede16cb3)
1998-10-06 13:20:06 +00:00
Andrew Tridgell
404f14fb36 implemented unix semantics for rename in smbwrapper
(This used to be commit a5c18f9c82f5f76b00ff29c5668b4f0d3e8d6bd0)
1998-10-06 13:10:06 +00:00
Luke Leighton
b4fb4caf90 rpcclient srvsvc commands.
(This used to be commit 1a9a22c657c46648adaa98ac1fe394ce4bce11f0)
1998-10-05 15:41:41 +00:00