1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-23 09:57:40 +03:00

733 Commits

Author SHA1 Message Date
Tim Potter
a7e67dc00a Added addform, setform and deleteform cli functions. -
Tim Potter
6a58c9bd06 Removed version number from file header.
Changed "SMB/Netbios" to "SMB/CIFS" in file header.
-
Andrew Bartlett
9d62f25f5d Name another talloc. -
Andrew Bartlett
5dfba2cf53 Back out some of the less well thought out ideas from last weeks work on
winbind default domains, particulary now I understand whats going on a lot
better.  This ensures that the RPC client code does as little 'magic' as
possible - this is up to the application/user.  (Where - for to name->sid code
- it was all along).  This leaves the change that allows the sid->name code to
return domains and usernames in seperate paramaters.

Andrew Bartlett
-
Andrew Bartlett
554842e0a5 Fix up a security issue with the way we handle domain groups retuned on the
info3.  These are RIDs, and it only makes sense to combine them with the domain
SID returned with them.  This is important for trusted domains, where that sid
might be other than the one we currently reterive from the secrets.tdb.

Also remove the become_root()/unbecome_root() wrapper from around both
remaining TDB users:  Both are now initialised at smbd startup.

Andrew Bartlett
-
Tim Potter
7c2d720593 Removed unused static variable. -
Martin Pool
935955b50f Add more string explanations of RAP errors that are already documented
in clirap2.
-
Tim Potter
e67c7c5852 Spelling fixes. -
Andrew Bartlett
20e0b56228 Fix a couple of memory leaks in the cli_establish_connection() code's failure
case.

Thanks to Nigel Williams <nigel@wednesday.demon.co.uk> for spotting these!

Andrew Bartlett
-
Andrew Bartlett
e870f0e727 This patch makes the 'winbind use default domain' code interact better with
smbd, and also makes it much cleaner inside winbindd.

It is mostly my code, with a few changes and testing performed by Alexander
Bokovoy <a.bokovoy@sam-solutions.net>.  ab has tested it in security=domain and
security=ads, but more testing is always appricatiated.

The idea is that we no longer cart around a 'domain\user' string, we keep them
seperate until the last moment - when we push that string into a pwent on onto
the socket.

This removes the need to be constantly parsing that string - the domain prefix
is almost always already provided, (only a couple of functions actually changed
arguments in all this).

Some consequential changes to the RPC client code, to stop it concatonating the
two strings (it now passes them both back as params).

I havn't changed the cache code, however the usernames will no longer have a
double domain prefix in the key string.  The actual structures are unchanged
 - but the meaning of 'username' in the 'rid' will have changed.  (The cache is
invalidated at startup, so on-disk formats are not an issue here).

Andrew Bartlett
-
Andrew Bartlett
07a21fcd23 This is the 'winbind default domain' patch from Alexander Bokovoy
<a.bokovoy@sam-solutions.net>.

The idea is the domain\username is rather harsh for unix systems - people don't
expect to have to FTP, SSH and (in particular) e-mail with a username like
that.

This 'corrects' that - but is not without its own problems.

As you can see from the changes to files like username.c and wb_client.c (smbd's
winbind client code) a lot of assumptions are made in a lot of places about
lp_winbind_seperator determining a users's status as a domain or local user.

The main change I will shortly be making is to investigate and kill off
winbind_initgroups() - as far as I know it was a workaround for an old bug in
winbind itself (and a bug in RH 5.2) and should no longer be relevent.

I am also going to move to using the 'winbind uid' and 'winbind gid' paramaters
to determine a user/groups's 'local' status, rather than the presence of the
seperator.

As such, this functionality is recommended for servers providing unix services,
but is currently less than optimal for windows clients.

(TODO: remove all references to lp_winbind_seperator() and
lp_winbind_use_default_domain() from smbd)

Andrew Bartlett
-
Tim Potter
aca0edc819 Made a debug look nicer. -
Andrew Tridgell
fb300e411b fixed a typo in the error map for WRONG_PASSWORD -
Jeremy Allison
0fcca6c627 Merged in %S fixes and XX_NOT_CHANGED fixes from 2.2.
Jeremy.
-
Jeremy Allison
16fcbf3c1c Fixup error mapping so we have only one table containing errno -> dos error -> NT STATUS
maps. Fixes problem with disk full returning incorrect error.
Jeremy.
-
Jeremy Allison
794c3e2c76 Added CIFS UNIX extension code to client.
Jeremy.
-
Tim Potter
cfac669017 Merge of name_status_find() debugs. -
Tim Potter
e69a22290e Removed fprintf(stderr, ...); calls which should not be present in library
functions.
-
Andrew Bartlett
80c2aefbe7 Many thanks to Alexander Bokovoy <a.bokovoy@sam-solutions.net>.
This work was sponsored by Optifacio Software Services, Inc.

Andrew Bartlett

(various e-mails announcements merged into some form of commit message below:)

This patch which adds basics of universal groups support
into Samba 3. Currently, only Winbind with RPC calls supports this, ADS
support requires additional (possibly huge) work on KRB5 PAC. However,
basic infrastructure is here.

This patch adds:

1. Storing of universal groups for particular user logged into Samba
software (smbd/ two winbind-pam methods) into netlogon_unigrp.tdb as array
of uint32 supplemental group rids keyed as DOMAIN_SID/USER_RID in tdb.

2. Fetching of unversal groups for given user rid and domain sid from
netlogon_unigrp.tdb.

Since this is used in both smbd and winbindd, main code is in
source/lib/netlogon_uingrp.c. Dependencies are added to AUTH_OBJ as
UNIGRP_OBJ and WINBINDD_OBJ as UNIGRP_OBJ.

This patch has had a few versions, the final version in particular:

Many thanks to Andrew Bartlett for critics and comments, and partly
rewritten code.

New:
- updated fetching code to changed byte order macros
- moved functions to proper namespace
- optimized memory usage by reusing caller's memory context
- enhanced code to more follow Samba coding rules

Todo:
- proper universal group expiration after timeout
-
Jeremy Allison
01ff6ce496 Same fix as went into 2.2 (I'm waiting for jerry to finish some code).
Jeremy.
-
Andrew Tridgell
0b0b937b58 fixed a crash bug in domain auth caused by an uninitialised nt_status -
Andrew Tridgell
73a59170e6 cope with direct IP addresses in resolve_name() -
Andrew Bartlett
ab8ff85f03 Fix up 'net ads join' to delete and rejoin if the account already exists.
This fixes up a problem where a machine would join (or downgrade by trust
password change) to NT4 membership and not be able to regain full ADS
membership until a 'net ads leave'.

Andrew Bartlett
-
Andrew Tridgell
12021a8de6 make sure resolve_name() only returns valid IP addresses
this is actually a workaround for old broken nmbd daemons, especially
from Samba 2.0
-
Tim Potter
08d2bcef1a Merge from appliance-head:
- put in some level 10 debugs so we can see what internal_resolve_name()
   is doing

 - remove duplicates from returned ip list of internal_resolve_name()
-
Tim Potter
7bfd1f35e4 Converted getprinterdriver to WERROR - it always returns dos error 6
(invalid handle) though.  )-:
-
Tim Potter
9d9e7fb74d Converted enumprinters and enumports cli functions to return WERRORs.
Make the offered and needed buffer size into parameters.
-
Tim Potter
6c42bf2089 Check for winbind separator in user name for cli_session_setup()
Patch from Alexander Bokovoy <a.bokovoy@sam-solutions.net>
-
Tim Potter
248d114f85 spoolss rpc client cleanup:
- converted OpenPrinterEx and ClosePrinter to WERROR instead of NT_STATUS
 - doc
-
Tim Potter
87bc0a71ec Define a rpc_client doc group. -
Tim Potter
5c8f6be290 Minor doc cleanups. -
Tim Potter
f4535721d3 Added a get_dos_error_msg() function to mirror the get_nt_error_msg()
One day I'll get around to refactoring the DOS error handling so it mirrors
the NT error handling code.
-
Tim Potter
9c968fbb01 DOS error 31 is ERRgeneral, General Failure. This is the WERROR equivalent
to NT_STATUS_UNSUCCESSFUL according to AB's funky new error map.
-
Andrew Tridgell
c6affae4bf fixed another DATA_BLOB constructor -
Andrew Tridgell
08bb2dfec2 simple fix for creating blank data blobs -
Andrew Bartlett
323dd422bd Add a comment on how this error map was derrived.
This applies only to the NT->Dos map, I'm still trying to come up with a way to
do the reverse.
-
Andrew Bartlett
b2af4372b1 Add a touch of const -
Andrew Bartlett
a855dfb2e0 Update the NT_STATUS -> DOS error table.
This new table is rather different to the old one (see diff posted to the
list for a sorted list of differences) and needs a *lot* of testing.

It does however seem to line up much better with what NT is using, as
exampled by the change to the OBJECT_NAME_COLLISION DOS error, it now matches
win2k where it didn't before.

I can't see any critical errors we now get wrong, and I know that the auth
errors are correct as per my on-the-wire observations.

This table was produced (and I hope to comment this better later) by
using the ERRMAPEXTRACT smbtorture tool, a Win2k domain member and the
'name_to_ntstatus' auth module on the HEAD PDC.  This module returned
the username as the error, and the NT box was forced to give me a dos
error becouse thats all I negotiated on that connection.  Hence the map.

Andrew Bartlett
-
Tim Potter
fe1fb6589a Initialise result on success in cli_spoolss_enum_printers() so we don't get
stuck in an infinite loop.
-
Tim Potter
6c950db05a The werror<->nt status code map has changed and has broken all the spoolss
commands in rpcclient.  Replacing ERROR_INSUFFICIENT_BUFFER with
NT_STATUS_BUFFER_TOO_SMALL fixes it.  Yay!

I always thought the caller (i.e cmd_spoolss.c) should take care of the
whole requested/needed buffer size thingy though...
-
Andrew Bartlett
024843a2ce This brings the NT->DOS error mapping into better line with what NT does.
I'll post the changes to the actual map to the list for comment, but this fixes
the 'unknown' case.

Andrew Bartlett
-
Andrew Bartlett
f0089b089b Add a function to convert 'NT_STATUS...' strings back into their actual error
code.

Andrew Bartlett
-
Andrew Bartlett
fe9d777915 Add a specialised version of tpot's libsmb samlogon code for use with
presupplied challange-response pairs, and only using the 'network' version.

This will be used to move the auth subsystem over to a libsmb (rather than
rpc_client) base.

Andrew Bartlett
-
Andrew Bartlett
2d1612dd35 Ensure the output cli can't have spurious values if the connection fails... -
Andrew Bartlett
45042bef7c Fix up the comment in the copyright header -
Simo Sorce
49f5cb7a3d util_sid.c - respect a const variabile (addedd strdup)
cli_reg.c  - indentation
pdb_ldap.c - some checks on init fns parameters
pdb_tdb.c  - some checks on init fns parameters + make sure we close the db on failure
-
Andrew Bartlett
79031b68ce Finish idra's cleanup of the RPC remote shutdown code. -
Andrew Tridgell
20368455ea - handle kerberos session setup reply with broken null termination
- don't display Domain=[] for auth protocols that don't give us a domain
-
Andrew Tridgell
1da988456d try to handle end of packet for not null terminated domain strings -
Andrew Tridgell
adf44a9bd0 added trusted realm support to ADS authentication
the method used for checking if a domain is a trusted domain is very
crude, we should really call a backend fn of some sort. For now I'm
using winbindd to do the dirty work.
-