1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-28 17:47:29 +03:00

41 Commits

Author SHA1 Message Date
Martin Pool
fe449328b2 Check return code from string_to_sid. -
Andrew Bartlett
122cf648d7 Add some more const :-)
This also makes it a easier to see which paramaters are 'in', and which are
'out'.

Andrew Bartlett
-
Simo Sorce
897e64d2e0 more debug classess activated -
Andrew Bartlett
e2a76a7fc9 Remove "sids.h" as it really wasn't being used anywhere, and was exporting
the (now static) global_sam_sid.

The only place it was being used was to return global_sid_NULL to some
uid->sid functions - and I'm not convinced this is correct in any case.

Andrew Bartlett
-
Simo Sorce
ae5d24873a debug classized -
Tim Potter
6a58c9bd06 Removed version number from file header.
Changed "SMB/Netbios" to "SMB/CIFS" in file header.
-
Andrew Bartlett
f1d8d50976 Some more 'winbind default domain' support patches from Alexander Bokovoy
<a.bokovoy@sam-solutions.net>.

This patch is designed to remove the 'special cases' required for this support.

In particular this now kills off winbind_initgroups, as it appears no longer to
be required.

Andrew Bartlett
-
Andrew Bartlett
ce1b4d4c30 Change the winbind interface to use seperate 'domain' and 'username' feilds for
the sid->uid and uid->sid conversions.

Remove some duplicate arguments from these funcitons, and update the
request/response structures for this and the 'winbind domain name' feature.

As such 'winbindd_lookup_name' now takes both a domain and username.
-
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
-
Andrew Tridgell
7db718d44a make sure we find NSS_STATUS struct -
Jeremy Allison
9563de2ef8 Fixed parse_domain_user to be bool.
Jeremy.
-
Andrew Tridgell
816e40a51a added name_to_sid to the backend -
Jeremy Allison
86b7cf7f85 Fix winbind client code so that winbind calls are not made if the
requested name does not have a winbind separator character. This
makes the intent explicit. Tim, contact me if this is not what
you indended.
Jeremy.
-
Andrew Bartlett
c95f5aeb93 This commit is number 4 of 4.
In particular this commit focuses on:

Actually adding the 'const' to the passdb interface, and the flow-on changes.

Also kill off the 'disp_info' stuff, as its no longer used.

While these changes have been mildly tested, and are pretty small, any
assistance in this is appreciated.

----

These changes introduces a large dose of 'const' to the Samba tree.
There are a number of good reasons to do this:

	- I want to allow the SAM_ACCOUNT structure to move from wasteful
	pstrings and fstrings to  allocated strings.  We can't do that if
	people are modifying these outputs, as they may well make
	assumptions about getting pstrings and fstrings

	- I want --with-pam_smbpass to compile with a slightly sane
	volume of warnings, currently its  pretty bad, even in 2.2
	where is compiles at all.

	- Tridge assures me that he no longer opposes 'const religion'
	based on the ability to  #define const the problem away.

	- Changed Get_Pwnam(x,y) into two variants (so that the const
	parameter can work correctly): - Get_Pwnam(const x) and
	Get_Pwnam_Modify(x).

	- Reworked smbd/chgpasswd.c to work with these mods, passing
	around a 'struct passwd' rather  than the modified username

---

This finishes this line of commits off, your tree should now compile again :-)

Andrew Bartlett
-
Simo Sorce
03dc67788f move to SAFE_FREE() -
Herb Lewis
0768991d04 get rid of compiler warnings -
Jeremy Allison
b4fa49fe13 More Realloc fixes.
Jeremy.
-
Tim Potter
73addddb2e Fixed up 'orrible formatting. -
Simo Sorce
fa8e55b8b4 this is a big global fix for the ptr = Realloc(ptr, size) bug.
many possible mem leaks, and segfaults fixed.

someone should port this fix to 2.2 also.
-
Andrew Tridgell
c2c1f2027e the nss and pam modules in winbind don't have strchr_m() yet, so use
strchr() for the moment
-
Andrew Tridgell
c41fc06376 strchr and strrchr are macros when compiling with optimisation in gcc, so we can't redefine them. damn. -
Tim Potter
9a77f8530f Fixed bug in winbind_sid_to_gid() function. -
Tim Potter
369c911b44 Indent dodgy function prototype to avoid make proto picking it up and
causing mayhem throughout the tree.
-
Tim Potter
086f332bb1 More compile fixups for winbind portability. -
Tim Potter
59f95416b6 Preliminary merge of winbind into HEAD. Note that this compiles and links
but I haven't actually run it yet so it probably doesn't work.  (-:
-
Jeremy Allison
80c18d8849 Fix for crash when doing name lookup with a quoted string. Part of
lookup_name was expecting to be able to write to the string. Changed
lookup_name to use const.
Jeremy.
-
David O'Neill
59229b9025 Changes from APPLIANCE_HEAD:
source/rpc_parse/parse_lsa.c
        - off by one unistr length bug in init_lsa_trans_name()

    source/lib/util_sid.c
        - resolve more BUILTIN sid values to names.

    source/nsswitch/wb_client.c
        - fix typo in debug message
        - set errno on error so we don't get bogus value from last failure.

    source/rpc_server/srv_spoolss_nt.c
        - add debug to track number of open printer handles for ease of
          tracking handle leaks in the future.

    source/rpc_server/srv_lsa.c
        - fix off-by-one string bug.  This was preventing NT from
          displaying names for well-know SIDs in printer permissions
          dialog.
-
David O'Neill
1dba9c5cd1 Changes from APPLIANCE_HEAD:
source/Makefile.in
        - changes to ctags and etags rules that somehow got lost along the way.

    source/include/proto.h
        - make proto

    source/smbd/sec_ctx.c
    source/smbd/password.c
        - merge debugs for debugging user groups and NT token stuff.

    source/lib/util_str.c
        - capitalise domain name returned from parse_domain_user()

    source/nsswitch/wb_client.c
        - fix broken conditional in debug statement.

    source/include/rpc_secdes.h
    source/include/rpc_spoolss.h
    source/printing/nt_printing.c
    source/lib/util_seaccess.c
        - fix printer permission bugs related to ACE masks for printers.
          This adds mapping of generic access rights to object specific
          rights for NT printers.  Still need to work out whether or not to
          ignore ACEs with certain flags set, though. See comments in
          util_seaccess.c:check_ace() for details.

    source/printing/nt_printing.c
    source/printing/printing.c
        - use PRINTER_ACCESS_ADMINISTER instead of JOB_ACCESS_ADMINISTER
          until we sort out printer/printjob permission stuff.
-
Jeremy Allison
0fc1a46150 Fix for uidtoname not returning DOMAIN\name but just name. This caused
printer_access_check to break in a domain environment.
Jeremy.
-
Jeremy Allison
5b0038a2af Fix to allow smbd to call winbindd if it is running for all group enumeration,
falling back to the UNIX calls on error. This should fix all problems with
smbd enumerating all users in all groups in all trusted domains via winbindd.
Also changed GETDC to query 1C name rather than 1b name as only the PDC
registers 1b.
Jeremy.
-
Jeremy Allison
c7c90c8337 Use sys_setgroups - systems with broken getgroups need this.
Jeremy.
-
Tim Potter
5f3cf2eb78 Renamed WINBINDD_INITGROUPS constant to WINBINDD_GETGROUPS. -
Tim Potter
e87b2d3d1f Modified initgroups to provide a get groups a user is a member of
functionality.  This is much faster than inverting the group database.

Added client side command for this to wbinfo.
-
Jeremy Allison
6696bf203c Added debug so we can see how winbindd converts SIDS.
Jeremy.
-
Tim Potter
178e697100 Spelling flames. (-: -
Tim Potter
ec7f7e350d Fixed compiler warnings. -
Jeremy Allison
8317d70a35 Fix from John Reilly @ HP for my typo with the parameters being reversed. Ooops.
Jeremy.
-
Jeremy Allison
81c5380f91 Added code to do SID to uid/gid conversion. Needed for ACL support.
Jeremy.
-
Jeremy Allison
5e5cc6efe2 Started to canonicalize our handling of uid -> sid code in order to
get ready and fix se_access_check().
Added cannonical lookup_name(), lookup_sid(), uid_to_sid(), gid_to_sid()
functions that look via winbind first the fall back on local lookup.

All Samba should use these rather than trying to call winbindd code
directly.

Added NT_USER_TOKEN struct in user_struct, contains list of NT sids
associated with this user.

se_access_check() should use this (cached) value rather than attempting
to do the same thing itself when given a uid/gid pair.

More work needs to be done to preserve these things accross security
context changes (especially with the tricky pipe problem) but I'm
beginning to see how this will be done..... probably by registering
a new vuid for an authenticated RPC pipe and not treating the
pipe calls specially.

More thoughts needed - but we're almost there...

Jeremy.
-
Jeremy Allison
d85deb9e4e Add local fallback for name lookup if no winbindd running...
Jeremy.
-
Tim Potter
f866c18f6b Moved winbind client functions from various odd locations to
nsswitch/wb_client.c

Merge of nsswitch/common.c rename to nsswitch/wb_common.c from TNG.
-