1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-25 06:04:04 +03:00

125 Commits

Author SHA1 Message Date
Stefan Metzmacher
3a28443079 r22009: change TDB_DATA from char * to unsigned char *
and fix all compiler warnings in the users

metze
2007-10-10 12:19:00 -05:00
Stefan Metzmacher
9ebaa4c573 r21982: make use of tdb_*_bystring() and string_term_tdb_data()
to avoid creating the TDB_DATA struct from strings "by hand"

metze
2007-10-10 12:18:55 -05:00
Günther Deschner
7db6ce295a r18703: Fix the annoying effect that happens when nscd is running:
We usually do not get the results from user/group script modifications
immediately. A lot of users do add nscd restart/refresh commands into
their scripts to workaround that while we could flush the nscd caches
directly using libnscd.

Guenther
2007-10-10 12:00:49 -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
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
Jeremy Allison
dfdb4ce891 r16663: Fix coverity #301, memleak in error path.
Jeremy.
2007-10-10 11:19:06 -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
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
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
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
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
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
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
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
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
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
e3489f7edd r13600: Move functions local to tdbsam to pdb_tdb.c 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
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
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
Gerald Carter
17e63ac4ed r13316: Let the carnage begin....
Sync with trunk as off r13315
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
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
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
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
Günther Deschner
6394257cc7 r4847: Hand over a acb_mask to pdb_setsampwent in load_sampwd_entries().
This allows the ldap-backend to search much more effeciently. Machines
will be searched in the ldap_machine_suffix and users in the
ldap_users_suffix. (Note that we already use the ldap_group_suffix in
ldapsam_setsamgrent for quite some time).

Using the specific ldap-bases becomes notably important in large
domains: On my testmachine "net rpc trustdom list" has to search through
40k accounts just to list 3 interdomain-trust-accounts, similiar effects
show up the non-user query_dispinfo-calls, etc.

Also renamed all_machines to only_machines in load_sampwd_entries()
since that reflects better what is really meant.

Guenther
2007-10-10 10:53:59 -05:00
Gerald Carter
77c10ff9aa r4724: Add support for Windows privileges in Samba 3.0
(based on Simo's code in trunk).  Rewritten with the
following changes:

* privilege set is based on a 32-bit mask instead of strings
  (plans are to extend this to a 64 or 128-bit mask before
   the next 3.0.11preX release).
* Remove the privilege code from the passdb API
  (replication to come later)
* Only support the minimum amount of privileges that make
  sense.
* Rewrite the domain join checks to use the SeMachineAccountPrivilege
  instead of the 'is a member of "Domain Admins"?' check that started
  all this.

Still todo:

* Utilize the SePrintOperatorPrivilege in addition to the 'printer admin'
  parameter
* Utilize the SeAddUserPrivilege for adding users and groups
* Fix some of the hard coded _lsa_*() calls
* Start work on enough of SAM replication to get privileges from one
  Samba DC to another.
* Come up with some management tool for manipultaing privileges
  instead of user manager since it is buggy when run on a 2k client
  (haven't tried xp).  Works ok on NT4.
2007-10-10 10:53:51 -05:00
Jeremy Allison
620f2e608f r4088: Get medieval on our ass about malloc.... :-). Take control of all our allocation
functions so we can funnel through some well known functions. Should help greatly with
malloc checking.
HEAD patch to follow.
Jeremy.
2007-10-10 10:53:32 -05:00
Jeremy Allison
8ee6060977 r1412: Fix password history list in tdbsam. Fix some memory leaks. Add
my (C) to a header file that was at least 50% mine :-).
Jeremy.
2007-10-10 10:52:10 -05:00
Jeremy Allison
ac846420d0 r1392: Added password history code to tdbsam backend. Not yet tested (ie. may
core dump) but compiles and links correctly. I will run the full set of
tests on the ldap sam and the tdb sam for password history tomorrow.
Jeremy.
2007-10-10 10:52:09 -05:00
Jeremy Allison
dd54b2a3c4 r1388: Adding password history code for ldap backend, based on a patch from
"Jianliang Lu" <j.lu@tiesse.com>. Multi-string attribute changed to
linearised pstring due to ordering issues. A few other changes to
fix race conditions. I will add the tdb backend code next. This code
compiles but has not yet been tested with password history policy
set to greater than zero. Targeted for 3.0.6.
Jeremy.
2007-10-10 10:52:09 -05:00
Jim McDonough
730c07cac2 Move tdbsam versioning/upgrade code into 3.0 -
Gerald Carter
daee8d7fee updates for tdbsam code to help make merge into head easier; needs a bit more testing tomorrow but initial results seem ok -
Jeremy Allison
e914230a2d Don't set an iterator to a piece of free'd memory, store it first.
Jeremy.
-
Gerald Carter
8734d91cd7 fix set/getsampwent iterator in tdbsam to use an allocated list -
Herb Lewis
a6a39c61e8 get rid of some sompiler warnings on IRIX -
Gerald Carter
b8394a107d removing unused function -
Rafal Szczesniak
b0be700605 This creates passdb backend files automatically when adding first account.
An extra message notifying that needed file didn't exist is displayed.
There's still a little catch with tdb backend, but it's better than it was,
from end-user's point of view.

This fixes #198


rafal
-
Gerald Carter
5efa0d7cc2 fix unitialised variable -
Gerald Carter
0463045cc7 moving more code around.
* move rid allocation into IDMAP.  See comments in _api_samr_create_user()
  * add winbind delete user/group functions

I'm checking this in to sync up with everyone.  But I'm going to split
the add a separate winbindd_allocate_rid() function for systems
that have an 'add user script' but need idmap to give them a RID.
Life would be so much simplier without 'enable rid algorithm'.
The current RID allocation is horrible due to this one fact.
Tested idmap_tdb but not idmap_ldap yet.  Will do that tomorrow.

Nothing has changed in the way a samba domain is represented, stored,
or search in the directory so things should be ok with previous installations.

going to bed now.
-
Jeremy Allison
88135fbc49 Moved SAM_ACCOUNT marshall/unmarshall functions to make them externally
available. Removed extra auth_init (thanks metze).
Jeremy.
-
Gerald Carter
688369c23c Cleaning up linking issues. sam/idmap*.c only links in
winbindd now.  Also removing an unused file.
-
Jeremy Allison
ff222716a0 Removed strupper/strlower macros that automatically map to strupper_m/strlower_m.
I really want people to think about when they're using multibyte strings.
Jeremy.
-
Volker Lendecke
9750799ba2 And some more memory leaks in mapping.c and pdb_tdb.c. tdb_nextkey
mallocs its key, so we should free it after use.

Volker
-