summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* libcli/security Remove unused SE_NONE defineAndrew Bartlett2010-09-111-1/+0
| | | | Signed-off-by: Andrew Tridgell <tridge@samba.org>
* libcli/security Move 'private' privileges functions to another headerAndrew Bartlett2010-09-114-24/+43
| | | | | | | | | These functions work on the bitmap, and are only exposed because the source3/ privileges storage uses the bitmap in account_policy.tdb Andrew Bartlett Signed-off-by: Andrew Tridgell <tridge@samba.org>
* s3-samr Explian better the use of two privileges in this callAndrew Bartlett2010-09-111-0/+4
| | | | Signed-off-by: Andrew Tridgell <tridge@samba.org>
* libcli/security Remove 'always true' return from se_priv_put_all_privilegesAndrew Bartlett2010-09-113-6/+3
| | | | | | Andrew Bartlett Signed-off-by: Andrew Tridgell <tridge@samba.org>
* s3-util_sid Tidy up global struct security_tokenAndrew Bartlett2010-09-114-16/+8
| | | | | | | | | This no longer needs to be global, and should be const. We now also init it with the C99 style initialisers. Andrew Bartlett Signed-off-by: Andrew Tridgell <tridge@samba.org>
* s4-rpc_server Put all 'logon failure' messages at the same debug level 4Andrew Bartlett2010-09-111-4/+6
| | | | Signed-off-by: Andrew Tridgell <tridge@samba.org>
* libcli/auth Failure to find the cached session key for SCHANNEL isn't level 0Andrew Bartlett2010-09-111-1/+1
| | | | | | | | | This happens all the time, particularly now that we don't keep the db around after a reboot. Don't scare the admins with the level 0. Andrew Bartlett Signed-off-by: Andrew Tridgell <tridge@samba.org>
* s3-privs Add constAndrew Bartlett2010-09-112-6/+6
| | | | Signed-off-by: Andrew Tridgell <tridge@samba.org>
* s3-privs Remove extra pointer on privilege maskAndrew Bartlett2010-09-111-4/+4
| | | | | | Now that this is a scalar, this isn't required. Signed-off-by: Andrew Tridgell <tridge@samba.org>
* s3-privileges: add handling of both old and new formats in databaseAndrew Tridgell2010-09-111-28/+48
| | | | | | | | | | We update privileges on a per-record basis instead of all at once, as this maintains maximum compatibility is someone uses old tools with a new version of Samba. The also auto-detects the byte order of the old entries in the database, and copes with either native or reversed byte order. Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
* s4-lsa: privilege IDs should use the enum, not an intAndrew Tridgell2010-09-111-1/+1
| | | | Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
* privileges: privilege luids are not all below 64Andrew Tridgell2010-09-111-3/+0
| | | | | | the ones brought across from s3 have higher values Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
* libcli/security Make sec_privilege_from_index() return SEC_PRIV_INVALID on ↵Andrew Bartlett2010-09-112-2/+2
| | | | | | | | | | failure This is clearer and more consistent than using a magic -1 return Andrew Bartlett Signed-off-by: Andrew Tridgell <tridge@samba.org>
* libcli/security Remove unused declarations from privileges.hAndrew Bartlett2010-09-111-51/+1
| | | | Signed-off-by: Andrew Tridgell <tridge@samba.org>
* s3-privs Remove unused functionAndrew Bartlett2010-09-112-31/+0
| | | | Signed-off-by: Andrew Tridgell <tridge@samba.org>
* s3-privs Overhaul PRIVILEGE_SET handling, avoid dealing with the bitmapAndrew Bartlett2010-09-113-106/+36
| | | | | | | | | | This avoids us dealing with the privilege bitmap in the LSA server, and overhauls much of the rest of the handling to be currnet with the modern world of talloc. Andrew Bartlett Signed-off-by: Andrew Tridgell <tridge@samba.org>
* s3-privs Hide the bitmap-based grant_privilege and revoke_privilegeAndrew Bartlett2010-09-114-28/+44
| | | | | | | | | The new wrappers avoid anything but the core privileges code dealing with the bitmap values directly. Andrew Bartlett Signed-off-by: Andrew Tridgell <tridge@samba.org>
* s3-privs Make privilege_enum_sids() take an LUID, not a bitmapAndrew Bartlett2010-09-114-9/+12
| | | | | | | | This moves one more privileges call away from direct bitmap manipuation. Andrew Bartlett Signed-off-by: Andrew Tridgell <tridge@samba.org>
* libcli/security Expose sec_privilege_mask()Andrew Bartlett2010-09-112-1/+6
| | | | Signed-off-by: Andrew Tridgell <tridge@samba.org>
* libcli/security make sec_privilege_id() return SEC_PRIV_INVALID on failure.Andrew Bartlett2010-09-114-8/+8
| | | | | | Andrew Bartlett Signed-off-by: Andrew Tridgell <tridge@samba.org>
* libcli/security Remove unused functions and constants.Andrew Bartlett2010-09-112-242/+14
| | | | | | | | All the callers to these functions have been removed or reworked. Andrew Bartlett Signed-off-by: Andrew Tridgell <tridge@samba.org>
* s3-privs Rework access_check_object() to take two privilegesAndrew Bartlett2010-09-113-68/+60
| | | | | | | | | | | | | | This allows the privileges bitmap to be used only when setting privileges, and uses an the LUID constant for all 'does this user have this privilege' operations. The advantage is that we now only need one API to determine if a token has a privilege, and much less code needs to know what type is used for the underlying bitmap. Andrew Bartlett Signed-off-by: Andrew Tridgell <tridge@samba.org>
* libcli/security Rename all privilege bitmaps constantsAndrew Bartlett2010-09-112-59/+59
| | | | | | | | | The idea here to to make it very clear how they differ from the enumerated LUID values. Andrew Bartlett Signed-off-by: Andrew Tridgell <tridge@samba.org>
* s3-privs Rework privilege enumeration to also use new DB formatAndrew Bartlett2010-09-111-5/+18
| | | | | | Andrew Bartlett Signed-off-by: Andrew Tridgell <tridge@samba.org>
* libcli/security Remove luid_to_se_priv() and luid_to_privilege_name()Andrew Bartlett2010-09-112-46/+13
| | | | | | | | These functions duplicate other functions in the merged code. Andrew Bartlett Signed-off-by: Andrew Tridgell <tridge@samba.org>
* s3-privs Directly manipulate the privileges bitmap.Andrew Bartlett2010-09-113-14/+7
| | | | | | | | | There is no longer any reason to go via the se_ functions to manipulate this bitmap. Andrew Bartlett Signed-off-by: Andrew Tridgell <tridge@samba.org>
* libcli/security Add an invalid LUID privilege valueAndrew Bartlett2010-09-111-0/+1
| | | | | | This helps code that may not want to specify any privilege Signed-off-by: Andrew Tridgell <tridge@samba.org>
* libcli/security Improve dump of privileges: Just walk the tableAndrew Bartlett2010-09-111-5/+4
| | | | | | | | | This removes some logic recently added that was just too smart - it is easier to just walk the table and do a bit match here. Andrew Bartlett Signed-off-by: Andrew Tridgell <tridge@samba.org>
* s3-privs Convert from user_has_privileges() -> security_token_has_privilege()Andrew Bartlett2010-09-119-47/+28
| | | | | | | | | This new call is available in the merged privileges code, and takes an enum as the parameter, rather than a bitmask. Andrew Bartlett Signed-off-by: Andrew Tridgell <tridge@samba.org>
* s3-privs Remove a pointer from grant_privilege()Andrew Bartlett2010-09-114-10/+10
| | | | | | Andrew Bartlett Signed-off-by: Andrew Tridgell <tridge@samba.org>
* s3-privs Remove pointer indirection from se_priv_to_privilege_set()Andrew Bartlett2010-09-113-5/+5
| | | | | | Andrew Bartlett Signed-off-by: Andrew Tridgell <tridge@samba.org>
* s3-privs Call security_token_set_privilege() rather than manual assignmentAndrew Bartlett2010-09-112-2/+3
| | | | | | | | This avoids as much direct modifiction of the bitmask as possible. Andrew Bartlett Signed-off-by: Andrew Tridgell <tridge@samba.org>
* s3-privs Remove a pointer indirection from revoke_privilege()Andrew Bartlett2010-09-114-7/+7
| | | | Signed-off-by: Andrew Tridgell <tridge@samba.org>
* libcli/security Don't export privs[] as a global variableAndrew Bartlett2010-09-114-50/+31
| | | | | | | | | | | | Instead, provide access functions for the LSA and net sam callers for the information they need. They still only enumerate the first 8 privileges that have traditionally been exposed. Andrew Bartlett Signed-off-by: Andrew Tridgell <tridge@samba.org>
* s3-lsa Use sec_privilege_id() to lookup name to LUIDAndrew Bartlett2010-09-111-9/+4
| | | | Signed-off-by: Andrew Tridgell <tridge@samba.org>
* libcli/security Merge privilege lists from source3 and source4Andrew Bartlett2010-09-111-169/+126
| | | | | | | | | The LSA enumeration in source3 will not show the new privileges, but otherwise, they are now in common, and can be set by name. Andrew Bartlett Signed-off-by: Andrew Tridgell <tridge@samba.org>
* libcli/security Return number of entries in the old source3 listAndrew Bartlett2010-09-112-4/+5
| | | | | | | | | This ensures there isn't a behaviour change when the source3 list is combined with the longer source4 list. Andrew Bartlett Signed-off-by: Andrew Tridgell <tridge@samba.org>
* libcli/privileges Simplify get_privilege_luid() to return just the enumAndrew Bartlett2010-09-113-13/+6
| | | | | | | | | As Samba only deals with the lower 32 bits of the LUID, just return those and let the LSA layer deal with the upper 0 bits. Andrew Bartlett Signed-off-by: Andrew Tridgell <tridge@samba.org>
* libcli/security Don't memcpy a uint64_t value, just assign it.Andrew Bartlett2010-09-111-1/+1
| | | | Signed-off-by: Andrew Tridgell <tridge@samba.org>
* libcli/security Use ARRAY_SIZE() consistantly.Andrew Bartlett2010-09-111-15/+16
| | | | | | | | | This avoids the use of SE_END, and has all callers walking the array using the same termination condition. Andrew Bartlett Signed-off-by: Andrew Tridgell <tridge@samba.org>
* libcli/security Fix and clarify privilege manipulation function commentsAndrew Bartlett2010-09-111-9/+9
| | | | Signed-off-by: Andrew Tridgell <tridge@samba.org>
* libcli/security Make the two privileges tables share a common struct definitionAndrew Bartlett2010-09-112-27/+22
| | | | Signed-off-by: Andrew Tridgell <tridge@samba.org>
* libcli/security Move source4/ privileges code into the common libcli/securityAndrew Bartlett2010-09-116-314/+333
| | | | Signed-off-by: Andrew Tridgell <tridge@samba.org>
* s3-privs Move manual prototypes to common privileges.hAndrew Bartlett2010-09-112-20/+88
| | | | Signed-off-by: Andrew Tridgell <tridge@samba.org>
* s3-privs Inline dump_se_priv into callers now that it's just a uint64_tAndrew Bartlett2010-09-114-24/+9
| | | | | | | | The previous 128 bit structure needed this helper function. Andrew Bartlett Signed-off-by: Andrew Tridgell <tridge@samba.org>
* libcli/security Use talloc_realloc() not TALLOC_REALLOC_ARRAY()Andrew Bartlett2010-09-111-1/+1
| | | | Signed-off-by: Andrew Tridgell <tridge@samba.org>
* libcli/security Use C99 typesAndrew Bartlett2010-09-111-3/+3
| | | | Signed-off-by: Andrew Tridgell <tridge@samba.org>
* libcli/security Use true and false, not True and FalseAndrew Bartlett2010-09-111-22/+22
| | | | Signed-off-by: Andrew Tridgell <tridge@samba.org>
* s3-privs Move source3/ privileges implmentation into commonAndrew Bartlett2010-09-114-7/+6
| | | | | | Andrew Bartlett Signed-off-by: Andrew Tridgell <tridge@samba.org>
* s3-privs Rename structure elements for greater clarityAndrew Bartlett2010-09-113-12/+12
| | | | | | | | | It is important to make clear which is the LUID and which is the Samba-only bitmap mask. Andrew Bartlett Signed-off-by: Andrew Tridgell <tridge@samba.org>