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:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/server

  • trunk/server/source3/lib/winbind_util.c

    r414 r745  
    2020
    2121#include "includes.h"
     22#include "../libcli/security/security.h"
     23#include "../lib/util/util_pw.h"
     24#include "nsswitch/libwbclient/wbclient.h"
    2225
    2326#if defined(WITH_WINBIND)
    2427
    25 #include "nsswitch/libwbclient/wbclient.h"
     28#include "lib/winbind_util.h"
    2629
    2730struct passwd * winbind_getpwnam(const char * name)
     
    4245}
    4346
    44 struct passwd * winbind_getpwsid(const DOM_SID *sid)
     47struct passwd * winbind_getpwsid(const struct dom_sid *sid)
    4548{
    4649        wbcErr result;
     
    6467/* Call winbindd to convert a name to a sid */
    6568
    66 bool winbind_lookup_name(const char *dom_name, const char *name, DOM_SID *sid,
     69bool winbind_lookup_name(const char *dom_name, const char *name, struct dom_sid *sid,
    6770                         enum lsa_SidType *name_type)
    6871{
     
    7578                return false;
    7679
    77         memcpy(sid, &dom_sid, sizeof(DOM_SID));
     80        memcpy(sid, &dom_sid, sizeof(struct dom_sid));
    7881        *name_type = (enum lsa_SidType)type;   
    7982
     
    8386/* Call winbindd to convert sid to name */
    8487
    85 bool winbind_lookup_sid(TALLOC_CTX *mem_ctx, const DOM_SID *sid,
     88bool winbind_lookup_sid(TALLOC_CTX *mem_ctx, const struct dom_sid *sid,
    8689                        const char **domain, const char **name,
    8790                        enum lsa_SidType *name_type)
     
    135138/* Call winbindd to convert SID to uid */
    136139
    137 bool winbind_sid_to_uid(uid_t *puid, const DOM_SID *sid)
     140bool winbind_sid_to_uid(uid_t *puid, const struct dom_sid *sid)
    138141{
    139142        struct wbcDomainSid dom_sid;
     
    149152/* Call winbindd to convert uid to sid */
    150153
    151 bool winbind_uid_to_sid(DOM_SID *sid, uid_t uid)
     154bool winbind_uid_to_sid(struct dom_sid *sid, uid_t uid)
    152155{
    153156        struct wbcDomainSid dom_sid;
     
    156159        result = wbcUidToSid(uid, &dom_sid);
    157160        if (result == WBC_ERR_SUCCESS) {
    158                 memcpy(sid, &dom_sid, sizeof(DOM_SID));
     161                memcpy(sid, &dom_sid, sizeof(struct dom_sid));
    159162        } else {
    160163                sid_copy(sid, &global_sid_NULL);
     
    166169/* Call winbindd to convert SID to gid */
    167170
    168 bool winbind_sid_to_gid(gid_t *pgid, const DOM_SID *sid)
     171bool winbind_sid_to_gid(gid_t *pgid, const struct dom_sid *sid)
    169172{
    170173        struct wbcDomainSid dom_sid;
     
    180183/* Call winbindd to convert gid to sid */
    181184
    182 bool winbind_gid_to_sid(DOM_SID *sid, gid_t gid)
     185bool winbind_gid_to_sid(struct dom_sid *sid, gid_t gid)
    183186{
    184187        struct wbcDomainSid dom_sid;
     
    187190        result = wbcGidToSid(gid, &dom_sid);
    188191        if (result == WBC_ERR_SUCCESS) {
    189                 memcpy(sid, &dom_sid, sizeof(DOM_SID));
     192                memcpy(sid, &dom_sid, sizeof(struct dom_sid));
    190193        } else {
    191194                sid_copy(sid, &global_sid_NULL);
     
    214217
    215218bool winbind_lookup_rids(TALLOC_CTX *mem_ctx,
    216                          const DOM_SID *domain_sid,
     219                         const struct dom_sid *domain_sid,
    217220                         int num_rids, uint32 *rids,
    218221                         const char **domain_name,
     
    296299
    297300bool winbind_get_sid_aliases(TALLOC_CTX *mem_ctx,
    298                              const DOM_SID *dom_sid,
    299                              const DOM_SID *members,
     301                             const struct dom_sid *dom_sid,
     302                             const struct dom_sid *members,
    300303                             size_t num_members,
    301304                             uint32_t **pp_alias_rids,
     
    347350}
    348351
    349 struct passwd * winbind_getpwsid(const DOM_SID *sid)
     352struct passwd * winbind_getpwsid(const struct dom_sid *sid)
    350353{
    351354        return NULL;
    352355}
    353356
    354 bool winbind_lookup_name(const char *dom_name, const char *name, DOM_SID *sid,
     357bool winbind_lookup_name(const char *dom_name, const char *name, struct dom_sid *sid,
    355358                         enum lsa_SidType *name_type)
    356359{
     
    360363/* Call winbindd to convert sid to name */
    361364
    362 bool winbind_lookup_sid(TALLOC_CTX *mem_ctx, const DOM_SID *sid,
     365bool winbind_lookup_sid(TALLOC_CTX *mem_ctx, const struct dom_sid *sid,
    363366                        const char **domain, const char **name,
    364367                        enum lsa_SidType *name_type)
     
    376379/* Call winbindd to convert SID to uid */
    377380
    378 bool winbind_sid_to_uid(uid_t *puid, const DOM_SID *sid)
     381bool winbind_sid_to_uid(uid_t *puid, const struct dom_sid *sid)
    379382{
    380383        return false;
     
    383386/* Call winbindd to convert uid to sid */
    384387
    385 bool winbind_uid_to_sid(DOM_SID *sid, uid_t uid)
     388bool winbind_uid_to_sid(struct dom_sid *sid, uid_t uid)
    386389{
    387390        return false;
     
    390393/* Call winbindd to convert SID to gid */
    391394
    392 bool winbind_sid_to_gid(gid_t *pgid, const DOM_SID *sid)
     395bool winbind_sid_to_gid(gid_t *pgid, const struct dom_sid *sid)
    393396{
    394397        return false;   
     
    397400/* Call winbindd to convert gid to sid */
    398401
    399 bool winbind_gid_to_sid(DOM_SID *sid, gid_t gid)
     402bool winbind_gid_to_sid(struct dom_sid *sid, gid_t gid)
    400403{
    401404        return false;
     
    412415
    413416bool winbind_lookup_rids(TALLOC_CTX *mem_ctx,
    414                          const DOM_SID *domain_sid,
     417                         const struct dom_sid *domain_sid,
    415418                         int num_rids, uint32 *rids,
    416419                         const char **domain_name,
     
    440443
    441444bool winbind_get_sid_aliases(TALLOC_CTX *mem_ctx,
    442                              const DOM_SID *dom_sid,
    443                              const DOM_SID *members,
     445                             const struct dom_sid *dom_sid,
     446                             const struct dom_sid *members,
    444447                             size_t num_members,
    445448                             uint32_t **pp_alias_rids,
Note: See TracChangeset for help on using the changeset viewer.