1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-25 23:21:54 +03:00
Commit Graph

13438 Commits

Author SHA1 Message Date
Gerald Carter
e62ef2ba2d move disabling code to context functions instead of backwards compatible wrappers 0001-01-01 00:00:00 +00:00
Jeremy Allison
4c182d3220 Fixup the allocate version of the function to do "crap" conversions too.
Embarrassing number of goto's in this :-(. Fixes #830 I think.
Jeremy.
0001-01-01 00:00:00 +00:00
Gerald Carter
28c2a74c85 return NSS_SUCCESS if we have found the max number of gids possible on Solaris; patch from John Klinger <john.klinger@lmco.com> 0001-01-01 00:00:00 +00:00
Andrew Bartlett
7a36cc4ac0 Fix const warning 0001-01-01 00:00:00 +00:00
Andrew Bartlett
955436a6f6 This should be the correct fix for the lack of a prototype for
remote_password_change().

Sorry for the original bug.

Andrew Bartlett
0001-01-01 00:00:00 +00:00
Jeremy Allison
6a7919f254 Working on #830. Cope with bad conversions better - don't just memcpy but
try a crap conversion instead. Next this needs to be done to the convert_alloc
function.
Actually fixes some valgrind warnings as well - cool !
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
4cb8facbf9 Fix for a bug where the mutex could be left locked. Also remove the
memory keytab code which has no effect. Driven by bug report from
"Rob J. Caskey" <rcaskey@uga.edu>.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
2da24613ed A few fixes from "L. Lucius" <ib@digicron.com>. Don't use int when it's
really a size_t.
Jeremy.
0001-01-01 00:00:00 +00:00
Gerald Carter
ec30303669 fix installmodules problem with make on True64 0001-01-01 00:00:00 +00:00
Gerald Carter
5a32f9568f fix problems with proto.h 0001-01-01 00:00:00 +00:00
Andrew Tridgell
655ec16828 there are places in the samba3 code that don't check properly for
packet-termination of strings. This change ensures that when we go
past the end of a packet we hit 2 null bytes, thus terminating. We are
relying on the SAFETY_MARGIN packet allocation stuff here.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
8b8f0c5279 the conversion from int to size_t in charcnv did not take into account
one place where we checked "if (src_len > 0)".

I actually would greatly prefer to switch back to int for src_len. The
type *can* be negative, which means an unsigned type is
inappropriate. There is absolutely no reason why "int" should not be
used for a parameter like this.

I didn't change back to int as we are close to a release and I wanted
a mininal change, but please don't go changing types like this in
future without very careful testing and a damn good reason.

this bug broke pull_ucs2(), I would not be surprised if it caused all
sorts of nastiness. Thanks to vl for noticing the symptoms!
0001-01-01 00:00:00 +00:00
Volker Lendecke
e3a5e2d9c2 Remove bogus check. No functional change, just cosmetics.
Volker
0001-01-01 00:00:00 +00:00
Andrew Bartlett
6cde5e8307 Always at least try to compile in cracklib support.
Andrew Bartlett
0001-01-01 00:00:00 +00:00
Andrew Bartlett
2202667ebb Merge the 'use cracklib' parameter from HEAD back to 3.0
Andrew Bartlett
0001-01-01 00:00:00 +00:00
Gerald Carter
b60f6ec30d remerge andrew's cracklib patch from HEAD and fix a compile warnings 0001-01-01 00:00:00 +00:00
Tim Potter
5ca866f247 Include sys/acl.h in check for broken nisplus include files. Bug #1025. 0001-01-01 00:00:00 +00:00
Tim Potter
2423a45947 Don't log an error in tdb_brlock() if a non-blocking lock returns EAGAIN -
it's supposed to do that.
0001-01-01 00:00:00 +00:00
Gerald Carter
87343fc15a * BUG 101: patch from j.lu@tiesse.com to set the SV_TYPE_PRINTQ_SERVER;
* don't set the unix_ERR_XX code in mkdir_internal, let the error mapping
  handle it.
0001-01-01 00:00:00 +00:00
Gerald Carter
11093ecfb7 cleanup patch for bug 977 so we don't display incorrect debug messages 0001-01-01 00:00:00 +00:00
Andrew Bartlett
ab7dd748a9 If we are setting the NT or LM password to NULL, remove the attribute
rather than writing XXXXX

Andrew Bartlett
0001-01-01 00:00:00 +00:00
Jeremy Allison
3a3e336030 Fix up name canonicalization (needed for krb5 keytab support later).
Remove source_env handler (no longer used in any codepath).
Jeremy.
0001-01-01 00:00:00 +00:00
Gerald Carter
52bf070b10 disable any account that doesn't have a password and doesn't had the ACB_PWNOTREQ bit set 0001-01-01 00:00:00 +00:00
Gerald Carter
9e590d6035 more initialization fixes 0001-01-01 00:00:00 +00:00
Gerald Carter
02899224a1 disable template accounts by default 0001-01-01 00:00:00 +00:00
Gerald Carter
54fd3992c3 initialization fixes 0001-01-01 00:00:00 +00:00
Gerald Carter
8135ea08b3 removing more unused parameters 0001-01-01 00:00:00 +00:00
Gerald Carter
d39b1b3fd6 BUG 570: don't overwrite LDFLAGS; patch from MORIYAMA Masayuki <moriyama@miraclelinux.com> 0001-01-01 00:00:00 +00:00
Andrew Tridgell
d62cb9454e completely rewrote the AIX UESS backend (UESS is the AIX equivalent of
NSS). This time I think I've actually got it right. I wrote a fairly
good test suite for UESS modules (similar to nsstest.c) that allowed
me to explore how the modules supplied with AIX actually work.

This new module also incorporates authentication features, so you
don't need a PAM module at all. Just install this UESS module and
authentication will "just work". It also handles password change, so
/usr/bin/passwd can be used to change windows password.
0001-01-01 00:00:00 +00:00
Richard Sharpe
0032c3f46a Remove an unused parameter from reload_services_file. 0001-01-01 00:00:00 +00:00
Jeremy Allison
1a7714ea32 Merge of Chris's fix.
Jeremy.
0001-01-01 00:00:00 +00:00
Gerald Carter
043a81b94d forgotten commit -- version == 3.0.3pre1 0001-01-01 00:00:00 +00:00
Gerald Carter
50f278ddcc prepping the SAMBA_3_0 branch for 3.0.3 work 0001-01-01 00:00:00 +00:00
Gerald Carter
6b89a76aa7 bug 977 - don't create a homes share for a user if a static share already exists by the same name 0001-01-01 00:00:00 +00:00
Andrew Bartlett
ca24ae50ea Clarify comment on set_effective_uid()
Andrew Bartlett
0001-01-01 00:00:00 +00:00
Andrew Bartlett
934e9f3bd0 Revise our server-side password change code to cope with the various
different feilds that different clients send.  (For example, not all clients
send both password types).

This also cleans up the code to make it clearer what is really going on,
and to make better use of common functions.

Andrew Bartlett
0001-01-01 00:00:00 +00:00
Andrew Bartlett
2a2b1f0c87 This adds client-side support for the unicode/SAMR password change scheme.
As well as avoiding DOS charset issues, this scheme returns useful error
codes, that we can map back via the pam interface.

This patch also cleans up the interfaces used for password buffers, to
avoid duplication of code.

Andrew Bartlett
0001-01-01 00:00:00 +00:00
Andrew Bartlett
7495cafd42 Add a few more NTSTATUS <=> PAM error mappings.
Andrew Bartlett
0001-01-01 00:00:00 +00:00
Andrew Bartlett
493ac5ce98 Patch by Luca Bolcioni <Luca.Bolcioni@yacme.com>. Ensure we always
initialise the session key.  Fixes segfaults with security=server, and
encrypt passwords = no.

Andrew Bartlett
0001-01-01 00:00:00 +00:00
Volker Lendecke
be485eea81 Fix memleak just introduced. Thanks to abartlet :-)
Volker
0001-01-01 00:00:00 +00:00
Volker Lendecke
1797b16fad On my SuSE 8.2 (glibc 2.3.2) the getpwnam inside pdb_getsampwnam reset
the surrounding getpwent loop to the first entry. So smbd went into an
endless loop.

Volker
0001-01-01 00:00:00 +00:00
Andrew Bartlett
636b98dab9 Fix the initialisation vectors for NTLM2, so that they at least make sense,
even if they don't work yet.

Andrew Bartlett
0001-01-01 00:00:00 +00:00
Andrew Bartlett
1096271454 If we are providing strndup(), ensure we provide a prototype too.
Andrew Bartlett
0001-01-01 00:00:00 +00:00
Andrew Bartlett
c97d3eb162 Fix removal of attributes in LDAP - we would not actually remove the old
value in the previous code.

Andrew Bartlett
0001-01-01 00:00:00 +00:00
Andrew Bartlett
4ca0ab7506 A Samba DC is nothing special these days - so every domain controller
location packet from the client is not a DEBUG(1) event anymore...

(Yes, we printed this for each of these UDP packets...)

Andrew Bartlett
0001-01-01 00:00:00 +00:00
Volker Lendecke
09a3001423 Fix typo 0001-01-01 00:00:00 +00:00
Volker Lendecke
6d22f0d8c3 Fix decoding of base64. We got the length wrong when the result was not
an exact multiple of 3.

I also wrote a torture test and it survived some minutes of random stuff
coded/decoded up to 16 MB data. But that would be a bit too embarassing to
commit... :-)

Volker
0001-01-01 00:00:00 +00:00
Andrew Bartlett
aca07f33a2 Fix for debian Bug#225328 by LaMont Jones <lamont@debian.org>, where
the failure of our LFS test caused the _GNU_SOURCE define not to be
added, causeing strndup() not to be defined...

I'll into when we really should define _GNU_SOURCE shortly, but the
fix is correct anyway.

Andrew Bartlett
0001-01-01 00:00:00 +00:00
Stefan Metzmacher
b5e814294e * Add SIGABRT to fault handling
so we now got a backtrace, if we crash
  in libldap with SIGABRT

metze
0001-01-01 00:00:00 +00:00
Volker Lendecke
413ed77142 Fix compiler warning 0001-01-01 00:00:00 +00:00
Volker Lendecke
ea1a5fb303 Display some nicer error messages for login via 'net'. I don't
see a reason why we have so many special cases and not simply use
nt_errstr(nt_status).

Comments?

Volker
0001-01-01 00:00:00 +00:00
Jeremy Allison
25d739978f Fix for a signing bug when the mid wraps.
Found by Fran Fabrizio <fran@cis.uab.edu>.
Add to the *start* of the list not the end of the list.
This ensures that the *last* send sequence with this mid
is returned by preference.
This can happen if the mid wraps and one of the early
mid numbers didn't get a reply and is still lurking on
the list.
Jeremy.
0001-01-01 00:00:00 +00:00
Gerald Carter
faec928564 fix another bug caused by cli_lsa_query_info_policy() changes 0001-01-01 00:00:00 +00:00
Jim McDonough
07d6ed4343 Fix another join problem. Don't use a TALLOC_CTX before it has been
initialized.

Also split out the oldstyle join into a new fn, allowing us to call it
with no failure message from net rpc join, but displaying a failure message
when used with net rpc oldjoin.
0001-01-01 00:00:00 +00:00
Volker Lendecke
4c90421070 Patch from "Stoian Ivanov" <sdr@bultra.com>: Add -g (greppable..) to
smbclient -L to make the output usable in pipes.

Volker
0001-01-01 00:00:00 +00:00
Volker Lendecke
da5944129f Commit sid<->[ug]id extensions to libnss_winbind.so on Linux, as well as a
factored-out nss_winbind.[ch]. I took tridge's public domain license comment
for the nss_winbind.[ch].

This is probably not the last word on that extension, but as it is quite
non-intrusive to the main samba code, I would like to give it a start.

Volker
0001-01-01 00:00:00 +00:00
Gerald Carter
2fd2c07df4 Bug 381: check builtin (not local) group SID. Patch from Jianliang Lu <j.lu@tiesse.com> 0001-01-01 00:00:00 +00:00
Gerald Carter
db1c6721bf setting version to 3.0.2rc2 0001-01-01 00:00:00 +00:00
Jim McDonough
a885df7635 Fix net rpc join (at least newstyle) after it was broken by changing
the parms to cli_lsa_query_info_policy without changing them here...
0001-01-01 00:00:00 +00:00
Gerald Carter
79fe75dcdf * BUG 446
- setup_logging() in smbclient to be interactive (remove the timestamps)
  - Fix bad return value in pull_ucs2( needs more testing to make sure this
    didn't break something else) that caused clistr_pull() to always read
    the same string from the buffer (pull_usc2() could return -1 if the original
    source length was given as -1)
  - increment some debugging messages to avoid printing them out so often
0001-01-01 00:00:00 +00:00
Gerald Carter
c51eaec4f0 BUG 958; don't use the -N option when invoking smbclient from the smbtar script 0001-01-01 00:00:00 +00:00
Volker Lendecke
3d9931fe29 reply_spnego_kerberos did not set the domain of the user handed to
register_vuid correctly. We ended up with the local netbios name in
substitutions for %D later.

Volker

P.S: Tridge, I can *really* see why you want to get rid of global variables
:-)
0001-01-01 00:00:00 +00:00
Volker Lendecke
c4a6151f46 Don't substitute stuff in lp_afs_username_map, this is explicitly
done later.

Volker
0001-01-01 00:00:00 +00:00
Volker Lendecke
945c780764 And another memory corruption in winbind. Arg 3 of safe_strcpy does not
include the terminating 0.

Volker
0001-01-01 00:00:00 +00:00
Volker Lendecke
cd89288e21 Fix a segfault in winbindd. Calling getusersids with a SID that results in 0
groups winbind ended up freeing an uninitialised pointer.

Volker
0001-01-01 00:00:00 +00:00
Stefan Metzmacher
b0c0d73691 * Fix sys_chown() when no chown() is presend
metze
0001-01-01 00:00:00 +00:00
Stefan Metzmacher
e9e5e2036f * Fix XFS quotas: XFS_USER_QUOTA -> USRQUOTA
XFS_GROUP_QUOTA -> GRPQUOTA
* Fix disk_free calculation with group quotas.
* Add debug class 'quota' and a lot of DEBUG()'s
  to the quota code.

metze
0001-01-01 00:00:00 +00:00
Gerald Carter
5134c6bcbc BUG 936: fix bind credentials for schannel binds in smbd (and add a comment to winbindd_cm about this 0001-01-01 00:00:00 +00:00
Tim Potter
67d25f3de8 Fix for bug 905. Remove POBAD_CC as it doesn't seem to be applicable
anymore.
0001-01-01 00:00:00 +00:00
Gerald Carter
1c15bfacb4 BUG 972; check pointer in cli_ds_getprimarydominfo() before trying to copy a structure 0001-01-01 00:00:00 +00:00
Herb Lewis
a363e5d8c5 source/rpc_parse/parse_prs.c ZERO_STRUCTP(ps) not needed as it is done
in prs_init now

testsuite/printing/psec.c	cannot do a prs_mem_free() when tdb_prs_fetch fails
				as the prs structure has not been initialized
0001-01-01 00:00:00 +00:00
Gerald Carter
40b7d863dc Fix initgroups() call nss_winbind on solaris; patch from John Klinger <john.klinger@lmco.com> 0001-01-01 00:00:00 +00:00
Gerald Carter
5145611188 bug 770; correct fix this time; Make sure that we send the SMBjobid for unix jobs back to the client. Allows windows client to remove print jobs submitted from lpr 0001-01-01 00:00:00 +00:00
Gerald Carter
be9f25bea9 bug 660; using byte order safe macros (or tdb_unpack) when reading 2 or 4 byte values from a tdb buffer 0001-01-01 00:00:00 +00:00
Gerald Carter
6202e0fa72 revert the cracklib changes until post 3.0.2 0001-01-01 00:00:00 +00:00
Gerald Carter
1ed2e52153 * Revert to using rpc for mixed mode AD domains.
The reason for this are:
  (a) the set_dc_type_and_flags() cannot tell the different
      between connecting to an NT4 domain and an NT4 BDC
      of a mixed mode domain.
  (b) the connection management for the rpc backend only
      provides on named pipe per cli_state.  So it is possible
      to connect to an NT4 BDC for netlogon and an AD mixed mode
      DC for lsarpc.  RPC is the lowest common demonimator here.
  (c) Issue with the sequence number value between the
      highestCommittedUSN LDAP attribute and the seq_num returned
      via RPC.


We will revisit this later, but the changes need to make this
work right now are too broad and risky.
0001-01-01 00:00:00 +00:00
Jeremy Allison
fb088b5679 Remove duplicate extern.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
da51988cfa Remove references to 'jn' which gcc-3.4 with precompiled headers
doesn't like.
Jeremy.
0001-01-01 00:00:00 +00:00
Stefan Metzmacher
c73e845055 fix XFS quotas the macro changed from HAVE_XFS_QUOTA -> HAVE_XFS_QUOTAS
metze
0001-01-01 00:00:00 +00:00
Andrew Bartlett
b0b2010461 Remove duplicate comment.
Andrew Bartlett
0001-01-01 00:00:00 +00:00
Andrew Bartlett
17518018c0 Finish adding cracklib support - this adds the configure test to enable
it, on machines that actually have a working cracklib, for which we have
the correct path to the dictionary.

Andrew Bartlett
0001-01-01 00:00:00 +00:00
Gerald Carter
bca702c976 * allow dns lookups to be disabled for DOMAIN#1c (and #1b)
names
* fix some a mispelled variable name
0001-01-01 00:00:00 +00:00
Andrew Bartlett
4a01f3dbb4 On systems without a working cracklib, ensure we don't include the header
(the actual call to crack was already in this #ifdef)

Andrew Bartlett
0001-01-01 00:00:00 +00:00
Gerald Carter
d7b6298b9e fixing compile problems due to my recent ads.h changes 0001-01-01 00:00:00 +00:00
Andrew Bartlett
bc770edb78 First stab at cracklib support (password quality checking) in Samba 3.0
This adds a configure test, that tries to find out if we have a working
cracklib installation, and tries to pick up the debian hints on where
the dictionary might be found.  Default is per my Fedora Core 1 system -
I'm not sure how much it changes.

Andrew Bartlett
0001-01-01 00:00:00 +00:00
Stefan Metzmacher
12d6bc3bd0 update copyright to -2004
metze
0001-01-01 00:00:00 +00:00
Jelmer Vernooij
d12b793d9c Fix swatdir location for --with-fhs 0001-01-01 00:00:00 +00:00
Gerald Carter
ebabf72a78 fix some warnings from the Sun compiler 0001-01-01 00:00:00 +00:00
Andrew Bartlett
7e75a6d681 Romve debugging assertions (oops...)
Andrew Bartlett
0001-01-01 00:00:00 +00:00
Andrew Bartlett
35f6347a73 Add a new type of name lookup 'ads'. This seperates this from normal
hostname lookups, and ensures that we don't lookup 'short' (ie NetBIOS)
domain names in DNS.

Andrew Bartlett
0001-01-01 00:00:00 +00:00
Jelmer Vernooij
65b01f67d5 Use StrCaseCmp, not strcasecmp. Should fix winbind build on IRIX 0001-01-01 00:00:00 +00:00
Gerald Carter
ba9dc0d9fd fix segfault when sid_ptr == 0 in DsEnumDomainTrusts() reply 0001-01-01 00:00:00 +00:00
Gerald Carter
8e8a351cab fix a seg fault caused by abartlet's last checkin; there's no way this could have been tested against an NT4 DC 0001-01-01 00:00:00 +00:00
Andrew Bartlett
595dee6607 use SAFE_FREE(), not free().
Andrew Bartlett
0001-01-01 00:00:00 +00:00
Andrew Bartlett
7c34de8096 This merges in my 'always use ADS' patch. Tested on a mix of NT and ADS
domains, this patch ensures that we always use the ADS backend when
security=ADS, and the remote server is capable.

The routines used for this behaviour have been upgraded to modern Samba
codeing standards.

This is a change in behaviour for mixed mode domains, and if the trusted
domain cannot be reached with our current krb5.conf file, we will show
that domain as disconnected.

This is in line with existing behaviour for native mode domains, and for
our primary domain.

As a consequence of testing this patch, I found that our kerberos error
handling was well below par - we would often throw away useful error
values.  These changes move more routines to ADS_STATUS to return
kerberos errors.

Also found when valgrinding the setup, fix a few memory leaks.

While sniffing the resultant connections, I noticed we would query our
list of trusted domains twice - so I have reworked some of the code to
avoid that.

Andrew Bartlett
0001-01-01 00:00:00 +00:00
Andrew Bartlett
c9f9d6d317 In tdb_allocate(), we would create a new record by writing a local variable
'newrec' into the tdb.

This was not initialised, so valgrind warned about it.

(Note:  valgrind only makes sense on tdbs with 'mmap = no' in your smb.conf)

Andrew Bartlett
0001-01-01 00:00:00 +00:00
Andrew Bartlett
7e6cc8f003 Make it clearer that the domain here is the domain of the user for
authentication.

Andrew Bartlett
0001-01-01 00:00:00 +00:00
Andrew Bartlett
2e6eaad9ce Move more of winbind to use 'find_our_domain()' rather than the dangerous
find_domain_from_name(lp_workgroup()).

(as find_domain_from_name() can change the data in lp_workgroup())

Andrew Bartlett
0001-01-01 00:00:00 +00:00
Andrew Bartlett
703f101136 The correct test for 'is our primary domain' is domain->primary 0001-01-01 00:00:00 +00:00
Andrew Bartlett
6a9bbd1da3 Machines are people too!
While machine accounts cannot use an NTLM login (NT4 style), they are
otherwise full and valid members of the domain, and expect to be able to
use kerberos to connect to CIFS servers.

This means that the LocalSystem account, used by various services, can
perform things like backups, without the admin needing to enter further
passwords.

This particular issue (bug 722) has started to come up a lot on the lists.

I have only enabled it for winbindd-based systems, as the macros use use
to call the 'add user script' will strip the $ from the username for
security reasons.

Andrew Bartlett
0001-01-01 00:00:00 +00:00
Jeremy Allison
fac9e6d712 Fix for bug #922. Fast path not called for strlower_m() and strupper_m().
From ab@samba.org (Alexander Bokovoy).
Jeremy.
0001-01-01 00:00:00 +00:00
Rafal Szczesniak
5d7f81eea2 Typo fix.
rafal
0001-01-01 00:00:00 +00:00
Rafal Szczesniak
b5e492b8ea Doxygen comment fix.
rafal
0001-01-01 00:00:00 +00:00
Jeremy Allison
7c4d52014e Fix from Justin Baugh <justin.baugh@request.com> for bugid #948 for
FreeBSD winbindd.
Jeremy.
0001-01-01 00:00:00 +00:00
Gerald Carter
344e113368 commiting jra's fix for Exchange clear test auth 0001-01-01 00:00:00 +00:00
Jeremy Allison
8e20c06ed3 Fix from Luke Howard <lukeh@PADL.COM> for incorrect early free().
Jeremy.
0001-01-01 00:00:00 +00:00
Andrew Bartlett
85da181e8a Don't duplicate pulling the 'IPC' username from secrets.tdb, instead
just use one function for both places.

Andrew Bartlett
0001-01-01 00:00:00 +00:00
Volker Lendecke
d429536817 There is a German translation of swat -- surprise :-)
Fix some msgs

Volker
0001-01-01 00:00:00 +00:00
Jelmer Vernooij
82bd1b45a4 Add smbget utility, a simple wget-like utility that uses libsmbclient.
Supports recursive downloads and resume, progress indication and shows
estimated time remaining.
0001-01-01 00:00:00 +00:00
Andrew Bartlett
4ad67f1340 Fix segfualt caused by incorrect configuration. If lp_realm() was not set,
but security=ADS, we would attempt to free the principal name that krb5
never allocated.

Also fix the dump_data() of the session key, now that we use a data_blob to
store that.

Andrew Bartlett
0001-01-01 00:00:00 +00:00
Jeremy Allison
d75db0bf1e Patch penguin. Cleaning out old mbp patch.
Jeremy.
0001-01-01 00:00:00 +00:00
Jelmer Vernooij
7495395c1c Fix -s option to smbcontrol (#908) 0001-01-01 00:00:00 +00:00
Gerald Carter
fac5e05ca1 remove unused seek_file(); don't hardcode '\' when printing the auth-user 0001-01-01 00:00:00 +00:00
Gerald Carter
52480d6d05 bumping to 3.0.2pre2 0001-01-01 00:00:00 +00:00
Gerald Carter
7d7a262f45 isolate ldap debug messages to the common smbldap_XXX() functions 0001-01-01 00:00:00 +00:00
Jeremy Allison
cae5f158e5 XFS quota patch from Stefan Metzmacher <metze@metzemix.de>.
Jeremy.
0001-01-01 00:00:00 +00:00
Volker Lendecke
50be537b19 Correctly detect AFS headers on SuSE in /usr/include/afs/afs/
Volker
0001-01-01 00:00:00 +00:00
Andrew Bartlett
5d43e00a49 Patch by Stefan Metzmacher <metze@metzemix.de>:
here's a small fix that fixes the new quota system on irix.

I need to reanable XFS quotas on irix for the new quota system
(Jerry do you want to wait for this for the release ?)

But the old system works and is the default on irix!
0001-01-01 00:00:00 +00:00
Jeremy Allison
019aaaf0df Patch based on work from James Peach <jpeach@sgi.com> to convert over to
using pread/pwrite. Modified a little to ensure fsp->pos is correct.
Fix for #889.
Jeremy.
0001-01-01 00:00:00 +00:00
Andrew Bartlett
93a5d8079a Ensure that for wbinfo --set-auth-user, we actually use the domain.
Andrew Bartlett
0001-01-01 00:00:00 +00:00
Steve French
865fcdcb85 cifs mount helper merge 0001-01-01 00:00:00 +00:00
Andrew Bartlett
ba33f1e0d5 Fix more cases to ensure that as a server, we don't complain to the client
about our server-side lack of session key.

Andrew Bartlett
0001-01-01 00:00:00 +00:00
Jeremy Allison
ffaf9982dc Added last missing file.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
52eafc131e Oops. Broke the build. Added missing files.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
1b1c216122 Fix from James Flemer <jflemer@uvm.edu> to make HAVE_ATTR_LIST linked to
HAVE_SYS_ATTRIBUTES_H to fix AIX compile.
Jeremy.
0001-01-01 00:00:00 +00:00
Gerald Carter
134cf1d546 fix inverted check using krb5_kt_resolve() and HAVE_MEMORY_KEYTAB; bug 912 0001-01-01 00:00:00 +00:00
Jeremy Allison
4350aa6ce6 Patch from Stefan (metze) Metzmacher <metze at metzemix.de> to revert to 2.2.x quota methods.
:-).

"here's a patch which ports the samba 2.2 samba_linux_quota.h stuff to 3_0.

This is needed because of so many broken quota files outthere.

Please, test this with old, new kernels
(strucr dqblk, struct mem_dqblk, and struct if_dqblk)
, quota.user, aquota.user formats

what is when a user is over soft quota and over hard quotas..."

Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
84d34e32be Ensure we set "always sign" flag if set. We don't currently do anything with
this but we should log the fact it was negotiated.
Jeremy.
0001-01-01 00:00:00 +00:00
Volker Lendecke
541e6998a0 Fix warning
Volker
0001-01-01 00:00:00 +00:00
Andrew Bartlett
39311495de Don't free the encrypted_session_key early - that causes the subsequent
test for a valid length to fail...

This should fix 'security=server' and hosts-equiv failures picked up by
the build farm.

Andrew Bartlett
0001-01-01 00:00:00 +00:00
Andrew Bartlett
7e5855dfd2 shorten some more lines. 0001-01-01 00:00:00 +00:00
Andrew Bartlett
3a4c56e4c6 Try to keep vl happy - shorten some of these lines. 0001-01-01 00:00:00 +00:00
Andrew Bartlett
687aececa6 Grumble... grumble... fix the build... 0001-01-01 00:00:00 +00:00
Andrew Bartlett
3d91b0a006 Show the sid type in name->sid translatons in a way that can be easily
understood by humans.

Andrew Bartlett
0001-01-01 00:00:00 +00:00
Andrew Bartlett
379368b0be Always call the auto-init funciton - this avoids tdb segfaulting under
us if we failed to open it earlier.

Andrew Bartlett
0001-01-01 00:00:00 +00:00
Andrew Bartlett
da408e0d5a Correctly handle per-pipe NTLMSSP inside a NULL session. Previously we
would attempt to supply a password to the 'inside' NTLMSSP, which the
remote side naturally rejected.

Andrew Bartlett
0001-01-01 00:00:00 +00:00
Andrew Bartlett
32397c8b01 Change our Domain controller lookup routines to more carefully seperate
DNS names (realms) from NetBIOS domain names.

Until now, we would experience delays as we broadcast lookups for DNS names
onto the local network segments.

Now if DNS comes back negative, we fall straight back to looking up the
short name.

Andrew Bartlett
0001-01-01 00:00:00 +00:00
Andrew Bartlett
aacb817e89 Add const. 0001-01-01 00:00:00 +00:00
Andrew Bartlett
c279e178bc There is some memory corruption hidden somewhere in our winbind code. If I
could reproduce it, I would fix it, but for now just make sure we always
SAFE_FREE() and set our starting pointers to NULL.

Andrew Bartlett
0001-01-01 00:00:00 +00:00
Andrew Bartlett
6e5b084c20 Change (unused) structure parameter for cli_ds_enum_domain_trusts() cleanup. 0001-01-01 00:00:00 +00:00
Andrew Bartlett
06c3f15aa1 rpc_client/cli_lsarpc.c:
rpc_parse/parse_lsa.c:
nsswitch/winbindd_rpc.c:
nsswitch/winbindd.h:
 - Add const

libads/ads_ldap.c:
 - Cleanup function for use

nsswitch/winbindd_ads.c:
 - Use new utility function ads_sid_to_dn
 - Don't search for 'dn=', rather call the ads_search_retry_dn()

nsswitch/winbindd_ads.c:
include/rpc_ds.h:
rpc_client/cli_ds.c:
 - Fixup braindamage in cli_ds_enum_domain_trusts():
    - This function was returning a UNISTR2 up to the caller, and
      was doing nasty (invalid, per valgrind) things with memcpy()
    - Create a new structure that represents this informaiton in a useful way
      and use talloc.

Andrew Bartlett
0001-01-01 00:00:00 +00:00
Andrew Bartlett
131bb928f1 Fix for bug 707, getent group for huge ads groups (>1500 members)
This introduces range retrieval of ADS attributes.

VL rewrote most of Gnther's patch, partly to remove code duplication and
partly to get the retrieval of members in one rush, not interrupted by the
lookups for the DN.

I rewrote that patch, to ensure that we can keep an eye on the USN
(sequence number) of the entry - this allows us to ensure the read was
atomic.

In particular, the range retrieval is now generic, for strings.  It
could easily be made generic for any attribute type, if need be.

Andrew Bartlett
0001-01-01 00:00:00 +00:00
Andrew Bartlett
0d5b0345a6 I'm not quite sure what happened here - but replace the ads_sid_to_dn
function with one that compiles.

Andrew Bartlett
0001-01-01 00:00:00 +00:00
Andrew Bartlett
cf44549694 We can't possilby get 'ok' here, as the if statement above just checked for it. 0001-01-01 00:00:00 +00:00
Andrew Bartlett
a78b020562 Make arbitary binary data unsigned char. 0001-01-01 00:00:00 +00:00
Andrew Bartlett
49a7a3fd17 Add a utilty function for converting a sid to a DN.
Andrew Bartlett
0001-01-01 00:00:00 +00:00
Andrew Bartlett
a2f6dec05b Make it clear that we cannot sign if we don't have a session key. 0001-01-01 00:00:00 +00:00
Andrew Bartlett
cb063c1b69 Automaticly initialise the signing engine, if we have a session key. 0001-01-01 00:00:00 +00:00
Jelmer Vernooij
65ad2c02fd - Put functions for generating SQL queries in pdb_sql.c
- Add pgSQL backend (based on patch by Hamish Friedlander)
- Use query generate functions from pdb_mysql and pdb_pgsql
- Only pdb_pgsql.c needs to be changed whenever the fields in SAM_ACCOUNT change
0001-01-01 00:00:00 +00:00
Volker Lendecke
3ce6c9f273 Commit the translation of the realm to the netbios domain name in the kerberos
session setup. After talking to jht and abartlet I made this unconditional, no
additional parameter.

Jerry: This is a change in behaviour, but I think it is necessary.

Volker
0001-01-01 00:00:00 +00:00
Andrew Bartlett
53d802c72a Even if the 'device type' is always an ascii string, use push_string to get
it out onto the wire.  Avoids valgrind warnings because the fstrcpy() causes
part of the wire buffer to be 'marked'.

Andrew Bartlett
0001-01-01 00:00:00 +00:00
Volker Lendecke
dafa4d202b And yet another const
Volker
0001-01-01 00:00:00 +00:00
Andrew Bartlett
e5abd93d79 There is not a particularly good excuse for complaining to the *client* that
it sent 'INVALID_PARAMETER', when it was us as the server that could not
come up with a session key.  Instead, allow normal authentication to take
place, but do not setup a session key.

Andrew Bartlett
0001-01-01 00:00:00 +00:00
Andrew Bartlett
faddf5d8f9 Match Win2k, and return NT_STATUS_INVALID_PARAMETER
if this parameter is not an account type

Andrew Bartlett
0001-01-01 00:00:00 +00:00
Andrew Bartlett
903263a1bd Under certain error conditions (a talloc() failure above) this would cause
a double-free(), and the resultant malloc heap corruption.

This may be one of our lurking winbind segfaults.

Andrew Bartlett
0001-01-01 00:00:00 +00:00
Andrew Bartlett
3f6d0cd3a8 Having no members of a group is a perfectly valid (if unusual) situation.
Andrew Bartlett
0001-01-01 00:00:00 +00:00
Andrew Bartlett
f9e59f8bc0 JHT came up with a nasty (broken) torture case in preparing examples for
his book.

This prompted me to look at the code that reads the unix group list.  This
code did a lot of name -> uid -> name -> sid translations, which caused
problems.  Instead, we now do just name->sid

I also cleaned up some interfaces, and client tools.

Andrew Bartlett
0001-01-01 00:00:00 +00:00
Volker Lendecke
0c8ee04c78 After talking with abartlet remove the fix for bug 707 again.
Volker
0001-01-01 00:00:00 +00:00
Volker Lendecke
9d8235bf41 Fix for bug 707, getent group for huge ads groups (>1500 members)
This introduces range retrieval of ADS attributes.

I've rewritten most of Gnther's patch, partly to remove code duplication and
partly to get the retrieval of members in one rush, not interrupted by the
lookups for the DN.

Andrew, you told me that you would like to see a check whether the AD sequence
number is the same before and after the retrieval to achieve atomicity. This
would be trivial to add, but I'm not sure that we want this, as this adds two
roundtrips to every membership query. We can not know before the first query
whether we get additional range values, and at that point it's too late to ask
for the USN.

Tested with a group of 4000 members along with lots of small groups.

Volker
0001-01-01 00:00:00 +00:00
Andrew Bartlett
6a8cc7f012 Changes to our PAM code to cope with the fact that we can't handle some
domains (in particular, the domain of the current machine, if it is not a PDC)

By changing the error codes, we now return values that PAM can correctly
use for better stacking of PAM modules - in particular of the password change
module.

This allows pam_winbind to co-exist with other pam modules for password changes.

Andrew Bartlett
0001-01-01 00:00:00 +00:00
Andrew Bartlett
6f3cd9e2af Forgot to commit this for the 'get our primary domain' change. 0001-01-01 00:00:00 +00:00
Andrew Bartlett
cc050e0137 Jerry rightly complained that we can't assume that the first domain is
our primary domain - new domains are added to the front of the list. :-(

Use a much more reliable 'flag test' instead.  (note:  changes winbind structures, make clean).

Andrew Bartlett
0001-01-01 00:00:00 +00:00
Andrew Bartlett
494781f628 auth/auth_util.c:
- Fill in the 'backup' idea of a domain, if the DC didn't supply one.  This
   doesn't seem to occour in reality, hence why we missed the typo.

lib/charcnv.c:
lib/smbldap.c:
libads/ldap.c:
libsmb/libsmbclient.c:
printing/nt_printing.c:
 - all the callers to pull_utf8_allocate() pass a char ** as the first
   parammeter, so don't make them all cast it to a void **

nsswitch/winbind_util.c:
 - Allow for a more 'correct' view of when usernames should be qualified
   in winbindd.  If we are a PDC, or have 'winbind trusted domains only',
   then for the authentication returns stip the domain portion.
 - Fix valgrind warning about use of free()ed name when looking up our
   local domain.  lp_workgroup() is maniplated inside a procedure that
   uses it's former value.  Instead, use the fact that our local domain is
   always the first in the list.

Andrew Bartlett
0001-01-01 00:00:00 +00:00
Andrew Bartlett
3225f262b1 Get the DOMAIN\username around the right way (I had username\domain...)
Push the unix username into utf8 for it's trip across the socket.

Andrew Bartlett
0001-01-01 00:00:00 +00:00
Gerald Carter
10b9976e0a Move to short lived TALLOC_CTX* for allocating printer
objects from the print handle cache.   Fixes bug that
caused smbd to consume large amounts of RAM when

(a) a printer handle was kept open over an extended
    period of time, and
(b) the client issued frequent requests that resulted
    in a call to get_a_printer()
0001-01-01 00:00:00 +00:00
Volker Lendecke
6d2285b6d1 The AFS pts command always generates completely lower-case user names. As case
is not significant in windows user names we should not lose information by
lower-casing the name before handing it to AFS.

Volker
0001-01-01 00:00:00 +00:00
Volker Lendecke
3663ed2b96 Fix Bug # 924
Volker
0001-01-01 00:00:00 +00:00
Andrew Bartlett
7a3a5a6361 Try to gain a bit more consistancy in the output of usernames from ntlm_auth:
Instead of returning a name in DOMAIN\user format, we now return it in the
same way that nsswtich does - following the rules of 'winbind use default
domain', in the correct case and with the correct seperator.

This should help sites who are using Squid or the new SASL code I'm working
on, to match back to their unix usernames.

Andrew Bartlett
0001-01-01 00:00:00 +00:00
Andrew Bartlett
0fa268863b Make the name of the NTLMSSP client more consistant before we lock it in stone. 0001-01-01 00:00:00 +00:00
Andrew Bartlett
96f3beb462 Remove testing hack 0001-01-01 00:00:00 +00:00
Andrew Bartlett
48315e8fd2 Move our basic password checking code from inside the authentication
subsystem into a seperate file - ntlm_check.c.

This allows us to call these routines from ntlm_auth.  The purpose of this
exercise is to allow ntlm_auth (when operating as an NTLMSSP server) to
avoid talking to winbind.  This should allow for easier debugging.

ntlm_auth itself has been reorgainised, so as to share more code between
the SPNEGO-wrapped and 'raw' NTLMSSP modes.  A new 'client' NTLMSSP mode
has been added, for use with a Cyrus-SASL module I am writing (based on vl's
work)

Andrew Bartlett
0001-01-01 00:00:00 +00:00
Andrew Bartlett
2375abfa00 Refactor our authentication and authentication testing code.
The next move will be to remove our password checking code from the SAM
authentication backend, and into a file where other parts of samba can use
it.

The ntlm_auth changes provide for better use of common code.

Andrew Bartlett
0001-01-01 00:00:00 +00:00
Andrew Bartlett
de3c3cbeeb Add the alignment required before all 2-byte quantities in NDR. Allows us
to correctly parse plaintext netlogon calls with odd-length passwords

Andrew Bartlett
0001-01-01 00:00:00 +00:00
Andrew Bartlett
8f9a069c59 Shutting down the connection closes outstanding sessions, so we don't need
to do it twice...

Amdrew Bartlett
0001-01-01 00:00:00 +00:00
Andrew Bartlett
76c59469a3 This patch corrects some errors in the NTLMSSP implementation, that
would incorrectly return INVALID_PARAMETER, instead of allowing a
login.

Andrew Bartlett
0001-01-01 00:00:00 +00:00
Volker Lendecke
f5afaafd61 Preliminary fix for our signing problem with failed NTLMSSP logins. This patch
solves the problem for me here, I can still successfully set up signing using
NTLMSSP against w2k3 and it does not show a signing error anymoe when the
password was wrong.

Jeremy, you might want to take a further look at it as this is not
particularly elegant.

Volker
0001-01-01 00:00:00 +00:00
Volker Lendecke
d74137d227 Collecting another little patch from gd@suse.de
As broken as it might be, smbwrapper.so should be put into the
libdir and not bindir.

Volker
0001-01-01 00:00:00 +00:00
Volker Lendecke
e6b4b956f6 Collecting some minor patches...
This adds the ability to specify the new user password for 'net ads password'
on the command line. As this needs the admin password on the command line, the
information leak is minimally more.

Patch from gd@suse.de

Volker
0001-01-01 00:00:00 +00:00
Andrew Bartlett
9080c30de8 Check the return value of string_to_sid in a few more places. (But
string_to_sid also needs to be less permissive on what it thinks are
valid sids...)

Andrew Bartlett
0001-01-01 00:00:00 +00:00
Andrew Bartlett
5b682aef67 Show the error message for failure to set the ldap password.
(For 'ldap password sync = yes')

Andrew Bartlett
0001-01-01 00:00:00 +00:00
Andrew Bartlett
fabf801690 Based on patch by Petri Asikainen <paca@sci.fi> fix bug #387 and #330.
This patch will change order how attributes are modified
from: add, delete
to:   delete, add

This is needed to update single valued attributes in Novell NDS and
should not harm anyone else.
0001-01-01 00:00:00 +00:00
Andrew Bartlett
6f828ff3d3 ldap rebind sleep -> ldap replication sleep
While writing documentation for metze's patch, it became clear that this is a
better name.

Andrew Bartlett
0001-01-01 00:00:00 +00:00
Volker Lendecke
63ffa770b6 This is metze's LDAP rebind sleep patch:
When smb.conf tells us to write to a read-only LDAP replica and we are
redirected by the LDAP server, the replication might take some seconds,
especially over slow links. This patch delays the next read after a rebind for
'ldap rebind sleep' milliseconds.

Metze, thanks for your patience.

Volker
0001-01-01 00:00:00 +00:00
Volker Lendecke
17473a65eb Fix our parsing of the LDAP url. We get around it as all decent systems seem
to have ldap_initialize.

Thanks to abartlet for the fix (and the bug in the first place ;-))

Volker
0001-01-01 00:00:00 +00:00
Volker Lendecke
d4e071d14b abartlet pointed me at the fact that the order and flags in loadparm.c are
actually used.... 'afs username map' should not show up in the swat basic
view. :-)

Maybe I should use swat from time to time....

Volker
0001-01-01 00:00:00 +00:00
Andrew Bartlett
8d54f5fe0c Fix bug 916 - do not perform a + -> space substitution for squid URL encoded
strings, only form input in SWAT.

Andrew Bartlett
0001-01-01 00:00:00 +00:00
Andrew Bartlett
e0a026c9b5 Thanks to Serassio Guido for noticing issues in our Squid NTLMSSP
implementation.  We were not resetting the NTLMSSP state for new
negotiate packets.

Andrew Bartlett
0001-01-01 00:00:00 +00:00
John Terpstra
46b2fb4db5 Fix typo. 0001-01-01 00:00:00 +00:00
Jeremy Allison
bee4b3348e Fix for special files being hidden from admins by Dmitry Butskoj <buc@odusz.elektra.ru>
Jeremy.
0001-01-01 00:00:00 +00:00
Gerald Carter
33a1a374eb add well known rid for pre win2k compatible access group; bug 897 0001-01-01 00:00:00 +00:00
Jeremy Allison
72252fb0b2 Patch from Jianliang Lu j.lu@tiesse.com to manage Power Users
group.
Jeremy.
0001-01-01 00:00:00 +00:00
Richard Sharpe
34351e457a A small fix to torture.c to cleanup the error handling and prevent crashes.
I really should clean up the comment as well.
0001-01-01 00:00:00 +00:00
Gerald Carter
850e4be29e * add a few useful debug lines
* fix bug involving Win9x clients.  Make sure we
  save the right case for the located username
  in fill_sam_account()
0001-01-01 00:00:00 +00:00
Jeremy Allison
b611f8d170 Add in comments explaining NTLMv2 selection. Use lm session key if that's
all there is.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
5aab4b976c Tidyup debug message in ntlmssp code. Add brackets around dodgy if statement.
Jeremy
0001-01-01 00:00:00 +00:00
Gerald Carter
ef4ab8d7c4 Make sure we correctly generate the lm session key.
This fixes a problem joining a Samba domain from a
vanilla win2k client that doesn't set the
NTLMSSP_NEGOTIATE_NTLM2 flag.

Reported on samba ml as "decode_pw: incorrect password length"
when handling a samr_set_userinfo(23 or 24) RPC.
0001-01-01 00:00:00 +00:00
Gerald Carter
19a8dd523a make sure we delete the group mapping before calling the delete group script; patch from Jianliang Lu <j.lu@tiesse.com> 0001-01-01 00:00:00 +00:00
Jeremy Allison
6d46e66ac2 Fix from ndb@theghet.to to allow an existing LDAP machine account to be
re-used, rather than created from scratch.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
ba0b5b8c9b Fix for bug #815. Make plaintext unicode passwords work with NT4.x
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
05afc34086 Fix detection of elements in in-memory keytab code.
Jeremy.
0001-01-01 00:00:00 +00:00