Ignore:
Timestamp:
Nov 24, 2016, 1:14:11 PM (9 years ago)
Author:
Silvan Scherrer
Message:

Samba Server: update vendor to version 4.4.3

File:
1 edited

Legend:

Unmodified
Added
Removed
  • vendor/current/nsswitch/libwbclient/wbclient.h

    r740 r988  
    66   Copyright (C) Gerald (Jerry) Carter 2007
    77   Copyright (C) Volker Lendecke 2009
     8   Copyright (C) Matthew Newton 2015
    89
    910   This library is free software; you can redistribute it and/or
     
    6970 *  0.7: Added wbcSidToStringBuf()
    7071 *  0.8: Added wbcSidsToUnixIds() and wbcLookupSids()
     72 *  0.9: Added support for WBC_ID_TYPE_BOTH
     73 *  0.10: Added wbcPingDc2()
     74 *  0.11: Extended wbcAuthenticateUserEx to provide PAC parsing
     75 *  0.12: Added wbcCtxCreate and friends
    7176 **/
    7277#define WBCLIENT_MAJOR_VERSION 0
    73 #define WBCLIENT_MINOR_VERSION 8
     78#define WBCLIENT_MINOR_VERSION 12
    7479#define WBCLIENT_VENDOR_VERSION "Samba libwbclient"
    7580struct wbcLibraryDetails {
     
    9196        char *dns_domain;
    9297};
     98
     99/**
     100 *  @brief Library context data
     101 *
     102 **/
     103
     104struct wbcContext;
    93105
    94106/*
     
    196208
    197209/**
     210 * @brief Generic Blob
     211 **/
     212
     213struct wbcBlob {
     214        uint8_t *data;
     215        size_t length;
     216};
     217
     218/**
     219 * @brief Named Blob
     220 **/
     221
     222struct wbcNamedBlob {
     223        const char *name;
     224        uint32_t flags;
     225        struct wbcBlob blob;
     226};
     227
     228/**
    198229 * @brief Auth User Parameters
    199230 **/
     
    211242                WBC_AUTH_USER_LEVEL_PLAIN = 1,
    212243                WBC_AUTH_USER_LEVEL_HASH = 2,
    213                 WBC_AUTH_USER_LEVEL_RESPONSE = 3
     244                WBC_AUTH_USER_LEVEL_RESPONSE = 3,
     245                WBC_AUTH_USER_LEVEL_PAC = 4
    214246        } level;
    215247        union {
     
    226258                        uint8_t *lm_data;
    227259                } response;
     260                struct wbcBlob pac;
    228261        } password;
    229 };
    230 
    231 /**
    232  * @brief Generic Blob
    233  **/
    234 
    235 struct wbcBlob {
    236         uint8_t *data;
    237         size_t length;
    238 };
    239 
    240 /**
    241  * @brief Named Blob
    242  **/
    243 
    244 struct wbcNamedBlob {
    245         const char *name;
    246         uint32_t flags;
    247         struct wbcBlob blob;
    248262};
    249263
     
    519533
    520534
     535/**********************************************************
     536 * Context Management
     537 **********************************************************/
     538
     539/**
     540 * @brief Create a new wbcContext context
     541 *
     542 * @return wbcContext
     543 **/
     544struct wbcContext *wbcCtxCreate(void);
     545
     546/**
     547 * @brief Free a library context
     548 *
     549 * @param ctx           wbcContext to free
     550 *
     551 * @return void
     552 **/
     553void wbcCtxFree(struct wbcContext *ctx);
     554
     555
     556
    521557/*
    522558 * Utility functions for dealing with SIDs
     
    596632 * @brief Ping winbindd to see if the daemon is running
    597633 *
     634 * @param *ctx        wbclient Context
     635 *
     636 * @return #wbcErr
     637 **/
     638wbcErr wbcCtxPing(struct wbcContext *ctx);
     639
     640/**
     641 * @brief Ping winbindd to see if the daemon is running
     642 *
    598643 * @return #wbcErr
    599644 **/
     
    602647wbcErr wbcLibraryDetails(struct wbcLibraryDetails **details);
    603648
     649wbcErr wbcCtxInterfaceDetails(struct wbcContext *ctx,
     650                              struct wbcInterfaceDetails **details);
    604651wbcErr wbcInterfaceDetails(struct wbcInterfaceDetails **details);
    605652
     
    611658 * @brief Convert a domain and name to SID
    612659 *
     660 * @param *ctx        wbclient Context
    613661 * @param dom_name    Domain name (possibly "")
    614662 * @param name        User or group name
     
    618666 * @return #wbcErr
    619667 **/
     668wbcErr wbcCtxLookupName(struct wbcContext *ctx,
     669                        const char *dom_name,
     670                        const char *name,
     671                        struct wbcDomainSid *sid,
     672                        enum wbcSidType *name_type);
     673
     674/**
     675 * @brief Convert a domain and name to SID
     676 *
     677 * @param dom_name    Domain name (possibly "")
     678 * @param name        User or group name
     679 * @param *sid        Pointer to the resolved domain SID
     680 * @param *name_type  Pointer to the SID type
     681 *
     682 * @return #wbcErr
     683 **/
    620684wbcErr wbcLookupName(const char *dom_name,
    621685                     const char *name,
     
    626690 * @brief Convert a SID to a domain and name
    627691 *
    628  * @param *sid        Pointer to the domain SID to be resolved
     692 * @param *ctx       wbclient Context
     693 * @param *sid       Pointer to the domain SID to be resolved
     694 * @param domain     Resolved Domain name (possibly "")
     695 * @param name       Resolved User or group name
     696 * @param *name_type Pointer to the resolved SID type
     697 *
     698 * @return #wbcErr
     699 **/
     700wbcErr wbcCtxLookupSid(struct wbcContext *ctx,
     701                       const struct wbcDomainSid *sid,
     702                       char **domain,
     703                       char **name,
     704                       enum wbcSidType *name_type);
     705
     706/**
     707 * @brief Convert a SID to a domain and name
     708 *
     709 * @param *sid       Pointer to the domain SID to be resolved
    629710 * @param domain     Resolved Domain name (possibly "")
    630711 * @param name       Resolved User or group name
     
    644725};
    645726
     727wbcErr wbcCtxLookupSids(struct wbcContext *ctx,
     728                        const struct wbcDomainSid *sids, int num_sids,
     729                        struct wbcDomainInfo **domains, int *num_domains,
     730                        struct wbcTranslatedName **names);
     731
    646732wbcErr wbcLookupSids(const struct wbcDomainSid *sids, int num_sids,
    647733                     struct wbcDomainInfo **domains, int *num_domains,
    648734                     struct wbcTranslatedName **names);
     735
     736/**
     737 * @brief Translate a collection of RIDs within a domain to names
     738 */
     739wbcErr wbcCtxLookupRids(struct wbcContext *ctx,
     740                        struct wbcDomainSid *dom_sid,
     741                        int num_rids,
     742                        uint32_t *rids,
     743                        const char **domain_name,
     744                        const char ***names,
     745                        enum wbcSidType **types);
    649746
    650747/**
     
    661758 * @brief Get the groups a user belongs to
    662759 **/
     760wbcErr wbcCtxLookupUserSids(struct wbcContext *ctx,
     761                            const struct wbcDomainSid *user_sid,
     762                            bool domain_groups_only,
     763                            uint32_t *num_sids,
     764                            struct wbcDomainSid **sids);
     765
     766/*
     767 * @brief Get the groups a user belongs to
     768 **/
    663769wbcErr wbcLookupUserSids(const struct wbcDomainSid *user_sid,
    664770                         bool domain_groups_only,
    665771                         uint32_t *num_sids,
    666772                         struct wbcDomainSid **sids);
     773
     774/*
     775 * @brief Get alias membership for sids
     776 **/
     777wbcErr wbcCtxGetSidAliases(struct wbcContext *ctx,
     778                           const struct wbcDomainSid *dom_sid,
     779                           struct wbcDomainSid *sids,
     780                           uint32_t num_sids,
     781                           uint32_t **alias_rids,
     782                           uint32_t *num_alias_rids);
    667783
    668784/*
     
    678794 * @brief Lists Users
    679795 **/
     796wbcErr wbcCtxListUsers(struct wbcContext *ctx,
     797                       const char *domain_name,
     798                       uint32_t *num_users,
     799                       const char ***users);
     800
     801/**
     802 * @brief Lists Users
     803 **/
    680804wbcErr wbcListUsers(const char *domain_name,
    681805                    uint32_t *num_users,
     
    685809 * @brief Lists Groups
    686810 **/
     811wbcErr wbcCtxListGroups(struct wbcContext *ctx,
     812                        const char *domain_name,
     813                        uint32_t *num_groups,
     814                        const char ***groups);
     815
     816/**
     817 * @brief Lists Groups
     818 **/
    687819wbcErr wbcListGroups(const char *domain_name,
    688820                     uint32_t *num_groups,
    689821                     const char ***groups);
     822
     823wbcErr wbcCtxGetDisplayName(struct wbcContext *ctx,
     824                            const struct wbcDomainSid *sid,
     825                            char **pdomain,
     826                            char **pfullname,
     827                            enum wbcSidType *pname_type);
    690828
    691829wbcErr wbcGetDisplayName(const struct wbcDomainSid *sid,
     
    701839 * @brief Convert a Windows SID to a Unix uid, allocating an uid if needed
    702840 *
     841 * @param *ctx        wbclient Context
    703842 * @param *sid        Pointer to the domain SID to be resolved
    704843 * @param *puid       Pointer to the resolved uid_t value
     
    707846 *
    708847 **/
     848wbcErr wbcCtxSidToUid(struct wbcContext *ctx,
     849                      const struct wbcDomainSid *sid,
     850                      uid_t *puid);
     851
     852/**
     853 * @brief Convert a Windows SID to a Unix uid, allocating an uid if needed
     854 *
     855 * @param *sid        Pointer to the domain SID to be resolved
     856 * @param *puid       Pointer to the resolved uid_t value
     857 *
     858 * @return #wbcErr
     859 *
     860 **/
    709861wbcErr wbcSidToUid(const struct wbcDomainSid *sid,
    710862                   uid_t *puid);
     
    725877 * @brief Convert a Unix uid to a Windows SID, allocating a SID if needed
    726878 *
     879 * @param *ctx        wbclient Context
    727880 * @param uid         Unix uid to be resolved
    728881 * @param *sid        Pointer to the resolved domain SID
     
    731884 *
    732885 **/
     886wbcErr wbcCtxUidToSid(struct wbcContext *ctx, uid_t uid,
     887                      struct wbcDomainSid *sid);
     888
     889/**
     890 * @brief Convert a Unix uid to a Windows SID, allocating a SID if needed
     891 *
     892 * @param uid         Unix uid to be resolved
     893 * @param *sid        Pointer to the resolved domain SID
     894 *
     895 * @return #wbcErr
     896 *
     897 **/
    733898wbcErr wbcUidToSid(uid_t uid,
    734899                   struct wbcDomainSid *sid);
     
    749914 * @brief Convert a Windows SID to a Unix gid, allocating a gid if needed
    750915 *
     916 * @param *ctx        wbclient Context
    751917 * @param *sid        Pointer to the domain SID to be resolved
    752918 * @param *pgid       Pointer to the resolved gid_t value
     
    755921 *
    756922 **/
     923wbcErr wbcCtxSidToGid(struct wbcContext *ctx,
     924                      const struct wbcDomainSid *sid,
     925                      gid_t *pgid);
     926
     927/**
     928 * @brief Convert a Windows SID to a Unix gid, allocating a gid if needed
     929 *
     930 * @param *sid        Pointer to the domain SID to be resolved
     931 * @param *pgid       Pointer to the resolved gid_t value
     932 *
     933 * @return #wbcErr
     934 *
     935 **/
    757936wbcErr wbcSidToGid(const struct wbcDomainSid *sid,
    758937                   gid_t *pgid);
     
    769948wbcErr wbcQuerySidToGid(const struct wbcDomainSid *sid,
    770949                        gid_t *pgid);
     950
     951/**
     952 * @brief Convert a Unix gid to a Windows SID, allocating a SID if needed
     953 *
     954 * @param *ctx        wbclient Context
     955 * @param gid         Unix gid to be resolved
     956 * @param *sid        Pointer to the resolved domain SID
     957 *
     958 * @return #wbcErr
     959 *
     960 **/
     961wbcErr wbcCtxGidToSid(struct wbcContext *ctx, gid_t gid,
     962                   struct wbcDomainSid *sid);
    771963
    772964/**
     
    797989        WBC_ID_TYPE_NOT_SPECIFIED,
    798990        WBC_ID_TYPE_UID,
    799         WBC_ID_TYPE_GID
     991        WBC_ID_TYPE_GID,
     992        WBC_ID_TYPE_BOTH
    800993};
    801994
     
    8131006 * @brief Convert a list of sids to unix ids
    8141007 *
     1008 * @param *ctx        wbclient Context
    8151009 * @param sids        Pointer to an array of SIDs to convert
    8161010 * @param num_sids    Number of SIDs
     
    8201014 *
    8211015 **/
     1016wbcErr wbcCtxSidsToUnixIds(struct wbcContext *ctx,
     1017                           const struct wbcDomainSid *sids, uint32_t num_sids,
     1018                           struct wbcUnixId *ids);
     1019
     1020/**
     1021 * @brief Convert a list of sids to unix ids
     1022 *
     1023 * @param sids        Pointer to an array of SIDs to convert
     1024 * @param num_sids    Number of SIDs
     1025 * @param ids         Preallocated output array for translated IDs
     1026 *
     1027 * @return #wbcErr
     1028 *
     1029 **/
    8221030wbcErr wbcSidsToUnixIds(const struct wbcDomainSid *sids, uint32_t num_sids,
    8231031                        struct wbcUnixId *ids);
     
    8261034 * @brief Obtain a new uid from Winbind
    8271035 *
    828  * @param *puid      *pointer to the allocated uid
     1036 * @param *ctx        wbclient Context
     1037 * @param *puid       Pointer to the allocated uid
     1038 *
     1039 * @return #wbcErr
     1040 **/
     1041wbcErr wbcCtxAllocateUid(struct wbcContext *ctx, uid_t *puid);
     1042
     1043/**
     1044 * @brief Obtain a new uid from Winbind
     1045 *
     1046 * @param *puid       Pointer to the allocated uid
    8291047 *
    8301048 * @return #wbcErr
     
    8351053 * @brief Obtain a new gid from Winbind
    8361054 *
    837  * @param *pgid      Pointer to the allocated gid
     1055 * @param *ctx        wbclient Context
     1056 * @param *pgid       Pointer to the allocated gid
     1057 *
     1058 * @return #wbcErr
     1059 **/
     1060wbcErr wbcCtxAllocateGid(struct wbcContext *ctx, gid_t *pgid);
     1061
     1062/**
     1063 * @brief Obtain a new gid from Winbind
     1064 *
     1065 * @param *pgid       Pointer to the allocated gid
    8381066 *
    8391067 * @return #wbcErr
     
    8451073 *
    8461074 * @param uid       Uid of the desired mapping.
    847  * @param *sid      Pointer to the sid of the diresired mapping.
     1075 * @param *sid      Pointer to the sid of the desired mapping.
    8481076 *
    8491077 * @return #wbcErr
     
    8581086 *
    8591087 * @param gid       Gid of the desired mapping.
    860  * @param *sid      Pointer to the sid of the diresired mapping.
     1088 * @param *sid      Pointer to the sid of the desired mapping.
    8611089 *
    8621090 * @return #wbcErr
     
    9251153 *   on username
    9261154 *
     1155 * @param *ctx      wbclient Context
    9271156 * @param *name     Username to lookup
    9281157 * @param **pwd     Pointer to resulting struct passwd* from the query.
     
    9301159 * @return #wbcErr
    9311160 **/
     1161wbcErr wbcCtxGetpwnam(struct wbcContext *ctx,
     1162                      const char *name, struct passwd **pwd);
     1163
     1164/**
     1165 * @brief Fill in a struct passwd* for a domain user based
     1166 *   on username
     1167 *
     1168 * @param *name     Username to lookup
     1169 * @param **pwd     Pointer to resulting struct passwd* from the query.
     1170 *
     1171 * @return #wbcErr
     1172 **/
    9321173wbcErr wbcGetpwnam(const char *name, struct passwd **pwd);
    9331174
     
    9361177 *   on uid
    9371178 *
     1179 * @param *ctx      wbclient Context
    9381180 * @param uid       Uid to lookup
    9391181 * @param **pwd     Pointer to resulting struct passwd* from the query.
     
    9411183 * @return #wbcErr
    9421184 **/
     1185wbcErr wbcCtxGetpwuid(struct wbcContext *ctx,
     1186                      uid_t uid, struct passwd **pwd);
     1187
     1188/**
     1189 * @brief Fill in a struct passwd* for a domain user based
     1190 *   on uid
     1191 *
     1192 * @param uid       Uid to lookup
     1193 * @param **pwd     Pointer to resulting struct passwd* from the query.
     1194 *
     1195 * @return #wbcErr
     1196 **/
    9431197wbcErr wbcGetpwuid(uid_t uid, struct passwd **pwd);
    9441198
     
    9471201 *   on sid
    9481202 *
     1203 * @param *ctx         wbclient Context
    9491204 * @param sid       Sid to lookup
    9501205 * @param **pwd     Pointer to resulting struct passwd* from the query.
     
    9521207 * @return #wbcErr
    9531208 **/
     1209wbcErr wbcCtxGetpwsid(struct wbcContext *ctx,
     1210                      struct wbcDomainSid * sid, struct passwd **pwd);
     1211
     1212/**
     1213 * @brief Fill in a struct passwd* for a domain user based
     1214 *   on sid
     1215 *
     1216 * @param sid       Sid to lookup
     1217 * @param **pwd     Pointer to resulting struct passwd* from the query.
     1218 *
     1219 * @return #wbcErr
     1220 **/
    9541221wbcErr wbcGetpwsid(struct wbcDomainSid * sid, struct passwd **pwd);
    9551222
     
    9581225 *   on username
    9591226 *
     1227 * @param *ctx      wbclient Context
    9601228 * @param *name     Username to lookup
    9611229 * @param **grp     Pointer to resulting struct group* from the query.
     
    9631231 * @return #wbcErr
    9641232 **/
     1233wbcErr wbcCtxGetgrnam(struct wbcContext *ctx,
     1234                      const char *name, struct group **grp);
     1235
     1236/**
     1237 * @brief Fill in a struct passwd* for a domain user based
     1238 *   on username
     1239 *
     1240 * @param *name     Username to lookup
     1241 * @param **grp     Pointer to resulting struct group* from the query.
     1242 *
     1243 * @return #wbcErr
     1244 **/
    9651245wbcErr wbcGetgrnam(const char *name, struct group **grp);
    9661246
     
    9691249 *   on uid
    9701250 *
     1251 * @param *ctx      wbclient Context
    9711252 * @param gid       Uid to lookup
    9721253 * @param **grp     Pointer to resulting struct group* from the query.
     
    9741255 * @return #wbcErr
    9751256 **/
     1257wbcErr wbcCtxGetgrgid(struct wbcContext *ctx,
     1258                      gid_t gid, struct group **grp);
     1259
     1260/**
     1261 * @brief Fill in a struct passwd* for a domain user based
     1262 *   on uid
     1263 *
     1264 * @param gid       Uid to lookup
     1265 * @param **grp     Pointer to resulting struct group* from the query.
     1266 *
     1267 * @return #wbcErr
     1268 **/
    9761269wbcErr wbcGetgrgid(gid_t gid, struct group **grp);
    9771270
     
    9791272 * @brief Reset the passwd iterator
    9801273 *
     1274 * @param *ctx      wbclient Context
     1275 *
     1276 * @return #wbcErr
     1277 **/
     1278wbcErr wbcCtxSetpwent(struct wbcContext *ctx);
     1279
     1280/**
     1281 * @brief Reset the passwd iterator
     1282 *
    9811283 * @return #wbcErr
    9821284 **/
     
    9861288 * @brief Close the passwd iterator
    9871289 *
     1290 * @param *ctx      wbclient Context
     1291 *
     1292 * @return #wbcErr
     1293 **/
     1294wbcErr wbcCtxEndpwent(struct wbcContext *ctx);
     1295
     1296/**
     1297 * @brief Close the passwd iterator
     1298 *
    9881299 * @return #wbcErr
    9891300 **/
     
    9931304 * @brief Return the next struct passwd* entry from the pwent iterator
    9941305 *
    995  * @param **pwd       Pointer to resulting struct passwd* from the query.
     1306 * @param *ctx      wbclient Context
     1307 * @param **pwd     Pointer to resulting struct passwd* from the query.
     1308 *
     1309 * @return #wbcErr
     1310 **/
     1311wbcErr wbcCtxGetpwent(struct wbcContext *ctx, struct passwd **pwd);
     1312
     1313/**
     1314 * @brief Return the next struct passwd* entry from the pwent iterator
     1315 *
     1316 * @param **pwd     Pointer to resulting struct passwd* from the query.
    9961317 *
    9971318 * @return #wbcErr
     
    10021323 * @brief Reset the group iterator
    10031324 *
     1325 * @param *ctx      wbclient Context
     1326 *
     1327 * @return #wbcErr
     1328 **/
     1329wbcErr wbcCtxSetgrent(struct wbcContext *ctx);
     1330
     1331/**
     1332 * @brief Reset the group iterator
     1333 *
    10041334 * @return #wbcErr
    10051335 **/
     
    10091339 * @brief Close the group iterator
    10101340 *
     1341 * @param *ctx      wbclient Context
     1342 *
     1343 * @return #wbcErr
     1344 **/
     1345wbcErr wbcCtxEndgrent(struct wbcContext *ctx);
     1346
     1347/**
     1348 * @brief Close the group iterator
     1349 *
    10111350 * @return #wbcErr
    10121351 **/
     
    10161355 * @brief Return the next struct group* entry from the pwent iterator
    10171356 *
    1018  * @param **grp       Pointer to resulting struct group* from the query.
     1357 * @param *ctx      wbclient Context
     1358 * @param **grp     Pointer to resulting struct group* from the query.
     1359 *
     1360 * @return #wbcErr
     1361 **/
     1362wbcErr wbcCtxGetgrent(struct wbcContext *ctx, struct group **grp);
     1363
     1364/**
     1365 * @brief Return the next struct group* entry from the pwent iterator
     1366 *
     1367 * @param **grp     Pointer to resulting struct group* from the query.
    10191368 *
    10201369 * @return #wbcErr
     
    10271376 * This is similar to #wbcGetgrent, just that the member list is empty
    10281377 *
    1029  * @param **grp       Pointer to resulting struct group* from the query.
     1378 * @param *ctx      wbclient Context
     1379 * @param **grp     Pointer to resulting struct group* from the query.
     1380 *
     1381 * @return #wbcErr
     1382 **/
     1383wbcErr wbcCtxGetgrlist(struct wbcContext *ctx, struct group **grp);
     1384
     1385/**
     1386 * @brief Return the next struct group* entry from the pwent iterator
     1387 *
     1388 * This is similar to #wbcGetgrent, just that the member list is empty
     1389 *
     1390 * @param **grp     Pointer to resulting struct group* from the query.
    10301391 *
    10311392 * @return #wbcErr
     
    10361397 * @brief Return the unix group array belonging to the given user
    10371398 *
     1399 * @param *ctx           wbclient Context
    10381400 * @param *account       The given user name
    10391401 * @param *num_groups    Number of elements returned in the groups array
     
    10421404 * @return #wbcErr
    10431405 **/
     1406wbcErr wbcCtxGetGroups(struct wbcContext *ctx,
     1407                       const char *account,
     1408                       uint32_t *num_groups,
     1409                       gid_t **_groups);
     1410
     1411/**
     1412 * @brief Return the unix group array belonging to the given user
     1413 *
     1414 * @param *account       The given user name
     1415 * @param *num_groups    Number of elements returned in the groups array
     1416 * @param **_groups      Pointer to resulting gid_t array.
     1417 *
     1418 * @return #wbcErr
     1419 **/
    10441420wbcErr wbcGetGroups(const char *account,
    10451421                    uint32_t *num_groups,
     
    10541430 * @brief Lookup the current status of a trusted domain
    10551431 *
    1056  * @param domain        The domain to query
     1432 * @param *ctx           wbclient Context
     1433 * @param domain         The domain to query
     1434 *
     1435 * @param dinfo          A pointer to store the returned domain_info struct.
     1436 *
     1437 * @return #wbcErr
     1438 **/
     1439wbcErr wbcCtxDomainInfo(struct wbcContext *ctx,
     1440                        const char *domain,
     1441                        struct wbcDomainInfo **dinfo);
     1442
     1443/**
     1444 * @brief Lookup the current status of a trusted domain
     1445 *
     1446 * @param domain         The domain to query
    10571447 *
    10581448 * @param dinfo          A pointer to store the returned domain_info struct.
     
    10661456 * @brief Lookup the currently contacted DCs
    10671457 *
     1458 * @param *ctx          wbclient Context
    10681459 * @param domain        The domain to query
    10691460 *
     
    10741465 * @return #wbcErr
    10751466 **/
     1467wbcErr wbcCtxDcInfo(struct wbcContext *ctx,
     1468                    const char *domain, size_t *num_dcs,
     1469                    const char ***dc_names, const char ***dc_ips);
     1470
     1471/**
     1472 * @brief Lookup the currently contacted DCs
     1473 *
     1474 * @param domain        The domain to query
     1475 *
     1476 * @param num_dcs       Number of DCs currently known
     1477 * @param dc_names      Names of the currently known DCs
     1478 * @param dc_ips        IP addresses of the currently known DCs
     1479 *
     1480 * @return #wbcErr
     1481 **/
    10761482wbcErr wbcDcInfo(const char *domain, size_t *num_dcs,
    10771483                 const char ***dc_names, const char ***dc_ips);
     1484
     1485/**
     1486 * @brief Enumerate the domain trusts known by Winbind
     1487 *
     1488 * @param *ctx          wbclient Context
     1489 * @param **domains     Pointer to the allocated domain list array
     1490 * @param *num_domains  Pointer to number of domains returned
     1491 *
     1492 * @return #wbcErr
     1493 **/
     1494wbcErr wbcCtxListTrusts(struct wbcContext *ctx,
     1495                        struct wbcDomainInfo **domains,
     1496                        size_t *num_domains);
    10781497
    10791498/**
     
    11131532 * @brief Enumerate the domain trusts known by Winbind
    11141533 *
     1534 * @param *ctx          wbclient Context
    11151535 * @param domain        Name of the domain to query for a DC
    11161536 * @param flags         Bit flags used to control the domain location query
     
    11191539 * @return #wbcErr
    11201540 **/
     1541wbcErr wbcCtxLookupDomainController(struct wbcContext *ctx,
     1542                                    const char *domain,
     1543                                    uint32_t flags,
     1544                                    struct wbcDomainControllerInfo **dc_info);
     1545
     1546/**
     1547 * @brief Enumerate the domain trusts known by Winbind
     1548 *
     1549 * @param domain        Name of the domain to query for a DC
     1550 * @param flags         Bit flags used to control the domain location query
     1551 * @param *dc_info      Pointer to the returned domain controller information
     1552 *
     1553 * @return #wbcErr
     1554 **/
    11211555wbcErr wbcLookupDomainController(const char *domain,
    11221556                                 uint32_t flags,
     
    11261560 * @brief Get extended domain controller information
    11271561 *
     1562 * @param *ctx          wbclient Context
    11281563 * @param domain        Name of the domain to query for a DC
    11291564 * @param guid          Guid of the domain to query for a DC
     
    11341569 * @return #wbcErr
    11351570 **/
     1571wbcErr wbcCtxLookupDomainControllerEx(struct wbcContext *ctx,
     1572                                      const char *domain,
     1573                                      struct wbcGuid *guid,
     1574                                      const char *site,
     1575                                      uint32_t flags,
     1576                                      struct wbcDomainControllerInfoEx **dc_info);
     1577
     1578/**
     1579 * @brief Get extended domain controller information
     1580 *
     1581 * @param domain        Name of the domain to query for a DC
     1582 * @param guid          Guid of the domain to query for a DC
     1583 * @param site          Site of the domain to query for a DC
     1584 * @param flags         Bit flags used to control the domain location query
     1585 * @param *dc_info      Pointer to the returned extended domain controller information
     1586 *
     1587 * @return #wbcErr
     1588 **/
    11361589wbcErr wbcLookupDomainControllerEx(const char *domain,
    11371590                                   struct wbcGuid *guid,
     
    11471600 * @brief Authenticate a username/password pair
    11481601 *
     1602 * @param *ctx         wbclient Context
    11491603 * @param username     Name of user to authenticate
    11501604 * @param password     Clear text password os user
     
    11521606 * @return #wbcErr
    11531607 **/
     1608wbcErr wbcCtxAuthenticateUser(struct wbcContext *ctx,
     1609                              const char *username,
     1610                              const char *password);
     1611
     1612/**
     1613 * @brief Authenticate a username/password pair
     1614 *
     1615 * @param username     Name of user to authenticate
     1616 * @param password     Clear text password os user
     1617 *
     1618 * @return #wbcErr
     1619 **/
    11541620wbcErr wbcAuthenticateUser(const char *username,
    11551621                           const char *password);
     
    11581624 * @brief Authenticate with more detailed information
    11591625 *
     1626 * @param *ctx         wbclient Context
    11601627 * @param params       Input parameters, WBC_AUTH_USER_LEVEL_HASH
    11611628 *                     is not supported yet
     
    11651632 * @return #wbcErr
    11661633 **/
     1634wbcErr wbcCtxAuthenticateUserEx(struct wbcContext *ctx,
     1635                                const struct wbcAuthUserParams *params,
     1636                                struct wbcAuthUserInfo **info,
     1637                                struct wbcAuthErrorInfo **error);
     1638
     1639/**
     1640 * @brief Authenticate with more detailed information
     1641 *
     1642 * @param params       Input parameters, WBC_AUTH_USER_LEVEL_HASH
     1643 *                     is not supported yet
     1644 * @param info         Output details on WBC_ERR_SUCCESS
     1645 * @param error        Output details on WBC_ERR_AUTH_ERROR
     1646 *
     1647 * @return #wbcErr
     1648 **/
    11671649wbcErr wbcAuthenticateUserEx(const struct wbcAuthUserParams *params,
    11681650                             struct wbcAuthUserInfo **info,
     
    11721654 * @brief Logon a User
    11731655 *
     1656 * @param[in]  *ctx        wbclient Context
    11741657 * @param[in]  params      Pointer to a wbcLogonUserParams structure
    11751658 * @param[out] info        Pointer to a pointer to a wbcLogonUserInfo structure
     
    11791662 * @return #wbcErr
    11801663 **/
     1664wbcErr wbcCtxLogonUser(struct wbcContext *ctx,
     1665                       const struct wbcLogonUserParams *params,
     1666                       struct wbcLogonUserInfo **info,
     1667                       struct wbcAuthErrorInfo **error,
     1668                       struct wbcUserPasswordPolicyInfo **policy);
     1669
     1670/**
     1671 * @brief Logon a User
     1672 *
     1673 * @param[in]  params      Pointer to a wbcLogonUserParams structure
     1674 * @param[out] info        Pointer to a pointer to a wbcLogonUserInfo structure
     1675 * @param[out] error       Pointer to a pointer to a wbcAuthErrorInfo structure
     1676 * @param[out] policy      Pointer to a pointer to a wbcUserPasswordPolicyInfo structure
     1677 *
     1678 * @return #wbcErr
     1679 **/
    11811680wbcErr wbcLogonUser(const struct wbcLogonUserParams *params,
    11821681                    struct wbcLogonUserInfo **info,
     
    11871686 * @brief Trigger a logoff notification to Winbind for a specific user
    11881687 *
     1688 * @param *ctx        wbclient Context
    11891689 * @param username    Name of user to remove from Winbind's list of
    11901690 *                    logged on users.
     
    11951695 * @return #wbcErr
    11961696 **/
     1697wbcErr wbcCtxLogoffUser(struct wbcContext *ctx,
     1698                        const char *username, uid_t uid,
     1699                        const char *ccfilename);
     1700
     1701/**
     1702 * @brief Trigger a logoff notification to Winbind for a specific user
     1703 *
     1704 * @param username    Name of user to remove from Winbind's list of
     1705 *                    logged on users.
     1706 * @param uid         Uid assigned to the username
     1707 * @param ccfilename  Absolute path to the Krb5 credentials cache to
     1708 *                    be removed
     1709 *
     1710 * @return #wbcErr
     1711 **/
    11971712wbcErr wbcLogoffUser(const char *username,
    11981713                     uid_t uid,
     
    12021717 * @brief Trigger an extended logoff notification to Winbind for a specific user
    12031718 *
     1719 * @param *ctx        wbclient Context
    12041720 * @param params      A wbcLogoffUserParams structure
    12051721 * @param error       User output details on error
     
    12071723 * @return #wbcErr
    12081724 **/
     1725wbcErr wbcCtxLogoffUserEx(struct wbcContext *ctx,
     1726                          const struct wbcLogoffUserParams *params,
     1727                          struct wbcAuthErrorInfo **error);
     1728
     1729/**
     1730 * @brief Trigger an extended logoff notification to Winbind for a specific user
     1731 *
     1732 * @param params      A wbcLogoffUserParams structure
     1733 * @param error       User output details on error
     1734 *
     1735 * @return #wbcErr
     1736 **/
    12091737wbcErr wbcLogoffUserEx(const struct wbcLogoffUserParams *params,
    12101738                       struct wbcAuthErrorInfo **error);
     
    12131741 * @brief Change a password for a user
    12141742 *
     1743 * @param *ctx          wbclient Context
    12151744 * @param username      Name of user to authenticate
    12161745 * @param old_password  Old clear text password of user
     
    12191748 * @return #wbcErr
    12201749 **/
     1750wbcErr wbcCtxChangeUserPassword(struct wbcContext *ctx,
     1751                                const char *username,
     1752                                const char *old_password,
     1753                                const char *new_password);
     1754
     1755/**
     1756 * @brief Change a password for a user
     1757 *
     1758 * @param username      Name of user to authenticate
     1759 * @param old_password  Old clear text password of user
     1760 * @param new_password  New clear text password of user
     1761 *
     1762 * @return #wbcErr
     1763 **/
    12211764wbcErr wbcChangeUserPassword(const char *username,
    12221765                             const char *old_password,
     
    12271770 *   failure
    12281771 *
     1772 * @param *ctx                  wbclient Context
    12291773 * @param params                Input parameters
    12301774 * @param error                 User output details on WBC_ERR_PWD_CHANGE_FAILED
     
    12341778 * @return #wbcErr
    12351779 **/
     1780wbcErr wbcCtxChangeUserPasswordEx(struct wbcContext *ctx,
     1781                                  const struct wbcChangePasswordParams *params,
     1782                                  struct wbcAuthErrorInfo **error,
     1783                                  enum wbcPasswordChangeRejectReason *reject_reason,
     1784                                  struct wbcUserPasswordPolicyInfo **policy);
     1785
     1786/**
     1787 * @brief Change a password for a user with more detailed information upon
     1788 *   failure
     1789 *
     1790 * @param params                Input parameters
     1791 * @param error                 User output details on WBC_ERR_PWD_CHANGE_FAILED
     1792 * @param reject_reason         New password reject reason on WBC_ERR_PWD_CHANGE_FAILED
     1793 * @param policy                Password policy output details on WBC_ERR_PWD_CHANGE_FAILED
     1794 *
     1795 * @return #wbcErr
     1796 **/
    12361797wbcErr wbcChangeUserPasswordEx(const struct wbcChangePasswordParams *params,
    12371798                               struct wbcAuthErrorInfo **error,
     
    12421803 * @brief Authenticate a user with cached credentials
    12431804 *
     1805 * @param *ctx       wbclient Context
    12441806 * @param *params    Pointer to a wbcCredentialCacheParams structure
    12451807 * @param **info     Pointer to a pointer to a wbcCredentialCacheInfo structure
     
    12481810 * @return #wbcErr
    12491811 **/
     1812wbcErr wbcCtxCredentialCache(struct wbcContext *ctx,
     1813                             struct wbcCredentialCacheParams *params,
     1814                             struct wbcCredentialCacheInfo **info,
     1815                             struct wbcAuthErrorInfo **error);
     1816
     1817/**
     1818 * @brief Authenticate a user with cached credentials
     1819 *
     1820 * @param *params    Pointer to a wbcCredentialCacheParams structure
     1821 * @param **info     Pointer to a pointer to a wbcCredentialCacheInfo structure
     1822 * @param **error    Pointer to a pointer to a wbcAuthErrorInfo structure
     1823 *
     1824 * @return #wbcErr
     1825 **/
    12501826wbcErr wbcCredentialCache(struct wbcCredentialCacheParams *params,
    12511827                          struct wbcCredentialCacheInfo **info,
     
    12551831 * @brief Save a password with winbind for doing wbcCredentialCache() later
    12561832 *
     1833 * @param *ctx       wbclient Context
     1834 * @param *user      Username
     1835 * @param *password  Password
     1836 *
     1837 * @return #wbcErr
     1838 **/
     1839wbcErr wbcCtxCredentialSave(struct wbcContext *ctx,
     1840                            const char *user, const char *password);
     1841
     1842/**
     1843 * @brief Save a password with winbind for doing wbcCredentialCache() later
     1844 *
    12571845 * @param *user      Username
    12581846 * @param *password  Password
     
    12691857 * @brief Resolve a NetbiosName via WINS
    12701858 *
     1859 * @param *ctx         wbclient Context
    12711860 * @param name         Name to resolve
    12721861 * @param *ip          Pointer to the ip address string
     
    12741863 * @return #wbcErr
    12751864 **/
     1865wbcErr wbcCtxResolveWinsByName(struct wbcContext *ctx,
     1866                               const char *name, char **ip);
     1867
     1868/**
     1869 * @brief Resolve a NetbiosName via WINS
     1870 *
     1871 * @param name         Name to resolve
     1872 * @param *ip          Pointer to the ip address string
     1873 *
     1874 * @return #wbcErr
     1875 **/
    12761876wbcErr wbcResolveWinsByName(const char *name, char **ip);
    12771877
     
    12791879 * @brief Resolve an IP address via WINS into a NetbiosName
    12801880 *
    1281  * @param ip          The ip address string
    1282  * @param *name       Pointer to the name
     1881 * @param *ctx         wbclient Context
     1882 * @param ip           The ip address string
     1883 * @param *name        Pointer to the name
     1884 *
     1885 * @return #wbcErr
     1886 *
     1887 **/
     1888wbcErr wbcCtxResolveWinsByIP(struct wbcContext *ctx,
     1889                             const char *ip, char **name);
     1890
     1891/**
     1892 * @brief Resolve an IP address via WINS into a NetbiosName
     1893 *
     1894 * @param ip           The ip address string
     1895 * @param *name        Pointer to the name
    12831896 *
    12841897 * @return #wbcErr
     
    12941907 * @brief Trigger a verification of the trust credentials of a specific domain
    12951908 *
     1909 * @param *ctx         wbclient Context
    12961910 * @param *domain      The name of the domain.
    12971911 * @param error        Output details on WBC_ERR_AUTH_ERROR
     
    12991913 * @return #wbcErr
    13001914 **/
     1915wbcErr wbcCtxCheckTrustCredentials(struct wbcContext *ctx, const char *domain,
     1916                                   struct wbcAuthErrorInfo **error);
     1917
     1918/**
     1919 * @brief Trigger a verification of the trust credentials of a specific domain
     1920 *
     1921 * @param *domain      The name of the domain.
     1922 * @param error        Output details on WBC_ERR_AUTH_ERROR
     1923 *
     1924 * @return #wbcErr
     1925 **/
    13011926wbcErr wbcCheckTrustCredentials(const char *domain,
    13021927                                struct wbcAuthErrorInfo **error);
     
    13051930 * @brief Trigger a change of the trust credentials for a specific domain
    13061931 *
     1932 * @param *ctx         wbclient Context
    13071933 * @param *domain      The name of the domain.
    13081934 * @param error        Output details on WBC_ERR_AUTH_ERROR
     
    13101936 * @return #wbcErr
    13111937 **/
     1938wbcErr wbcCtxChangeTrustCredentials(struct wbcContext *ctx, const char *domain,
     1939                                    struct wbcAuthErrorInfo **error);
     1940
     1941/**
     1942 * @brief Trigger a change of the trust credentials for a specific domain
     1943 *
     1944 * @param *domain      The name of the domain.
     1945 * @param error        Output details on WBC_ERR_AUTH_ERROR
     1946 *
     1947 * @return #wbcErr
     1948 **/
    13121949wbcErr wbcChangeTrustCredentials(const char *domain,
    13131950                                 struct wbcAuthErrorInfo **error);
     
    13171954 *        version of wbcCheckTrustCredentials
    13181955 *
     1956 * @param *ctx         wbclient Context
    13191957 * @param *domain      The name of the domain, only NULL for the default domain is
    13201958 *                     supported yet. Other values than NULL will result in
     
    13241962 * @return #wbcErr
    13251963 **/
     1964wbcErr wbcCtxPingDc(struct wbcContext *ctx, const char *domain,
     1965                    struct wbcAuthErrorInfo **error);
     1966
     1967/**
     1968 * @brief Trigger a no-op call through the NETLOGON pipe. Low-cost
     1969 *        version of wbcCheckTrustCredentials
     1970 *
     1971 * @param *domain      The name of the domain, only NULL for the default domain is
     1972 *                     supported yet. Other values than NULL will result in
     1973 *                     WBC_ERR_NOT_IMPLEMENTED.
     1974 * @param error        Output details on WBC_ERR_AUTH_ERROR
     1975 *
     1976 * @return #wbcErr
     1977 **/
    13261978wbcErr wbcPingDc(const char *domain, struct wbcAuthErrorInfo **error);
     1979
     1980/**
     1981 * @brief Trigger a no-op call through the NETLOGON pipe. Low-cost
     1982 *        version of wbcCheckTrustCredentials
     1983 *
     1984 * @param *ctx         wbclient Context
     1985 * @param *domain      The name of the domain, only NULL for the default domain is
     1986 *                     supported yet. Other values than NULL will result in
     1987 *                     WBC_ERR_NOT_IMPLEMENTED.
     1988 * @param error        Output details on WBC_ERR_AUTH_ERROR
     1989 * @param dcname       DC that was attempted to ping
     1990 *
     1991 * @return #wbcErr
     1992 **/
     1993wbcErr wbcCtxPingDc2(struct wbcContext *ctx, const char *domain,
     1994                     struct wbcAuthErrorInfo **error,
     1995                     char **dcname);
     1996
     1997/**
     1998 * @brief Trigger a no-op call through the NETLOGON pipe. Low-cost
     1999 *        version of wbcCheckTrustCredentials
     2000 *
     2001 * @param *domain      The name of the domain, only NULL for the default domain is
     2002 *                     supported yet. Other values than NULL will result in
     2003 *                     WBC_ERR_NOT_IMPLEMENTED.
     2004 * @param error        Output details on WBC_ERR_AUTH_ERROR
     2005 * @param dcname       DC that was attempted to ping
     2006 *
     2007 * @return #wbcErr
     2008 **/
     2009wbcErr wbcPingDc2(const char *domain, struct wbcAuthErrorInfo **error,
     2010                  char **dcname);
    13272011
    13282012/**********************************************************
Note: See TracChangeset for help on using the changeset viewer.