Andrew Tridgell [Sun, 13 Jan 2002 11:46:04 +0000 (11:46 +0000)]
don't try to allocate zero bytes
Andrew Bartlett [Sun, 13 Jan 2002 11:13:54 +0000 (11:13 +0000)]
I'm doing some things towards the NamedPipes game with lckl and he has asked me
to move this from being a static to matching its mate in lib/util_sock.c.
In any case, this should discorage anybody from using the 'wrong' version of
this function. (ie the one from TNG, which needs a bit more error checking
depending on use).
Andrew Bartlett
Andrew Bartlett [Sat, 12 Jan 2002 23:57:10 +0000 (23:57 +0000)]
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
Simo Sorce [Sat, 12 Jan 2002 23:12:13 +0000 (23:12 +0000)]
updates from 2.2
Jeremy Allison [Sat, 12 Jan 2002 02:37:54 +0000 (02:37 +0000)]
Added PRINTER_INFO_4/PRINTER_INFO_5, we're seeing level 5 requested on the wire... so.
Jeremy.
Andrew Bartlett [Sat, 12 Jan 2002 02:06:17 +0000 (02:06 +0000)]
Thanks to vance for spotting the missing Makefile.in commit.
This should make things a little happier...
Andrew Bartlett
Andrew Bartlett [Sat, 12 Jan 2002 01:55:09 +0000 (01:55 +0000)]
Move all the pdb_get...() and pdb_set...() functions to a new file.
This brings passdb.c down to a much more manageable ~1100 lines and makes it a
little easier to comprehend whats going on here.
Andrew Bartlett
Jeremy Allison [Sat, 12 Jan 2002 00:50:01 +0000 (00:50 +0000)]
Added the O_NOFOLLOW flag if follow symlinks is set off.
Jeremy.
Jeremy Allison [Fri, 11 Jan 2002 23:33:12 +0000 (23:33 +0000)]
Round and round we go....
Jeremy.
Jeremy Allison [Fri, 11 Jan 2002 21:52:46 +0000 (21:52 +0000)]
Latest attempt at changeid.
Jeremy.
Jeremy Allison [Fri, 11 Jan 2002 19:10:25 +0000 (19:10 +0000)]
Same fix as went into 2.2 (I'm waiting for jerry to finish some code).
Jeremy.
Andrew Tridgell [Fri, 11 Jan 2002 13:14:28 +0000 (13:14 +0000)]
fixed a crash bug in domain auth caused by an uninitialised nt_status
Andrew Tridgell [Fri, 11 Jan 2002 11:26:31 +0000 (11:26 +0000)]
fixed a crash in merge_aces()
when we free curr_ace_outer we need to not try to use it again :)
Andrew Tridgell [Fri, 11 Jan 2002 10:05:34 +0000 (10:05 +0000)]
force the time difference in cache comparisons to be unsigned to cope
with the local machine time changing
Andrew Tridgell [Fri, 11 Jan 2002 10:02:28 +0000 (10:02 +0000)]
make the winbind sequence number code more robust
when switching from rpc to ADS this now should make sense
Andrew Tridgell [Fri, 11 Jan 2002 09:48:27 +0000 (09:48 +0000)]
cope with direct IP addresses in resolve_name()
Samba Release Account [Fri, 11 Jan 2002 08:48:49 +0000 (08:48 +0000)]
preparing for release of 3.0-alpha13
Andrew Bartlett [Fri, 11 Jan 2002 07:48:55 +0000 (07:48 +0000)]
Make this error match Win2k.
Andrew Bartlett [Fri, 11 Jan 2002 06:22:42 +0000 (06:22 +0000)]
The DC is meant to be sent the *unmapped* username...
Andrew Bartlett
Tim Potter [Fri, 11 Jan 2002 05:33:45 +0000 (05:33 +0000)]
Always query the PDC for the list of trusted domains rather than interating
the list received at startup or we get an out of date list. I thought
there might be some sequence number that is incremented when a trusted
domain is added or removed - perhaps there is but I just haven't found it
yet.
- Renamed get_domain_info() to init_domain_list()
- Made an accessor function to return the list of trusted domains rather
than using a global so we don't have to remember to put a magic init
function
- The getent state can not keep a pointer to a winbind_domain structure as
it may be freed if init_domain_list() is called again so we keep the
domain name instead
Andrew Bartlett [Fri, 11 Jan 2002 05:29:09 +0000 (05:29 +0000)]
Back out the crazy notion that the NTLMSSP flags actually mean anything...
Replace this with some flags that *we* define. We can do a mapping later
if we actually get some more reliable info about what passwords are actually
valid.
Andrew Bartlett
Tim Potter [Fri, 11 Jan 2002 05:14:52 +0000 (05:14 +0000)]
Correct4ed comment.
Andrew Bartlett [Fri, 11 Jan 2002 04:50:45 +0000 (04:50 +0000)]
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
Tim Potter [Fri, 11 Jan 2002 03:49:51 +0000 (03:49 +0000)]
Some memory leak fixes.
Gerald Carter [Fri, 11 Jan 2002 00:41:27 +0000 (00:41 +0000)]
commit some changes for ab, and keep working on the smbgroupedit
manpage.
Andrew Tridgell [Fri, 11 Jan 2002 00:23:29 +0000 (00:23 +0000)]
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 [Thu, 10 Jan 2002 23:45:29 +0000 (23:45 +0000)]
Since AB has been changing the winbind interface it's time to add the "mock
swedish" test to client calls. This is putting a length field at the
start of a request so we can disconnect clients talking with an out of date
libnss_winbind.so rather than deadlock them.
Misc cleanups:
- made some int values uint32
- moved WINBIND_INTERFACE_VERSION to start of cmd list
Herb Lewis [Thu, 10 Jan 2002 19:40:40 +0000 (19:40 +0000)]
added structure members referred to by recent changes in vfs-wrap.c
Herb Lewis [Thu, 10 Jan 2002 18:49:37 +0000 (18:49 +0000)]
merge tpots name changes into IRIX part of code. When you change the name
of a define you need to grep for the old name and change ALL places.
Andrew Bartlett [Thu, 10 Jan 2002 12:32:59 +0000 (12:32 +0000)]
Take a stab at keeping the doco current :-)
Andrew Bartlett [Thu, 10 Jan 2002 11:28:14 +0000 (11:28 +0000)]
Return the winbind separator over the socket, so programs don't have to parse
smb.conf to get it right.
While wb_client needs its lp_load() for samba dependency reasons, it now uses
the new method both to example and test the new code.
Also add an interface version function, and return the winbind's samba version
string.
In preperation for default domains, its now up to winbindd to reject plaintext
auths that don't have a seperator, but NTLM (CRAP) auths now have two feilds,
hence need parsing.
Andrew Bartlett
Andrew Bartlett [Thu, 10 Jan 2002 10:23:54 +0000 (10:23 +0000)]
This changes the winbind protcol a bit:
It adds a 'ping' request, just to check winbind is in fact alive
It also changes winbindd_pam_auth_crap to take usernames and domain seperatly.
(backward incompatible change, needs merge to 2.2, but this is not yet released
code, so no workarounds)
Finally, it adds some debugs and fixes a few memory leaks (uses talloc to do
it).
Andrew Bartlett
Martin Pool [Thu, 10 Jan 2002 06:32:01 +0000 (06:32 +0000)]
Quieten warning about uninitialized variable.
Tim Potter [Thu, 10 Jan 2002 06:20:03 +0000 (06:20 +0000)]
A big tidyup while thinking about getting trusted domains being re-read
when they are added or removed on the PDC.
- renamed GETPWNAM_FROM_{UID,USER} constants and functions to GETPW{NAM,UID}
- renamed GETGRNAM_FROM_{GID,GROUP} constants and functions to GETGR{NAM,GID}
- use SIGUSR2 in winbindd for debugging/logging instead of SIGUSR1 in
preparation for moving to smbcontrol type messages (not sure whether to
ditch this altogether or not)
- tidy debugging messages in top level winbind user and group routines
- convert talloc_init() to talloc_init_named()
- make enumerations of the domain list use the same local variable names
Tim Potter [Thu, 10 Jan 2002 06:05:37 +0000 (06:05 +0000)]
Spelling fix.
Martin Pool [Thu, 10 Jan 2002 03:53:06 +0000 (03:53 +0000)]
browse_fn: FIXME: If the remote machine returns non-ascii characters
in any of these fields, they can corrupt the output. We
should remove them.
Jeremy Allison [Thu, 10 Jan 2002 02:41:15 +0000 (02:41 +0000)]
First part of UNIX extensions (#ifdefed out) more to follow.
Jeremy.
Jeremy Allison [Thu, 10 Jan 2002 02:18:08 +0000 (02:18 +0000)]
Oh joy - the original code didn't do mapping of the perms onto the wire.
Make it up as we go along... :-).
Jeremy.
Jeremy Allison [Thu, 10 Jan 2002 01:49:22 +0000 (01:49 +0000)]
Ensure this is committed last.
Jeremy.
Jeremy Allison [Thu, 10 Jan 2002 01:49:09 +0000 (01:49 +0000)]
We need to test for major/minor macros.
Jeremy.
Tim Potter [Thu, 10 Jan 2002 01:32:57 +0000 (01:32 +0000)]
Although configure.in and configure were checked in at the same time
I think configure.in just beat it to the repository so the timestamp of
configure.in is newer than configure. )-:
Jeremy Allison [Thu, 10 Jan 2002 00:28:09 +0000 (00:28 +0000)]
Getting ready to add UNIX extensions in HEAD also.
Jeremy
Jeremy Allison [Wed, 9 Jan 2002 21:30:37 +0000 (21:30 +0000)]
Added tests for st_blocks in struct stat, and added a (hateful) constant
the specifies the units that st_blocks is in. The reason for this is
that HPUX uses 8k, AIX uses a #defined constant and everyone else (tm)
uses 512 byte units.
Needed for the CIFS UNIX extensions - coming to a Samba server near
you soon.... :-).
Jeremy.
Jeremy Allison [Wed, 9 Jan 2002 20:48:18 +0000 (20:48 +0000)]
Fixed typo.
Jeremy.
Jeremy Allison [Wed, 9 Jan 2002 18:26:39 +0000 (18:26 +0000)]
Move SAFE_FREE into tdb.c to stop exporting it into tdb.h namespace.
Jeremy.
Martin Pool [Wed, 9 Jan 2002 08:27:15 +0000 (08:27 +0000)]
Add two more memory-debug smbcontrol messages: these ones should
prompt dmalloc to log information about what happening, so you can see
in flight why smbd is getting bloated.
Martin Pool [Wed, 9 Jan 2002 08:17:12 +0000 (08:17 +0000)]
FIXME: At the moment, if the user should happen to give the options
ahead of the service name (in standard Unix fashion) then smbclient
just spits out the usage message with no explanation of what in
particular was wrong. Is there any reason we can't just parse out the
service name and password after running getopt??
Martin Pool [Wed, 9 Jan 2002 07:52:51 +0000 (07:52 +0000)]
Better explanation message for dmalloc.
Also more insertion of parenthesis to handle struct members called
'free'.
You can now get useful dmalloc output, as long as it is compatible
with your C library. On RH7.1 it looks like you have to rebuild
dmalloc to allow free(0) by default, because something in libcrypt
does that. (sigh)
Martin Pool [Wed, 9 Jan 2002 06:38:22 +0000 (06:38 +0000)]
With --enable-dmalloc, also use dmalloc's wrappers around routines
like strcat
Martin Pool [Wed, 9 Jan 2002 06:35:45 +0000 (06:35 +0000)]
Sample configuration for dmalloc.
Martin Pool [Wed, 9 Jan 2002 05:27:59 +0000 (05:27 +0000)]
Add UNUSED(paramname) macro to be used in parameter lists, to quieten
gcc warnings about unused parameters.
Martin Pool [Wed, 9 Jan 2002 05:27:27 +0000 (05:27 +0000)]
Add UNUSED(paramname) macro to be used in parameter lists, to quieten
gcc warnings about unused parameters.
msg_pool_usage: assert msg_type is as expected.
Jeremy Allison [Wed, 9 Jan 2002 05:24:07 +0000 (05:24 +0000)]
When re-writing tdb version numbers as little endian int32, we must
change the version number also.
Jeremy.
Martin Pool [Wed, 9 Jan 2002 05:10:47 +0000 (05:10 +0000)]
Fix macro name controlling inclusion of DMALLOC.
Martin Pool [Wed, 9 Jan 2002 05:09:44 +0000 (05:09 +0000)]
Add harmless parentheses so that dmalloc doesn't get confused by a
variable called 'free'.
Tim Potter [Wed, 9 Jan 2002 04:26:41 +0000 (04:26 +0000)]
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 [Wed, 9 Jan 2002 04:17:24 +0000 (04:17 +0000)]
For hysterical raisins you must use string_set() to set the value of a
string in the loadparam Globals struct. Using pstrcpy was causing every
NULL string was being set to the name of the winbindd log file. (-:
Jeremy Allison [Wed, 9 Jan 2002 04:13:30 +0000 (04:13 +0000)]
Fixed all uses of tdb_fetch/store/_int to use explicit int32 little endian
in tdb's. All except winbindd_idmap.... Hmmmmmm.
Jeremy.
Jeremy Allison [Wed, 9 Jan 2002 03:38:31 +0000 (03:38 +0000)]
HPUX nss fix.
Jeremy.
Jeremy Allison [Wed, 9 Jan 2002 02:35:08 +0000 (02:35 +0000)]
Fixed up atomic update code.
Jeremy.
Jeremy Allison [Wed, 9 Jan 2002 01:53:19 +0000 (01:53 +0000)]
Added int32 version of "atomic" update.
Jeremy.
Jeremy Allison [Wed, 9 Jan 2002 01:32:17 +0000 (01:32 +0000)]
Added int32 versions of the endian-dependent code.
Jeremy.
Jeremy Allison [Tue, 8 Jan 2002 23:50:14 +0000 (23:50 +0000)]
My previous fix had a bug....
This is SO NASTY as some drivers need this to change, others need it
static. This value will change every second, and I must hope that this
is enough..... DON'T CHANGE THIS CODE WITHOUT A TEST MATRIX THE SIZE OF
UTAH !
Jeremy.
Gerald Carter [Tue, 8 Jan 2002 22:53:58 +0000 (22:53 +0000)]
I think I've finally gotten this straighten out in my tree.
All should be curent now.
Gerald Carter [Tue, 8 Jan 2002 22:49:28 +0000 (22:49 +0000)]
i **really** hate stuck tags in CVS :-( Figured out why
my files were not being checked in sometimes.....
cvs update -A
cleared all the sticky tages and now I have to recheck some things in.
j-
Jeremy Allison [Tue, 8 Jan 2002 21:11:25 +0000 (21:11 +0000)]
Getting ready to add winbindd support for HPUX 11.
Jeremy.
Gerald Carter [Tue, 8 Jan 2002 17:55:41 +0000 (17:55 +0000)]
entering placeholders for forthcoming documentation
Jeremy Allison [Tue, 8 Jan 2002 05:39:27 +0000 (05:39 +0000)]
Another attempt at getting changeid correct. Jerry / JF please check !
This fixes a driver init bug.
Jeremy.
Andrew Tridgell [Tue, 8 Jan 2002 04:44:15 +0000 (04:44 +0000)]
- fixed my breakage of CPPFLAGS
- allow winbindd and wbinfo to build without shared libraries
Jeremy Allison [Tue, 8 Jan 2002 01:22:23 +0000 (01:22 +0000)]
Caught one problem where a BOOL fn was returning 3 different values :-).
Roll on defined types :-).
Jeremy.
Jeremy Allison [Tue, 8 Jan 2002 00:52:36 +0000 (00:52 +0000)]
Debugs that print out a share mode table in debug level 10. This code
enabled me to track down a *nasty* bug.
Jeremy.
Jeremy Allison [Tue, 8 Jan 2002 00:46:56 +0000 (00:46 +0000)]
Added get_called_name() function, which replaces global_myname in printing
code (one less global, hurrah !) - to allow NetBIOS aliasing to be used
with point and print.
Jeremy.
Jeremy Allison [Mon, 7 Jan 2002 22:58:20 +0000 (22:58 +0000)]
Return called NetBIOS name if present in preference to global_myname.
Should allow print servers to work with NetBIOS aliases.
Needs testing.
Jeremy.
Herb Lewis [Mon, 7 Jan 2002 21:32:22 +0000 (21:32 +0000)]
merge changes from 2.2 branch to prevent smb.conf from changing debug level
of commands when specified on command line.
Gerald Carter [Mon, 7 Jan 2002 14:17:49 +0000 (14:17 +0000)]
sync getopt() args with 2.2
Andrew Tridgell [Mon, 7 Jan 2002 11:42:12 +0000 (11:42 +0000)]
- use CFLAGS when linking shared libs (for things like -64 on irix)
- don't attempt to build winbindd if we can't do shared libs
Tim Potter [Mon, 7 Jan 2002 06:13:40 +0000 (06:13 +0000)]
Sed error. The status value in the PRINTER_INFO_2 structure isn't a WERROR
but a plain old uint32.
Tim Potter [Mon, 7 Jan 2002 03:33:46 +0000 (03:33 +0000)]
Converted getprinterdriver to WERROR - it always returns dos error 6
(invalid handle) though. )-:
Tim Potter [Mon, 7 Jan 2002 02:58:31 +0000 (02:58 +0000)]
Spelling fix.
Tim Potter [Mon, 7 Jan 2002 02:57:06 +0000 (02:57 +0000)]
Don't log the password in pam_sm_authenticate() unless DEBUG_PASSWORD is
defined. This is done with --enable-developer mode.
Gerald Carter [Sun, 6 Jan 2002 23:21:23 +0000 (23:21 +0000)]
sync up comments with 2.2
Tim Potter [Sun, 6 Jan 2002 09:03:48 +0000 (09:03 +0000)]
Converted enumprinters and enumports cmd functions to use WERROR
values returned from cli functions. They are converted to NTSTATUS codes
using the error map functions.
Do buffer size loop checks by setting offered = 0 and using the return
value of needed in the next call.
Tim Potter [Sun, 6 Jan 2002 09:02:14 +0000 (09:02 +0000)]
Converted enumprinters and enumports cli functions to return WERRORs.
Make the offered and needed buffer size into parameters.
Tim Potter [Sun, 6 Jan 2002 04:03:26 +0000 (04:03 +0000)]
Check for winbind separator in user name for cli_session_setup()
Patch from Alexander Bokovoy <a.bokovoy@sam-solutions.net>
Tim Potter [Sun, 6 Jan 2002 03:54:40 +0000 (03:54 +0000)]
spoolss rpc client cleanup:
- converted OpenPrinterEx and ClosePrinter to WERROR instead of NT_STATUS
- doc
Tim Potter [Sun, 6 Jan 2002 03:49:28 +0000 (03:49 +0000)]
Define a rpc_client doc group.
Tim Potter [Sun, 6 Jan 2002 03:48:41 +0000 (03:48 +0000)]
Minor doc cleanups.
Tim Potter [Sun, 6 Jan 2002 03:41:29 +0000 (03:41 +0000)]
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 [Sun, 6 Jan 2002 03:24:51 +0000 (03:24 +0000)]
Display nicer message when server name could not be resolved.
Tim Potter [Sun, 6 Jan 2002 02:55:37 +0000 (02:55 +0000)]
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 Bartlett [Sun, 6 Jan 2002 01:37:14 +0000 (01:37 +0000)]
Get this code back to where it belongs...
Apparently (and I will doublecheck) its legal to do an annoymous session setup
when we negoitiated SPNEGO, but we can't do an authenticated one becouse we
didn't give a challange.
Andrew Bartlett
Andrew Bartlett [Sun, 6 Jan 2002 00:49:23 +0000 (00:49 +0000)]
Some more SPNEGO fixes.
Andrew Tridgell [Sat, 5 Jan 2002 23:34:06 +0000 (23:34 +0000)]
fixed another DATA_BLOB constructor
Andrew Tridgell [Sat, 5 Jan 2002 23:30:59 +0000 (23:30 +0000)]
simple fix for creating blank data blobs
Gerald Carter [Sat, 5 Jan 2002 19:27:26 +0000 (19:27 +0000)]
merge from 2.2
Andrew Bartlett [Sat, 5 Jan 2002 12:04:33 +0000 (12:04 +0000)]
Fix up the SPNEGO segfault.
Gerald Carter [Sat, 5 Jan 2002 06:11:29 +0000 (06:11 +0000)]
yeah! I think I figured it out now
Andrew Bartlett [Sat, 5 Jan 2002 04:55:41 +0000 (04:55 +0000)]
I've decided to move the auth code around a bit more...
The auth_authsupplied_info typedef is now just a plain struct - auth_context,
but it has been modified to contain the function pointers to the rest
of the auth subsystem's components.
(Who needs non-static functions anyway?)
In working all this mess out, I fixed a number of memory leaks and moved the
entire auth subsystem over to talloc().
Note that the TALLOC_CTX attached to the auth_context can be rather long-lived,
it is provided for things that are intended to live as long. (The
global_negprot_auth_context lasts the whole life of the smbd).
I've also adjusted a few things in auth_domain.c, mainly passing the domain as
a paramater to a few functions instead of looking up lp_workgroup(). I'm
hopign to make this entire thing a bit more trusted domains (as PDC) freindly
in the near future.
Other than that, I moved a bit of the code around, hence the rather messy diff.
Andrew Bartlett
Andrew Bartlett [Sat, 5 Jan 2002 04:23:12 +0000 (04:23 +0000)]
Add a talloc varient of the data_blob functions.
Also change the structure so it has its own (optional) 'free' pointer - so we
don't free() a talloc'ed version.
also split out the data_blob_clear() functionaility.
Andrew Bartlett
Andrew Bartlett [Sat, 5 Jan 2002 04:04:03 +0000 (04:04 +0000)]
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.