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

181 Commits

Author SHA1 Message Date
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
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
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
Volker Lendecke
4c4ae01c67 r17199: Add comment to the RID/SID miracle 2007-10-10 11:38:19 -05:00
Volker Lendecke
f777b2d294 r17194: To run rpc-samba3-lsa in the build farm, we can't rely on geteuid()==0. Adapt
it to other "Am I root?" checks.

Jerry, Jeremy, please check this!

Thanks,

Volker
2007-10-10 11:38:19 -05:00
Volker Lendecke
41456b498a r17192: Make this actually survive valgrind. We NEED pidl here...
Maybe bzr is not such a bad idea, then you would probably see less spam on
samba-cvs, sorry for that... :-)

Volker
2007-10-10 11:38:19 -05:00
Volker Lendecke
b185fb9fa6 r17188: Dump lsa_lookupsids3. I could not make it work at all against W2k3, the
rpc-lsa test even considers NT_STATUS_RPC_PROTSEQ_NOT_SUPPORTED not to be an
error.

Before someone re-activates this, show me a working sniff please :-)

Volker
2007-10-10 11:38:18 -05:00
Gerald Carter
4e51cf34cf r17183: LsaLookupSids() shoudl return the string form of a SID when
it cannot be mapped and not the hex of the RID.  Who wrote that?
2007-10-10 11:38:18 -05:00
Volker Lendecke
5cfe482841 r17064: lsa_GetUserName needs to return the name for S-1-5-7 on an anonymous login.
Found that because I want to play around with setsharesecurity, for this I
need the "whoami" call figuring out the SID of the currently connected user.

Not activating this test yet until the build farm has picked up the new samba4
revision.

Volker
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
Jeremy Allison
490c7c8467 r16433: Fix Coverity #300 (triggered by a Klockwork bugfix
I think). If a alloc fails just return NT_STATUS_NO_MEMORY,
don't go to "done" label and deref pointers.
Jeremy.
2007-10-10 11:18:54 -05:00
Volker Lendecke
d6547d12b1 r16409: Fix Klocwork ID's.
1177

In reg_perfcount.c: 1200 1202 1203 1204
In regfio.c: 1243 1245 1246 1247 1251

Jerry, the reg_perfcount and regfio.c ones, can you take a look please? This
is really your code, and I'm not sure I did the right thing to return an
error.

smbcacls.c: 1377
srv_eventlog_nt.c: 1415 1416 1417
srv_lsa_nt.c: 1420 1421
srv_netlog_nt.c: 1429
srv_samr_nt: 1458 1459 1460

Volker

Volker
2007-10-10 11:18:52 -05:00
Günther Deschner
3ff278b852 r15044: Fix the build. (void returning non-void).
Guenther
2007-10-10 11:15:59 -05:00
Günther Deschner
0fed66926f r15041: Adding rpc client calls to manipulate auditing policies on remote CIFS
servers. Also add a new "net rpc audit" tool. The lsa query infolevels
were taken from samb4 IDL, the lsa policy flags and categories are
partly documented on msdn. I need to cleanup the double
lsa_query_info_policy{2}{_new} calls next.

Guenther
2007-10-10 11:15:59 -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
Jeremy Allison
e3a28bf4c8 r14182: Ensure we know that dom_sid cannot be null.
Jeremy.
2007-10-10 11:15:15 -05:00
Jeremy Allison
ea82958349 r13553: Fix all our warnings at -O6 on an x86_64 box.
Jeremy.
2007-10-10 11:10:13 -05:00
Jeremy Allison
6ec0e9124a r13521: Implement LOOKUPNAME3 and 4.
Jeremy.
2007-10-10 11:10:09 -05:00
Jeremy Allison
f1a362580a r13458: Add parsing functions - but stub internals for lookupnames3 and 4.
Jeremy.
2007-10-10 11:10:04 -05:00
Jeremy Allison
b57406c89f r13456: Add lsa_lookup_names2.
Jeremy.
2007-10-10 11:10:04 -05:00
Jeremy Allison
2274709587 r13455: Prepare to add lookupnames2.
Jeremy.
2007-10-10 11:10:04 -05:00
Jeremy Allison
a9e1d0f3b4 r13449: Ensure we don't crash if no dc struct on pipe.
Jeremy.
2007-10-10 11:10:04 -05:00
Jeremy Allison
a164cfab42 r13447: Added LSA_LOOKUPSIDS2 and LSA_LOOKUPSIDS3.
Jeremy.
2007-10-10 11:10:03 -05:00
Gerald Carter
17e63ac4ed r13316: Let the carnage begin....
Sync with trunk as off r13315
2007-10-10 11:06:23 -05:00
Jeremy Allison
23f16cbc2e r13293: Rather a big patch I'm afraid, but this should fix bug #3347
by saving the UNIX token used to set a delete on close flag,
and using it when doing the delete. libsmbsharemodes.so still
needs updating to cope with this change.
Samba4 torture tests to follow.
Jeremy.
2007-10-10 11:06:21 -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
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
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
3a633a509e r9195: setting log level to 2 instead of 0 2007-10-10 11:00:27 -05:00
Gerald Carter
ff6e3464a2 r9194: do not enumerate privileges when they are not enabled 2007-10-10 11:00:27 -05:00
Gerald Carter
0d6352da48 r7995: * privileges are local except when they're *not*
printmig.exe assumes that the LUID of the SeBackupPrivlege
  on the target server matches the LUID of the privilege
  on the local client.  Even though an LUID is never guaranteed
  to be the same across reboots.  How *awful*!  My cat could
  write better code! (more on my cat later....)

* Set the privelege LUID in the global PRIVS[] array

* Rename RegCreateKey() to RegCreateKeyEx() to better match MSDN

* Rename the unknown field in RegCreateKeyEx() to disposition
  (guess according to MSDN)

* Add the capability to define REG_TDB_ONLY for using the reg_db.c
  functions and stress the RegXXX() rpc functions.
2007-10-10 10:58:07 -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
f6e2730510 r6536: Jeremy, did you actually test this part of revision 801? I just tested that
Windows 2003 returns "4 (Local Group)" for

rpcclient -c 'lookupnames "System Operators"'

Before #ifdef'ing that out again I would like to see a sniff how you get a "5"
(WKN_GRP) out of lsa_lookupnames.

Volker
2007-10-10 10:56:44 -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
Gerald Carter
efb3ac4c69 r6228: remove BUFHDR2 and clean up LsaEnumTrustedDomains()
Tested client and server code.
2007-10-10 10:56:30 -05:00
Herb Lewis
efea76ac71 r6225: get rid of warnings from my compiler about nested externs 2007-10-10 10:56:30 -05:00
Gerald Carter
0e29dc8aa3 r6071: * clean up UNISTR2_ARRAY ( really just an array of UNISTR4 + count )
* add some backwards compatibility to 'net rpc rights list'
* verify privilege name in 'net rpc rights privileges <name>' in order
  to give back better error messages.
2007-10-10 10:56:20 -05:00
Gerald Carter
277203b535 r5726: merge LsaLookupPrivValue() code from trunk 2007-10-10 10:55:57 -05:00
Jim McDonough
c03a939574 r5458: Generate a sane response to exceeding lookupsids limit. Truncate list to zero
and return NT_STATUS_NONE_MAPPED.  This does not crash windows and maintains
the benefit of not overallocating memory.  The previous response of
truncating to the MAX limit was not useful because it crashed lsass.exe on
windows (bug opened with MS), and it was also misleading the client to
believe that a complete answer was received.
2007-10-10 10:55:41 -05:00
Gerald Carter
ead54b14f6 r5383: add missing checks to allow root to manage user rights 2007-10-10 10:55:39 -05:00
Tim Potter
bc4f884104 r5246: We can't use a pointer to struct lsa_info until is has been
initialised.  Fix for bugzilla #2315.  Can the privileges dude(s)
please verify this?
2007-10-10 10:55:34 -05:00
Gerald Carter
c0e7f7ff60 r5056: * correct STANDARD_RIGHTS_WRITE_ACCESS bitmask define
* make sure to apply the rights_mask and not just the saved
  bits from the mask in access_check_samr_object()
* allow root to grant/revoke privileges (in addition to Domain
  Admins) as suggested by Volker.

Tested machine joins from XP, 2K, and NT4 with and without
pre-existing machine trust accounts.  Also tested basic file
operations using cmd.exe and explorer.exe after changing the
STANDARD_RIGHTS_WRITE_ACCESS bitmask.
2007-10-10 10:55:12 -05:00
Gerald Carter
3f4f2c80fd r4822: fix return code when you ask for a non-privileged SID via one of the privileges RPC calls 2007-10-10 10:53:56 -05:00
Gerald Carter
41dc7f7573 r4805: Last planned change to the privileges infrastructure:
* rewrote the tdb layout of privilege records in account_pol.tdb
  (allow for 128 bits instead of 32 bit flags)
* migrated to using SE_PRIV structure instead of the PRIVILEGE_SET
  structure.  The latter is now used for parsing routines mainly.

Still need to incorporate some client support into 'net' so
for setting privileges.  And make use of the SeAddUserPrivilege
right.
2007-10-10 10:53:55 -05:00
Gerald Carter
ccdff4a998 r4746: add server support for lsa_enum_acct_rights(); last checkin for the night 2007-10-10 10:53:54 -05:00
Gerald Carter
7bf1312287 r4742: add server support for lsa_add/remove_account_rights() and fix some parsing bugs related to that code 2007-10-10 10:53:53 -05:00
Gerald Carter
e8b4cedc20 r4739: require membership in Domain Admins to be able to set privileges 2007-10-10 10:53:52 -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