Changeset 745 for trunk/server/libgpo


Ignore:
Timestamp:
Nov 27, 2012, 4:43:17 PM (13 years ago)
Author:
Silvan Scherrer
Message:

Samba Server: updated trunk to 3.6.0

Location:
trunk/server
Files:
1 deleted
8 edited
1 copied

Legend:

Unmodified
Added
Removed
  • trunk/server

  • trunk/server/libgpo/gpext/gpext.c

    r414 r745  
    1919
    2020#include "includes.h"
     21#include "../libgpo/gpo.h"
    2122#include "../libgpo/gpext/gpext.h"
    2223#include "librpc/gen_ndr/ndr_misc.h"
    2324#include "lib/util/dlinklist.h"
     25#include "../libcli/registry/util_reg.h"
     26#if _SAMBA_BUILD_ == 3
     27#include "libgpo/gpo_proto.h"
     28#include "registry.h"
     29#include "registry/reg_api.h"
     30#endif
    2431
    2532static struct gp_extension *extensions = NULL;
     
    277284                case REG_SZ:
    278285                case REG_EXPAND_SZ:
    279                         data->v.sz.str = talloc_strdup(mem_ctx, data_s);
    280                         NT_STATUS_HAVE_NO_MEMORY(data->v.sz.str);
    281                         data->v.sz.len = strlen(data_s);
     286                        if (!push_reg_sz(mem_ctx, &data->data, data_s)) {
     287                                return NT_STATUS_NO_MEMORY;
     288                        }
    282289                        break;
    283                 case REG_DWORD:
    284                         data->v.dword = atoi(data_s);
     290                case REG_DWORD: {
     291                        uint32_t v = atoi(data_s);
     292                        data->data = data_blob_talloc(mem_ctx, NULL, 4);
     293                        SIVAL(data->data.data, 0, v);
    285294                        break;
     295                }
    286296                default:
    287297                        return NT_STATUS_NOT_SUPPORTED;
     
    587597
    588598                        if (!reg_ctx) {
    589                                 NT_USER_TOKEN *token;
     599                                struct security_token *token;
    590600
    591601                                token = registry_create_system_token(mem_ctx);
     
    671681                           TALLOC_CTX *mem_ctx,
    672682                           uint32_t flags,
    673                            const NT_USER_TOKEN *token,
     683                           const struct security_token *token,
    674684                           struct GROUP_POLICY_OBJECT *gpo_list,
    675685                           const char *extension_guid,
     
    685695                                 TALLOC_CTX *mem_ctx,
    686696                                 uint32_t flags,
    687                                  const NT_USER_TOKEN *token,
     697                                 const struct security_token *token,
    688698                                 struct registry_key *root_key,
    689699                                 struct GROUP_POLICY_OBJECT *gpo,
  • trunk/server/libgpo/gpext/gpext.h

    r414 r745  
    6666                                         uint32_t flags,
    6767                                         struct registry_key *root_key,
    68                                          const NT_USER_TOKEN *token,
     68                                         const struct security_token *token,
    6969                                         struct GROUP_POLICY_OBJECT *gpo,
    7070                                         const char *extension_guid,
     
    7474                                         TALLOC_CTX *mem_ctx,
    7575                                         uint32_t flags,
    76                                          const NT_USER_TOKEN *token,
     76                                         const struct security_token *token,
    7777                                         struct GROUP_POLICY_OBJECT *gpo_list,
    7878                                         const char *extension_guid);
     
    110110                           TALLOC_CTX *mem_ctx,
    111111                           uint32_t flags,
    112                            const NT_USER_TOKEN *token,
     112                           const struct security_token *token,
    113113                           struct GROUP_POLICY_OBJECT *gpo_list,
    114114                           const char *extension_guid,
     
    117117                                 TALLOC_CTX *mem_ctx,
    118118                                 uint32_t flags,
    119                                  const NT_USER_TOKEN *token,
     119                                 const struct security_token *token,
    120120                                 struct registry_key *root_key,
    121121                                 struct GROUP_POLICY_OBJECT *gpo,
  • trunk/server/libgpo/gpo.h

    r414 r745  
    2525#else
    2626struct loadparm_context;
     27#include "ads.h"
    2728#endif
    2829
     
    156157
    157158struct gp_registry_context {
    158         const NT_USER_TOKEN *token;
     159        const struct security_token *token;
    159160        const char *path;
    160161        struct registry_key *curr_key;
     
    215216                             TALLOC_CTX *mem_ctx,
    216217                             const char *dn,
    217                              NT_USER_TOKEN **token);
     218                             struct security_token **token);
    218219ADS_STATUS ads_get_gpo_list(ADS_STRUCT *ads,
    219220                            TALLOC_CTX *mem_ctx,
    220221                            const char *dn,
    221222                            uint32_t flags,
    222                             const NT_USER_TOKEN *token,
     223                            const struct security_token *token,
    223224                            struct GROUP_POLICY_OBJECT **gpo_list);
    224225
     
    226227
    227228NTSTATUS gpo_apply_security_filtering(const struct GROUP_POLICY_OBJECT *gpo,
    228                                       const NT_USER_TOKEN *token);
     229                                      const struct security_token *token);
    229230
    230231/* The following definitions come from libgpo/gpo_util.c  */
     
    245246ADS_STATUS gpo_process_a_gpo(ADS_STRUCT *ads,
    246247                             TALLOC_CTX *mem_ctx,
    247                              const NT_USER_TOKEN *token,
     248                             const struct security_token *token,
    248249                             struct registry_key *root_key,
    249250                             struct GROUP_POLICY_OBJECT *gpo,
     
    252253ADS_STATUS gpo_process_gpo_list(ADS_STRUCT *ads,
    253254                                TALLOC_CTX *mem_ctx,
    254                                 const NT_USER_TOKEN *token,
     255                                const struct security_token *token,
    255256                                struct GROUP_POLICY_OBJECT *gpo_list,
    256257                                const char *extensions_guid_filter,
     
    282283                                struct loadparm_context *lp_ctx,
    283284                                const char *dn,
    284                                 NT_USER_TOKEN **token);
     285                                struct security_token **token);
    285286
    286287
  • trunk/server/libgpo/gpo_fetch.c

    r414 r745  
    2626#include "param/param.h"
    2727#include "libcli/resolve/resolve.h"
    28 #include "../lib/tevent/tevent.h"
     28#include <tevent.h>
    2929#include "libcli/libcli.h"
    3030#include "libcli/raw/libcliraw.h"
     
    3333#include "libgpo/gpo_s4.h"
    3434#include "lib/util/util.h"
     35#else
     36#include "libgpo/gpo_proto.h"
     37#include "libsmb/libsmb.h"
    3538#endif
    3639
     
    149152                        CLI_FULL_CONNECTION_USE_KERBEROS |
    150153                        CLI_FULL_CONNECTION_FALLBACK_AFTER_KERBEROS,
    151                         Undefined, NULL);
     154                        Undefined);
    152155        if (!NT_STATUS_IS_OK(result)) {
    153156                DEBUG(10,("check_refresh_gpo: "
  • trunk/server/libgpo/gpo_ldap.c

    r414 r745  
    1919
    2020#include "includes.h"
     21#include "libgpo/gpo.h"
     22#include "auth.h"
    2123#if _SAMBA_BUILD_ == 4
    22 #include "libgpo/gpo.h"
    2324#include "libgpo/gpo_s4.h"
    2425#include "source4/libgpo/ads_convenience.h"
    2526#endif
     27#include "../libcli/security/security.h"
    2628
    2729/****************************************************************
     
    486488                "versionNumber",
    487489                NULL};
    488         uint32_t sd_flags = DACL_SECURITY_INFORMATION;
     490        uint32_t sd_flags = SECINFO_DACL;
    489491
    490492        ZERO_STRUCTP(gpo);
     
    553555                                         enum GPO_LINK_TYPE link_type,
    554556                                         bool only_add_forced_gpos,
    555                                          const NT_USER_TOKEN *token)
     557                                         const struct security_token *token)
    556558{
    557559        ADS_STATUS status;
     
    620622                             TALLOC_CTX *mem_ctx,
    621623                             const char *dn,
    622                              NT_USER_TOKEN **token)
     624                             struct security_token **token)
    623625{
    624626        ADS_STATUS status;
    625         DOM_SID object_sid;
    626         DOM_SID primary_group_sid;
    627         DOM_SID *ad_token_sids;
     627        struct dom_sid object_sid;
     628        struct dom_sid primary_group_sid;
     629        struct dom_sid *ad_token_sids;
    628630        size_t num_ad_token_sids = 0;
    629         DOM_SID *token_sids;
    630         size_t num_token_sids = 0;
    631         NT_USER_TOKEN *new_token = NULL;
     631        struct dom_sid *token_sids;
     632        uint32_t num_token_sids = 0;
     633        struct security_token *new_token = NULL;
    632634        int i;
    633635
     
    639641        }
    640642
    641         token_sids = TALLOC_ARRAY(mem_ctx, DOM_SID, 1);
     643        token_sids = TALLOC_ARRAY(mem_ctx, struct dom_sid, 1);
    642644        ADS_ERROR_HAVE_NO_MEMORY(token_sids);
    643645
     
    671673        *token = new_token;
    672674
    673         debug_nt_user_token(DBGC_CLASS, 5, *token);
     675        security_token_debug(DBGC_CLASS, 5, *token);
    674676
    675677        return ADS_ERROR_LDAP(LDAP_SUCCESS);
     
    711713                            const char *dn,
    712714                            uint32_t flags,
    713                             const NT_USER_TOKEN *token,
     715                            const struct security_token *token,
    714716                            struct GROUP_POLICY_OBJECT **gpo_list)
    715717{
     
    725727        if (!dn) {
    726728                return ADS_ERROR_NT(NT_STATUS_INVALID_PARAMETER);
     729        }
     730
     731        if (!ads_set_sasl_wrap_flags(ads, ADS_AUTH_SASL_SIGN)) {
     732                return ADS_ERROR(LDAP_INVALID_CREDENTIALS);
    727733        }
    728734
  • trunk/server/libgpo/gpo_sec.c

    r414 r745  
    1919
    2020#include "includes.h"
    21 #include "libcli/security/dom_sid.h"
     21#include "libcli/security/security.h"
     22#include "../libgpo/gpo.h"
     23#include "auth.h"
     24#include "../librpc/ndr/libndr.h"
    2225#if _SAMBA_BUILD_ == 4
    2326#include "libgpo/ads_convenience.h"
     
    2528#include "librpc/gen_ndr/ndr_misc.h"
    2629#include "../libcli/security/secace.h"
    27 #include "../libgpo/gpo.h"
    2830#endif
    2931
     
    102104
    103105static NTSTATUS gpo_sd_check_ace_denied_object(const struct security_ace *ace,
    104                                                const NT_USER_TOKEN *token)
     106                                               const struct security_token *token)
    105107{
    106108        char *sid_str;
     
    124126
    125127static NTSTATUS gpo_sd_check_ace_allowed_object(const struct security_ace *ace,
    126                                                 const NT_USER_TOKEN *token)
     128                                                const struct security_token *token)
    127129{
    128130        char *sid_str;
     
    147149
    148150static NTSTATUS gpo_sd_check_ace(const struct security_ace *ace,
    149                                  const NT_USER_TOKEN *token)
     151                                 const struct security_token *token)
    150152{
    151153        switch (ace->type) {
     
    163165
    164166NTSTATUS gpo_apply_security_filtering(const struct GROUP_POLICY_OBJECT *gpo,
    165                                       const NT_USER_TOKEN *token)
     167                                      const struct security_token *token)
    166168{
    167169        struct security_descriptor *sd = gpo->security_descriptor;
  • trunk/server/libgpo/gpo_util.c

    r414 r745  
    1919#define TALLOC_DEPRECATED 1
    2020#include "includes.h"
     21#include "system/filesys.h"
    2122#include "librpc/gen_ndr/ndr_misc.h"
     23#include "../librpc/gen_ndr/ndr_security.h"
     24#include "../libgpo/gpo.h"
     25#include "../libcli/security/security.h"
    2226#if _SAMBA_BUILD_ == 4
    23 #include "system/filesys.h"
    2427#include "auth/auth.h"
    25 #include "../libgpo/gpo.h"
    26 #include "../lib/talloc/talloc.h"
     28#include <talloc.h>
    2729#include "source4/libgpo/ads_convenience.h"
    2830#endif
     
    322324                dump_gp_ext(gp_ext, lvl);
    323325        }
    324 
    325         DEBUGADD(lvl,("security descriptor:\n"));
    326 
    327         NDR_PRINT_DEBUG(security_descriptor, gpo->security_descriptor);
     326        if (gpo->security_descriptor) {
     327                DEBUGADD(lvl,("security descriptor:\n"));
     328
     329                NDR_PRINT_DEBUG(security_descriptor, gpo->security_descriptor);
     330        }
    328331}
    329332
     
    447450ADS_STATUS gpo_process_a_gpo(ADS_STRUCT *ads,
    448451                             TALLOC_CTX *mem_ctx,
    449                              const NT_USER_TOKEN *token,
     452                             const struct security_token *token,
    450453                             struct registry_key *root_key,
    451454                             struct GROUP_POLICY_OBJECT *gpo,
     
    504507static ADS_STATUS gpo_process_gpo_list_by_ext(ADS_STRUCT *ads,
    505508                                              TALLOC_CTX *mem_ctx,
    506                                               const NT_USER_TOKEN *token,
     509                                              const struct security_token *token,
    507510                                              struct registry_key *root_key,
    508511                                              struct GROUP_POLICY_OBJECT *gpo_list,
     
    542545ADS_STATUS gpo_process_gpo_list(ADS_STRUCT *ads,
    543546                                TALLOC_CTX *mem_ctx,
    544                                 const NT_USER_TOKEN *token,
     547                                const struct security_token *token,
    545548                                struct GROUP_POLICY_OBJECT *gpo_list,
    546549                                const char *extensions_guid_filter,
     
    839842                                struct loadparm_context *lp_ctx,
    840843                                const char *dn,
    841                                 NT_USER_TOKEN **token)
    842 {
    843         NT_USER_TOKEN *ad_token = NULL;
     844                                struct security_token **token)
     845{
     846        struct security_token *ad_token = NULL;
    844847        ADS_STATUS status;
    845848#if _SAMBA_BUILD_ == 4
Note: See TracChangeset for help on using the changeset viewer.