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

6975 Commits

Author SHA1 Message Date
Andrew Tridgell
b48750fba6 this fixes the problem of not being able to add a SD to a file on a
non-domain Samba server from a NT4 client.

Note that this exactly reverses a change by Jeremy on the 18th of
December 2001, reverting the code back to what JF originally wrote. I
have looked carefully with a sniffer and JFs original NULL sid is
correct (ie. it matches what NT4 does) and also fixes the problem.

Sending a blank sid (which is what jeremy's patch did) causes NT4 to
give a classic "parameter is incorrect error" and prevents the
addition of new ACLs.
(This used to be commit 9930cf9733)
2002-01-31 09:37:26 +00:00
Samba Release Account
3e5fe964f9 preparing for release of 3.0-alpha14
(This used to be commit 6f977036ad)
2002-01-30 12:12:16 +00:00
Andrew Bartlett
03a2391417 Back out herb's changes (to allow smbpasswd -x to work on accounts outside
/etc/passwd) and replace them with a version that works.  Unfortunetly HEAD and
2.2 have different passdb interfaces and different local_password_change
functions...

Andrew Bartlett
(This used to be commit 86d5326d0d)
2002-01-30 12:06:22 +00:00
Andrew Bartlett
c08186b947 An attempt at producing the correct Makefile magic for wrepld_proto.h to be
automatically generated on first 'make'.  This wasn't being picked up by the
build farm becouse of the explicit 'make proto'.

The 'make proto' bit isn't somthing our alpha testers know about (its certainly
not clearly documented) and its meant to be automatic.

I hope this works...

Andrew Bartlett
(This used to be commit 3a413ef1ea)
2002-01-30 10:50:07 +00:00
Tim Potter
a7737cd93e Addd wrepld (what a cool name!)
(This used to be commit ab049355af)
2002-01-30 06:10:09 +00:00
Tim Potter
98bd072ec0 Added wrepld_proto.h
(This used to be commit 1b9b4e46d2)
2002-01-30 06:09:48 +00:00
Tim Potter
cd68afe312 Removed version number from file header.
Changed "SMB/Netbios" to "SMB/CIFS" in file header.
(This used to be commit 6a58c9bd06)
2002-01-30 06:08:46 +00:00
Tim Potter
d248006357 Unused file.
(This used to be commit 78013c0ecc)
2002-01-30 05:49:20 +00:00
Gerald Carter
c3b9cc08e8 merge from 2.2
(This used to be commit 69a9c005c2)
2002-01-30 05:45:09 +00:00
Herb Lewis
967af63a5f merge change from @_2 to allow smbpasswd -x to delete user even if no
entry in /etc/passwd.

There are still differences in the local_password_change function. I'm
not sure which was the latest so I didn't change any thing else. Someone
needs to take a look and sync these up.
(This used to be commit 539b025397)
2002-01-30 04:07:42 +00:00
Tim Potter
62ea16ae36 Fix for password change from Samuel Ziegler <sam@xpedion.com>
(This used to be commit 418bdd5919)
2002-01-30 03:23:40 +00:00
Tim Potter
4b9839c58a Removed silly fprintf(stderr, ...) debug.
Part of Samuel Ziegler's patch to get winbind password changing working
again in HEAD.
(This used to be commit b5540bee7b)
2002-01-30 03:14:20 +00:00
Martin Pool
8f5fa6871f Doc.
(This used to be commit 91e8cb7662)
2002-01-29 05:34:16 +00:00
Jeremy Allison
15f2c69c4f Fix "strict allocate" to write the data out on ftruncate with extend.
Jeremy.
(This used to be commit 48fc42c710)
2002-01-29 01:17:44 +00:00
Tim Potter
86aa1d20f9 Since we have dynamic initialisation in the group mapping code, make
init_group_mapping() a static function and don't call it from any client
programs.

Not sure whether I've made a bigger mess here or not...
(This used to be commit 3c887d9021)
2002-01-29 01:01:14 +00:00
Andrew Bartlett
7c822ae3ff Name another talloc.
(This used to be commit 9d62f25f5d)
2002-01-28 00:54:37 +00:00
Simo Sorce
c889c29d0d minor fix and checks
(This used to be commit a034bfb9ef)
2002-01-27 16:37:12 +00:00
Andrew Bartlett
7b671e34f5 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
(This used to be commit f1d8d50976)
2002-01-27 12:12:22 +00:00
Andrew Bartlett
184cc84ada Yes, dev is an 'input/output' paramater...
Andrew Bartlett
(This used to be commit 8cac618174)
2002-01-27 12:06:27 +00:00
Andrew Bartlett
de03bb6160 Patch from Kevin Stefanik <kstef@mtppi.org> to do some more error checking for
group mapping init failures.
(This used to be commit cd6a2dad4e)
2002-01-27 10:53:43 +00:00
Andrew Bartlett
26073c4aec Give pdbedit a -D paramater for setting the DEBUGLEVEL (makes debugging passdb
much saner :-).

Change to pdb_init_sam()/pdb_free_sam() loop rather than reset based due to
the talloc basis.

Andrew Bartlett
(This used to be commit e40a0a7f27)
2002-01-27 03:00:56 +00:00
Gerald Carter
485b4ff5ec merge from APPLIANCE_HEAD
(This used to be commit e3b87ffc8c)
2002-01-26 22:27:12 +00:00
Andrew Bartlett
59b17ff597 - Provide sid->name lookup support for non-unix accounts.
- Rework the name -> sid lookup function to always try local lookup first (for
local domain names) before trying winbind.  This seems to eliminate my winbind
feedback loop problems.  (I don't use winbind for nsswitch, where there are
almost certainly further issues).

Andrew Bartlett
(This used to be commit 25cadce67b)
2002-01-26 12:24:18 +00:00
Andrew Bartlett
ba8c1c6e45 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
(This used to be commit 5dfba2cf53)
2002-01-26 11:48:42 +00:00
Andrew Bartlett
670f46fd4c Bring this code into line with new winbind_lookup_name() interface. I think
this might need a bit more work - or at least documentation.

This is certainly a worthwile little hack, as it avoids the need to invert the
group database.  I don't think we should allow unqualified domains here - as
that allows us to distinguish between (at least some) usernames and these
'special' groups.
(This used to be commit 151dd7bc6c)
2002-01-26 10:10:25 +00:00
Andrew Bartlett
84ce7ec0a4 Make a talloc'ed copy of this strings so we can pass the right kind of pointer
to the function.  This fixes a nice little segfault the brute-force-casting
created. :-)

Andrew Bartlett
(This used to be commit c84fa7f5fd)
2002-01-26 10:06:23 +00:00
Andrew Bartlett
b1da5c0253 Rework lookup_name() to take seperate username/domain args, and to remove
varioius crazy 'if winbind didn't find it' cases.  This makes winbind default
domain support easier to intergrate with smbd.
(This used to be commit 3e71521957)
2002-01-26 10:05:10 +00:00
Andrew Bartlett
abd7df24dc Add the become_root()/unbecome_root() wrapper around the lookup_name() call,
and its new args.
(This used to be commit e7b3d64f60)
2002-01-26 10:03:25 +00:00
Andrew Bartlett
965f440983 Move the lsa code across to the changed args for lookup_name, and surround it
in become_root()/unbecome_root().

Also only allocate the memory the client reqests - and don't allow the client
to trigger an SMB_ASSERT if they ask for 'more'.

Up the maximum number of sids allowed, and note that this is an arbiary guess,
and can be raised without consequence.

Andrew Bartlett
(This used to be commit 6e7667125d)
2002-01-26 10:02:23 +00:00
Andrew Bartlett
33cf9ba4b7 We may as well not use these temporary variables - they are only used once and
just make it harder to debug (gcc stips optomises them away).
(This used to be commit 100d2705dd)
2002-01-26 09:58:11 +00:00
Andrew Bartlett
61b20e5ee6 local_lookup_name() doens't acutally use its 'domain' argument, so drop it and
make its use clearer.
(This used to be commit d1ea20cc23)
2002-01-26 09:56:47 +00:00
Andrew Bartlett
06c79a1757 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.
(This used to be commit ce1b4d4c30)
2002-01-26 09:55:38 +00:00
Andrew Bartlett
4691c931e8 Allow a winbind client to obtain the server's domain name.
(This used to be commit 85018fecfa)
2002-01-26 09:52:55 +00:00
Andrew Bartlett
88ed747e29 Remove the 'direct to winbind' hacks, as they should (if I understand
correctly) be no longer needed.  This is in aid of the 'winbind default domain'
code - which works much better when smbd always goes via the standard unix
interfaces.

Andrew Bartlett
(This used to be commit a41fe2f6c8)
2002-01-26 09:50:28 +00:00
Andrew Bartlett
7547398c97 This always points at a string literal, so it probably should be 'const'.
(This used to be commit e72e511935)
2002-01-26 06:28:50 +00:00
Andrew Bartlett
714cdd47cb 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
(This used to be commit 554842e0a5)
2002-01-26 06:24:53 +00:00
Andrew Bartlett
806991158e fix typo
(This used to be commit 8ffc024ebc)
2002-01-26 06:18:59 +00:00
Andrew Bartlett
306ee55f91 The new plugable password backend system needs to be initialised after
lp_load().

Andrew Bartlett
(This used to be commit 168c712bf3)
2002-01-26 06:16:36 +00:00
Andrew Bartlett
a7b5354078 These changes commited on a 'no less broken' basis.
The previous code attempted to call winbind to find out the domain sid.  This
couldn't work for a number of reasons - not the least of which was that both
the client and server ends would reject any name (in this case domain name)
without a \ in it (or lp_winbind_seperator()).

I think this is what was intended to occour.  If there is still some need to
contact winbind for this information, I suggest a new call be created for this
- as it the server-side code doesn't allow for this information to be extracted
easily in any case.

Finally, it gets in the way of the default domain code a bit - hence why I was
actually looking at it...

Andrew Bartlett
(This used to be commit 5fe1ea7f11)
2002-01-26 06:02:28 +00:00
Andrew Bartlett
3e29c28a0b Try to get the compiler not to complain about assignments and truth values...
Andrew Bartlett
(This used to be commit 6650b21cea)
2002-01-26 05:53:07 +00:00
Andrew Bartlett
29ad4a76cd Try to move towards slightly sane linking for Samba by removing some pdb_...()
calls from rpc_parse/parse_net.c - instead these values are passed as a
paramater.

Unfortunetly some there is still some samr work to be done before this is
actually useful.

Andrew Bartlett
(This used to be commit 4fc9e16ad7)
2002-01-26 05:52:20 +00:00
Andrew Bartlett
8a05b8c53f Add some information tidbits to an error DEBUG().
(This used to be commit 3db417c2eb)
2002-01-26 01:52:52 +00:00
Jeremy Allison
5b0dca4998 Fixed ADDPRINTEREX to take a devmode and a security descriptor...
Jeremy.
(This used to be commit 27f65b3aad)
2002-01-26 01:20:38 +00:00
Jean-François Micouleau
2452515a16 that's the wins replication daemon !
there are still some work to do on it but it's already functionnal.

        J.F.
(This used to be commit 2506c98d19)
2002-01-25 22:53:49 +00:00
Jean-François Micouleau
558e4cf0b8 rewrote nmbd's wins backend to use a tdb instead of a flat text file.
Changed the way the wins record are handled in memory. Now they are living
much longer with the different states: active, released and tombstone.
Also added a version ID, some wins flags and the wins owner ip address to
the namrec->data struct, and a function to process messages sent by the
wins replication daemon.

the initiate_wins_processing() function is not correct, I'll fix it later.

        J.F.
(This used to be commit b902e087d0)
2002-01-25 22:50:15 +00:00
Andrew Bartlett
38ac78c3df Change this code so that we don't do a lookup_name() on root.
This matches the lookup failure case in 2.2, and seems to make more sense than
giving the printer to 'world'.  (Avoiding this lookup makes some of my other
changes - including winbind default domains - a little easier).

In any case, tpot has promised to look at this and test it when he gets back to
work. :-)

Andrew Bartlett
(This used to be commit f0137ac126)
2002-01-25 22:44:21 +00:00
Jim McDonough
de260eadf9 Enable net ads commands to use existing tickets if the user doesn't specify a username on the commandline. Also don't continue past the kinit if a password is entered and fails because existing tickets would be used, which may not be desired if the username was specified.
(This used to be commit 7e5d7dfa83)
2002-01-25 22:07:46 +00:00
Jeremy Allison
9d8ed7220f Fixed display of "remote downlevel document" in old print job submission
case.
Jeremy.
(This used to be commit 248770d730)
2002-01-25 20:16:14 +00:00
Jeremy Allison
b3e5d34171 Make systemtime work for spooling on bigendian systems. Fix from
Benjamin (Bj) Kuit bj@it.uts.edu.au.
Jeremy.
(This used to be commit 5f4de275a3)
2002-01-25 18:27:40 +00:00
Jean-François Micouleau
214542b874 new message type for nmbd
J.F.
(This used to be commit 5fef8a5ad2)
2002-01-25 17:04:47 +00:00
Jean-François Micouleau
a2cff140cf remove unused variable
J.F.
(This used to be commit ca7665c6b3)
2002-01-25 17:03:36 +00:00
Jean-François Micouleau
b387638d48 picky about realloc
J.F.
(This used to be commit 873dba59cf)
2002-01-25 17:02:54 +00:00
Gerald Carter
107b12ec11 merge from 2.2
(This used to be commit 7dc1c34145)
2002-01-25 15:47:12 +00:00
Andrew Bartlett
320f7cb4ac Passdb changes:
Modules now name themselves, which should allow for sane behaviour when we get
an 'extern' passdb module (which in turn loads a .so).

Fix up tdbsam for non-unix-accounts.  Not sure if this fixes idra's bug, but
its a start...

Andrew Bartlett
(This used to be commit 7d576d89d7)
2002-01-25 11:44:15 +00:00
Andrew Bartlett
30802965d2 Fix a 'const' warning.
(This used to be commit 56be51d648)
2002-01-25 10:38:00 +00:00
Andrew Bartlett
24dc27b4b9 Bring auth_winbind into line with the protocol changes
Andrew Bartlett
(This used to be commit c796799afd)
2002-01-25 10:16:20 +00:00
Simo Sorce
2836f3fbdd micro fix :-)
(This used to be commit 8929f07a15)
2002-01-25 09:55:29 +00:00
Tim Potter
5bd34d995d Removed dodgy init of local variable.
(This used to be commit 1f7172b48e)
2002-01-25 05:28:38 +00:00
Jeremy Allison
565b9cc157 Return correct RPC fault PDU on bad handle incoming.
Jeremy.
(This used to be commit 0db93d8752)
2002-01-25 05:28:37 +00:00
Tim Potter
d82e73ae55 Much more useful handling of backup domain controllers in winbindd. Honour
the "password server" smb.conf parameter when choosing a DC to connect to.

Due to the origin of the code in cm_get_dc_name() it wouldn't try
additional DCs if the first DC didn't work.  This would wedge winbindd if you
had "password server = foo1, foo2" and foo1 was down.
(This used to be commit fc7ed1b4a8)
2002-01-25 05:24:07 +00:00
Tim Potter
5fb852d047 Remove check for passwordserver = "*" as we now initialise it.
Added TODO about perhaps doing a SAMLOGON udp/138 request before a
cli_full_connection in connect_to_domain_password_server()
(This used to be commit b61e40a5be)
2002-01-25 05:17:49 +00:00
Tim Potter
01a1516f15 Initialise password server to "*" in init_globals()
(This used to be commit 97b243c488)
2002-01-25 05:16:40 +00:00
Tim Potter
9731bbe06d Removed unused static variable.
(This used to be commit 7c2d720593)
2002-01-25 04:26:16 +00:00
Simo Sorce
114eaabdcb minor fixes
(This used to be commit 04f492980b)
2002-01-25 00:35:14 +00:00
Andrew Tridgell
dfed852520 handle filenames like .bashrc better in the new mangling code
(This used to be commit 05adb30eab)
2002-01-24 13:31:34 +00:00
Jim McDonough
723b368dc2 Check request flag for unicode capability and respond accordingly, rather than only doing unicode. smbfs didn't work.
(This used to be commit 95857a3515)
2002-01-23 18:09:56 +00:00
Andrew Bartlett
7c05db4803 Oops...
(This used to be commit 9b63a87223)
2002-01-23 13:44:32 +00:00
Andrew Bartlett
158efc3aa2 getpwnam -> getpwnam_alloc.
idra has promised not to revert these this time :-)
(This used to be commit f556ad67e8)
2002-01-23 12:59:24 +00:00
Andrew Bartlett
44dd648a64 Change the order of this a bit - as unix password change can fail.
This due for abstraction into chgpasswd.c shortly.

Andrew Bartlett
(This used to be commit 635942ae21)
2002-01-23 11:57:11 +00:00
Tim Potter
f0fe8ff18a Sync up startpageprinter with appliance.
(This used to be commit 6025ab201a)
2002-01-23 11:47:19 +00:00
Gerald Carter
e710c07411 merge from 2.2
(This used to be commit 8ed7c1ffad)
2002-01-23 05:10:27 +00:00
Jeremy Allison
1182b7cd8c Merge of fixes from 2.2.
Jeremy.
(This used to be commit 6406a42d01)
2002-01-22 19:45:17 +00:00
Gerald Carter
e24937d9a2 merge from appliance_head
(This used to be commit 38d2d26af9)
2002-01-22 18:19:00 +00:00
Gerald Carter
528ff0d6f7 merge from 2.2. of
* PRINTER_ATTRIBUTE's
  * "default devmode" parameter
(This used to be commit 90a7a1840b)
2002-01-22 18:14:31 +00:00
Jeremy Allison
73af0a70f5 Ensure fsp->size is correct so readraw's return correct data.
Jeremy.
(This used to be commit 443d2530a7)
2002-01-22 07:24:12 +00:00
Martin Pool
c69d1b9434 Add more string explanations of RAP errors that are already documented
in clirap2.
(This used to be commit 935955b50f)
2002-01-22 05:11:28 +00:00
Martin Pool
c4fe824c42 We have to do some initialization before the string conversion
routines can work.  The code was copied into both convert_string and
convert_string_allocate -- I split it into a little static function,
and removed an apparently duplicate call to init_valid_table().
(This used to be commit 7f7d22880d)
2002-01-22 03:51:28 +00:00
Tim Potter
a4bd608b48 Raise log level of warning produced when the open() of the tdb fails.
Sometimes an open error is OK.
(This used to be commit 5fb3be6291)
2002-01-22 00:38:36 +00:00
Tim Potter
5916634a3a Display tdb name of "unknown" in logging debug when tdb has not been named.
(This used to be commit 96c36e51ee)
2002-01-22 00:36:53 +00:00
Tim Potter
a45dbdd722 Added comment about running lp_load() before calling pidfile_create().
(This used to be commit e05c9b34f0)
2002-01-22 00:35:51 +00:00
Tim Potter
48c4877194 Call pidfile_create() as part of init sequence.
(This used to be commit fa05a7de6d)
2002-01-22 00:35:05 +00:00
Tim Potter
50648ac3cc Having a const parameter for set_socket_options() causes too much confusion.
(This used to be commit 025a0ea8ba)
2002-01-22 00:31:41 +00:00
Jeremy Allison
71bc6b9af2 Removed freebsd hack. Not correct.
Jeremy.
(This used to be commit 61b4ce7aef)
2002-01-21 23:36:47 +00:00
Jeremy Allison
2383fd87a7 Found and fixed the logic bug in write cache code. Amazingly helpful
work from Juergen.Hasch@de.bosch.com in tracking this down.
Jermy.
(This used to be commit 40060fe345)
2002-01-21 23:34:13 +00:00
Simo Sorce
2af4b8a500 getpwnam_alloc -> getpwnam
same reason as per pdb_tdb.c
there isn't (and will never be probably) another call to any getpw* fn,
let's use getpwnam_alloc only when needed.
(This used to be commit f12361b132)
2002-01-21 08:08:54 +00:00
Simo Sorce
d6b4327f11 hmm, get it right this time.
(This used to be commit 57a145bff6)
2002-01-21 07:55:35 +00:00
Simo Sorce
6e22428f27 fix also the comment.
(This used to be commit 7f7a15e09a)
2002-01-21 07:54:09 +00:00
Simo Sorce
38c7fc5fe1 replace getpwnam_alloc with plain getpwnam.
We are not going to reuse any getpw* call, so the extra alloc,copy and free
only uses extra memory and extra cpu time for nothing.
(This used to be commit 5c0bb0487b)
2002-01-21 07:51:26 +00:00
Martin Pool
2a2f4a24f7 Make the -L option to smbclient slightly less gross:
smbclient -L //nautilus1/

should definitely not say "unknown host "nautilus1/".  Sheesh.
(This used to be commit 1cd431b8f1)
2002-01-21 06:42:45 +00:00
Tim Potter
fb76d58d16 Spelling fix.
(This used to be commit 6380f9ff7a)
2002-01-21 06:12:22 +00:00
Andrew Bartlett
3723171ea6 getpwnam -> getpwnam_alloc
(This used to be commit 59905d44e5)
2002-01-21 02:51:23 +00:00
Andrew Bartlett
e1793bde61 getpwnam -> getpwnam_alloc
(This used to be commit f8208458b3)
2002-01-21 00:47:02 +00:00
Andrew Bartlett
a03b5e3864 One less Get_Pwnam_Modify call!
(the passdb backend is case-insensitive, so there isn't any point to this).

Andrew Bartlett
(This used to be commit 5e868b4033)
2002-01-21 00:32:26 +00:00
Andrew Bartlett
93e9fd542d Inititialise the gid to what standard_sub_advanced wants for 'no value'.
Andrew Bartlett
(This used to be commit a96503475d)
2002-01-20 23:17:36 +00:00
Andrew Bartlett
5b5b6771a8 Fix the negation of the extra parinoia check on machine password changes.
I *love* automated testing - this one got picked up by the build farm.

Andew Bartlett
(This used to be commit b19296172a)
2002-01-20 23:05:23 +00:00
Tim Potter
1f670cfb27 Spelling fixes.
(This used to be commit e67c7c5852)
2002-01-20 22:50:23 +00:00
Simo Sorce
56d884eefe fixes from 2.2
(This used to be commit e8a891354d)
2002-01-20 17:03:23 +00:00
Andrew Bartlett
1a74d8d1f0 This is another *BIG* change...
Samba now features a pluggable passdb interface, along the same lines as the
one in use in the auth subsystem.  In this case, only one backend may be active
at a time by the 'normal' interface, and only one backend per passdb_context is
permitted outside that.

This pluggable interface is designed to allow any number of passdb backends to
be compiled in, with the selection at runtime.  The 'passdb backend' paramater
has been created (and documented!) to support this.

As such, configure has been modfied to allow (for example) --with-ldap and the
old smbpasswd to be selected at the same time.

This patch also introduces two new backends:  smbpasswd_nua and tdbsam_nua.
These two backends accept 'non unix accounts', where the user does *not* exist
in /etc/passwd.  These accounts' don't have UIDs in the unix sense, but to
avoid conflicts in the algroitmic mapping of RIDs, they use the values
specified in the 'non unix account range' paramter - in the same way as the
winbind ranges are specifed.

While I was at it, I cleaned up some of the code in pdb_tdb (code copied
directly from smbpasswd and not really considered properly).  Most of this was
to do with % macro expansion on stored data.  It isn't easy to get the macros
into the tdb, and the first password change will 'expand' them.  tdbsam needs
to use a similar system to pdb_ldap in this regard.

This patch only makes minor adjustments to pdb_nisplus and pdb_ldap, becouse I
don't have the test facilities for these.  I plan to incoroprate at least
pdb_ldap into this scheme after consultation with Jerry.

Each (converted) passdb module now no longer has any 'static' variables, and
only exports 1 init function outside its .c file.

The non-unix-account support in this patch has been proven!  It is now possible
to join a win2k machine to a Samba PDC without an account in /etc/passwd!

Other changes:

Minor interface adjustments:
pdb_delete_sam_account() now takes a SAM_ACCOUNT, not a char*.

pdb_update_sam_account() no longer takes the 'override' argument that was being
ignored so often (every other passdb backend).  Extra checks have been added in
some places.

Minor code changes:
smbpasswd no longer attempts to initialise the passdb at startup, this is
now done on first use.

pdbedit has lost some of its 'machine account' logic, as this behaviour is now
controlled by the passdb subsystem directly.

The samr subsystem no longer calls 'local password change', but does the pdb
interactions directly.  This allow the ACB_ flags specifed to be transferred
direct to the backend, without interference.

Doco:

I've updated the doco to reflect some of the changes, and removed some paramters
no longer applicable to HEAD.
(This used to be commit ff354c99c5)
2002-01-20 14:30:58 +00:00
Andrew Bartlett
32101155d4 Kill off another ugly wart from the side of the passdb subsystem.
This time its the pdb_getsampwuid() function - which was only being used by the
SAMR rpc subsystem to gain a 'user session key'.  This 'user session key' is
actually generated at login time, and the other changes here simply move that
data around.

This also means that (when I check some details) we will be able to use the
user session key, even when we are not actually the DC, becouse its one of the
components of the info3 struct returned on logon.

Andrew Bartlett
(This used to be commit 799ac01fe0)
2002-01-20 13:26:31 +00:00
Andrew Bartlett
3871e970b5 Fix up an embarrsing bug I introduced when I moved the id21/id23 -> SAM_ACCOUNT
conversion across to the pdb_set...() interface.

Now we only set strings that are non-null.  This allows Win2k to join the
domain again, particularly when using tdbsam.

Andrew Bartlett
(This used to be commit 6d0b3d051f)
2002-01-20 12:26:46 +00:00
Andrew Bartlett
f46db61068 Kill off the old varient of 'check_plaintext_password' (new version just
committed in auth/auth_compat.c and use the new version to make the plaintext
password change slightly sane...  (Needs testing).

Andrew Bartlett
(This used to be commit 996d0cd89c)
2002-01-20 09:00:32 +00:00
Andrew Bartlett
2d06adc3f0 Add a touch of 'const' to some auth components, and move the simple plaintext
password check into its own helper funciton.  (This will allow it to be called
from other places).

Andrew Bartlett
(This used to be commit 9e96f43805)
2002-01-20 08:58:21 +00:00
Andrew Bartlett
8d2d97b176 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
(This used to be commit 20e0b56228)
2002-01-20 07:13:05 +00:00
Andrew Bartlett
bb6af711b8 This is the current patch from Luke Leighton <lckl@samba-tng.org> to add a
degree of seperation betwen reading/writing the raw NamedPipe SMB packets
and the matching operations inside smbd's RPC components.

This patch is designed for no change in behaviour, and my tests hold that to be
true.  This patch does however allow for the future loadable modules interface
to specify function pointers in replacement of the fixed state.

The pipes_struct has been split into two peices, with smb_np_struct taking the
information that should be generic to where the data ends up.

Some other minor changes are made: we get another small helper function in
util_sock.c and some of the original code has better failure debugs and
variable use. (As per on-list comments).

Andrew Bartlett
(This used to be commit 8ef13cabdd)
2002-01-20 02:40:05 +00:00
Andrew Bartlett
93a8358910 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
(This used to be commit e870f0e727)
2002-01-20 01:24:59 +00:00
Jeremy Allison
a6541401b0 Ensure identical between 2.2.3 and 3.0 - no need for difference here..
Jeremy.
(This used to be commit 7c5c035e41)
2002-01-20 01:01:46 +00:00
Jeremy Allison
2590721a36 Fix file size calculations for write cache code.
Jeremy.
(This used to be commit 71d647b6c0)
2002-01-20 00:43:28 +00:00
Jeremy Allison
427896866a Attempt to fix bugs in write cache code (yes I know it's going away :-).
Jeremy.
(This used to be commit ccda82b457)
2002-01-20 00:04:15 +00:00
Jeremy Allison
74462c0c17 Readline has problems on non tty fd's. Use readline replacement to in cases
where stdin is !isatty to allow stripts to work.
Jeremy.
(This used to be commit 997d6687fc)
2002-01-19 22:54:13 +00:00
Jeremy Allison
4668960b1d Added #ifdef for FreeBSD TCP bug.
Jeremy.
(This used to be commit 80df5ab07e)
2002-01-19 21:37:38 +00:00
Jeremy Allison
e400bfce39 Report write fail in smb_dump.
Jeremy.
(This used to be commit 832b9e7838)
2002-01-19 21:29:20 +00:00
Jeremy Allison
95501cf1ba Fix to close winbindd_idmap on exit. Pointed out by Alexander Bokovoy.
Jeremy.
(This used to be commit 1bd96b3094)
2002-01-19 20:21:29 +00:00
Simo Sorce
7019bfe546 fixes (asprintf) from 2.2
(This used to be commit 6b123adda9)
2002-01-19 17:29:32 +00:00
Andrew Bartlett
aea134de2c Don't do tridge's crazy 'am I a trusted domain' lookup for guests.
Andrew Bartlett
(This used to be commit 9bfe54a3d4)
2002-01-18 08:12:10 +00:00
Jeremy Allison
efdb29d0e0 Ensure (C) message is output on startup.
Jeremy.
(This used to be commit 7d05175494)
2002-01-18 03:26:53 +00:00
Jeremy Allison
a0b86d4cd2 If 127.0.0.1 matches both allow & deny then allow. Patch from Steve Langasek vorlon@netexpress.net
Jeremy.
(This used to be commit 478696e924)
2002-01-18 03:08:40 +00:00
Andrew Bartlett
1fb9ccc4e2 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
(This used to be commit 07a21fcd23)
2002-01-18 02:37:55 +00:00
Jeremy Allison
9d05373a76 Tidyup & code refactoring from Martin.Sheppard@csiro.au.
Jeremy.
(This used to be commit 85da18e46e)
2002-01-18 02:30:37 +00:00
Jeremy Allison
3a851587f8 Ensure we log tdb open fails. Patch from Alexander Bokovoy <a.bokovoy@sam-solutions.net>
Jeremy.
(This used to be commit eb99e7f29c)
2002-01-18 02:15:04 +00:00
Jeremy Allison
2a3673994d Added prs_mem_clear(). Clear memory on buffer reallocation. That way
we're not returning what the client gave us.
Jeremy.
(This used to be commit 9a969069f1)
2002-01-18 00:36:16 +00:00
Jeremy Allison
37834a48e8 Always clear malloced memory for parse structs.
Jeremy.
(This used to be commit 6deb4caca5)
2002-01-18 00:19:45 +00:00
Andrew Bartlett
c311d24ce3 A nice *big* change to the fundemental way we do things.
Samba (ab)uses the returns from getpwnam() a lot - in particular it keeps
them around for a long time - often past the next call...

This adds a getpwnam_alloc and a getpwuid_alloc to the collection.

These function as expected, returning a malloced structure that can be
free()ed with passwd_free(&passwd).

This patch also cuts down on the number of calls to getpwnam - mostly by
taking advantage of the fact that the passdb interface is already
case-insensiteve.

With this patch most of the recursive cases have been removed (that I know
of) and the problems are reduced further by not using the sys_ interface
in the new code.  This means that pointers to the cache won't be affected.
(This is a tempoary HACK, I intend to kill the password cache entirly).

The only change I'm a little worried about is the change to
rpc_server/srv_samr_nt.c for private groups.  In this case we are getting
groups from the new group mapping DB.  Do we still need to check for private
groups?  I've toned down the check to a case sensitve match with the new code,
but we might be able to kill it entirly.

I've also added a make_modifyable_passwd() function, that copies a passwd
struct into the form that the old sys_getpw* code provided.  As far as I can
tell this is only actually used in the pass_check.c crazies, where I moved
the final 'special case' for shadow passwords (out of _Get_Pwnam()).

The matching case for getpwent() is dealt with already, in lib/util_getent.c

Also included in here is a small change to register the [homes] share at vuid
creation rather than just in one varient of the session setup.  (This picks
up the SPNEGO cases).  The home directory is now stored on the vuid, and I
am hoping this might provide a saner way to do %H substitions.

TODO:  Kill off remaining Get_Pwnam_Modify calls (they are not needed), change
the remaining sys_getpwnam() callers to use getpwnam_alloc() and move
Get_Pwnam to return an allocated struct.

Andrew Bartlett
(This used to be commit 1d86c7f942)
2002-01-17 08:45:58 +00:00
Andrew Bartlett
350161d44b Move the bang (!) command back to the bottom of the list, allowing smbclient
to function again.

Add comment to warn anybody that wants to 'Alphabetize' the list to read crh's
existing comment on the issue.

Andrew Bartlett
(This used to be commit d123d79060)
2002-01-17 07:14:21 +00:00
Tim Potter
21a6c34485 Made a debug look nicer.
(This used to be commit aca0edc819)
2002-01-17 05:07:36 +00:00
Tim Potter
269d24f716 Added some guards.
(This used to be commit 967c688580)
2002-01-17 03:03:58 +00:00
Tim Potter
6c705b69db Fixed typo.
(This used to be commit e675d34dbf)
2002-01-17 02:54:23 +00:00
Andrew Tridgell
ab3cae9768 fixed a typo in the error map for WRONG_PASSWORD
(This used to be commit fb300e411b)
2002-01-17 01:05:34 +00:00
Andrew Tridgell
630e0ae8ef don't use O_NONBLOCK in open(). This was added erroneously for kernel
oplocks and really shouldn't be used
(This used to be commit c3a83002cf)
2002-01-17 00:25:13 +00:00
Jeremy Allison
08019e8a33 Separate out get_user_home_dir() from get_user_home_service_dir().
Jeremy.
(This used to be commit c1b97226db)
2002-01-16 23:53:10 +00:00
Jeremy Allison
5cf6457bcc Merged in %S fixes and XX_NOT_CHANGED fixes from 2.2.
Jeremy.
(This used to be commit 0fcca6c627)
2002-01-16 23:32:10 +00:00
Jeremy Allison
04ec469c72 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.
(This used to be commit 16fcbf3c1c)
2002-01-16 21:27:57 +00:00
Jeremy Allison
1cd8c9c41f Alphabetize.
Jeremy.
(This used to be commit 64301bc5f7)
2002-01-16 20:25:23 +00:00
Jeremy Allison
0173911b46 Added CIFS UNIX extension code to client.
Jeremy.
(This used to be commit 794c3e2c76)
2002-01-16 20:13:28 +00:00
Jeremy Allison
24bdb14564 Fix name register bug with non-existent wins server.
Jeremy.
(This used to be commit 4e41780c21)
2002-01-16 19:23:05 +00:00
Jeremy Allison
493e6e6f47 At leadt don't lose this - I need to re-sync trans2.c between 2.2.x and
HEAD soon.
Jeremy.
(This used to be commit 2f57257558)
2002-01-16 02:42:47 +00:00
Martin Pool
fed604bfa3 Roll back PSTRING_SANCTIFY patch; just leave non-controversial type
and constness changes.
(This used to be commit cee0ec7274)
2002-01-16 02:42:07 +00:00
Tim Potter
978f1ba98d Quieten some pointer cast warnings.
(This used to be commit 1906903f06)
2002-01-16 02:31:53 +00:00
Andrew Tridgell
9f85d4ad5f much better support for organisational units in ADS join
(This used to be commit 7e876057d5)
2002-01-16 02:22:30 +00:00
Martin Pool
3fee2ac712 Roll back PSTR insertion.
Just leave the fstrcpy/pstrcpy bugfix, and conversion to pstr_sprintf
rather than manual calculation of length.
(This used to be commit e38e7a2bdc)
2002-01-16 02:20:34 +00:00
Tim Potter
bf7c56665c Merge of name_status_find() debugs.
(This used to be commit cfac669017)
2002-01-16 01:41:30 +00:00
Jim McDonough
b5f5861225 Fix from 2.2. It didn't break on HEAD because it isn't being compiled. Herb?
(This used to be commit 4fcaec53de)
2002-01-15 17:58:59 +00:00
Jeremy Allison
5fa0da0ba5 Missing assign fix from Bernt Nilsson bkn@ida.liu.se.
Jeremy.
(This used to be commit adf24a90e8)
2002-01-15 16:20:25 +00:00
Andrew Bartlett
c402fd6b79 For some reason I wasn't thinking about failure cases this morning...
Anyway, this makes it slightly sane, but we may decide to smb_panic() here
instead.

Andrew Bartlett
(This used to be commit 724109a33b)
2002-01-15 05:15:22 +00:00
Martin Pool
1c639ca28e Convert to the new pstring interface. This diff is a pretty good
example of the scope of change the new pstrings would entail:
basically inserting PSTR() or FSTR() everywhere you need to coerce one
to a char*.

It's also a good example of the kind of bug we might catch: on about
line 540, we were doing a pstrcpy into an fstring, which might
overflow.  It's not a problem in this particular case, but it is in
general.
(This used to be commit 5a403da4a7)
2002-01-15 02:15:58 +00:00
Martin Pool
0d3e258fd1 Split pstring definitions into their own header.
(This used to be commit 04e3082f7d)
2002-01-15 02:11:55 +00:00
Martin Pool
a276e917d8 Integrate with PSTRING_SANCTIFY.
(This used to be commit 20a03facb6)
2002-01-15 02:10:50 +00:00
Martin Pool
17745322ab #ifdef variable that's not used without dmalloc
(This used to be commit bf513668cb)
2002-01-15 01:49:06 +00:00
Martin Pool
37d20e29a3 Add constness to parameters
(This used to be commit e0105974c0)
2002-01-15 01:45:26 +00:00
Herb Lewis
4ce7b42ee0 adding wins commands to winbindd - will check in the rest of the changes
after further testing in 2.2 branch.
(This used to be commit d5cdbc7e4f)
2002-01-15 01:42:57 +00:00
Martin Pool
9964e1f966 Add constness to parameters
(This used to be commit a61abaec06)
2002-01-15 01:38:05 +00:00
Martin Pool
df3d5b3556 Add constness to filenames passed to functions.
(This used to be commit 8d106dc1f4)
2002-01-15 01:37:12 +00:00
Andrew Bartlett
90558370ab Commit the auth associated changes I missed from the last commit.
Also set the default value of all the allocated strings to "" to avoid changing
the interface (becouse pdb_get...() would point to a null string, rather than a
null pointer and parts of samba rely on that).

Andrew Bartlett
(This used to be commit 5b4079f748)
2002-01-15 01:14:58 +00:00
Andrew Bartlett
dbee612f71 Change the passdb interface to use allocated strings.
These strings are allocated using talloc(), either using its own memory context
stored on the SAM_ACCOUNT or one supplied by the caller.

The pdb_init_sam() and pdb_free_sam() function have been modifed so that a call
to pdb_free_sam() will either clean up (remove hashes from memory) and destroy
the TALLOC_CTX or just clean up depending on who supplied it.

The pdb_init_sam and pdb_free_sam functions now also return an NTSTATUS, and I
have modified the 3 places that actually checked these returns.

The only nasty thing about this patch is the small measure needed to maintin
interface compatability - strings set to NULL are actually set to "".

This is becouse there are too many places in Samba that do strlen() on these
strings without checking if they are NULL pointers.

A supp patch will follow to set all strings to "" in pdb_default_sam().

Andrew Bartlett
(This used to be commit 144345b41d)
2002-01-15 01:02:13 +00:00
Andrew Bartlett
22e7da0a3d rerun autoconf
(This used to be commit d6bd9f1005)
2002-01-14 22:11:44 +00:00
Andrew Bartlett
6894c42b91 I like --enable-developer, but I find it rather usless when all it gets me is a
screen-full of kerberos warnings.

This is almost as good, and I can actually see the Samba warnings.

Andrew Bartlett
(This used to be commit 35a6275e18)
2002-01-14 22:11:01 +00:00
Andrew Bartlett
d76478f0a7 Initialise cli variables and try not to do a cli_shutdown() of uninitialsed
memory.

The winbind connection caching code isn't exactly a plesent beast, and there is
more work that needs to be done to nail this properly.

Andrew Bartlett
(This used to be commit dd40ce54b7)
2002-01-14 22:08:47 +00:00
Andrew Bartlett
dd0f0f043f Fix a segfault in auth/auth_domain.c error cases.
This occured when the attempt to contact the PDC failed.  The connection code
has already shut down the connection, and 'free'ed the cli or has never
initialised it in the first place.

Andrew Bartlett
(This used to be commit 37ce763043)
2002-01-14 21:52:25 +00:00
Jeremy Allison
9e007457e4 Removed MAXSTATUS which was set incorrectly - thus causing tdb traversal
of the connections db on smbd startup. This should fix the Solaris large
load bug.... (fingers crossed).
Jeremy.
(This used to be commit 5b2b9c25af)
2002-01-14 19:34:28 +00:00
Martin Pool
3353223b47 FIXME We should turn the global list off when using Insure++,
otherwise all the memory will be seen as still reachable.
(This used to be commit 682e7cd394)
2002-01-14 06:51:34 +00:00
Martin Pool
6059f40763 Move local variable to avoid warning when compiled without GSSAPI.
(This used to be commit 312c6d906e)
2002-01-14 06:34:53 +00:00
Martin Pool
1b6c848c10 PSTRING_SANCTIFY:
If you define this, pstring and fstring become distinguished types, so
that it's harder to accidentally overflow them by for example passing
an fstring on the lhs of pstrcpy.

The types are defined as one-element union arrays so that with
"fstring f" the name "f" will be a pointer and with a big hammer you
can cast it to (char *).  So code that tries to just use it directly
will get a loud warning, but hopefully nothing worse.

To pass them to non-pstring-aware functions, use PSTR and check that
the function takes a const.  They should almost never be modified
except by special calls.  In those unusual cases, use PSTR_MUTABLE.

This is off by default so as not to produce too many warnings.  As the
code is vetted it can become the default.
(This used to be commit ca233bc8b3)
2002-01-14 06:15:07 +00:00
Tim Potter
cb4658d419 Removed fprintf(stderr, ...); calls which should not be present in library
functions.
(This used to be commit e69a22290e)
2002-01-14 02:22:31 +00:00
Andrew Bartlett
f7a657721a A couple of coding syle updates to follow the re-indent.
(This used to be commit 7417d6f931)
2002-01-13 12:37:01 +00:00
Andrew Bartlett
fef35c5ce0 Re-indent these two functions to make it actually possible to understand their
contents...

Andrew Bartlett
(This used to be commit e20d69d518)
2002-01-13 12:33:42 +00:00
Andrew Tridgell
2f4a6d60ef don't try to allocate zero bytes
(This used to be commit d09616da68)
2002-01-13 11:46:04 +00:00
Andrew Bartlett
0d1ecbbb73 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
(This used to be commit e6a3a01f79)
2002-01-13 11:13:54 +00:00
Andrew Bartlett
e895b9004e 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
(This used to be commit 80c2aefbe7)
2002-01-12 23:57:10 +00:00
Simo Sorce
b79fa88b4d updates from 2.2
(This used to be commit 398b4ff0d4)
2002-01-12 23:12:13 +00:00
Jeremy Allison
c9d350a736 Added PRINTER_INFO_4/PRINTER_INFO_5, we're seeing level 5 requested on the wire... so.
Jeremy.
(This used to be commit b63b762978)
2002-01-12 02:37:54 +00:00
Andrew Bartlett
973c0b3257 Thanks to vance for spotting the missing Makefile.in commit.
This should make things a little happier...

Andrew Bartlett
(This used to be commit 6ce467a65f)
2002-01-12 02:06:17 +00:00
Andrew Bartlett
e3e3144417 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
(This used to be commit 28d5ab269c)
2002-01-12 01:55:09 +00:00
Jeremy Allison
68245b54cd Added the O_NOFOLLOW flag if follow symlinks is set off.
Jeremy.
(This used to be commit 4f1f5f28b5)
2002-01-12 00:50:01 +00:00
Jeremy Allison
1d40138232 Round and round we go....
Jeremy.
(This used to be commit 2603ab3c68)
2002-01-11 23:33:12 +00:00
Jeremy Allison
b741f6b04c Latest attempt at changeid.
Jeremy.
(This used to be commit 24ee18c77e)
2002-01-11 21:52:46 +00:00
Jeremy Allison
d6823366b8 Same fix as went into 2.2 (I'm waiting for jerry to finish some code).
Jeremy.
(This used to be commit 01ff6ce496)
2002-01-11 19:10:25 +00:00
Andrew Tridgell
27655be3c1 fixed a crash bug in domain auth caused by an uninitialised nt_status
(This used to be commit 0b0b937b58)
2002-01-11 13:14:28 +00:00
Andrew Tridgell
a78fd04681 fixed a crash in merge_aces()
when we free curr_ace_outer we need to not try to use it again :)
(This used to be commit 1c5e19a418)
2002-01-11 11:26:31 +00:00
Andrew Tridgell
13059beb24 force the time difference in cache comparisons to be unsigned to cope
with the local machine time changing
(This used to be commit 116c0a0e3b)
2002-01-11 10:05:34 +00:00
Andrew Tridgell
35623dac54 make the winbind sequence number code more robust
when switching from rpc to ADS this now should make sense
(This used to be commit ec73d26c7f)
2002-01-11 10:02:28 +00:00
Andrew Tridgell
034a855d73 cope with direct IP addresses in resolve_name()
(This used to be commit 73a59170e6)
2002-01-11 09:48:27 +00:00
Samba Release Account
e2584de054 preparing for release of 3.0-alpha13
(This used to be commit 4f4f898348)
2002-01-11 08:48:49 +00:00
Andrew Bartlett
b322fc3b26 Make this error match Win2k.
(This used to be commit 490d3aaf20)
2002-01-11 07:48:55 +00:00
Andrew Bartlett
7f8ae6e35c The DC is meant to be sent the *unmapped* username...
Andrew Bartlett
(This used to be commit d7fca1806a)
2002-01-11 06:22:42 +00:00
Tim Potter
da84e2a756 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
(This used to be commit 37216c649a)
2002-01-11 05:33:45 +00:00
Andrew Bartlett
5047a66d39 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
(This used to be commit 7f7a42c3e4)
2002-01-11 05:29:09 +00:00
Tim Potter
348f178428 Correct4ed comment.
(This used to be commit 78814664ef)
2002-01-11 05:14:52 +00:00
Andrew Bartlett
4acb3125cd 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
(This used to be commit ab8ff85f03)
2002-01-11 04:50:45 +00:00
Tim Potter
9ee8213f9a Some memory leak fixes.
(This used to be commit da4db0373b)
2002-01-11 03:49:51 +00:00
Andrew Tridgell
3fb5e2867c make sure resolve_name() only returns valid IP addresses
this is actually a workaround for old broken nmbd daemons, especially
from Samba 2.0
(This used to be commit 12021a8de6)
2002-01-11 00:23:29 +00:00
Tim Potter
85e06cebc0 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
(This used to be commit a4af65b9b9)
2002-01-10 23:45:29 +00:00
Herb Lewis
969d1dd468 added structure members referred to by recent changes in vfs-wrap.c
(This used to be commit c5e14d73df)
2002-01-10 19:40:40 +00:00
Herb Lewis
e87d94d46d 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.
(This used to be commit 09e3276fb7)
2002-01-10 18:49:37 +00:00
Andrew Bartlett
7d6dd0b3a0 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
(This used to be commit 2bd2a092ee)
2002-01-10 11:28:14 +00:00
Andrew Bartlett
cf00e41421 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
(This used to be commit 6df29bfe33)
2002-01-10 10:23:54 +00:00
Martin Pool
692215e485 Quieten warning about uninitialized variable.
(This used to be commit 63ea2bb0ad)
2002-01-10 06:32:01 +00:00
Tim Potter
610f530aee 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
(This used to be commit eeb8af9c1a)
2002-01-10 06:20:03 +00:00
Tim Potter
cd1ad031a6 Spelling fix.
(This used to be commit 85d3ffb270)
2002-01-10 06:05:37 +00:00
Martin Pool
b8b7ab052a 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.
(This used to be commit 934aacdb39)
2002-01-10 03:53:06 +00:00
Jeremy Allison
a36c10bd1e First part of UNIX extensions (#ifdefed out) more to follow.
Jeremy.
(This used to be commit 02b18f2cca)
2002-01-10 02:41:15 +00:00
Jeremy Allison
fd56ebd54f Oh joy - the original code didn't do mapping of the perms onto the wire.
Make it up as we go along... :-).
Jeremy.
(This used to be commit 4289fe3499)
2002-01-10 02:18:08 +00:00
Jeremy Allison
f069a41c85 Ensure this is committed last.
Jeremy.
(This used to be commit 2591361fa8)
2002-01-10 01:49:22 +00:00
Jeremy Allison
09571aa76d We need to test for major/minor macros.
Jeremy.
(This used to be commit ee8c8add7f)
2002-01-10 01:49:09 +00:00
Tim Potter
87db7c557b 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.  )-:
(This used to be commit ee0a6f8d26)
2002-01-10 01:32:57 +00:00
Jeremy Allison
3454945146 Getting ready to add UNIX extensions in HEAD also.
Jeremy
(This used to be commit 6210d4aa19)
2002-01-10 00:28:09 +00:00
Jeremy Allison
3375267106 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.
(This used to be commit 38cfffea5f)
2002-01-09 21:30:37 +00:00
Jeremy Allison
ca2558ff34 Fixed typo.
Jeremy.
(This used to be commit a99e0cec1e)
2002-01-09 20:48:18 +00:00
Jeremy Allison
d3e9213af7 Move SAFE_FREE into tdb.c to stop exporting it into tdb.h namespace.
Jeremy.
(This used to be commit 4f703b84cd)
2002-01-09 18:26:39 +00:00
Martin Pool
6c7050ea95 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.
(This used to be commit bcb443c5c4)
2002-01-09 08:27:15 +00:00
Martin Pool
a56f0e93ea 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??
(This used to be commit 5f6feb55d7)
2002-01-09 08:17:12 +00:00
Martin Pool
f5bc0e92a6 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)
(This used to be commit 391cbb6901)
2002-01-09 07:52:51 +00:00
Martin Pool
a8389eaeb5 With --enable-dmalloc, also use dmalloc's wrappers around routines
like strcat
(This used to be commit fb8ab69b6f)
2002-01-09 06:38:22 +00:00
Martin Pool
8079930620 Sample configuration for dmalloc.
(This used to be commit 7bbfb29842)
2002-01-09 06:35:45 +00:00
Martin Pool
bb21af13e3 Add UNUSED(paramname) macro to be used in parameter lists, to quieten
gcc warnings about unused parameters.
(This used to be commit b29775d442)
2002-01-09 05:27:59 +00:00
Martin Pool
e4bf9af03c 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.
(This used to be commit 3ef135e91a)
2002-01-09 05:27:27 +00:00
Jeremy Allison
a842a3d458 When re-writing tdb version numbers as little endian int32, we must
change the version number also.
Jeremy.
(This used to be commit 3dec9cf99a)
2002-01-09 05:24:07 +00:00
Martin Pool
abc6e70ca4 Fix macro name controlling inclusion of DMALLOC.
(This used to be commit a57e13b8b6)
2002-01-09 05:10:47 +00:00
Martin Pool
0e0c24b40d Add harmless parentheses so that dmalloc doesn't get confused by a
variable called 'free'.
(This used to be commit a823e3f8b2)
2002-01-09 05:09:44 +00:00
Tim Potter
d42fc03e9b 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()
(This used to be commit 08d2bcef1a)
2002-01-09 04:26:41 +00:00
Tim Potter
bf22d9cca8 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.  (-:
(This used to be commit 24bae9f055)
2002-01-09 04:17:24 +00:00
Jeremy Allison
91536cc901 Fixed all uses of tdb_fetch/store/_int to use explicit int32 little endian
in tdb's. All except winbindd_idmap.... Hmmmmmm.
Jeremy.
(This used to be commit ec71f1732b)
2002-01-09 04:13:30 +00:00
Jeremy Allison
0a3f6b9b48 HPUX nss fix.
Jeremy.
(This used to be commit 1f12e310e5)
2002-01-09 03:38:31 +00:00
Jeremy Allison
d2687a00e1 Fixed up atomic update code.
Jeremy.
(This used to be commit 274b04d4a6)
2002-01-09 02:35:08 +00:00
Jeremy Allison
af85c2f062 Added int32 version of "atomic" update.
Jeremy.
(This used to be commit 1233b553e7)
2002-01-09 01:53:19 +00:00
Jeremy Allison
b6f4f3465f Added int32 versions of the endian-dependent code.
Jeremy.
(This used to be commit d57fb9a8c2)
2002-01-09 01:32:17 +00:00
Jeremy Allison
eca00cab66 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.
(This used to be commit 9fb780d951)
2002-01-08 23:50:14 +00:00
Jeremy Allison
9178f89200 Getting ready to add winbindd support for HPUX 11.
Jeremy.
(This used to be commit 012a914412)
2002-01-08 21:11:25 +00:00
Jeremy Allison
bbc42672a2 Another attempt at getting changeid correct. Jerry / JF please check !
This fixes a driver init bug.
Jeremy.
(This used to be commit 8e8d718160)
2002-01-08 05:39:27 +00:00
Andrew Tridgell
1803e9cc0f - fixed my breakage of CPPFLAGS
- allow winbindd and wbinfo to build without shared libraries
(This used to be commit d5db2518be)
2002-01-08 04:44:15 +00:00
Jeremy Allison
b19ec04f52 Caught one problem where a BOOL fn was returning 3 different values :-).
Roll on defined types :-).
Jeremy.
(This used to be commit ccf07e2184)
2002-01-08 01:22:23 +00:00
Jeremy Allison
c1efcac59c Debugs that print out a share mode table in debug level 10. This code
enabled me to track down a *nasty* bug.
Jeremy.
(This used to be commit ed5a9a0ee3)
2002-01-08 00:52:36 +00:00
Jeremy Allison
4702494dce 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.
(This used to be commit 10d72f0b01)
2002-01-08 00:46:56 +00:00
Jeremy Allison
43b27771f5 Return called NetBIOS name if present in preference to global_myname.
Should allow print servers to work with NetBIOS aliases.
Needs testing.
Jeremy.
(This used to be commit ee8fd2690a)
2002-01-07 22:58:20 +00:00
Herb Lewis
f1256e847e merge changes from 2.2 branch to prevent smb.conf from changing debug level
of commands when specified on command line.
(This used to be commit 39d6b31e14)
2002-01-07 21:32:22 +00:00
Gerald Carter
bff833e76a sync getopt() args with 2.2
(This used to be commit 2fcdc520ce)
2002-01-07 14:17:49 +00:00
Andrew Tridgell
6c14b8c387 - 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
(This used to be commit c98158f3f8)
2002-01-07 11:42:12 +00:00
Tim Potter
17729f5dc5 Sed error. The status value in the PRINTER_INFO_2 structure isn't a WERROR
but a plain old uint32.
(This used to be commit 690cc12bad)
2002-01-07 06:13:40 +00:00
Tim Potter
9a02c6b4e8 Converted getprinterdriver to WERROR - it always returns dos error 6
(invalid handle) though.  )-:
(This used to be commit 7bfd1f35e4)
2002-01-07 03:33:46 +00:00
Tim Potter
0094af05ed Spelling fix.
(This used to be commit dfcc97a158)
2002-01-07 02:58:31 +00:00
Tim Potter
105e35a6e4 Don't log the password in pam_sm_authenticate() unless DEBUG_PASSWORD is
defined.  This is done with --enable-developer mode.
(This used to be commit caff5dc1d6)
2002-01-07 02:57:06 +00:00
Tim Potter
2f25e5118f 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.
(This used to be commit 4efbdda3fc)
2002-01-06 09:03:48 +00:00
Tim Potter
b77eec91dc Converted enumprinters and enumports cli functions to return WERRORs.
Make the offered and needed buffer size into parameters.
(This used to be commit 9d9e7fb74d)
2002-01-06 09:02:14 +00:00
Tim Potter
969d82ef25 Check for winbind separator in user name for cli_session_setup()
Patch from Alexander Bokovoy <a.bokovoy@sam-solutions.net>
(This used to be commit 6c42bf2089)
2002-01-06 04:03:26 +00:00
Tim Potter
cd0772e51e spoolss rpc client cleanup:
- converted OpenPrinterEx and ClosePrinter to WERROR instead of NT_STATUS
 - doc
(This used to be commit 248d114f85)
2002-01-06 03:54:40 +00:00
Tim Potter
009d7414d2 Define a rpc_client doc group.
(This used to be commit 87bc0a71ec)
2002-01-06 03:49:28 +00:00
Tim Potter
21881b9c35 Minor doc cleanups.
(This used to be commit 5c8f6be290)
2002-01-06 03:48:41 +00:00
Tim Potter
bf4c3d3659 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.
(This used to be commit f4535721d3)
2002-01-06 03:41:29 +00:00
Tim Potter
84dbcd6147 Display nicer message when server name could not be resolved.
(This used to be commit 950d8e3656)
2002-01-06 03:24:51 +00:00
Tim Potter
d1baa1fda9 DOS error 31 is ERRgeneral, General Failure. This is the WERROR equivalent
to NT_STATUS_UNSUCCESSFUL according to AB's funky new error map.
(This used to be commit 9c968fbb01)
2002-01-06 02:55:37 +00:00
Andrew Bartlett
b8b228d961 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
(This used to be commit 08a5c5bf94)
2002-01-06 01:37:14 +00:00
Andrew Bartlett
b283dba09d Some more SPNEGO fixes.
(This used to be commit 0e564cb32a)
2002-01-06 00:49:23 +00:00