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

1198 Commits

Author SHA1 Message Date
Volker Lendecke
661c5c741a r12163: Change lookup_sid and lookup_name to return const char * instead of char *,
use a temporary talloc_ctx for clarity.

Volker
(This used to be commit b15815c804)
2007-10-10 11:05:46 -05:00
Volker Lendecke
ab51c18cc9 r12129: Fix uninitialized variables.
Volker
(This used to be commit 8a7d6eb2c0)
2007-10-10 11:05:46 -05:00
Volker Lendecke
05ac2de0df r12051: Merge across the lookup_name and lookup_sid work. Lets see how the build farm
reacts :-)

Volker
(This used to be commit 9f99d04a54)
2007-10-10 11:05:43 -05:00
Jeremy Allison
d1f91f7c72 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.
(This used to be commit c65b752604)
2007-10-10 11:05:42 -05:00
Volker Lendecke
bd21ee68e5 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
(This used to be commit 30fcdf84d8)
2007-10-10 11:05:41 -05:00
Volker Lendecke
6f04dc477e r11947: Back out passdb:expand_explicit until we find consensus. I'll file this as a
bugzilla entry.

Volker
(This used to be commit d228cb62a7)
2007-10-10 11:05:38 -05:00
Volker Lendecke
10bc204efb 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
(This used to be commit c917cfc320)
2007-10-10 11:05:36 -05:00
Volker Lendecke
046a8873b9 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
(This used to be commit 57f0cf8cdd)
2007-10-10 11:05:36 -05:00
Volker Lendecke
d36eb68cb5 r11920: Rename local_lookup_rid to lookup_global_sam_rid, add lookup_builtin_rid.
Volker
(This used to be commit bc8836d5d7)
2007-10-10 11:05:35 -05:00
Volker Lendecke
add1493a86 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
(This used to be commit 35ba5e083c)
2007-10-10 11:05:35 -05:00
Volker Lendecke
ace1212dec 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
(This used to be commit 6622db97bb)
2007-10-10 11:05:34 -05:00
Günther Deschner
092e3e514b 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
(This used to be commit 04a3ac5e50)
2007-10-10 11:05:33 -05:00
Gerald Carter
ac331c48db 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
(This used to be commit a33e78aced)
2007-10-10 11:05:31 -05:00
Günther Deschner
0e8b90e45d r11847: Fix typo.
Guenther
(This used to be commit 6aefb3aebb)
2007-10-10 11:05:29 -05:00
Jeremy Allison
cef9443a87 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.
(This used to be commit f46d847065)
2007-10-10 11:05:09 -05:00
Jim McDonough
1113cad9c0 r11236: Implement user rename for smbpasswd and ldap backends. Some cleanup on
tdb as well to make naming consistent.
(This used to be commit ee91eb9a39)
2007-10-10 11:05:08 -05:00
Jeremy Allison
8d7c886671 r11137: Compile with only 2 warnings (I'm still working on that code) on a gcc4
x86_64 box.
Jeremy.
(This used to be commit d720867a78)
2007-10-10 11:05:02 -05:00
Jim McDonough
254938c636 r10911: part of #2861: add rename support for usrmgr.exe when using tdbsam
This gets it working before replacing tdb with the samba4 version.
(This used to be commit 8210b0503a)
2007-10-10 11:04:56 -05:00
Jeremy Allison
e127501d45 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.
(This used to be commit a6d8a4b1ff)
2007-10-10 11:04:54 -05:00
Volker Lendecke
ba51ce6053 r10658: It's so nice to have CVSIN to blame for this kind of bugs :-)
Volker
(This used to be commit cf06a090a3)
2007-10-10 11:04:49 -05:00
Gerald Carter
54abd2aa66 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)
(This used to be commit 939c3cb5d7)
2007-10-10 11:04:48 -05:00
Gerald Carter
dbbaccc2c0 r10606: pdb_*sql patches from
Uli Meis <a.sporto@gmail.com>
Peter Rindfuss <rindfuss@wz-berlin.de>
(This used to be commit 8bf124adaf)
2007-10-10 11:04:48 -05:00
Gerald Carter
f44e11c100 r9661: fallback to cn attribubte if displayName is not available
(This used to be commit b1524999e0)
2007-10-10 11:03:24 -05:00
Gerald Carter
be0f3f159f r9660: real fix for group enumeration bug in 3.0.20; only affected the ldapsam code
(This used to be commit 62f9fb5e3a)
2007-10-10 11:03:24 -05:00
Günther Deschner
1d1d2418f0 r9522: Give better error-message when "NDS Universal Password" change fails.
Guenther
(This used to be commit df90ea016a)
2007-10-10 11:01:11 -05:00
James Peach
2c42509673 r9303: Clobber compiler warnings. Patch from Jason Mader <jason@ncac.gwu.edu> plus
some extra function declarations. Bugzilla bug #2523.
(This used to be commit 98d364459d)
2007-10-10 11:00:32 -05:00
Lars Müller
f5024ae257 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.
(This used to be commit 7423895900)
2007-10-10 11:00:24 -05:00
Günther Deschner
faa4b4a9f2 r8797: avoid unset rids for builtin-aliases.
Guenther
(This used to be commit c2810bcf66)
2007-10-10 11:00:17 -05:00
Günther Deschner
ecc0d00a6d r8787: Make enumeration of builtin-aliases work again.
Guenther
(This used to be commit 0c8859474d)
2007-10-10 11:00:17 -05:00
Günther Deschner
235bece8ff 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
(This used to be commit 793c82c017)
2007-10-10 11:00:08 -05:00
Jeremy Allison
19ca97a70f 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
(This used to be commit 9506b8e145)
2007-10-10 10:58:00 -05:00
Jeremy Allison
aeb3e96cdb r7787: Fix from Fernando Schapachnik <fernando@mecon.gov.ar> to add logon hours
support for the Postgres backend.
Jeremy.
(This used to be commit dd5d36c95f)
2007-10-10 10:57:21 -05:00
Volker Lendecke
e6ef7ba7a4 r7730: Some merges
(This used to be commit 5b4720598b)
2007-10-10 10:57:20 -05:00
Volker Lendecke
5b08e6688e r7718: Remove some unused code
(This used to be commit 10606be050)
2007-10-10 10:57:20 -05:00
Gerald Carter
3c47e65e93 r7577: switching to macro for IS_DC
(This used to be commit e6df9a7ac7)
2007-10-10 10:57:14 -05:00
Gerald Carter
fed660877c r7415: * big change -- volker's new async winbindd from trunk
(This used to be commit a0ac9a8ffd)
2007-10-10 10:57:08 -05:00
Gerald Carter
27ccf6ba6a r7142: removing 'ldap filter' smb.conf option
(This used to be commit e2f8eeb4e2)
2007-10-10 10:57:03 -05:00
Gerald Carter
f24d88cf9d r7139: trying to reduce the number of diffs between trunk and 3.0; changing version to 3.0.20pre1
(This used to be commit 9727d05241)
2007-10-10 10:57:02 -05:00
Volker Lendecke
4853a5d509 r6774: Fix 2 memleaks
(This used to be commit 6af57d4bae)
2007-10-10 10:56:54 -05:00
Volker Lendecke
8bb2b294f3 r6770: Fix bug 2705. Thanks, John, for beating my stuff :-)
Volker
(This used to be commit f406dda687)
2007-10-10 10:56:54 -05:00
Volker Lendecke
848cec55a0 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
(This used to be commit 85320c1257)
2007-10-10 10:56:53 -05:00
Gerald Carter
27bef67b3a r6713: another talloc() fix. This time in pdb_xml.c
(This used to be commit b0289d2258)
2007-10-10 10:56:52 -05:00
Jelmer Vernooij
620f8b899e r6635: Fix build of the various sql pdb backends after new talloc.
(This used to be commit 0a7eabd46d)
2007-10-10 10:56:48 -05:00
Jeremy Allison
7b9d6ac23e r6595: This is Volkers new-talloc patch. Just got the go-ahead from
Volker to commit. Woo Hoo !
Jeremy.
(This used to be commit 316df944a4)
2007-10-10 10:56:46 -05:00
Volker Lendecke
2e0cac8e3e r6445: Make us survive the PARANOID_MALLOC_CHECKER. Should we enable that for
--enable-developer=yes?

Volker
(This used to be commit 61d40ac60d)
2007-10-10 10:56:41 -05:00
Gerald Carter
57eb9f47d0 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.
(This used to be commit 0ac57ae942)
2007-10-10 10:56:41 -05:00
Volker Lendecke
f74f7c933d 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
(This used to be commit a831e54738)
2007-10-10 10:56:39 -05:00
Volker Lendecke
d3d6126d94 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
(This used to be commit f0bb44ac58)
2007-10-10 10:56:38 -05:00
Volker Lendecke
9f4c0afa0a 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
(This used to be commit 8b4f67a1e9)
2007-10-10 10:56:34 -05:00
Volker Lendecke
83e11ba86c r6263: Get rid of generate_wellknown_sids, they are const static and initializable
statically.

Volker
(This used to be commit 3493d9f383)
2007-10-10 10:56:33 -05:00
Herb Lewis
978ca84860 r6225: get rid of warnings from my compiler about nested externs
(This used to be commit efea76ac71)
2007-10-10 10:56:30 -05:00
Derrell Lipman
9840db418b 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.
(This used to be commit 994694f7f2)
2007-10-10 10:56:24 -05:00
Jeremy Allison
202c7b4571 r6092: This much const causes the compiler on Fedora Core 2
to throw up.
Jeremy.
(This used to be commit 051f0ed807)
2007-10-10 10:56:21 -05:00
Volker Lendecke
e84ead0cfd 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
(This used to be commit 3a67865169)
2007-10-10 10:56:20 -05:00
Jim McDonough
cf7d098b2c r5965: Apply Volker's patch for "ldapsam trusted = yes" for samr_lookup_rids. Gives us
again up to ~6x improvement on group membership lookups.
(This used to be commit e2117bcb09)
2007-10-10 10:56:13 -05:00
Gerald Carter
ec139622c5 r5957: BUGS 2478, 2093: compiler warning patches from Jason Mader
(This used to be commit b0f4346082)
2007-10-10 10:56:12 -05:00
Gerald Carter
dbd5c968d7 r5951: gotta love that SGI compiler :-) (thanks Jason)
(This used to be commit e84d070275)
2007-10-10 10:56:10 -05:00
Jim McDonough
b824fcb081 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).
(This used to be commit bf3ce651ff)
2007-10-10 10:56:09 -05:00
Jeremy Allison
91d355772f 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.
(This used to be commit 0976793e30)
2007-10-10 10:56:03 -05:00
Volker Lendecke
5ba3fb825b r5767: Get rid of some compiler warnings
(This used to be commit 66471de977)
2007-10-10 10:56:00 -05:00
Gerald Carter
f651bb0bea r5746: remove unneeded header that caused problems on rh73
(This used to be commit 68fe1f194a)
2007-10-10 10:55:59 -05:00
Jelmer Vernooij
a9a218f5e6 r5733: Don't crash when the SID column contains NULL (Fixes #2316)
Patch by Justin Ossevoort
(This used to be commit a281148168)
2007-10-10 10:55:58 -05:00
Jelmer Vernooij
cbe4adaec7 r5718: Don't update fields that haven't changed (fixes #1957)
(This used to be commit 5c682c665d)
2007-10-10 10:55:57 -05:00
Gerald Carter
32416866dd r5708: BUG 2424: patch from Vince Brimhall <vbrimhall@novell.com> to ensure that uidNumber and gidNumber use match the rfc2307 schema
(This used to be commit c1727dc9e0)
2007-10-10 10:55:56 -05:00
Jeremy Allison
a5f84481e3 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.
(This used to be commit 6f5ea963ab)
2007-10-10 10:55:54 -05:00
Volker Lendecke
f17c4ad8ae r5481: Fix a memleak
(This used to be commit 36bcfc5dae)
2007-10-10 10:55:42 -05:00
Volker Lendecke
a90a58ff22 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
(This used to be commit e1c3ca182b)
2007-10-10 10:55:41 -05:00
Volker Lendecke
f51677051c 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
(This used to be commit 543799fc0d)
2007-10-10 10:55:40 -05:00
Volker Lendecke
bc10e4067a r5421: Fix a memleak
(This used to be commit a7df3b5f06)
2007-10-10 10:55:40 -05:00
Günther Deschner
6c84ecb556 r5349: After talking with Jerry, reverted the addition of account policies to
passdb in 3_0 (they are still in trunk).

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

Guenther
(This used to be commit 168ddf31d1)
2007-10-10 10:55:13 -05:00
Gerald Carter
46d8ff2320 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.
(This used to be commit f9f9e6039b)
2007-10-10 10:55:12 -05:00
Gerald Carter
e512799c00 r4996: sync up copytights with trunk
(This used to be commit 8946efe102)
2007-10-10 10:55:11 -05:00
Günther Deschner
a548e710d8 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
(This used to be commit 78c3c71274)
2007-10-10 10:55:11 -05:00
Günther Deschner
de87569cfb r4988: After speaking with Jerry, remove old lp_admin_users to
administrator-sid mapping completely.

Guenther
(This used to be commit 4cbe37ecd5)
2007-10-10 10:55:10 -05:00
Günther Deschner
0b3889e346 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
(This used to be commit d319c0e189)
2007-10-10 10:55:09 -05:00
Günther Deschner
e3971524d2 r4926: Use LDAP_SCOPE_ONELEVEL instead of OpenLDAP's LDAP_SCOPE_ONE-scope.
Guenther
(This used to be commit eee0bd806b)
2007-10-10 10:55:08 -05:00
Günther Deschner
b4afdc08d5 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
(This used to be commit 75af83dfcd)
2007-10-10 10:55:08 -05:00
Gerald Carter
811df6699c r4860: fix silly limitation in ldapsam and tdbsam. Expand variables in the profile path, logon home and logon script values
(This used to be commit 504ea4ac68)
2007-10-10 10:54:00 -05:00
Günther Deschner
320d765081 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
(This used to be commit 853a8b7f1c)
2007-10-10 10:53:59 -05:00
Günther Deschner
1ed62fde09 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
(This used to be commit 6394257cc7)
2007-10-10 10:53:59 -05:00
Günther Deschner
0c6010238d r4840: * Add more generic root-dse inspection function to check for given
controls or extensions.
* Check and remember if ldapsam's LDAP Server support paged results
(in preparation of adding async paged-results to set|get|end-sampwent in
ldapsam).

Guenther
(This used to be commit ced58bd884)
2007-10-10 10:53:57 -05:00
Jelmer Vernooij
5d47f8e5e5 r4802: Don't try to update a column with the name "NULL"
(This used to be commit ed38e60264)
2007-10-10 10:53:55 -05:00
Jelmer Vernooij
69e24e59a4 r4788: Don't log mysql password at debug level 1.
(This used to be commit 760455875f)
2007-10-10 10:53:54 -05:00
Gerald Carter
c3ba8b9a53 r4736: small set of merges from rtunk to minimize the diffs
(This used to be commit 4b351f2fcc)
2007-10-10 10:53:52 -05:00
Gerald Carter
d94d87472c 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.
(This used to be commit 77c10ff9aa)
2007-10-10 10:53:51 -05:00
Jeremy Allison
acf9d61421 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.
(This used to be commit 620f2e608f)
2007-10-10 10:53:32 -05:00
Jelmer Vernooij
2956b574df r3974: - Fix assignment of a couple of fields in pdb_{mysql,pgsql}
- Use new DTD URL in pdb_xml
(This used to be commit 99dc2f36d1)
2007-10-10 10:53:26 -05:00
Jeremy Allison
c5c2dd6dba r3948: Fix incorrect declaration. Bug #2083.
Jeremy.
(This used to be commit 05b905a28f)
2007-10-10 10:53:26 -05:00
Jeremy Allison
90a18110e9 r3931: Fix all "may be used uninitialized" and "shadow" warnings.
Jeremy.
(This used to be commit 8e979772a6)
2007-10-10 10:53:25 -05:00
Volker Lendecke
9b734922b5 r3883: Fix error return -- thanks to rsharpe
(This used to be commit 2d952c86c7)
2007-10-10 10:53:23 -05:00
Günther Deschner
7c93bdcdf8 r3875: Allow to look up at least or own sid in _lsa_lookup_sids.
This fixes Bugzilla #1076 and Exchange 5.5 SP4 can then be finally
installed on NT4 in a samba-controlled domain.

Guenther
(This used to be commit bb191c1098)
2007-10-10 10:53:22 -05:00
Volker Lendecke
b917dd4bfa r3871: Fix memleak
(This used to be commit dbfdde5f63)
2007-10-10 10:53:22 -05:00
Volker Lendecke
36913aa038 r3852: Fix the build...
(This used to be commit 3bd72b864f)
2007-10-10 10:53:21 -05:00
Volker Lendecke
f9e87b9ba6 r3705: Nobody has commented, so I'll take this as an ack...
abartlet, I'd like to ask you to take a severe look at this!

We have solved the problem to find the global groups a user is in twice: Once
in auth_util.c and another time for the corresponding samr call. The attached
patch unifies these and sends them through the passdb backend (new function
pdb_enum_group_memberships). Thus it gives pdb_ldap.c the chance to further
optimize the corresponding call if the samba and posix accounts are unified by
issuing a specialized ldap query.

The parameter to activate this ldapsam behaviour is

ldapsam:trusted = yes

Volker
(This used to be commit b94838aff1)
2007-10-10 10:53:15 -05:00
Volker Lendecke
69ddbbf97b r3704: Implement a cache get saves the result of a pdb_getsampwnam for later
retrieval by pdb_getsampwsid. This solves our problem that we do lots of calls
to LDAP during a typical XP login. XP does a lookupnames, then an openuser and
some queryinfo stuff. Lookupnames triggers the initial getsampwnam, and all
the subsequent ones make us call getsampwsid. This patch gets this down to one
call to LDAP.

Yes, a more "correct" way would be to stick the information to the open user
handle, but this one is simpler and saves the LDAP roundtrip for the openuser
call.

Volker
(This used to be commit 3d9758fa3c)
2007-10-10 10:53:15 -05:00
Günther Deschner
8384b33e0d r3628: A typo and a compile-warning.
Guenther
(This used to be commit 906d5f88aa)
2007-10-10 10:53:10 -05:00
Volker Lendecke
154d5f913b r3566: Completely replace the queryuseraliases call. The previous implementation does
not exactly match what you would expect.

XP workstations during login actually do this, so we should better become a
bit more correct. The LDAP query issued is not really fully optimal, but it is
a lot faster and more correct than what was there before. The change in
passdb.h makes it possible that queryuseraliases is done with a single ldap
query.

Volker
(This used to be commit 2508d4ed1e)
2007-10-10 10:53:09 -05:00
Volker Lendecke
55fe875a44 r3563: During a typical logon a modern workstation makes a lot of anonymous session
setups on its way to open a pipe. This gets rid of many round-trips to the
LDAP server during logon by setting up the server_info_guest once and not
asking the LDAP server and nss every time. Make sure that the ldap connection
is reopened in the child. (I did not look at the sql backends.)

Volker
(This used to be commit 3298f6105e)
2007-10-10 10:53:09 -05:00
Günther Deschner
5976f2327b r2923: Fix some obvious copy/paste leftover debug-messages.
Guenther
(This used to be commit 94f48d06c7)
2007-10-10 10:52:56 -05:00
Günther Deschner
c5ccf8edaf r2819: Make 'password history'-behaviour in ldapsam more consistent.
Currently we cannot store more then 15 password history entries (windows
NT4 allows to store 24) in ldapsam. When choosing more then "15" with
pdbedit -P "password history", we fail to initialize the password
history upon password change and overwrite the history, effectively
using a password history of "1". We do already decrease any
history-policy larger then 15 to 15 while storing the password history
list attribute in ldap.

Guenther
(This used to be commit a4b47e7147)
2007-10-10 10:52:53 -05:00
Günther Deschner
4edd6528f9 r2752: Fix the paranoia-check to ensure the ldap-attribute and the
smb.conf-parameter for samba's "algorithmic rid base" in ldapsam are
identical.

It tried to get the value of LDAP_ATTR_ALGORITHMIC_RID_BASE via
get_userattr_key2string() for a very long time now. This just can not
work because LDAP_ATTR_ALGORITHMIC_RID_BASE is neither in attrib_map_v22
nor in attrib_map_v30. Instead, get it directly from dominfo_attr_list.

Ldapsam will now correctly refuse to initialize when admins tried
manually to have differing values for "algorithmic rid base" in ldap and
smb.conf. idmap_ldap is another story...

Guenther
(This used to be commit c5b8bc6c2e)
2007-10-10 10:52:50 -05:00
Volker Lendecke
a9a4f22958 r2619: Only issue the ldap extended password change operation if the ldap server
supports it. This might be a fix for bugs 1823 and 1545, notifying both.

Also ignore object class violation errors from the extended operation. We
don't have the userPassword field in sambaSamAccount, and if we have such
broken setup with user in /etc/passwd and only samba attribs in ldap, we fail
this :-)

Volker
(This used to be commit a32ea3bc88)
2007-10-10 10:52:48 -05:00
Jeremy Allison
557f2cf461 r2479: Stop attribute "modifyTimestamp" from being deleted.
Jeremy.
(This used to be commit 0351bf8b03)
2007-10-10 10:52:45 -05:00
Jelmer Vernooij
2dce7d4409 r2473: Convert internal data to UTF-8 before calling libxml2
(This used to be commit 8be3fa5bfa)
2007-10-10 10:52:44 -05:00
Volker Lendecke
ec62d5a968 r2444: Based on jmcd's patch, implement special lists for the ldap user attributes to
delete.

Richard, IMHO this is the better solution to the problem you currently
have. Please review.

Thanks,

Volker
(This used to be commit 6957d6a892)
2007-10-10 10:52:43 -05:00
Jeremy Allison
b0d376ba07 r2374: Fix from Vince Brimhall vbrimhall@novell.com for
ldapsam_compat. Be robust against NULL attributes.
Jeremy.
(This used to be commit 727fc341b5)
2007-10-10 10:52:41 -05:00
Jeremy Allison
c0b43349b3 r2317: Fixup error messages and reformat.
Jeremy.
(This used to be commit 8ae10c74ec)
2007-10-10 10:52:39 -05:00
Jeremy Allison
92c1eba403 r2312: Fix for bugid #1667, smbpasswd file could be left locked on
some error exits.
Jeremy.
(This used to be commit e2b0b9fb72)
2007-10-10 10:52:39 -05:00
Volker Lendecke
9723edd84f r1906: Revert lukeh's change for primary uid/gid change. This creates a recursion
loop between uid_to_sid -> getsampwnam -> uid_to_sid. It needs further
inspection.

Volker
(This used to be commit 67d8bc4853)
2007-10-10 10:52:23 -05:00
Jeremy Allison
5cd11b7127 r1871: Patch from Luke Howard <lukeh@PADL.COM> to correctly use
uid_to_sid() and gid_to_sid() in pdb_set_sam_sids().
Jeremy.
(This used to be commit dae084d713)
2007-10-10 10:52:22 -05:00
Jeremy Allison
c9e0625f57 r1869: Rename "fallback_XXXX" mapping to "algorithmic_XXX" as
that's what it actually does, and "fallback_" is just
confusing.
Jeremy.
(This used to be commit f44b4ba381)
2007-10-10 10:52:22 -05:00
Jeremy Allison
bdab948fcf r1810: Patch from Richard Renard <rrenard@idealx.com> to store
logon hours attributes in an LDAP database.
Jeremy.
(This used to be commit dac72638fb)
2007-10-10 10:52:21 -05:00
Jeremy Allison
ead3776a74 r1733: Fix hashed password history for LDAP backends.
Jeremy.
(This used to be commit a1bb6fbbe4)
2007-10-10 10:52:20 -05:00
Jeremy Allison
2723be1239 r1661: Changed the password history format so that each history entry
consists of a 16 byte salt, followed by the 16 byte MD5 hash of
the concatination of the salt plus the NThash of the historical
password. Allows these to be exposed in LDAP without security issues.
Jeremy.
(This used to be commit 82e4036aaa)
2007-10-10 10:52:17 -05:00
Jeremy Allison
db4fde99d4 r1610: Patch from Richard Renard <rrenard@idealx.com>. Ensure we
save the password as it is being changed into the password
history list.
Jeremy.
(This used to be commit 4fd619d7e1)
2007-10-10 10:52:16 -05:00
Jeremy Allison
1fca1fd8d7 r1539: If a account was locked out by an admin (and has a bad password count of zero)
leave it locked out until an admin unlocks it (but log a message).
Jeremy.
(This used to be commit 14bd2a9ffc)
2007-10-10 10:52:14 -05:00
Andrew Bartlett
9d0783bf21 r1492: Rework our random number generation system.
On systems with /dev/urandom, this avoids a change to secrets.tdb for every fork().

For other systems, we now only re-seed after a fork, and on startup.
No need to do it per-operation.  This removes the 'need_reseed'
parameter from generate_random_buffer().

Andrew Bartlett
(This used to be commit 36741d3cf5)
2007-10-10 10:52:13 -05:00
Jeremy Allison
d4ac326d46 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.
(This used to be commit 8ee6060977)
2007-10-10 10:52:10 -05:00
Jeremy Allison
c54a86b969 r1394: Const fix.
Jeremy.
(This used to be commit 9ac4945012)
2007-10-10 10:52:10 -05:00
Jeremy Allison
10f0c34a2a 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.
(This used to be commit ac846420d0)
2007-10-10 10:52:09 -05:00
Jeremy Allison
1c5867502a 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.
(This used to be commit dd54b2a3c4)
2007-10-10 10:52:09 -05:00
Volker Lendecke
e107e9790d r1108: Index: pdb_ldap.c
===================================================================
--- pdb_ldap.c	(revision 1095)
+++ pdb_ldap.c	(working copy)
@@ -1134,6 +1134,19 @@
 	return NT_STATUS_OK;
 }

+static void append_attr(char ***attr_list, const char *new_attr)
+{
+	int i;
+
+	for (i=0; (*attr_list)[i] != NULL; i++)
+		;
+
+	(*attr_list) = Realloc((*attr_list), sizeof(**attr_list) * (i+2));
+	SMB_ASSERT((*attr_list) != NULL);
+	(*attr_list)[i] = strdup(new_attr);
+	(*attr_list)[i+1] = NULL;
+}
+
 /**********************************************************************
 Get SAM_ACCOUNT entry from LDAP by username.
 *********************************************************************/
@@ -1149,6 +1162,7 @@
 	int rc;

 	attr_list = get_userattr_list( ldap_state->schema_ver );
+	append_attr(&attr_list, MODIFY_TIMESTAMP_STRING);
 	rc = ldapsam_search_suffix_by_name(ldap_state, sname, &result, attr_list);
 	free_attr_list( attr_list );

@@ -1194,6 +1208,7 @@
 	switch ( ldap_state->schema_ver ) {
 		case SCHEMAVER_SAMBASAMACCOUNT:
 			attr_list = get_userattr_list(ldap_state->schema_ver);
+			append_attr(&attr_list, MODIFY_TIMESTAMP_STRING);
 			rc = ldapsam_search_suffix_by_sid(ldap_state, sid, result, attr_list);
 			free_attr_list( attr_list );

Index: login_cache.c
===================================================================
--- login_cache.c	(revision 1095)
+++ login_cache.c	(working copy)
@@ -95,10 +95,13 @@
 			&entry->bad_password_count,
 			&entry->bad_password_time) == -1) {
 		DEBUG(7, ("No cache entry found\n"));
+		SAFE_FREE(entry);
 		SAFE_FREE(databuf.dptr);
 		return NULL;
 	}

+	SAFE_FREE(databuf.dptr);
+
 	DEBUG(5, ("Found login cache entry: timestamp %12u, flags 0x%x, count %d, time %12u\n",
 		  (unsigned int)entry->entry_timestamp, entry->acct_ctrl,
 		  entry->bad_password_count, (unsigned int)entry->bad_password_time));
(This used to be commit c0bf8425f4)
2007-10-10 10:51:55 -05:00
Volker Lendecke
4e1b26db34 r989: Calling sid_to_gid from within winbind makes no sense, as this calls
winbind_sid_to_gid. For the consistency check, local_sid_to_gid must set the
name_type it found.

Volker
(This used to be commit 5070c1b68f)
2007-10-10 10:51:52 -05:00
Andrew Bartlett
fe8977e12c r936: Fix a rather weird error that crippled my site, when we upgraded to
Samba 3.0.4.

If we fail a query for the members of the 'administrators' group (and we may well just have the IDL wrong), this destroys later parts of the domain logon process.

For reasons I can't understand, the client-side 'heck, what happened'
bailout causes the connection to the DC to be dropped, and causes the
mandetory profile not to be loaded.  (This also only occours after a reboot)

Return the members of 'administrators', and it all works fine.

The reason we hit this is because we run winbindd (to support
pam_winbind) on our DC, and the winbindd lookup in sid_to_gid was
messing things up.  As we don't care what type of thing this is,
provided it exists in the group mapping db, we should not bother
winbindd here.

Andrew Bartlett
(This used to be commit d626b5c6d4)
2007-10-10 10:51:50 -05:00
Jeremy Allison
e8681c225f r910: Fix for bug #1385 found by Jason Mader <jason@ncac.gwu.edu>.
Don't use non-consts in a structure initialization.
Jeremy.
(This used to be commit 455ed258b3)
2007-10-10 10:51:48 -05:00
Jeremy Allison
52ddd54083 r801: Fix from "Jianliang Lu" <j.lu@tiesse.com> to return correct group
types.
Jeremy.
(This used to be commit d97b9146a1)
2007-10-10 10:51:46 -05:00
Jeremy Allison
0f5e40b14e r788: Inspired by patch from "Jianliang Lu" <j.lu@tiesse.com>. Correct
sid type is WKN_GROUP, not alias. Added some more known types.
Jeremy.
(This used to be commit 538b66f4e9)
2007-10-10 10:51:38 -05:00
Richard Sharpe
7cb9ca16f6 r505: Break out algorithmic_gid_to_sid so that those of us who need it can use it.
(This used to be commit 5d7ee320cc)
2007-10-10 10:51:26 -05:00
Richard Sharpe
fc62b9fcc1 r501: Fix a small cut-n-pasteo ...
(This used to be commit b1825184d3)
2007-10-10 10:51:26 -05:00
Stefan Metzmacher
f880fe51b3 r340: fix a segfault in the login_cache code...
metze
(This used to be commit 908d8a4125)
2007-10-10 10:51:20 -05:00
Volker Lendecke
0d6acfe19a r316: Fix split_domain_name. This defaulted to get_myname() instead of
get_global_sam_name().

Error case: Adding a domain user to a XP local group did a lsalookupname on
the user without domain prefix, and this then failed.

Jerry: This is a must-fix before 3.0.3.

Volker
(This used to be commit f35e353454)
2007-10-10 10:51:18 -05:00
Gerald Carter
8ad3d8c9b0 r196: merging struct uuid from trunk
(This used to be commit 911a28361b)
2007-10-10 10:51:13 -05:00
Volker Lendecke
69a91df4ed r145: pdb_create_alias now returns NTSTATUS. More of this to follow.
Volker
(This used to be commit 6e18bed170)
2007-10-10 10:51:11 -05:00
Gerald Carter
7af3777ab3 r116: volker's patch for local group and group nesting
(This used to be commit b393469d95)
2007-10-10 10:51:10 -05:00
Jim McDonough
a15393a3d9 r53: Remove modifyTimestamp from list of our attributes. We just check it for
cache entry time comparisons in password lockout.  Fixes problems where
pdb_ldap tries to delete the operational attribute modifyTimestamp when
deleting a user account.
(This used to be commit 5ebcb9081e)
2007-10-10 10:51:06 -05:00
Jeremy Allison
7226511ead r48: Fix types for debug message parameters.
Jeremy.
(This used to be commit 85d9c92fd5)
2007-10-10 10:51:05 -05:00
Gerald Carter
931df5850e r39: * importing .cvsignore files
* updateing WHATSNEW with vl's change
(This used to be commit a7e2730ec4)
2007-10-10 10:51:05 -05:00
Volker Lendecke
95bd9b5ab0 Apply some const
(This used to be commit aa220cffa7)
2004-03-31 15:21:48 +00:00
Volker Lendecke
9d1a4e8013 Remove some unused code
(This used to be commit 2b757b6adf)
2004-03-31 14:36:25 +00:00
Jim McDonough
2732b702fb Use timegm, or our already existing replacement instead of timezone, as
some platforms (FreeBSD in this case) don't define timezone according to
posix.  This is what I wanted to do anyway.

Spotted by Andrzej Tobola <san@iem.pw.edu.pl>
(This used to be commit bc13e35db0)
2004-03-25 18:25:41 +00:00
Jeremy Allison
a79b205d92 Fix gcc warnings. Fix mkproto with new type.
Jeremy.
(This used to be commit 00fa66df3e)
2004-03-19 01:29:14 +00:00
Jim McDonough
357998ddbd Password lockout for LDAP backend. Caches autolock flag, bad count, and
bad time locally, updating the directory only for hitting the policy limit
or resetting.

This needed to be done at the passdb level rather than auth, because some
of the functions need to be supported from tools such as pdbedit.  It was
done at the LDAP backend level instead of generically after discussion,
because of the complexity of inserting it at a higher level.

The login cache read/write/delete is outside of the ldap backend, so it could
easily be called by other backends.  tdbsam won't call it for obvious
reasons, and authors of other backends need to decide if they want to
implement it.
(This used to be commit 2a679cbc87)
2004-03-18 19:22:51 +00:00
Jim McDonough
3d18997afd Get MungedDial actually working with full TS strings in it for pdb_ldap.
I know this isn't pretty, but neither was our assumption that all strings
from the directory fit inside a pstring.  There was no way this worked
before will all versions of usrmgr (for example, the only version of
mine that has the TS Confic button).
(This used to be commit d275c0e384)
2004-03-11 16:32:19 +00:00
Volker Lendecke
b3b93aaa3f Get us a little closer to Windows LSA semantics.
A windows DC does not reply to DCNAME\\Administrator, only to
DOMAIN\\Administrator. Fix that.

Without winbind we are wrong as domain members, we should forward the request
DOMAIN\\Username to the DC on behalf of the asking client. Winbind fixes that
nicely.

Volker
(This used to be commit 7ed61edbbe)
2004-03-07 08:22:06 +00:00
Volker Lendecke
e692b991d1 And another little const
(This used to be commit f6bb3304fc)
2004-02-26 11:07:06 +00:00
Andrew Bartlett
9e2a098a0a Fix bug in previous global_sam_sid() commit. I broke the 'read from
MACHINE.SID' file functionality.

Also, before we print out the results of 'net getlocalsid' and 'net
getdomainsid', ensure we have tried to read that file, or have
generated one.

Andrew Bartlett
(This used to be commit 191b43159e)
2004-02-25 23:12:29 +00:00
Andrew Bartlett
56bd63b1cd I *hate* global variables...
OK, what was happening here was that we would invalidate global_sam_sid
when we set the sid into secrets.tdb, to force a re-read.

The problem was, we would do *two* writes into the TDB, and the second one
(in the PDC/BDC case) would be of a NULL pointer.  This caused smbd startups
to fail, on a blank TDB.

By using a local variable in the pdb_generate_sam_sid() code, we avoid this
particular trap.

I've also added better debugging for the case where this all matters, which
is particularly for LDAP, where it finds out a domain SID from the sambaDomain
object.

Andrew Bartlett
(This used to be commit 86ad04d26d)
2004-02-25 22:01:02 +00:00
Andrew Bartlett
06549b8886 Found by Fabien Chevalier <fabien.chevalier@supelec.fr> and
JustFillBug <mozbugbox@yahoo.com.au> on the Samba lists - a 'max
password age' of zero should be considered as 'never expire'.

For the timebeing we just set it like -1, but we might revisit this
for closer-to-ms behaviour.

Andrew Bartlett
(This used to be commit 9ffc490fce)
2004-02-23 21:09:09 +00:00
Jim McDonough
9264194340 handle both 0 and -1 as disabling reset count and lockout duration
(This used to be commit 84fe24e64e)
2004-02-20 16:00:25 +00:00
Jim McDonough
222d9a3ce2 Clean up bad pw count and autolock flag update fn()s
(This used to be commit 9a79f9fbcb)
2004-02-19 21:37:24 +00:00
Jim McDonough
e507a83617 Add bad pw count and autolock flag update fn()s
(This used to be commit 600fcd534b)
2004-02-19 18:35:43 +00:00
Jim McDonough
39a154ae92 Add functions to get/set bad password time
(This used to be commit 557f598c63)
2004-02-19 15:59:35 +00:00
Jim McDonough
d21f23e01f Move tdbsam versioning/upgrade code into 3.0
(This used to be commit 730c07cac2)
2004-02-13 14:48:20 +00:00
Jim McDonough
041f03151c Try to remove the last vestiges of unknown_3...
Jelmer, can you look at the sql and xml backends please to verify?
(This used to be commit b7706f7e25)
2004-02-12 19:09:21 +00:00
Gerald Carter
eaece3bbe6 abartlet's pdb_set/changed flag fix for NULL passwords
(This used to be commit cfe80f0df7)
2004-02-12 17:51:23 +00:00
Gerald Carter
b6a320bdc1 stupid cut-n=paste error; my fault
(This used to be commit ee8f142b87)
2004-02-12 17:09:01 +00:00
Jim McDonough
1fa1e931a3 More sync between passdb on 3.0 and HEAD.
Replace unknown_3 with fields_present.  Also causes rpc_samr structure field changes.
(This used to be commit 1976843345)
2004-02-12 16:16:53 +00:00
Jim McDonough
34232f9ec0 Start of merging HEAD changes. Right now, just move one fn() to eliminate
the prototype at the beginning, and change some comments so diffs to HEAD
aren't filled with useless info.
(This used to be commit 7b40f6c464)
2004-02-12 15:20:40 +00:00
Gerald Carter
a6a2a69680 updates for tdbsam code to help make merge into head easier; needs a bit more testing tomorrow but initial results seem ok
(This used to be commit daee8d7fee)
2004-02-12 05:07:44 +00:00
Jeremy Allison
16733020e3 Don't set an iterator to a piece of free'd memory, store it first.
Jeremy.
(This used to be commit e914230a2d)
2004-02-11 22:47:12 +00:00
Gerald Carter
da52004988 fix set/getsampwent iterator in tdbsam to use an allocated list
(This used to be commit 8734d91cd7)
2004-02-11 21:10:04 +00:00
Volker Lendecke
24f2e0cc3e And another build fix.
Volker
(This used to be commit 6c78a096a5)
2004-02-09 15:21:42 +00:00
Volker Lendecke
42f763e6f0 Fix the build & get rid of a compiler warning.
Volker
(This used to be commit 38c9b775ce)
2004-02-09 14:43:18 +00:00
Andrew Bartlett
46975eb92f When we set a domain sid, force get_global_sam_sid() to do it's work again.
This should ensure that the value it returns is always consistant.

Andrew Bartlett
(This used to be commit a4392ede33)
2004-02-08 11:05:34 +00:00
Andrew Bartlett
b401888b6b Add static, and assert that we will never overflow the static fstring
in pdb_encode_acct_ctrl()  (All current callers are fine)

Andrew Bartlett
(This used to be commit 01be89eb43)
2004-02-08 11:02:11 +00:00
Andrew Bartlett
d198c55877 Make more functions static, and remove duplication in the use of functions
in lib/smbpasswd.c that were exact duplicates of functions in passdb/passdb.c

(These should perhaps be pulled back out to smbpasswd.c, but that can occour
later).

Andrew Bartlett
(This used to be commit fcdc5efb1e)
2004-02-08 08:38:42 +00:00
Gerald Carter
471e558b28 move disabling code to context functions instead of backwards compatible wrappers
(This used to be commit e62ef2ba2d)
2004-02-04 19:46:29 +00:00
Andrew Bartlett
f125759072 Fix const warning
(This used to be commit 7a36cc4ac0)
2004-02-04 11:41:22 +00:00
Andrew Bartlett
9751ccf2af If we are setting the NT or LM password to NULL, remove the attribute
rather than writing XXXXX

Andrew Bartlett
(This used to be commit ab7dd748a9)
2004-01-30 23:37:38 +00:00
Gerald Carter
3141a26677 disable any account that doesn't have a password and doesn't had the ACB_PWNOTREQ bit set
(This used to be commit 52bf070b10)
2004-01-30 14:59:40 +00:00
Gerald Carter
d4420dc902 more initialization fixes
(This used to be commit 9e590d6035)
2004-01-29 22:16:58 +00:00
Gerald Carter
6566a89bee initialization fixes
(This used to be commit 54fd3992c3)
2004-01-29 20:14:50 +00:00
Rafal Szczesniak
9919ab60ea Typo fix.
rafal
(This used to be commit 5d7f81eea2)
2004-01-07 22:44:28 +00:00
Andrew Bartlett
43a4e1dbf9 Don't duplicate pulling the 'IPC' username from secrets.tdb, instead
just use one function for both places.

Andrew Bartlett
(This used to be commit 85da181e8a)
2004-01-07 10:11:24 +00:00
Gerald Carter
29b4959815 isolate ldap debug messages to the common smbldap_XXX() functions
(This used to be commit 7d7a262f45)
2004-01-06 18:26:18 +00:00
Jelmer Vernooij
430f9abd5f - 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
(This used to be commit 65ad2c02fd)
2004-01-04 21:09:42 +00:00
Andrew Bartlett
b4593e92ff 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
(This used to be commit f9e59f8bc0)
2004-01-02 05:32:07 +00:00
Andrew Bartlett
66f039d58c 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
(This used to be commit 9080c30de8)
2003-12-26 03:14:31 +00:00
Andrew Bartlett
988f561477 Show the error message for failure to set the ldap password.
(For 'ldap password sync = yes')

Andrew Bartlett
(This used to be commit 5b682aef67)
2003-12-26 00:43:48 +00:00
Gerald Carter
380e160778 add well known rid for pre win2k compatible access group; bug 897
(This used to be commit 33a1a374eb)
2003-12-22 21:48:06 +00:00
Jeremy Allison
9f0e1c0f7f Patch from Jianliang Lu j.lu@tiesse.com to manage Power Users
group.
Jeremy.
(This used to be commit 72252fb0b2)
2003-12-22 11:12:15 +00:00
Alexander Bokovoy
05fcb69270 Fix uninitialized variable in passdb code. Reported by Andy Polyakov <appro@fy.chalmers.se>
(This used to be commit ac7a60abf2)
2003-12-11 10:24:43 +00:00
Gerald Carter
87fddf6a98 more group lookup access fixes on the neverending bug 281
(This used to be commit 9359a6ea80)
2003-12-10 16:40:17 +00:00
Gerald Carter
5df2fd4175 support munged dial for ldapsam; patch from Aurlien Degrmont; bug 800
(This used to be commit 1c3c16abc9)
2003-12-04 04:52:00 +00:00
Gerald Carter
70e2f0944a another strequal() == 0 fix
(This used to be commit 464b410734)
2003-12-01 19:59:25 +00:00
Gerald Carter
716484265d add Replicator and RAS Servers to list of builtin SIDs we resolve; bug 608
(This used to be commit 4bc58129e0)
2003-12-01 18:37:47 +00:00
Gerald Carter
c39f5fea4a more access fixes for group enumeration in LDAP; bug 281
(This used to be commit 68283407e0)
2003-11-24 17:31:38 +00:00
Gerald Carter
4097f5ec8d * make sure we only enumerate group mapping entries
(not /etc/group) even when doing local aliases

* remove "hide local users" parameter; we have this
  behavior built into 3.0
(This used to be commit a7685a0697)
2003-11-17 16:06:10 +00:00
Gerald Carter
36558f8f2b fix more memory leaks in the LDAP backend code; patches from metze
(This used to be commit e079c8842a)
2003-11-14 03:28:03 +00:00
Gerald Carter
6ebde91c44 * only install swat html files once
* revert the change that prevent the guest
  account from being added to a passdb backend
  since it broke the build farm.
* apply patch from Alex Deiter to fix the
  "smbldap_open: cannot access when not root
  error" messages when looking up group
  information (bug 281)
(This used to be commit 9b8bf6a950)
2003-11-07 23:04:06 +00:00
Gerald Carter
84ca7ad00c fix for bug 680 (heads up). This gist is to map the
UNIX entity foo to DOMAIN\foo instead of SERVER\foo
on members of a Samba domain when all UNIX accounts
are shared via NIS, et. al.

  * allow winbindd to match local accounts to domain SID
    when 'winbind trusted domains only = yes'

  * remove code in idmap_ldap that searches the user
    suffix and group suffix.  It's not needed and
    provides inconsistent functionality from the tdb backend.

This has been tested.  I'm still waiting on some more feedback
but This needs to be in 3.0.1pre2 for widespread use.
(This used to be commit ee272414e9)
2003-11-07 14:39:47 +00:00
Gerald Carter
9db332645b don't allow setting of the guest account
(This used to be commit e0eea36394)
2003-11-07 14:32:25 +00:00
Andrew Bartlett
c22afa7d97 I agree with vl's #if 0 here, and am not quite sure what I was
thinking with regard to the original code.

Let's keep samba simple, and just remove it.

Andrew Bartlett
(This used to be commit 156cf8bede)
2003-11-07 08:36:29 +00:00
Gerald Carter
2c1d659020 bug 624; make sure to set the GUEST SID rather than using the PDB_DEFAULT flag
(This used to be commit ccc7634b1c)
2003-11-06 05:46:06 +00:00
Jeremy Allison
732fecd3a0 Patch from Aurlien Degrmont <adegremont@idealx.com>. "entry" is dependent
on "result", don't free result first.
Jeremy.
(This used to be commit c61a230c5a)
2003-10-31 19:16:59 +00:00
Jeremy Allison
f23c2ff0a0 If nothing to do, return success. Fix from Aur?lien Degr?mont <adegremont@idealx.com>
Jeremy.
(This used to be commit aa668a0206)
2003-10-30 20:09:13 +00:00
Jeremy Allison
bb0598faf5 Put strcasecmp/strncasecmp on the banned list (except for needed calls
in iconv.c and nsswitch/). Using them means you're not thinking about multibyte at
all and I really want to discourage that.
Jeremy.
(This used to be commit d7e35dfb92)
2003-10-22 23:38:20 +00:00
Andrew Bartlett
6f83e9c0cd Match Samba 2.2, and make ACB_NORMAL the default ACB value.
(Samba 2.2 did this in the LDAP code, but it fits better as a generic thing)

Andrew Bartlett
(This used to be commit dfd6bef580)
2003-10-10 12:57:44 +00:00
Simo Sorce
b1f610ebb1 split some security related functions in their own files.
(no need to include all of smbd files to use some basic sec functions)

also minor compile fixes
couldn't compile to test these due to some kerberos problems wirh 3.0,
but on HEAD they're working well, so I suppose it's ok to commit
(This used to be commit c78f2d0bd1)
2003-10-06 01:38:46 +00:00
Jeremy Allison
0f0fbbbaa4 Typo in error message.
Jeremy.
(This used to be commit 8996c51770)
2003-10-03 22:09:33 +00:00
Jeremy Allison
567caaf5f9 Portability fix from schmitz@hp.com (Joachim Schmitz). Bug #547.
Jeremy.
(This used to be commit bbc7b189b9)
2003-10-02 17:53:57 +00:00
Volker Lendecke
ec6c16d7b1 Make pdb_ldap.c compile with SUN iPlanet headers. Whether this works will be
tested soon, but this fix is somewhat obvious.

Volker
(This used to be commit 227882d6f7)
2003-10-02 09:26:51 +00:00
Jelmer Vernooij
52e27c4a58 Fix a bug and warn when configuration file values are incorrect. Thanks to
Wilco Baan Hofman <wilco@andoburg.nl>
(This used to be commit 2c584efae6)
2003-09-20 22:22:41 +00:00
Alexander Bokovoy
593e93b16b Fix pdb_mysql. Jelmer will look into details tonight.
(This used to be commit b00a81b543)
2003-09-19 13:09:10 +00:00
Jeremy Allison
3a48e4b287 The "unknown_5" 32 bit field in the user structs is actually 2 16-bit
fields, bad_password_count and logon_count. Ensure this is stored/fetched
in the various SAMs. As it replaces the unknown_5 field this fits
exactly into the tdb SAM without any binary problems. It also is added
to the LDAP SAM as two extra attributes. It breaks compatibility with
the experimental SAMs xml and mysql. The maintainers of these SAMs must
fix them so upgrades like this can be done transparently. I will insist
on the "experimental" status until this is solved.
Jeremy.
(This used to be commit cd7bd8c2da)
2003-09-18 23:53:48 +00:00
Jeremy Allison
d4df20e96f Oops. Proper fix for #470.
Jeremy.
(This used to be commit 82f98b066d)
2003-09-18 21:19:41 +00:00
Jeremy Allison
9f50a90db1 Fix for #470 - unable to display SIDs in ACLs.
Jeremy.
(This used to be commit 56df89eff3)
2003-09-18 01:17:22 +00:00
Jelmer Vernooij
bf4ab61d57 Fix typo. Found by Aurelien Degremont
(This used to be commit 4765e56f92)
2003-09-16 13:31:41 +00:00
Gerald Carter
1d0329c768 remove getpwnam() calls from init_sam_from_xxx().
This means that %u & %g will no longer expand, but %U
and %G still do.  The payback is that winbindd local
accounts for users work with 'wbinfo -u' when winbind
is running on a PDC.
(This used to be commit eb02fcf3c2)
2003-09-11 16:52:10 +00:00
Jeremy Allison
ca1c6ebb11 Fix a nasty mess, and also bug #296. passdb/pdb_ldap.c was not converting
to/from utf8 for some calls. The libads code gets this right. Wonder why
the passdb code doesn't use it ?
Jeremy.
(This used to be commit 910d21d316)
2003-09-10 22:33:06 +00:00
Volker Lendecke
1c38391c70 Nobody complained on the team-list, so commit it ...
This implements some kind of improved AFS support for Samba on Linux with
OpenAFS 1.2.10. ./configure --with-fake-kaserver assumes that you have
OpenAFS on your machine. To use this, you have to put the AFS server's KeyFile
into secrets.tdb with 'net afskey'. If this is done, on each tree connect
smbd creates a Kerberos V4 ticket suitable for use by the AFS client and
gives it to the kernel via the AFS syscall. This is meant to be very
light-weight, so I did not link in a whole lot of libraries to be more
platform-independent using the ka_SetToken function call.

Volker
(This used to be commit 5775690ee8)
2003-09-07 16:36:13 +00:00
Jelmer Vernooij
14b438e90a Only set sids when they're retrurned by the MySQL query
(This used to be commit 9a603f6f07)
2003-09-06 12:21:08 +00:00
Jeremy Allison
94f59f5492 More tuning from cachegrind. Change most trim_string() calls to trim_char(0,
as that's what they do. Fix string_replace() to fast-path ascii.
Jeremy.
(This used to be commit f35e9a8b90)
2003-09-05 19:59:55 +00:00
Gerald Carter
7f3e60d837 remove 'ldap trust ids' since there was no way for it to work now
(This used to be commit 3724063f15)
2003-08-27 21:17:10 +00:00
Gerald Carter
c2983f9323 Fix bug 327 (again and I think for the last time). Make sure that
pam_smbpass.so will load ok.  Had to move some functions around to work
around dependency problems (hence the new passdb/lookup_sid.c)

Also make sure that libsmbclient.a is built and installed when
we support shared libraries.
(This used to be commit 780055f442)
2003-08-27 20:52:56 +00:00
Gerald Carter
49f7298ae0 fix for BUG 245; make sure we set the sid type when falling back to the rid algorithm stuff
(This used to be commit f6363aa31a)
2003-08-21 21:05:01 +00:00
Herb Lewis
062f89bc28 get rid of some sompiler warnings on IRIX
(This used to be commit a6a39c61e8)
2003-08-15 01:42:30 +00:00
Gerald Carter
5faf3ba9af 2 fixes
* bug #280 (my fault) - initialize sambaNextUserRid and
   sambaNextGroupRid

 * Unix users shared vis LDAP or NIS between a samba domain member
   of a Samba domain are not seen as domain users on the member servers.
   not as local users.
(This used to be commit a030fa373a)
2003-08-13 00:08:28 +00:00
Gerald Carter
0c67574d24 fix bug #281 by surrounding pdb_getgrgid() with become/unbecome_root()
(This used to be commit f6a01f5115)
2003-08-11 07:05:23 +00:00
Gerald Carter
44e6c30f71 fix bug #208; have to get the gid of the user's primary group for %G
(This used to be commit 575483a1ef)
2003-08-06 19:16:17 +00:00
Gerald Carter
269bcd91a3 oops; fix typo. Noticed by gcc warning
(This used to be commit 4c36ef65e5)
2003-08-06 00:06:37 +00:00
Gerald Carter
055b7df499 fix bug #245; local_lookupsid() needed to make a getpwuid() call to get the username instead of making up unix_user.##
(This used to be commit b947fc3eed)
2003-08-05 23:24:14 +00:00
Tim Potter
7d833de662 More printf portability fixes. Got caught out by some gcc'isms last
time.  )-:
(This used to be commit 59dae1da66)
2003-07-25 04:24:40 +00:00
Tim Potter
77373f1f8e More printf fixes - size_t is long on some architectures.
(This used to be commit ba4d334b82)
2003-07-24 23:46:27 +00:00
Gerald Carter
3a5dc7c2ec convert snprintf() calls using pstrings & fstrings
to pstr_sprintf() and fstr_sprintf() to try to standardize.
lots of snprintf() calls were using len-1; some were using
len.  At least this helps to be consistent.
(This used to be commit 9f835b85dd)
2003-07-23 12:33:59 +00:00
Gerald Carter
c51ffbbdaa removing unused function
(This used to be commit b8394a107d)
2003-07-22 15:08:34 +00:00
Tim Potter
80c1f1d865 Fixup a bunch of printf-style functions and debugs to use unsigned long when
displaying pid_t, uid_t and gid_t values.  This removes a whole lot of warnings
on some of the 64-bit build farm machines as well as help us out when 64-bit
uid/gid/pid values come along.
(This used to be commit f93528ba00)
2003-07-22 04:31:20 +00:00
Rafal Szczesniak
b3064ac5d6 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
(This used to be commit b0be700605)
2003-07-20 21:43:41 +00:00
Volker Lendecke
7756b4088d Fix memleak
(This used to be commit defc71d4cb)
2003-07-19 11:28:15 +00:00
Volker Lendecke
ffbb6ee3b8 Fix two memleaks in pdb_ldap.c.
Whoever put the private.backend_private_data_free_fn thingy into
SAM_ACCOUNT, could you please revisit my change to pdb_get_set.c and
comment on my comment there?

Thanks,

Volker
(This used to be commit 922ec277d1)
2003-07-18 09:05:30 +00:00
Volker Lendecke
658099b695 Fix memleak
(This used to be commit 42a59d6910)
2003-07-16 13:57:53 +00:00
Volker Lendecke
36d1df4413 typo
(This used to be commit 09e00970d4)
2003-07-16 13:35:23 +00:00
Gerald Carter
a84270ce11 fixes for 'net rpc vampire'. I can now take a blank Samba host
and migrate an NT4 domain and still logon from domain members
(tested logon scripts, system policies, profiles, & home directories)
(passdb backend = tdbsam)

removed call to idmap_init_wellknown_sids() from winbindd.c
since the local domain should be handled by the guest passdb backend
(and you don't really always want the Administrator account to be root)
...and we didn't pay attention to this anyways now.
(This used to be commit 837d7c54d3)
2003-07-16 02:20:53 +00:00
Volker Lendecke
cf8628e585 Fix memleaks
(This used to be commit 26134ac302)
2003-07-15 17:00:11 +00:00
Gerald Carter
8582358d54 make sure to fallback to rid algoruthm for users not in smbpasswd (e.g. force user = foo)
(This used to be commit 399799c68c)
2003-07-15 02:27:00 +00:00
Simo Sorce
5345a5d721 use the specific funtion we have to check if a SID belong to our domain
(This used to be commit a926959391)
2003-07-13 21:41:23 +00:00
Volker Lendecke
9bcc3886d0 Argl. Thinking twice and looking at the rest of callers of sid_compare_domain
proved the last patch wrong.

Sorry.

Volker
(This used to be commit d8695eccc7)
2003-07-13 09:43:58 +00:00
Volker Lendecke
e9681cc658 We have an API to compare the domain parts of two SIDs, so use it.
Volker
(This used to be commit 39308ff138)
2003-07-13 09:38:55 +00:00
Gerald Carter
733f767b94 fix sid_to_[uid|gid] (spotted by Volker).
Still testing this, but I'm checking it in
so Volker can test it as well.  Should be right.
(This used to be commit 8edf193722)
2003-07-11 16:37:23 +00:00
Gerald Carter
24ce328662 fix unitialised variable
(This used to be commit 5efa0d7cc2)
2003-07-11 15:17:06 +00:00
Gerald Carter
03d5867d52 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.
(This used to be commit 0463045cc7)
2003-07-11 05:33:40 +00:00
Gerald Carter
c674e411c7 i guess i'm the only one this ever annyoed...
fix the confusion when we tdb_lock_bystring() but
we retrieve an entry using tdb_fetch_by_string.
It's now always tdb.*bystring()
(This used to be commit 66359531b8)
2003-07-10 20:37:01 +00:00
Jeremy Allison
2f0c3cd817 Fix up become_root/unbecome_root pairs needed around local passdb
lookups.
Jeremy.
(This used to be commit 6bd4788403)
2003-07-09 00:20:43 +00:00
Jeremy Allison
e4bfa0a460 Moved SAM_ACCOUNT marshall/unmarshall functions to make them externally
available. Removed extra auth_init (thanks metze).
Jeremy.
(This used to be commit 88135fbc49)
2003-07-08 21:58:29 +00:00
Gerald Carter
5895dfb89b Cleaning up linking issues. sam/idmap*.c only links in
winbindd now.  Also removing an unused file.
(This used to be commit 688369c23c)
2003-07-07 20:00:29 +00:00
Jeremy Allison
436555aaa7 Fixed a couple of const issues with the new code.
Jeremy.
(This used to be commit e9fb6e4508)
2003-07-07 17:04:48 +00:00
Gerald Carter
0b18acb841 and so it begins....
* remove idmap_XX_to_XX calls from smbd.  Move back to the
  the winbind_XXX and local_XXX calls used in 2.2

* all uid/gid allocation must involve winbindd now

* move flags field around in winbindd_request struct

* add WBFLAG_QUERY_ONLY option to winbindd_sid_to_[ug]id()
  to prevent automatic allocation for unknown SIDs

* add 'winbind trusted domains only' parameter to force a domain member
  server to use matching users names from /etc/passwd for its domain
  (needed for domain member of a Samba domain)

* rename 'idmap only' to 'enable rid algorithm' for better clarity
  (defaults to "yes")

code has been tested on

  * domain member of native mode 2k domain
  * ads domain member of native mode 2k domain
  * domain member of NT4 domain
  * domain member of Samba domain
  * Samba PDC running winbindd with trusts

Logons tested using 2k clients and smbclient as domain users
and trusted users. Tested both 'winbind trusted domains only = [yes|no]'

This will be a long week of changes.  The next item on the list is
winbindd_passdb.c & machine trust accounts not in /etc/passwd (done
via winbindd_passdb)
(This used to be commit 8266dffab4)
2003-07-07 05:11:10 +00:00