1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-15 23:24:37 +03:00

316 Commits

Author SHA1 Message Date
Günther Deschner
92fca97951 Use netr_SamInfo3 in remaining places.
Guenther
2008-02-17 02:12:01 +01:00
Günther Deschner
e1bcb7d82f Add get_logon_hours_from_pdb() (inspired by samba4).
Guenther
2008-02-12 14:52:25 +01:00
Volker Lendecke
5223d18ea2 Remove a static
I very much doubt that this is called enough to justify a global. If this turns
out to be a hot code path, we might reconsider :-)
2008-02-04 19:40:08 +01:00
Michael Adam
0a9874c1c7 Prevent another segfault.
Michael
2007-12-18 01:30:52 +01:00
Volker Lendecke
bb35e794ec Replace sid_string_static by sid_string_dbg in DEBUGs 2007-12-15 22:09:36 +01:00
Michael Adam
b2e12365b5 Pass NULL instead of unneeded &sid: pdb_get_trusteddom_pw() checks.
Michael
2007-12-13 10:15:19 +01:00
Michael Adam
0cde7ac9cb Rename get_trust_pw() to get_trust_pw_hash().
Michael
2007-12-13 10:15:19 +01:00
Michael Adam
4562342eb8 Export logic of get_trust_pw() to new function get_trust_pw_clear().
get_trust_pw() just now computes the md4 hash of the result of
get_trust_pw_clear() if that was successful. As a last resort,
in the non-trusted-domain-situation, get_trust_pw() now tries to
directly obtain the hashed version of the password out of secrets.tdb.

Michael
2007-12-13 10:15:18 +01:00
Michael Adam
6ced4a7f88 Let get_trust_pw() determine the machine_account_name to use.
Up to now each caller used its own logic.

This eliminates code paths where there was a special treatment
of the following situation: the domain given is not our workgroup
(i.e. our own domain) and we are not a DC (i.e. it is not a typical
trusted domain situation). In situation the given domain name was
previously used as the machine account name, resulting in an account
name of DOMAIN\\DOMAIN$, which does not seem very reasonable to me.
get_trust_pw would not have obtained a password in this situation
anyways.

I hope I have not missed an important point here!

Michael
2007-12-13 10:15:17 +01:00
Jeremy Allison
f652fe2bdb Remove pstrings from pam_smbpass - make local_password_change
return malloced strings.
Jeremy.
2007-11-21 17:42:52 -08:00
Jeremy Allison
15074de938 More pstring elimination.
Jeremy.
2007-11-20 17:18:16 -08:00
Jeremy Allison
00760451b6 Remove smbldap_get_single_pstring() and all pstrings
from pdb_ldap.c. I don't have an LDAP passdb setup here,
so I'm going to need some help on testing this.
Jeremy.
2007-11-14 16:05:42 -08:00
Volker Lendecke
5490e2d772 static pstring removal 2007-11-05 03:16:58 +01:00
Jeremy Allison
f35a266b3c RIP BOOL. Convert BOOL -> bool. I found a few interesting
bugs in various places whilst doing this (places that assumed
BOOL == int). I also need to fix the Samba4 pidl generation
(next checkin).
Jeremy.
2007-10-18 17:40:25 -07:00
Michael Adam
b9e76a479e r24990: Kill an incredible amount of trailing whitespaces...
Further reformat get_trust_pw to conform to coding rules.

Michael
2007-10-10 12:30:31 -05:00
Andrew Tridgell
b0132e94fc r23784: use the GPLv3 boilerplate as recommended by the FSF and the license text 2007-10-10 12:28:22 -05:00
Jeremy Allison
407e6e695b r23779: Change from v2 or later to v3 or later.
Jeremy.
2007-10-10 12:28:20 -05:00
Gerald Carter
6af4c1a73c r23192: Remove fallback to looking up group mappings by the
Unix name after discussion with Simo.
2007-10-10 12:22:53 -05:00
Jeremy Allison
4e1a0b2549 r23005: If we're running on a system where time_t is 8 bytes
we have to take care to preserve the "special" values
for Windows of 0x80000000 and 0x7FFFFFFF when casting
between time_t and uint32. Add conversion functions
(and use them).
Jeremy.
2007-10-10 12:22:13 -05:00
Jeremy Allison
f3ffb3f984 r22096: become_root_uid_only() is unneeded - it's only used in
messages.c. Refactor to use become_root() instead and
make it local to messages.c
Jeremy.
2007-10-10 12:19:11 -05:00
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
Jeremy Allison
8ff76a9cb8 r21954: Someone misused a '!' instead of a '~' for a binary NOT
command. Jerry, Simo, please check.
Jeremy.
2007-10-10 12:18:52 -05:00
Gerald Carter
2a7311db27 r20985: leave room for terminating NULL when printing password hashes via 'pdbedit -L -w' 2007-10-10 12:17:22 -05:00
Volker Lendecke
b48ea4d777 r20851: To read account policies from LDAP we need root.
Volker
2007-10-10 12:17:13 -05:00
Volker Lendecke
3c879745cf r20824: Send access to the trusted domain passwords through the pdb backend, so that
in the next step we can store them in LDAP to be replicated across DCs.

Thanks to Michael Adam <ma@sernet.de>

Volker
2007-10-10 12:17:10 -05:00
Volker Lendecke
7e444e1612 r20614: Dummy-checkin to trigger the build 2007-10-10 12:16:58 -05:00
Simo Sorce
7167e7b26a r20243: Make lookup_name resolve both the mapped and the real unix group name 2007-10-10 12:16:35 -05:00
Jim McDonough
21abbeaee9 r19058: Implement "user cannot change password", and complete "user must change
password at next logon" code.  The "password last set time" of zero now
means "user must change password", because that's how windows seems to
use it.  The "can change" and "must change" times are now calculated
based on the "last set" time and policies.

We use the "can change" field now to indicate that a user cannot change
a password by putting MAX_TIME_T in it (so long as "last set" time isn't
zero).  Based on this, we set the password-can-change bit in the
faked secdesc.
2007-10-10 12:15:06 -05:00
Gerald Carter
3da9f80c28 r18271: Big change:
* autogenerate lsa ndr code
* rename 'enum SID_NAME_USE' to 'enum lsa_SidType'
* merge a log more security descriptor functions from
  gen_ndr/ndr_security.c in SAMBA_4_0

The most embarassing thing is the "#define strlen_m strlen"
We need a real implementation in SAMBA_3_0 which I'll work on
after this code is in.
2007-10-10 11:51:18 -05:00
Volker Lendecke
70edd716ef r17924: Get rid of warnings now that talloc is merged.
Destructors now take a pointer to the "real" destroyed object as an argument.

Volker
2007-10-10 11:38:59 -05:00
Gerald Carter
1a5b90f3c1 r17815: Revert Volker's change in 16014. I really do not believe
the this should be necessary.  If there is still a bug,
I believe that setting thr group RID from the passdb is
masking it.  Not fixing it.  It is very likely that
the change was necessary before but is no longer
with the recent changes.  But I'm not taking the chance
of merging it to 3.0.23c. :-)
2007-10-10 11:38:51 -05:00
Gerald Carter
0a3aa8b43a r17813: Remove another instance of manually setting the group SID.
The would have been primaryly used when adding a user to
an smbpasswd file, but could have been introduce to other
backends by using pdbedit -i -e.

The symptom was

[2006/08/09 13:07:43, 0] rpc_parse/parse_samr.c:init_sam_user_info21A(6276)
  init_sam_user_info_21A: User nobody has Primary Group SID S-1-22-2-99,
  which conflicts with the domain sid S-1-5-21-1825997848-4107600307-1754506280.
  Failing operation.
2007-10-10 11:38:51 -05:00
Gerald Carter
dde552336c r17669: Remove RID algorithm support from unmapped users and groups
when using smbpasswd
2007-10-10 11:38:45 -05:00
Volker Lendecke
761cbd52f0 r17554: Cleanup 2007-10-10 11:38:38 -05:00
Volker Lendecke
f9856f6490 r17463: A bit of cleanup work:
Remove some unused code: pdb_find_alias is not used anymore, and nobody I
think has ever used the pdb_nop operations for group mapping. smbpasswd and
tdb use the default ones and ldap has its own.

Make the functions pdb_getgr* return NTSTATUS instead of BOOL. Nobody right
now really makes use of it, but it feels wrong to throw away information so
early.

Volker
2007-10-10 11:38:36 -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
720a917205 r16593: Make the invarient explicit to Klocwork. Bug #2023.
Jeremy.
2007-10-10 11:19:02 -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
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
ea7cced6bc r15601: Fix segfaults with 'security=share' and 'guest only = yes'
Volker
2007-10-10 11:17:03 -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
Simo Sorce
a374546c7e r13776: Merge in the editposix ldapsam optimization 2007-10-10 11:10:53 -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
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
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