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

97 Commits

Author SHA1 Message Date
Gerald Carter
d8cf54399d merge from APP_HEAD 0001-01-01 00:00:00 +00:00
Simo Sorce
897e64d2e0 more debug classess activated 0001-01-01 00:00:00 +00:00
Tim Potter
4d715cb682 Grr - the removal of the nnecessary prs_align() from relative unicode
strings didn't make it across into HEAD.
0001-01-01 00:00:00 +00:00
Andrew Bartlett
0bdd94cb99 Partly based on the work by mimir (Rafal Szczesniak
<mimir@diament.ists.pwr.wroc.pl>) this patch allows samba to correctly
enumerate its trusted domains - by exaimining the keys in the secrets.tdb file.

This patch has been tested with both NT4 and rpcclient/wbinfo, and adds
some extra functionality to talloc and rpc_parse to allow it to deal with
already unicode strings.

Finally, this cleans up some const warnings that were in net_rpc.c by pushing
another dash of const into the rpc client code.

Andrew Bartlett
0001-01-01 00:00:00 +00:00
Andrew Bartlett
f0b16b7b51 more const 0001-01-01 00:00:00 +00:00
Tim Potter
6a58c9bd06 Removed version number from file header.
Changed "SMB/Netbios" to "SMB/CIFS" in file header.
0001-01-01 00:00:00 +00:00
Andrew Bartlett
f0c301a12e Give the main loop talloc context a name (using mbp's new talloc naming
system).

Andrew Bartlett
0001-01-01 00:00:00 +00:00
Andrew Bartlett
64bf8f81c4 Const religion for some of the RPC code. 0001-01-01 00:00:00 +00:00
Jean-François Micouleau
bfbe7f377e samr_querydom_info level 1: found the meaning of the unknow fields. And
discovered that our reply is short by 4 bytes since day 1 of this code.

Added a decode function to rpcclient too.

splitted the STRING2 fields filling while trying to understand the win9x
userlist bug. (didn't fix the bug, but the reply looks closer to NT).

        J.F.
0001-01-01 00:00:00 +00:00
Jeremy Allison
94403d8417 Fixed the bug with member servers in a Samba PDC hosted domain not allowing
other access. Problem was max time was being set to 0xffffffff, instead of
0x7fffffff.
Jeremy.
0001-01-01 00:00:00 +00:00
Tim Potter
2d0922b0ea Removed 'extern int DEBUGLEVEL' as it is now in the smb.h header. 0001-01-01 00:00:00 +00:00
Andrew Bartlett
af53e774d7 Fix up some compile issues. We can't have C99 comments and add a smattering
of const.
0001-01-01 00:00:00 +00:00
Tim Potter
3a60cb44f2 Merge of sam sync code from TNG.
Reverse-engineered the sam replication protocol from staring at hex dumps
for a while.  It's pretty similar to the sam sync protocol with a couple of
different delta header types.

I wasn't able to figure out the format of the privilege stuff - needs more
time and a whiteboard.  (-:

The impressive bit is that the sam sync stuff from tng basically just
worked thanks mainly to Luke Leighton's efforts in this area.
0001-01-01 00:00:00 +00:00
Andrew Bartlett
b30b6202f3 This is my 'Authentication Rewrite' version 1.01, mostly as submitted to
samba-technical a few weeks ago.

The idea here is to standardize the checking of user names and passwords,
thereby ensuring that all authtentications pass the same standards.  The
interface currently implemented in as

nt_status = check_password(user_info, server_info)

where user_info contains (mostly) the authentication data, and server_info
contains things like the user-id they got, and their resolved user name.

The current ugliness with the way the structures are created will be killed
the next revision, when they will be created and malloced by creator functions.

This patch also includes the first implementation of NTLMv2 in HEAD, but which
needs some more testing.  We also add a hack to allow plaintext passwords to be
compared with smbpasswd, not the system password database.

Finally, this patch probably reintroduces the PAM accounts bug we had in
2.2.0, I'll fix that once this hits the tree.  (I've just finished testing
it on a wide variety of platforms, so I want to get this patch in).
0001-01-01 00:00:00 +00:00
Andrew Bartlett
bd3c2a0cdd This backs out my last change, which broke some of the finer points of RPC
coding :-).  I'll be more carfull in this area in future.

This does not back out the cli_login change, so domain logons still work, but
only for english.

Andrew Bartlett
0001-01-01 00:00:00 +00:00
Andrew Bartlett
cf1d1cd9d6 This fixes security=domain, which has been broke since the big charset
changeover.  For my own sainity I have created a new function to fill out both
the header and buffer for a string in an RPC struct.  This DOES NOT take a
length argument, only the actual string to be placed.

The RPC code is currently littered with code that does init_uni_hdr() followed
immidiatly by init_unistr2(), and often the length argument is wrong.  (It was
for the code I changed, even before the charset stuff).  Another bug where we
made strings AT LEAST MAX_UNICODE_LEN long hid this bug.

This works for loopback connections to Samba, and can't be any more broke than
it was before :-).  (We had double and revese conversions, fun...).

In particular this makes us multibyte complient.

In any case, if there are no objections I will slowly convert other bits of
code to the same system.
0001-01-01 00:00:00 +00:00
Jean-François Micouleau
a8006e6f3e when converting ascii to unicode, if the ascii string is NULL, don't
convert it, rpcstr_push doesn't like it.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
debb471267 The big character set handling changeover!
This commit gets rid of all our old codepage handling and replaces it with
iconv. All internal strings in Samba are now in "unix" charset, which may
be multi-byte. See internals.doc and my posting to samba-technical for
a more complete explanation.
0001-01-01 00:00:00 +00:00
Jeremy Allison
9b3dd80176 Added code from "Nigel Williams" <nigel@veritas.com> (yes, the same famous
Nigel Williams who did NIS/GINA !) to implement add/modify/delete shares
for Win2k. Needs testing as I made a few mods to the original code.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
0e6a34510e Sync up handle creation with 2.2 branch. We can now join AS/U domains and
authenticate against them. Big/little endian issues fixed.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
d3a56c6042 Added total memory allocated counter to talloc, so we can tell if a talloc
pool is getting bloated. Also added a talloc_zero function to return zeroed memory.
Added debug in rpc_server/srv_pipe_hnd.c so we know when a talloc pool is being
freed. Syncup with srv_pipe_hnd.c from 2.2 so we are freeing memory at the same time.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
f76dc952f7 Fixed "object picker can't determine if object in domain" bug seen from W2K
clients. Did this by importing Samba-TNG code that correctly handles LSA
lookups.
*MANY* thanks to Luke, Sander, Elrond and the rest of the TNG gang !
Jeremy
0001-01-01 00:00:00 +00:00
Jean-François Micouleau
69fe739303 lib/util_unistr.c:
rewrote unistr2_to_ascii() to correct a bug seen on SGI boxes.

rpc_parse/parse_misc.c:
rpc_parse/parse_prs.c:
        rewrote of BUFFER5 handling to NOT byteswap when it was already in
        network byte order.

rpc_parse/parse_samr.c:
        cleanup of samr_io_q_lookup_domain(), remove the over-parsing by 2
        bytes.

rpc_server/srv_lsa.c:
        UNISTR2 strings need to be NULL terminated to pleased W2K.

rpc_server/srv_spoolss_nt.c:
        use snprintf instead of safe_strcpy as we want the string
        truncated at 32 chars.


That should fix SUN and SGI box not able to act as printserver and the
problem with joining from a W2K wks.

        J.F.
0001-01-01 00:00:00 +00:00
Jeremy Allison
0a40bc83e1 Fixed memory leaks in lsa_XX calls. Fixed memory leaks in smbcacls. Merged
in fixes from appliance-head and 2.2. Fixed multiple connection.tdb open
problem.
Jeremy.
0001-01-01 00:00:00 +00:00
Tim Potter
817819d0cc Port of lsa_lookup_sids() and lsa_lookup_names() rpc client functions from
TNG branch.

Re-instated lsa_lookup_sids and lsa_lookup_names functions in rpcclient.

This requires most samba binaries to link in another handful of object
files due to uncessary coupling between modules.  )-:
0001-01-01 00:00:00 +00:00
Jeremy Allison
b17e23a8ff printing/nt_printing.c: use getpwuid not smbgetpwuid. Canonicalize printernames.
printing/printing.c: Insure fix for malloc of zero.
rpc_parse/parse_misc.c: Enusre UNISTR's are zero filled.
rpc_parse/parse_spoolss.c: Correct INFO_6 - differs between pre-releases of W2K and shipping build.
rpc_server/srv_spoolss_nt.c: Canonicalize printernames.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
d131ad1ce3 Adding Herb's compile warning fixes to HEAD.
Jeremy.
0001-01-01 00:00:00 +00:00
Gerald Carter
b64ddbd1aa added comment for my own memory purposes
jerry
0001-01-01 00:00:00 +00:00
Gerald Carter
65ee5f9b6e - fixed memcpy bug in copy_unistr2()
- init_unistr2_from_unistr() does not NULL terminate
  the buffer



--jerry
0001-01-01 00:00:00 +00:00
Jeremy Allison
ceba9f3dcd Fixed the problem with UNISTR marshalling in a buffer5 struct.
The smb_io_unistr() code called a prs_align, this was not being
counted in the size or taken account of in the offset calculation.
Fixed size_ calculation to always return a size a multiple of 4
and also set the offset correctly. This fixes the problem I saw
and will hopefully fix the problem HP reported. JF please check
this change.
Jeremy.
0001-01-01 00:00:00 +00:00
Gerald Carter
8ecd5dd52a More work on AddPrinterDriver() and AddPrinterEx() client RPC's
Also fixed init_unistr() to deal with a NULL source character string.



-jerry
0001-01-01 00:00:00 +00:00
Gerald Carter
1e00ac19cd cleanup in init_unistr2_from_unistr()
--jerry
0001-01-01 00:00:00 +00:00
Gerald Carter
7b69cbbde3 it is not my day it seems. :-(
Fixed missing )


j-
0001-01-01 00:00:00 +00:00
Gerald Carter
34d4fb54c3 removed the for() loop to copy the buffer in init_unistr2_from_unistr()
Replaced with a memcpy()



Forgot to commit this a few moments ago


j-
0001-01-01 00:00:00 +00:00
Gerald Carter
4ecd15cd58 Fixed bug in init_unistr2_from_unistr() found by Elrond.
Thanks :-)





j-
0001-01-01 00:00:00 +00:00
Gerald Carter
c8f9e54bea After talking with Jeremy and JF (and staring at packet traces between
NT <-> NT), I've come to realize that UNISTR2 strings should be NULL
terminated.




jerry
0001-01-01 00:00:00 +00:00
Tim Potter
4ab75143c4 Fixed read overrun in init_string2() 0001-01-01 00:00:00 +00:00
Jeremy Allison
0ff2ce543e Ok - this is a *BIG* change - but it fixes the problems with static strings
in the RPC code. This change was prompted by trying to save a long (>256)
character comment in the printer properties page.

The new system associates a TALLOC_CTX with the pipe struct, and frees
the pool on return of a complete PDU.

A global TALLOC_CTX is used for the odd buffer allocated in the BUFFERxx
code, and is freed in the main loop.

This code works with insure, and seems to be free of memory leaks and
crashes (so far) but there are probably the occasional problem with
code that uses UNISTRxx structs on the stack and expects them to contain
storage without doing a init_unistrXX().

This means that rpcclient will probably be horribly broken.
A TALLOC_CTX also needed associating with the struct cli_state also,
to make the prs_xx code there work.

The main interface change is the addition of a TALLOC_CTX to the
prs_init calls - used for dynamic allocation in the prs_XXX calls.

Now this is in place it should make dynamic allocation of all RPC
memory on unmarshall *much* easier to fix.

Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
3cdcfa6325 More insure found memory leak and corruption fixes.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
eba31e4e80 Back to building. Now to test with insure.
Added some frees needed to stop memory leaks.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
c2099cfb03 Getting back to a compilable state (not there yet but close).
Added patches for random -> sys_random.
Added set_effective_xxx patches for AFS code.
Memory allocation changes in spoolss code.
Jeremy.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
7030b7f06a init_unistr takes a const 2nd arg
(ps: I hate const)
0001-01-01 00:00:00 +00:00
Andrew Tridgell
974813f0d4 added spool_io_printer_driver_info_level_6()
thsi function and the associated header structure were autogenerated
using a little awk based code geerator I wroe ths evening. I'll commit
that next ...
0001-01-01 00:00:00 +00:00
Jean-François Micouleau
c212fbe009 rewrote getprinterdriver level 3, now correctly handle the dependent
files.
A number of memleak fixed
some error return values fixed.

	J.F.
0001-01-01 00:00:00 +00:00
Jeremy Allison
f02999dbf7 acconfig.h configure configure.in: Added check for UT_SYSLEN for utmp code.
include/byteorder.h: Added alignment macros.
include/nameserv.h: Added defines for msg_type field options - from rfc1002.
lib/time.c: Typo fix.
lib/util_unistr.c: Updates from UNICODE branch.
printing/nt_printing.c: bzero -> memset.
smbd/connection.c: Added check for UT_SYSLEN for utmp code.

Other fixes : Rollback of unapproved commit from Luke.
Please *ask* next time before doing large changes to HEAD.

Jeremy.
0001-01-01 00:00:00 +00:00
Luke Leighton
cfaea90529 added the following message to all dce/rpc client/server code, except
the spoolss code (it's cut from TNG) and the smb-dce/rpc interface
code that jeremy has been working up to TNG-functionality.

i also want this message to go into SAMBA_2_0 and SAMBA_2_0_RELEASE,
because it is intolerable that potentially good modifications be made
to code that is going to be thrown away, and people waste their time
fixing bugs and adding enhancements that have already been carried
out already, up to two years ago in the TNG branch.

/*
 * THIS CODE IS OUT-OF-DATE BY TWO YEARS, IS LEGACY DESIGN AND VERY, VERY,
 * INCOMPLETE.  PLEASE DO NOT MAKE ANY FURTHER ENHANCEMENTS TO THIS CODE
 * UNLESS THEY ARE ALSO CARRIED OUT IN THE SAMBA_TNG BRANCH.
 *
 * PLEASE DO NOT TREAT THIS CODE AS AUTHORITATIVE IN *ANY* WAY.
 *
 * REPEAT, PLEASE DO NOT MAKE ANY MODIFICATIONS TO THIS CODE WITHOUT
 * FIRST CHECKING THE EQUIVALENT MODULE IN SAMBA_TNG, UPDATING THAT
 * FIRST, *THEN* CONSIDER MAKING THE SAME MODIFICATION IN THIS BRANCH
 *
 * YOU WILL, ALMOST GUARANTEED, FIND THAT THE BUG-FIX OR ENHANCEMENT THAT
 * YOU THINK IS NECESSARY, HAS ALREADY BEEN IMPLEMENTED IN SAMBA_TNG.
 * IF IT HAS NOT, YOUR BUG-FIX OR ENHANCEMENT *MUST* GO INTO SAMBA_TNG
 * AS THE SAMBA_TNG CODE WILL REPLACE THIS MODULE WITHOUT REFERENCE TO
 * ANYTHING IN IT, WITH THE POSSIBLE RISK THAT THE BUG-FIX OR ENHANCEMENT
 * MAY BE LOST.
 *
 * PLEASE OBSERVE AND RESPECT THIS SIMPLE REQUEST.
 *
 * THANK YOU.
 *
 * lkcl@samba.org
 */
0001-01-01 00:00:00 +00:00
Jean-François Micouleau
81e375bbbe spoolss definitions.
also added some prs_struct functions, 'cause I'm handling buffers as
prs_struct.

	J.F.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
453a822a76 first pass at updating head branch to be to be the same as the SAMBA_2_0 branch 0001-01-01 00:00:00 +00:00
Luke Leighton
c98c666906 damn, that took a while. nt login password was being stored incorrectly
in private .mac file (oops).  ntlogin test now works.
0001-01-01 00:00:00 +00:00
Luke Leighton
9193f0eff5 attempted a svcset command. password is encrypted / messed up, therefore
command fails.
0001-01-01 00:00:00 +00:00