Line data Source code
1 : /*
2 : Unix SMB/CIFS implementation.
3 :
4 : Winbind client API - SSSD version
5 :
6 : Copyright (C) Sumit Bose <sbose@redhat.com> 2014
7 :
8 : This library is free software; you can redistribute it and/or
9 : modify it under the terms of the GNU Lesser General Public
10 : License as published by the Free Software Foundation; either
11 : version 3 of the License, or (at your option) any later version.
12 :
13 : This library is distributed in the hope that it will be useful,
14 : but WITHOUT ANY WARRANTY; without even the implied warranty of
15 : MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 : Library General Public License for more details.
17 :
18 : You should have received a copy of the GNU Lesser General Public License
19 : along with this program. If not, see <http://www.gnu.org/licenses/>.
20 : */
21 :
22 : /* Required Headers */
23 : #include "libwbclient.h"
24 : #include "wbc_sssd_internal.h"
25 :
26 : /* Authenticate a username/password pair */
27 0 : wbcErr wbcAuthenticateUser(const char *username,
28 : const char *password)
29 : {
30 0 : wbcErr wbc_status = WBC_ERR_SUCCESS;
31 0 : struct wbcAuthUserParams params = {0};
32 :
33 0 : params.account_name = username;
34 0 : params.level = WBC_AUTH_USER_LEVEL_PLAIN;
35 0 : params.password.plaintext = password;
36 :
37 0 : wbc_status = wbcAuthenticateUserEx(¶ms, NULL, NULL);
38 :
39 0 : return wbc_status;
40 : }
41 :
42 :
43 : /* Authenticate with more detailed information */
44 0 : wbcErr wbcAuthenticateUserEx(const struct wbcAuthUserParams *params,
45 : struct wbcAuthUserInfo **info,
46 : struct wbcAuthErrorInfo **error)
47 : {
48 0 : if (error != NULL) {
49 0 : *error = NULL;
50 : }
51 :
52 0 : WBC_SSSD_NOT_IMPLEMENTED;
53 : }
54 :
55 : /* Trigger a verification of the trust credentials of a specific domain */
56 0 : wbcErr wbcCheckTrustCredentials(const char *domain,
57 : struct wbcAuthErrorInfo **error)
58 : {
59 0 : if (error != NULL) {
60 0 : *error = NULL;
61 : }
62 :
63 0 : WBC_SSSD_NOT_IMPLEMENTED;
64 : }
65 :
66 : /* Trigger a change of the trust credentials for a specific domain */
67 0 : wbcErr wbcChangeTrustCredentials(const char *domain,
68 : struct wbcAuthErrorInfo **error)
69 : {
70 0 : if (error != NULL) {
71 0 : *error = NULL;
72 : }
73 :
74 0 : WBC_SSSD_NOT_IMPLEMENTED;
75 : }
76 :
77 : /*
78 : * Trigger a no-op NETLOGON call. Lightweight version of
79 : * wbcCheckTrustCredentials
80 : */
81 0 : wbcErr wbcPingDc(const char *domain, struct wbcAuthErrorInfo **error)
82 : {
83 0 : return wbcPingDc2(domain, error, NULL);
84 : }
85 :
86 : /*
87 : * Trigger a no-op NETLOGON call. Lightweight version of
88 : * wbcCheckTrustCredentials, optionally return attempted DC
89 : */
90 0 : wbcErr wbcPingDc2(const char *domain, struct wbcAuthErrorInfo **error,
91 : char **dcname)
92 : {
93 0 : WBC_SSSD_NOT_IMPLEMENTED;
94 : }
95 :
96 : /* Trigger an extended logoff notification to Winbind for a specific user */
97 0 : wbcErr wbcLogoffUserEx(const struct wbcLogoffUserParams *params,
98 : struct wbcAuthErrorInfo **error)
99 : {
100 0 : WBC_SSSD_NOT_IMPLEMENTED;
101 : }
102 :
103 : /* Trigger a logoff notification to Winbind for a specific user */
104 0 : wbcErr wbcLogoffUser(const char *username,
105 : uid_t uid,
106 : const char *ccfilename)
107 : {
108 0 : WBC_SSSD_NOT_IMPLEMENTED;
109 : }
110 :
111 : /* Change a password for a user with more detailed information upon failure */
112 0 : wbcErr wbcChangeUserPasswordEx(const struct wbcChangePasswordParams *params,
113 : struct wbcAuthErrorInfo **error,
114 : enum wbcPasswordChangeRejectReason *reject_reason,
115 : struct wbcUserPasswordPolicyInfo **policy)
116 : {
117 0 : if (error != NULL) {
118 0 : *error = NULL;
119 : }
120 :
121 0 : if (policy != NULL) {
122 0 : *policy = NULL;
123 : }
124 :
125 0 : WBC_SSSD_NOT_IMPLEMENTED;
126 : }
127 :
128 : /* Change a password for a user */
129 0 : wbcErr wbcChangeUserPassword(const char *username,
130 : const char *old_password,
131 : const char *new_password)
132 : {
133 0 : wbcErr wbc_status = WBC_ERR_SUCCESS;
134 0 : struct wbcChangePasswordParams params = {0};
135 :
136 0 : params.account_name = username;
137 0 : params.level = WBC_CHANGE_PASSWORD_LEVEL_PLAIN;
138 0 : params.old_password.plaintext = old_password;
139 0 : params.new_password.plaintext = new_password;
140 :
141 0 : wbc_status = wbcChangeUserPasswordEx(¶ms, NULL, NULL, NULL);
142 :
143 0 : return wbc_status;
144 : }
145 :
146 : /* Logon a User */
147 0 : wbcErr wbcLogonUser(const struct wbcLogonUserParams *params,
148 : struct wbcLogonUserInfo **info,
149 : struct wbcAuthErrorInfo **error,
150 : struct wbcUserPasswordPolicyInfo **policy)
151 : {
152 0 : if (info != NULL) {
153 0 : *info = NULL;
154 : }
155 :
156 0 : if (error != NULL) {
157 0 : *error = NULL;
158 : }
159 :
160 0 : if (policy != NULL) {
161 0 : *policy = NULL;
162 : }
163 :
164 0 : WBC_SSSD_NOT_IMPLEMENTED;
165 : }
166 :
167 : /* Authenticate a user with cached credentials */
168 0 : wbcErr wbcCredentialCache(struct wbcCredentialCacheParams *params,
169 : struct wbcCredentialCacheInfo **info,
170 : struct wbcAuthErrorInfo **error)
171 : {
172 0 : if (error != NULL) {
173 0 : *error = NULL;
174 : }
175 :
176 0 : WBC_SSSD_NOT_IMPLEMENTED;
177 : }
178 :
179 : /* Authenticate a user with cached credentials */
180 0 : wbcErr wbcCredentialSave(const char *user, const char *password)
181 : {
182 0 : WBC_SSSD_NOT_IMPLEMENTED;
183 : }
|