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

1266 Commits

Author SHA1 Message Date
Volker Lendecke
873a5a1211 r17451: Change pdb_getgrsid not to take a DOM_SID but a const DOM_SID * as an
argument.

Volker
2007-10-10 11:38:34 -05:00
Jeremy Allison
b5f0b1b644 r17407: Don't do strchr_m twice when once will do.
Jeremy.
2007-10-10 11:38:32 -05:00
Volker Lendecke
255475901c r17406: We need to do a translation of winbind separator -> '\\' in
lookup_name_smbconf, otherwise

force user = domain+administrator

can not work. Also attempt to fix the 'valid users = domain+group' bug at the
same time.

Volker
2007-10-10 11:38:32 -05:00
Volker Lendecke
250b9f3531 r17404: Is this XP (extreme programming)? :-)
With lp_workgroup we end up with remote names again...

Volker
2007-10-10 11:38:32 -05:00
Gerald Carter
63325b3687 r17403: add a helpful debug msg 2007-10-10 11:38:32 -05:00
Jeremy Allison
1e1fcb5eb2 r17402: Added lookup_name_smbconf() to be called when looking
up names from smb.conf. If the name is unqualified it
causes the lookup to be done in WORKGROUP\name, then
"Unix [users|groups]"\name rather than searching the
domain. Should fix the problems with "force user"
selecting a domain user by preference.
Jeremy.
2007-10-10 11:38:31 -05:00
Gerald Carter
21d69dcb3c r17271: Fix a regression in the ldapsam uri syntax.
Allow multiple LDAP URIs to be grouped by  ""
2007-10-10 11:38:23 -05:00
Gerald Carter
dc4fec1f7d r17246: BUG 3964: lower case username prior to getpwnam() call in smbpasswd 2007-10-10 11:38:22 -05:00
Gerald Carter
bbe11b7a95 r17150: MMC User & group plugins fixes:
* Make sure to lower case all usernames before
  calling the create, delete, or rename hooks.
* Preserve case for usernames in passdb
* Flush the getpwnam cache after renaming a user
* Add become/unbecome root block in _samr_delete_dom_user()
  when trying to verify the account's existence.
2007-10-10 11:38:16 -05:00
Volker Lendecke
03e9924f5c r17075: Even without talloc_steal you can still create memory problems.... ;-) 2007-10-10 11:38:10 -05:00
Jeremy Allison
9dafb7f48c r16945: Sync trunk -> 3.0 for 3.0.24 code. Still need
to do the upper layer directories but this is what
everyone is waiting for....

Jeremy.
2007-10-10 11:19:14 -05:00
Volker Lendecke
84913caebd r16866: No idea why I did not see the warning, sorry.... 2007-10-10 11:19:12 -05:00
Volker Lendecke
9ec5ccfe85 r16865: This is a proposal to fix bug 3915. Before sending patches around, this is
what svn is for.

The idea is that we fall back to a pure unix user with S-1-22 SIDs in the
token in case anything weird is going on with the 'force user'.

Volker
2007-10-10 11:19:12 -05:00
Jeremy Allison
8c7e40f2a4 r16683: Fix bug #3900 reported by jason@ncac.gwu.edu.
Jeremy.
2007-10-10 11:19:07 -05:00
Jeremy Allison
1cd9a0ef83 r16681: Fix bug #3899 reported by jason@ncac.gwu.edu.
Jeremy.
2007-10-10 11:19:07 -05:00
Jeremy Allison
5c5ea3152f r16678: Fix bug #3898 reported by jason@ncac.gwu.edu.
Jeremy.
2007-10-10 11:19:07 -05:00
Jeremy Allison
dfdb4ce891 r16663: Fix coverity #301, memleak in error path.
Jeremy.
2007-10-10 11:19:06 -05:00
Jeremy Allison
98a5e20ff4 r16628: Fix bug #3880, reported by jason@ncac.gwu.edu
by ensuring we return the correct enum for sid
type, not a uint32.
Jeremy.
2007-10-10 11:19:04 -05:00
Jeremy Allison
1f52b8b406 r16624: Fix bug #3877, reported by jason@ncac.gwu.edu
Jeremy.
2007-10-10 11:19:04 -05:00
Jeremy Allison
720a917205 r16593: Make the invarient explicit to Klocwork. Bug #2023.
Jeremy.
2007-10-10 11:19:02 -05:00
Jeremy Allison
ce14daf51c r16582: Fix Klocwork #1997 and all generic class of problems
where we don't correctly check the return from memdup.
Jeremy.
2007-10-10 11:19:01 -05:00
Volker Lendecke
adf2dcce09 r16427: Fix bug # 3848. Thanks to Wilco Baan Hofman for testing the release candidate!
Volker
2007-10-10 11:18:53 -05:00
Jeremy Allison
7b68a2acfc r16383: Klocwork #1086. No null deref.
Jeremy.
2007-10-10 11:18:50 -05:00
Jeremy Allison
2e5a881478 r16381: Now samu can't be null don't check it on set. Klockwork
related fix.
Jeremy.
2007-10-10 11:18:50 -05:00
Volker Lendecke
3df0bf7d60 r16360: Fix Klocwork ID 136 520 521 522 523 542 574 575 576 607
in net_rpc.c: 715 716 732 734 735 736 737 738 739 749

in net_rpc_audit.c: 754 755 756

in net_rpc_join.c: 757

in net_rpc_registry: 766 767

in net_rpc_samsync.c: 771 773

in net_sam.c: 797 798

Volker
2007-10-10 11:18:48 -05:00
Günther Deschner
3203ce3b49 r16350: Fix the build.
GUenther
2007-10-10 11:17:37 -05:00
Volker Lendecke
d3f5acb16e r16334: Fix Klocwork ID's 1087, 1095, 1096, 1098, 1099, 1101, 1102, 1105, 1107, 1109,
1111

Volker
2007-10-10 11:17:34 -05:00
Jeremy Allison
a0d368197d r16241: Fix Klocwork #106 and others like it.
Make 2 important changes. pdb_get_methods()
returning NULL is a *fatal* error. Don't try
and cope with it just call smb_panic. This
removes a *lot* of pointless "if (!pdb)" handling
code. Secondly, ensure that if samu_init()
fails we *always* back out of a function. That
way we are never in a situation where the pdb_XXX()
functions need to start with a "if (sampass)"
test - this was just bad design, not defensive
programming.
Jeremy.
2007-10-10 11:17:27 -05:00
Volker Lendecke
963ae5bd14 r16197: Fix Klocwork id 1338 2007-10-10 11:17:24 -05:00
Jeremy Allison
da768bf9c2 r16155: Janitor for jelmer.
Fix typo in DEBUG()
Jeremy.
2007-10-10 11:17:23 -05:00
Günther Deschner
322f1664df r16121: Fix a eDir related memory leak.
Guenther
2007-10-10 11:17:21 -05:00
Jeremy Allison
5cd234a1ff r16076: Fix for machine password timeout overflow from Shlomi Yaakobovich
<Shlomi@exanet.com>.
Jeremy.
2007-10-10 11:17:19 -05:00
Volker Lendecke
8f9ba5f96c r16064: Bug fix for another one Tom Bork has reported:
'valid users = +unixgroup' failed with smbpasswd if 'unixgroup' has a
(non-algorithmic) group mapping.

Thanks a lot!

People out there listening, please test current code, this release is

	   **BIG**

:-)

Volker
2007-10-10 11:17:19 -05:00
Jeremy Allison
da26565a2e r16016: Add debug to be symetrical with reading from
cache.
Jeremy.
2007-10-10 11:17:17 -05:00
Volker Lendecke
40339fdcce r16014: Correctly set the group RID in init_sam_from_buffer.
BIG THANKS to Tom Bork for reporting that Bug!

Volker
2007-10-10 11:17:17 -05:00
Jeremy Allison
4962548dfe r15895: Ensure all new rid allocation goes through
the same function (deals with races).
Jeremy.
2007-10-10 11:17:12 -05:00
Jeremy Allison
9890a31c5f r15888: Fix bug #3804 from jason@ncac.gwu.edu
Invalid comparisons.
Jeremy.
2007-10-10 11:17:12 -05:00
Günther Deschner
b5a5d0b24e r15649: Allow to store 24 password history entries in ldapsam (same limit as on
Windows). Fixes bug #1914.

Guenther
2007-10-10 11:17:05 -05:00
Günther Deschner
1b5a712467 r15633: Minor smbldap/pdb_ldap cleanup
Guenther
2007-10-10 11:17:04 -05:00
Volker Lendecke
ea7cced6bc r15601: Fix segfaults with 'security=share' and 'guest only = yes'
Volker
2007-10-10 11:17:03 -05:00
Volker Lendecke
2cf503d7da r15571: Fix Coverity bug #285 2007-10-10 11:17:02 -05:00
Gerald Carter
7d99e05ee8 r15547: say goodbye to --with-ldapsam (although the ldapsam_compat passdb backend still exists 2007-10-10 11:16:58 -05:00
Günther Deschner
e4734cb99c r15542: Close the LDAP connection and free the struct, regardless whether the
simple bind operation was successful or not.

Guenther
2007-10-10 11:16:57 -05:00
Jeremy Allison
755c272ebf r15444: Fix from Jim to ensure we do a wildcard search for SID's
starting with the global SAM sid, not an exact search.
Jeremy.
2007-10-10 11:16:45 -05:00
Volker Lendecke
898948d654 r15360: Fix bug # 3741. One more place where the algorithmic mapping needs to stay.
Volker
2007-10-10 11:16:37 -05:00
Gerald Carter
b6904e0950 r15310: only store lanman passwords on a change if 'lanman auth = yes' 2007-10-10 11:16:34 -05:00
Paul Green
17774387ad r15283: Oh yeah. The build farm doesn't do much with head. OK, here is the patch to SAMBA_3_0 to declare prototypes for the initialization functions. These are the same changes I just made to head. --paulg 2007-10-10 11:16:31 -05:00
Volker Lendecke
b9c6e3f556 r15101: Little step towards getting Samba4 tdb into 3: tdb_lock_bystring does not
have the timeout argument in Samba4. Add a new routine
tdb_lock_bystring_with_timeout.

Volker
2007-10-10 11:16:23 -05:00
Volker Lendecke
0a7d4f1ab1 r15009: Add a check for NULL 2007-10-10 11:15:56 -05:00
Gerald Carter
021b3dc2db r14868: I will not write code when changing to Daylight Savings Time.
I will not write code when changing to Daylight Savings Time.
I will not write code when changing to Daylight Savings Time.
I will not write code when changing to Daylight Savings Time.
I will not write code when changing to Daylight Savings Time.
I will not write code when changing to Daylight Savings Time.
I will not write code when changing to Daylight Savings Time.
I will not write code when changing to Daylight Savings Time.
I will not write code when changing to Daylight Savings Time.

...

Fix my brain dead inverted logic for turning winbindd on and off
when run on a DC or when calling pdb functions from within winbindd.
2007-10-10 11:15:52 -05:00
Gerald Carter
4ab372f4ca r14855: Various fixes:
* depreacte 'acl group control' after discussion with Jeremy
  and implement functionality as part of 'dos filemode'
* fix winbindd on a non-member server to expand local groups
* prevent code previously only used by smbd from blindly
  turning _NO_WINBINDD back on
2007-10-10 11:15:51 -05:00
Jeremy Allison
1588ce8efe r14780: Fix coverity bug #272, null deref.
Jeremy.
2007-10-10 11:15:48 -05:00
Günther Deschner
25970a5429 r14758: Fix broken LDAP search filter.
Guenther
2007-10-10 11:15:46 -05:00
Günther Deschner
7eefeaad35 r14756: Make smbpasswd -a root work for eDirectory where there is no "account"
structural objectclass.

Guenther
2007-10-10 11:15:46 -05:00
Jelmer Vernooij
c149421ef7 r14696: make pdb_find_backend_entry public (for use by an external "multi" pdb backend) 2007-10-10 11:15:44 -05:00
Gerald Carter
db1162241f r14634: Many bug fixes thanks to train rides and overnight stays in airports
* Finally fix parsing idmap uid/gid ranges not to break with spaces
  surrounding the '-'
* Allow local groups to renamed by adding info level 2 to
  _samr_set_aliasinfo()
* Fix parsing bug in _samr_del_dom_alias() reply
* Prevent root from being deleted via Samba
* Prevent builting groups from being renamed or deleted
* Fix bug in pdb_tdb that broke renaming user accounts
* Make sure winbindd is running when trying to create the Administrators
  and Users BUILTIN groups automatically from smbd (and not just check the
  winbind nexted groups parameter value).
* Have the top level rid allocator verify that the RID it is about to
  grant is not already assigned in our own SAM (retries up to 250 times).
  This fixes passdb with existing SIDs assigned to users from the RID algorithm
  but not monotonically allocating the RIDs from passdb.
2007-10-10 11:15:41 -05:00
Gerald Carter
df53d64910 r14577: BUG Fixes:
* Add back in the import/export support to pdbedit
* Fix segv in pam_smbpass
* Cleanup some error paths in pdb_tdb and pdb_interface
2007-10-10 11:15:37 -05:00
Gerald Carter
d2c1842978 r14457: Add a few more special cases for RID 513 in the samr code.
Now that I know what all the requirements for this group are
I can generalize the code some more and make it cleaner.
But at least this is working with lusrmgr.msc on XP and 2k now.
2007-10-10 11:15:31 -05:00
Gerald Carter
0b7549997a r14452: Sorry. Need more coffee....
* Fix sprintf() args when createing the group search filter.
2007-10-10 11:15:31 -05:00
Gerald Carter
2c0a46d731 r14451: In order to get pdb_ldap searching for SID_NAME_ALIAS
groups in the ${MACHINESID} and S_1-5-32 domains correctly,
I had to add a substr search on sambaSID.

* add substr matching rule to OpenLDAP schema
  (we need to update the other schema as will since this
  is a pretty important change).  Sites will need to
  - install the new schema
  - add 'indea sambaSID   sub' to slapd.conf
  - run slapindex

* remove uses of SID_NAME_WKN_GRP in pdb_ldap.c
2007-10-10 11:15:30 -05:00
Gerald Carter
612979476a r14403: * modifies create_local_nt_token() to create a BUILTIN\Administrators
group IFF sid_to_gid(S-1-5-32-544) fails and 'winbind nested groups = yes'

* Add a SID domain to the group mapping enumeration passdb call
  to fix the checks for local and builtin groups.  The SID can be
  NULL if you want the old semantics for internal maintenance.
  I only updated the tdb group mapping code.

* remove any group mapping from the tdb that have a
  gid of -1 for better consistency with pdb_ldap.c.
  The fixes the problem with calling add_group_map() in
  the tdb code for unmapped groups which might have had
  a record present.

* Ensure that we distinguish between groups in the
  BUILTIN and local machine domains via getgrnam()
  Other wise BUILTIN\Administrators & SERVER\Administrators
  would resolve to the same gid.

* Doesn't strip the global_sam_name() from groups in the
  local machine's domain (this is required to work with
  'winbind default domain' code)

Still todo.

* Fix fallback Administrators membership for root and domain Admins
  if nested groups = no or winbindd is not running

* issues with "su - user -c 'groups'" command

* There are a few outstanding issues with BUILTIN\Users that
  Windows apparently tends to assume.  I worked around this
  presently with a manual group mapping but I do not think
  this is a good solution.  So I'll probably add some similar
  as I did for Administrators.
2007-10-10 11:15:28 -05:00
Volker Lendecke
b880602c4c r14103: Fix a memleak found by valgrind (!!) 2007-10-10 11:11:12 -05:00
Volker Lendecke
56dc19879c r14102: Fix Coverity bug # 70 2007-10-10 11:11:12 -05:00
Jeremy Allison
7f3ace5481 r14088: Fix Coverity bug #20. Don't deref possible null.
Jeremy.
2007-10-10 11:11:11 -05:00
Volker Lendecke
d38e05329a r13979: We've dereferenced my_methods already, so there's no point in checking for
!= NULL. Coverity #149.

Volker
2007-10-10 11:11:02 -05:00
Jeremy Allison
1d710d06a2 r13915: Fixed a very interesting class of realloc() bugs found by Coverity.
realloc can return NULL in one of two cases - (1) the realloc failed,
(2) realloc succeeded but the new size requested was zero, in which
case this is identical to a free() call.

The error paths dealing with these two cases should be different,
but mostly weren't. Secondly the standard idiom for dealing with
realloc when you know the new size is non-zero is the following :

 tmp = realloc(p, size);
 if (!tmp) {
    SAFE_FREE(p);
    return error;
 } else {
    p = tmp;
 }

However, there were *many* *many* places in Samba where we were
using the old (broken) idiom of :

 p = realloc(p, size)
 if (!p) {
    return error;
 }

which will leak the memory pointed to by p on realloc fail.

This commit (hopefully) fixes all these cases by moving to
a standard idiom of :

 p = SMB_REALLOC(p, size)
 if (!p) {
    return error;
 }

Where if the realloc returns null due to the realloc failing
or size == 0 we *guarentee* that the storage pointed to by p
has been freed. This allows me to remove a lot of code that
was dealing with the standard (more verbose) method that required
a tmp pointer. This is almost always what you want. When a
realloc fails you never usually want the old memory, you
want to free it and get into your error processing asap.

For the 11 remaining cases where we really do need to keep the
old pointer I have invented the new macro SMB_REALLOC_KEEP_OLD_ON_ERROR,
which can be used as follows :

 tmp = SMB_REALLOC_KEEP_OLD_ON_ERROR(p, size);
 if (!tmp) {
    SAFE_FREE(p);
    return error;
 } else {
    p = tmp;
 }

SMB_REALLOC_KEEP_OLD_ON_ERROR guarentees never to free the
pointer p, even on size == 0 or realloc fail. All this is
done by a hidden extra argument to Realloc(), BOOL free_old_on_error
which is set appropriately by the SMB_REALLOC and SMB_REALLOC_KEEP_OLD_ON_ERROR
macros (and their array counterparts).

It remains to be seen what this will do to our Coverity bug count :-).

Jeremy.
2007-10-10 11:10:59 -05:00
Simo Sorce
705d811808 r13843: Merge in net sam provision and some pdb_ldap fixes 2007-10-10 11:10:56 -05:00
Volker Lendecke
ae9614ce01 r13791: Having S-1-1-0 show up in winbind lookupsid does not really make sense.
Volker
2007-10-10 11:10:54 -05:00
Simo Sorce
a374546c7e r13776: Merge in the editposix ldapsam optimization 2007-10-10 11:10:53 -05:00
Gerald Carter
085c6859ee r13765: Fix bug reported by jra. Don't check for a group SID when storing
a user since we no longer pay any attention to the value.
2007-10-10 11:10:53 -05:00
Gerald Carter
c13af58f63 r13756: use samu_new() rather than calling talloc() directly. 2007-10-10 11:10:52 -05:00
Jeremy Allison
993069eb87 r13747: Fix the reference count for tdbsam_open() - on an
upgrade it calls tdbsam_convert() which calls tdbsam_open()
deep inside the init_sam_from_buffer_vX call.
If the ref count hasn't been set yet then we will close
the tdbsam reference in tdbsam_getsampwsid().
smbpasswd -a was core-dumping again :-).
Jeremy
2007-10-10 11:10:51 -05:00
Volker Lendecke
2afcbbfb6f r13729: Fix smbpasswd -x 2007-10-10 11:10:51 -05:00
Volker Lendecke
59f95ea752 r13728: No, we have not talked about this on irc less than 24h ago... ;-) 2007-10-10 11:10:51 -05:00
Volker Lendecke
76c100834d r13727: Fix a segfault 2007-10-10 11:10:51 -05:00
Günther Deschner
5b89e8bc24 r13711: * Correctly handle acb_info/acct_flags as uint32 not as uint16.
* Fix a couple of related parsing issues.
* in the info3 reply in a samlogon, return the ACB-flags (instead of
  returning zero)

Guenther
2007-10-10 11:10:25 -05:00
Jeremy Allison
7e243104eb r13704: Janitor for tpot.
Jeremy
-------------
Slightly smaller version of pdb_get_methods() patch.  Turns out that
callers to initialize_password_db() use the reload parameter so this
has turned in to a smaller cleanup than I thought.
2007-10-10 11:10:24 -05:00
Volker Lendecke
7c098ca0ae r13693: More Solaris/LDAP fixes from Bjoern <bjoern@j3e.de> 2007-10-10 11:10:24 -05:00
Volker Lendecke
dbdb8bdb99 r13683: Fix the 'valid users = +users' problem I introduced.
Volker
2007-10-10 11:10:23 -05:00
Gerald Carter
bcf269e2ec r13679: Commiting the rm_primary_group.patch posted on samba-technical
* ignore the primary group SID attribute from struct samu*
* generate the primary group SID strictlky from the Unix
  primary group when dealing with passdb users
* Fix memory leak in original patch caused by failing to free a
  talloc *
* add wrapper around samu_set_unix() to prevent exposing the create
  BOOL to callers.  Wrappers are samu_set_unix() and samu-allic_rid_unix()
2007-10-10 11:10:23 -05:00
Volker Lendecke
faf1d832a1 r13678: Remove unneeded braces 2007-10-10 11:10:23 -05:00
Günther Deschner
b2eac2e6eb r13622: Allow to rename machine accounts in a Samba Domain. This still uses the
"rename user script" to do the rename of the posix machine account (this
might be changed later). Fixes #2331.

Guenther
2007-10-10 11:10:19 -05:00
Gerald Carter
92c251fdf0 r13601: * Remove unused code from pdb_ldap.c
* Add a 'struct passwd *' to the struct samu for later reference
  (I know this may be controversial but its easily reverted which is
  is why I'm checking this is as a seaparate patch before I get
  too deep).
* Remove unix_homedir from struct samu {} and update the pdb wrapper
  functions associated with it.
2007-10-10 11:10:18 -05:00
Gerald Carter
e3489f7edd r13600: Move functions local to tdbsam to pdb_tdb.c 2007-10-10 11:10:18 -05:00
Gerald Carter
6568c9cb03 r13593: consolidate pdb_set_sam_sids() into samu_set_unix() which
was the only place it was called from.
2007-10-10 11:10:18 -05:00
Gerald Carter
6f1afa4acc r13590: * replace all pdb_init_sam[_talloc]() calls with samu_new()
* replace all pdb_{init,fill}_sam_pw() calls with samu_set_unix()
2007-10-10 11:10:16 -05:00
Gerald Carter
77332f0738 r13589: Make sure we only try to close the tdbsam file in endsampwent() when we
have a valid pwent list from a setsampwent().  Fixes a bug with the
reference count on the open tdb.
2007-10-10 11:10:16 -05:00
Gerald Carter
19b7593972 r13576: This is the beginnings of moving the SAM_ACCOUNT data structure
to make full use of the new talloc() interface.  Discussed with Volker
and Jeremy.

* remove the internal mem_ctx and simply use the talloc()
  structure as the context.
* replace the internal free_fn() with a talloc_destructor() function
* remove the unnecessary private nested structure
* rename SAM_ACCOUNT to 'struct samu' to indicate the current an
  upcoming changes.  Groups will most likely be replaced with a
  'struct samg' in the future.

Note that there are now passbd API changes.  And for the most
part, the wrapper functions remain the same.

While this code has been tested on tdb and ldap based Samba PDC's
as well as Samba member servers, there are probably still
some bugs.  The code also needs more testing under valgrind to
ensure it's not leaking memory.

But it's a start......
2007-10-10 11:10:15 -05:00
Gerald Carter
b65be8874a r13571: Replace all calls to talloc_free() with thye TALLOC_FREE()
macro which sets the freed pointer to NULL.
2007-10-10 11:10:14 -05:00
Gerald Carter
db575c7641 r13550: remove pdb_guest 2007-10-10 11:10:13 -05:00
Jeremy Allison
43f095a38d r13548: Always use the get_remote_macinhe_name() as the key
for the creds store. This should fix the problems
Jerry reported (but I have still to run tests :-).
Jeremy.
2007-10-10 11:10:13 -05:00
Gerald Carter
f79f4dc4c5 r13545: A patch which I think it's time has come. VOlker, we can talk about
this more but it gets around the primary group issue.

* don't map a SID to a name from the group mapping code if
  the map doesn't have a valid gid.  This is only an issue
  in a tdb setup
* Always allow S-1-$DOMAIN-513 to resolve (just like Windows)
* if we cannot resolve a users primary GID to a SID, then set
  it to S-1-$DOMAIN-513
* Ignore the primary group SID inside pdb_enum_group_memberships().
  Only look at the Unix group membersip.

Jeremy, this fixes a fresh install startup for smbd as far as my tests
are concerned.
2007-10-10 11:10:12 -05:00
Jeremy Allison
e755155b0e r13542: Don't reuse a pointer we just freed (Doh!).
Jeremy.
2007-10-10 11:10:11 -05:00
Jeremy Allison
cef240d571 r13538: Make sure we store all 16 bytes of credentials session
key and delete records that are old. We will need this
for the full 16 byte session key support.
Jeremy.
2007-10-10 11:10:11 -05:00
Jeremy Allison
80f4868944 r13519: Fix the credentials chaining across netlogon pipe disconnects.
I mean it this time :-).
Jeremy.
2007-10-10 11:10:09 -05:00
Gerald Carter
94c37e0652 r13512: Rewrite tdbsam code to use a reference count based open/close
on the tdb file.  This allow recusive calls to succeed
without complaining about failed opens since a tdb can
only be opened once per process.  We probably still need to backport
the transaction support from Samba 4 here though.
2007-10-10 11:10:08 -05:00
Volker Lendecke
bb40e544de r13494: Merge the stuff I've done in head the last days.
Volker
2007-10-10 11:10:06 -05:00
Volker Lendecke
5a92df31d6 r13493: module_name and module_location are the same string. Fix a valgrind
error.

Volker
2007-10-10 11:10:06 -05:00
Gerald Carter
7a2da5f0cc r13460: by popular demand....
* remove pdb_context data structure
* set default group for DOMAIN_RID_GUEST user as RID 513 (just
  like Windows)
* Allow RID 513 to resolve to always resolve to a name
* Remove auto mapping of guest account primary group given the
  previous 2 changes
2007-10-10 11:10:04 -05:00
Jeremy Allison
5b3c2e63c7 r13407: Change the credentials code to be more like the Samba4 structure,
makes fixes much easier to port. Fix the size of dc->sess_key to
be 16 bytes, not 8 bytes - only store 8 bytes in the inter-smbd
store in secrets.tdb though. Should fix some uses of the dc->sess_key
where we where assuming we could read 16 bytes.
Jeremy.
2007-10-10 11:09:59 -05:00
Volker Lendecke
d3b66fb871 r13389: get_ldap_filter is only used once, make it static 2007-10-10 11:09:58 -05:00
Volker Lendecke
a3bc4f5114 r13338: Remove the experimental pdb modules 2007-10-10 11:06:25 -05:00
Gerald Carter
17e63ac4ed r13316: Let the carnage begin....
Sync with trunk as off r13315
2007-10-10 11:06:23 -05:00
Gerald Carter
6c3480f9ae r13310: first round of server affinity patches for winbindd & net ads join 2007-10-10 11:06:23 -05:00
Volker Lendecke
e747ea7250 r13209: Make smbpasswd -a work again if passdb did not exist.
Volker
2007-10-10 11:06:17 -05:00
Jeremy Allison
c0ba64297a r13190: Fix #3458 from Andriy Gapon <avg@icyb.net.ua>. Don't
access free'd memory.
Jerry please pick up for 3.0.21b !
Jeremy.
2007-10-10 11:06:16 -05:00
Jeremy Allison
31b3201f53 r13175: Actually make adding a new user into an empty pdbtdb
file create the file.
Jeremy.
2007-10-10 11:06:16 -05:00
Jeremy Allison
e5f19ad5ac r13172: Fix incorrect error message when new tdb not created correctly.
Jeremy.
2007-10-10 11:06:16 -05:00
Gerald Carter
77575c64e4 r12913: missed merge to fix BUG 3391; ensure we can lookup account policies 2007-10-10 11:06:06 -05:00
Günther Deschner
f78c7f8abe r12714: Fix segfault in pdb_nds.c.
Guenther
2007-10-10 11:06:01 -05:00
Volker Lendecke
3ee6b732f4 r12663: Fix a memleak 2007-10-10 11:06:01 -05:00
Volker Lendecke
dc167037b0 r12645: Fix some memleaks. This will also be in the trunk checkin that comes next.
Volker
2007-10-10 11:06:00 -05:00
Volker Lendecke
082763988d r12603: NO, I'm not claiming maintainership of this.
Fix bug 3351.

Volker
2007-10-10 11:06:00 -05:00
Jeremy Allison
c2752347eb r12522: Try and fix bug #2926 by removing setlocale(LC_ALL, "C")
and replace calls to isupper/islower/toupper/tolower with
ASCII equivalents (mapping into _w variants).
Jeremy.
2007-10-10 11:05:58 -05:00
Gerald Carter
5121d38069 r12400: one line patch for Sun LDAP libs pointed out by Nicholas Brealey <nick@brealey.org> 2007-10-10 11:05:55 -05:00
Gerald Carter
be32f10609 r12398: adding Guenther's account policy migration fix 2007-10-10 11:05:54 -05:00
Volker Lendecke
be6c9012da r12313: Introduce yet another copy of the string_sub function:
talloc_string_sub. Someone with time on his hands could convert all the
callers of all_string_sub to this.

realloc_string_sub is *only* called from within substitute.c, it could be
moved there I think.

Volker
2007-10-10 11:05:53 -05:00
Jeremy Allison
43c2d545ab r12245: eDirectory returns LDAP_UNWILLING_TO_PERFORM if the
account is disabled. If we get this we can't check
the password so have to tell the client the account
was disabled.
Jeremy.
2007-10-10 11:05:50 -05:00
Volker Lendecke
b15815c804 r12163: Change lookup_sid and lookup_name to return const char * instead of char *,
use a temporary talloc_ctx for clarity.

Volker
2007-10-10 11:05:46 -05:00
Volker Lendecke
8a7d6eb2c0 r12129: Fix uninitialized variables.
Volker
2007-10-10 11:05:46 -05:00
Volker Lendecke
9f99d04a54 r12051: Merge across the lookup_name and lookup_sid work. Lets see how the build farm
reacts :-)

Volker
2007-10-10 11:05:43 -05:00
Jeremy Allison
c65b752604 r12043: It's amazing the warnings you find when compiling on a 64-bit
box with gcc4 and -O6...
Fix a bunch of C99 dereferencing type-punned pointer will break
strict-aliasing rules errors. Also added prs_int32 (not uint32...)
as it's needed in one place. Find places where prs_uint32 was being
used to marshall/unmarshall a time_t (a big no no on 64-bits).
More warning fixes to come.
Thanks to Volker for nudging me to compile like this.
Jeremy.
2007-10-10 11:05:42 -05:00
Volker Lendecke
30fcdf84d8 r11999: Re-add "passdb expand explicit".
We came to the conclusion that changing the default is something that has to
wait one or two more releases, but it will happen one way or the other.

Volker
2007-10-10 11:05:41 -05:00
Volker Lendecke
d228cb62a7 r11947: Back out passdb:expand_explicit until we find consensus. I'll file this as a
bugzilla entry.

Volker
2007-10-10 11:05:38 -05:00
Volker Lendecke
c917cfc320 r11923: Add samr_lookup_rids for the builtin domain. Doing it this way feels a bit
wrong, but so far we don't have proper multi-domain support in passdb yet...

Volker
2007-10-10 11:05:36 -05:00
Volker Lendecke
57f0cf8cdd r11922: Looks bigger than it is: There's no point in allocating arrays in
samr_lookup_rids twice. It was done in the srv_samr_nt.c code as well as in
the pdb module. Remove the latter, this might happen more often.

Volker
2007-10-10 11:05:36 -05:00
Volker Lendecke
bc8836d5d7 r11920: Rename local_lookup_rid to lookup_global_sam_rid, add lookup_builtin_rid.
Volker
2007-10-10 11:05:35 -05:00
Volker Lendecke
35ba5e083c r11919: The generic mappings in srv_samr_nt.c are only used there -- make them
static.

One long overdue simplification: Change local_lookup_sid to local_lookup_rid
its responsible for "our" domain only, in fact it checked for it.

Volker
2007-10-10 11:05:35 -05:00
Volker Lendecke
6622db97bb r11914: After talking to Jeremy, implement passdb:expand_explicit with a default of
no. This changes our default behaviour.

Sorry, Ingo, this *is* a bug that needs fixing.

Jerry, you might want to put a marker into the WHATSNEW.txt when this is due.

Volker
2007-10-10 11:05:34 -05:00
Günther Deschner
04a3ac5e50 r11874: Merge LDAP connection setup in lib/smbldap.c and pdb_nds.c.
Also allow to use START_TLS in the pdb_nds_update_login_attempts
function when doing simple binds to eDir.

Guenther
2007-10-10 11:05:33 -05:00
Gerald Carter
a33e78aced r11863: BUG 3196: patch from Alex Deiter <tiamat@komi.mts.ru> to compile against the Sun LDAP client libs. But not for AD support; just ldap support 2007-10-10 11:05:31 -05:00
Günther Deschner
6aefb3aebb r11847: Fix typo.
Guenther
2007-10-10 11:05:29 -05:00
Jeremy Allison
f46d847065 r11256: Remove use of long long and strtoll in libsmbclient (we
can't assume long long is always there). Removed unused
var in new a/c rename code.
long long still used in eventlog code but Jerry has promised
to fix that.
Jeremy.
2007-10-10 11:05:09 -05:00
Jim McDonough
ee91eb9a39 r11236: Implement user rename for smbpasswd and ldap backends. Some cleanup on
tdb as well to make naming consistent.
2007-10-10 11:05:08 -05:00
Jeremy Allison
d720867a78 r11137: Compile with only 2 warnings (I'm still working on that code) on a gcc4
x86_64 box.
Jeremy.
2007-10-10 11:05:02 -05:00
Jim McDonough
8210b0503a r10911: part of #2861: add rename support for usrmgr.exe when using tdbsam
This gets it working before replacing tdb with the samba4 version.
2007-10-10 11:04:56 -05:00
Jeremy Allison
a6d8a4b1ff r10792: Fix the "schannel not stored across client disconnects" problem.
Based on the Samba4 solution - stores data in
$samba/private/schannel_store.tdb.
This tdb is not left open but open and closed on demand.
Jeremy.
2007-10-10 11:04:54 -05:00
Volker Lendecke
cf06a090a3 r10658: It's so nice to have CVSIN to blame for this kind of bugs :-)
Volker
2007-10-10 11:04:49 -05:00
Gerald Carter
939c3cb5d7 r10656: BIG merge from trunk. Features not copied over
* \PIPE\unixinfo
* winbindd's {group,alias}membership new functions
* winbindd's lookupsids() functionality
* swat (trunk changes to be reverted as per discussion with Deryck)
2007-10-10 11:04:48 -05:00
Gerald Carter
8bf124adaf r10606: pdb_*sql patches from
Uli Meis <a.sporto@gmail.com>
Peter Rindfuss <rindfuss@wz-berlin.de>
2007-10-10 11:04:48 -05:00
Gerald Carter
b1524999e0 r9661: fallback to cn attribubte if displayName is not available 2007-10-10 11:03:24 -05:00
Gerald Carter
62f9fb5e3a r9660: real fix for group enumeration bug in 3.0.20; only affected the ldapsam code 2007-10-10 11:03:24 -05:00
Günther Deschner
df90ea016a r9522: Give better error-message when "NDS Universal Password" change fails.
Guenther
2007-10-10 11:01:11 -05:00
James Peach
98d364459d r9303: Clobber compiler warnings. Patch from Jason Mader <jason@ncac.gwu.edu> plus
some extra function declarations. Bugzilla bug #2523.
2007-10-10 11:00:32 -05:00
Lars Müller
7423895900 r9051: Fix from Fernando Schapachnik <fernando@mecon.gov.ar> to add logon hours
support for the Postgres backend.

Also add these changes from svn rev 7787 to trunk.
2007-10-10 11:00:24 -05:00
Günther Deschner
c2810bcf66 r8797: avoid unset rids for builtin-aliases.
Guenther
2007-10-10 11:00:17 -05:00
Günther Deschner
0c8859474d r8787: Make enumeration of builtin-aliases work again.
Guenther
2007-10-10 11:00:17 -05:00
Günther Deschner
793c82c017 r8542: - (re-)add better search-semantics: look for Interdomain trust accounts
below the machine-suffix (this is where we create them)) to avoid
  digging through thousands of user-accounts just to find a handful of
  trust-accounts in the enumdomusers-samr-call.

- don't access freed data in DEBUG-statement

Guenther
2007-10-10 11:00:08 -05:00
Jeremy Allison
9506b8e145 r7882: Looks like a large patch - but what it actually does is make Samba
safe for using our headers and linking with C++ modules. Stops us
from using C++ reserved keywords in our code.
Jeremy
2007-10-10 10:58:00 -05:00
Jeremy Allison
dd5d36c95f r7787: Fix from Fernando Schapachnik <fernando@mecon.gov.ar> to add logon hours
support for the Postgres backend.
Jeremy.
2007-10-10 10:57:21 -05:00
Volker Lendecke
5b4720598b r7730: Some merges 2007-10-10 10:57:20 -05:00
Volker Lendecke
10606be050 r7718: Remove some unused code 2007-10-10 10:57:20 -05:00
Gerald Carter
e6df9a7ac7 r7577: switching to macro for IS_DC 2007-10-10 10:57:14 -05:00
Gerald Carter
a0ac9a8ffd r7415: * big change -- volker's new async winbindd from trunk 2007-10-10 10:57:08 -05:00
Gerald Carter
e2f8eeb4e2 r7142: removing 'ldap filter' smb.conf option 2007-10-10 10:57:03 -05:00
Gerald Carter
9727d05241 r7139: trying to reduce the number of diffs between trunk and 3.0; changing version to 3.0.20pre1 2007-10-10 10:57:02 -05:00
Volker Lendecke
6af57d4bae r6774: Fix 2 memleaks 2007-10-10 10:56:54 -05:00
Volker Lendecke
f406dda687 r6770: Fix bug 2705. Thanks, John, for beating my stuff :-)
Volker
2007-10-10 10:56:54 -05:00
Volker Lendecke
85320c1257 r6748: With reconnects, state->connection->ldap_struct can change in smbldap_search
and friends. This should be a fix for bug 2701. Thanks to jht for giving me
access to his box!

Volker
2007-10-10 10:56:53 -05:00
Gerald Carter
b0289d2258 r6713: another talloc() fix. This time in pdb_xml.c 2007-10-10 10:56:52 -05:00
Jelmer Vernooij
0a7eabd46d r6635: Fix build of the various sql pdb backends after new talloc. 2007-10-10 10:56:48 -05:00
Jeremy Allison
316df944a4 r6595: This is Volkers new-talloc patch. Just got the go-ahead from
Volker to commit. Woo Hoo !
Jeremy.
2007-10-10 10:56:46 -05:00
Volker Lendecke
61d40ac60d r6445: Make us survive the PARANOID_MALLOC_CHECKER. Should we enable that for
--enable-developer=yes?

Volker
2007-10-10 10:56:41 -05:00
Gerald Carter
0ac57ae942 r6421: use add machine script when creating a user (ACB_NORMAL)
who has a name ending in '$' (usrmgr.exe does this for
domain trusts (that's was jfm's original comment I think).

avoid an assert() call in libldap.
2007-10-10 10:56:41 -05:00
Volker Lendecke
a831e54738 r6367: Slim down pdb_interface.c a bit. next_entry and search_end are function
pointers now.

Yes, Jeremy, this is about re-inventing C++... :-)

Volker
2007-10-10 10:56:39 -05:00
Volker Lendecke
f0bb44ac58 r6351: This is quite a large and intrusive patch, but there are not many pieces that
can be taken out of it, so I decided to commit this in one lump. It changes
the passdb enumerating functions to use ldap paged results where possible. In
particular the samr calls querydispinfo, enumdomusers and friends have
undergone significant internal changes. I have tested this extensively with
rpcclient and a bit with usrmgr.exe. More tests and the merge to trunk will
follow later.

The code is based on a first implementation by Günther Deschner, but has
evolved quite a bit since then.

Volker
2007-10-10 10:56:38 -05:00
Volker Lendecke
8b4f67a1e9 r6277: This implements a new caching API for enumerating the pdb elements. It is
modeled after query_displayinfo and should hide the differences between users,
groups and aliases while allowing a cache analog load_sampw_entries:

struct pdb_search *pdb_search_users(uint16 acct_flags);
struct pdb_search *pdb_search_groups(void);
struct pdb_search *pdb_search_aliases(const DOM_SID *sid);
uint32 pdb_search_entries(struct pdb_search *search, uint32 start_idx,
                          uint32 max_entries,
                          struct samr_displayentry **result);
void pdb_search_destroy(struct pdb_search *search);

Why this API? Eventually we will need to apply the work gd has started on
enumerating users with paged ldap searches to groups and aliases. Before doing
that I want to clean up the search routines we have.

The sample application (more to follow) is 'net maxrid'.

Volker
2007-10-10 10:56:34 -05:00
Volker Lendecke
3493d9f383 r6263: Get rid of generate_wellknown_sids, they are const static and initializable
statically.

Volker
2007-10-10 10:56:33 -05:00
Herb Lewis
efea76ac71 r6225: get rid of warnings from my compiler about nested externs 2007-10-10 10:56:30 -05:00
Derrell Lipman
994694f7f2 r6149: Fixes bugs #2498 and 2484.
1. using smbc_getxattr() et al, one may now request all access control
   entities in the ACL without getting all other NT attributes.
2. added the ability to exclude specified attributes from the result set
   provided by smbc_getxattr() et al, when requesting all attributes,
   all NT attributes, or all DOS attributes.
3. eliminated all compiler warnings, including when --enable-developer
   compiler flags are in use.  removed -Wcast-qual flag from list, as that
   is specifically to force warnings in the case of casting away qualifiers.

Note: In the process of eliminating compiler warnings, a few nasties were
      discovered.  In the file libads/sasl.c, PRIVATE kerberos interfaces
      are being used; and in libsmb/clikrb5.c, both PRIAVE and DEPRECATED
      kerberos interfaces are being used.  Someone who knows kerberos
      should look at these and determine if there is an alternate method
      of accomplishing the task.
2007-10-10 10:56:24 -05:00
Jeremy Allison
051f0ed807 r6092: This much const causes the compiler on Fedora Core 2
to throw up.
Jeremy.
2007-10-10 10:56:21 -05:00
Volker Lendecke
3a67865169 r6080: Port some of the non-critical changes from HEAD to 3_0. The main one is the
change in pdb_enum_alias_memberships to match samr.idl a bit closer.

Volker
2007-10-10 10:56:20 -05:00
Jim McDonough
e2117bcb09 r5965: Apply Volker's patch for "ldapsam trusted = yes" for samr_lookup_rids. Gives us
again up to ~6x improvement on group membership lookups.
2007-10-10 10:56:13 -05:00
Gerald Carter
b0f4346082 r5957: BUGS 2478, 2093: compiler warning patches from Jason Mader 2007-10-10 10:56:12 -05:00
Gerald Carter
e84d070275 r5951: gotta love that SGI compiler :-) (thanks Jason) 2007-10-10 10:56:10 -05:00
Jim McDonough
bf3ce651ff r5927: Fix ldapsam trusted enum_group_members. We were searching in the user
suffix instead of the group suffix.

Thanks to John Janosik (jpjanosi@us.ibm.com).
2007-10-10 10:56:09 -05:00
Jeremy Allison
0976793e30 r5817: Patch from Vince Brimhall <vbrimhall@novell.com> to change the way pdb_nds
handles users with no Universal or Simple Password. Bug #2453.
Jeremy.
2007-10-10 10:56:03 -05:00
Volker Lendecke
66471de977 r5767: Get rid of some compiler warnings 2007-10-10 10:56:00 -05:00
Gerald Carter
68fe1f194a r5746: remove unneeded header that caused problems on rh73 2007-10-10 10:55:59 -05:00
Jelmer Vernooij
a281148168 r5733: Don't crash when the SID column contains NULL (Fixes #2316)
Patch by Justin Ossevoort
2007-10-10 10:55:58 -05:00
Jelmer Vernooij
5c682c665d r5718: Don't update fields that haven't changed (fixes #1957) 2007-10-10 10:55:57 -05:00
Gerald Carter
c1727dc9e0 r5708: BUG 2424: patch from Vince Brimhall <vbrimhall@novell.com> to ensure that uidNumber and gidNumber use match the rfc2307 schema 2007-10-10 10:55:56 -05:00
Jeremy Allison
6f5ea963ab r5655: Added support for Novell NDS universal password. Code donated by
Vince Brimhall <vbrimhall@novell.com> - slight tidyup by me to
use Samba conventions.
Vince - thanks a *lot* for this code - please test to make sure
I haven't messed anything up.
Jeremy.
2007-10-10 10:55:54 -05:00
Volker Lendecke
36bcfc5dae r5481: Fix a memleak 2007-10-10 10:55:42 -05:00
Volker Lendecke
e1c3ca182b r5467: Optimize _samr_query_groupmem with LDAP backend for large domains.
Could someone else please look at this patch, verifying that I did not break
the ldapsam:trusted = False fallback to the old behaviour? It works fine for
me, but you never know. You're certainly free to review the new code as well :-)

Thanks,

Volker
2007-10-10 10:55:41 -05:00
Volker Lendecke
543799fc0d r5428: Apply some const. LDAP attribs should now be declared const char *attr[]. This
gives some new warnings in smbldap.c, but a the callers are cleaned up.

Volker
2007-10-10 10:55:40 -05:00
Volker Lendecke
a7df3b5f06 r5421: Fix a memleak 2007-10-10 10:55:40 -05:00
Günther Deschner
fdf9bdbbac r5349: After talking with Jerry, reverted the addition of account policies to
passdb in 3_0 (they are still in trunk).

Guenther
2007-10-10 10:55:38 -05:00
Gerald Carter
a882a349df r5337: BUG 1439: make sure to initialize pointer to prevent invalide free()'s on exit 2007-10-10 10:55:38 -05:00
Jeremy Allison
54ac409d4f r5166: From James Peach - remove minor C99-isms.
Jeremy.
2007-10-10 10:55:31 -05:00
Günther Deschner
168ddf31d1 r5058: Due to the fragileness how windows reacts on unmapped sids sometimes,
don't leave administator-sid unmapped. Simply return "Administrator"

Guenther
2007-10-10 10:55:13 -05:00
Gerald Carter
f9f9e6039b r5015: (based on abartlet's original patch to restrict password changes)
* added SE_PRIV checks to access_check_samr_object() in order
  to deal with the run-time security descriptor and their
  interaction with user rights

* Reordered original patch in _samr_set_userinfo[2] to still
  allow root/administrative password changes for users and machines.
2007-10-10 10:55:12 -05:00
Gerald Carter
8946efe102 r4996: sync up copytights with trunk 2007-10-10 10:55:11 -05:00
Günther Deschner
78c3c71274 r4994: Patch from abartlet:
When migrating account policies to ldapsam, handle the fact that an
admin might have changed the default location of the sambaDomain-object
after installation.

Guenther
2007-10-10 10:55:11 -05:00
Günther Deschner
4cbe37ecd5 r4988: After speaking with Jerry, remove old lp_admin_users to
administrator-sid mapping completely.

Guenther
2007-10-10 10:55:10 -05:00
Günther Deschner
d319c0e189 r4964: Fix our lsa lookupsid $OURDOMAINSID-500.
Give the admin-user (rid 500) a chance to be found in passdb, not
returning the (possibly obscure) first entry of "admin users" before
that.

Guenther
2007-10-10 10:55:09 -05:00
Günther Deschner
eee0bd806b r4926: Use LDAP_SCOPE_ONELEVEL instead of OpenLDAP's LDAP_SCOPE_ONE-scope.
Guenther
2007-10-10 10:55:08 -05:00
Günther Deschner
75af83dfcd r4925: Migrate Account Policies to passdb (esp. replicating ldapsam).
Does automated migration from account_policy.tdb v1 and v2 and offers a
pdbedit-Migration interface. Jerry, please feel free to revert that if
you have other plans.

Guenther
2007-10-10 10:55:08 -05:00
Gerald Carter
504ea4ac68 r4860: fix silly limitation in ldapsam and tdbsam. Expand variables in the profile path, logon home and logon script values 2007-10-10 10:54:00 -05:00
Günther Deschner
853a8b7f1c r4851: Preleminary fix for ldapsam_enum_group_memberships when
ldapsam:trusted=True. Don't bail out when ldap-search returns pure
posixgroups (w.o. samba group-mapping).

This way those unix-memberships do not appear in user and nt user token.
Volker, could you please look over that one?

Guenther
2007-10-10 10:53:59 -05:00