| 1 | /*
|
|---|
| 2 | Unix SMB/CIFS implementation.
|
|---|
| 3 |
|
|---|
| 4 | Copyright (C) Stefan Metzmacher 2004
|
|---|
| 5 |
|
|---|
| 6 | This program is free software; you can redistribute it and/or modify
|
|---|
| 7 | it under the terms of the GNU General Public License as published by
|
|---|
| 8 | the Free Software Foundation; either version 3 of the License, or
|
|---|
| 9 | (at your option) any later version.
|
|---|
| 10 |
|
|---|
| 11 | This program is distributed in the hope that it will be useful,
|
|---|
| 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|---|
| 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|---|
| 14 | GNU General Public License for more details.
|
|---|
| 15 |
|
|---|
| 16 | You should have received a copy of the GNU General Public License
|
|---|
| 17 | along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|---|
| 18 | */
|
|---|
| 19 |
|
|---|
| 20 | /* struct and enum for doing a remote password change */
|
|---|
| 21 | enum libnet_ChangePassword_level {
|
|---|
| 22 | LIBNET_CHANGE_PASSWORD_GENERIC,
|
|---|
| 23 | LIBNET_CHANGE_PASSWORD_SAMR,
|
|---|
| 24 | LIBNET_CHANGE_PASSWORD_KRB5,
|
|---|
| 25 | LIBNET_CHANGE_PASSWORD_LDAP,
|
|---|
| 26 | LIBNET_CHANGE_PASSWORD_RAP
|
|---|
| 27 | };
|
|---|
| 28 |
|
|---|
| 29 | union libnet_ChangePassword {
|
|---|
| 30 | struct {
|
|---|
| 31 | enum libnet_ChangePassword_level level;
|
|---|
| 32 |
|
|---|
| 33 | struct _libnet_ChangePassword_in {
|
|---|
| 34 | const char *account_name;
|
|---|
| 35 | const char *domain_name;
|
|---|
| 36 | const char *oldpassword;
|
|---|
| 37 | const char *newpassword;
|
|---|
| 38 | } in;
|
|---|
| 39 |
|
|---|
| 40 | struct _libnet_ChangePassword_out {
|
|---|
| 41 | const char *error_string;
|
|---|
| 42 | } out;
|
|---|
| 43 | } generic;
|
|---|
| 44 |
|
|---|
| 45 | struct {
|
|---|
| 46 | enum libnet_ChangePassword_level level;
|
|---|
| 47 | struct _libnet_ChangePassword_in in;
|
|---|
| 48 | struct _libnet_ChangePassword_out out;
|
|---|
| 49 | } samr;
|
|---|
| 50 |
|
|---|
| 51 | struct {
|
|---|
| 52 | enum libnet_ChangePassword_level level;
|
|---|
| 53 | struct _libnet_ChangePassword_in in;
|
|---|
| 54 | struct _libnet_ChangePassword_out out;
|
|---|
| 55 | } krb5;
|
|---|
| 56 |
|
|---|
| 57 | struct {
|
|---|
| 58 | enum libnet_ChangePassword_level level;
|
|---|
| 59 | struct _libnet_ChangePassword_in in;
|
|---|
| 60 | struct _libnet_ChangePassword_out out;
|
|---|
| 61 | } ldap;
|
|---|
| 62 |
|
|---|
| 63 | struct {
|
|---|
| 64 | enum libnet_ChangePassword_level level;
|
|---|
| 65 | struct _libnet_ChangePassword_in in;
|
|---|
| 66 | struct _libnet_ChangePassword_out out;
|
|---|
| 67 | } rap;
|
|---|
| 68 | };
|
|---|
| 69 |
|
|---|
| 70 | /* struct and enum for doing a remote password set */
|
|---|
| 71 | enum libnet_SetPassword_level {
|
|---|
| 72 | LIBNET_SET_PASSWORD_GENERIC,
|
|---|
| 73 | LIBNET_SET_PASSWORD_SAMR,
|
|---|
| 74 | LIBNET_SET_PASSWORD_SAMR_HANDLE,
|
|---|
| 75 | LIBNET_SET_PASSWORD_SAMR_HANDLE_26,
|
|---|
| 76 | LIBNET_SET_PASSWORD_SAMR_HANDLE_25,
|
|---|
| 77 | LIBNET_SET_PASSWORD_SAMR_HANDLE_24,
|
|---|
| 78 | LIBNET_SET_PASSWORD_SAMR_HANDLE_23,
|
|---|
| 79 | LIBNET_SET_PASSWORD_KRB5,
|
|---|
| 80 | LIBNET_SET_PASSWORD_LDAP,
|
|---|
| 81 | LIBNET_SET_PASSWORD_RAP
|
|---|
| 82 | };
|
|---|
| 83 |
|
|---|
| 84 | union libnet_SetPassword {
|
|---|
| 85 | struct {
|
|---|
| 86 | enum libnet_SetPassword_level level;
|
|---|
| 87 |
|
|---|
| 88 | struct _libnet_SetPassword_in {
|
|---|
| 89 | const char *account_name;
|
|---|
| 90 | const char *domain_name;
|
|---|
| 91 | const char *newpassword;
|
|---|
| 92 | } in;
|
|---|
| 93 |
|
|---|
| 94 | struct _libnet_SetPassword_out {
|
|---|
| 95 | const char *error_string;
|
|---|
| 96 | } out;
|
|---|
| 97 | } generic;
|
|---|
| 98 |
|
|---|
| 99 | struct {
|
|---|
| 100 | enum libnet_SetPassword_level level;
|
|---|
| 101 | struct _libnet_SetPassword_samr_handle_in {
|
|---|
| 102 | const char *account_name; /* for debug only */
|
|---|
| 103 | struct policy_handle *user_handle;
|
|---|
| 104 | struct dcerpc_pipe *dcerpc_pipe;
|
|---|
| 105 | const char *newpassword;
|
|---|
| 106 | struct samr_UserInfo21 *info21; /* can be NULL,
|
|---|
| 107 | * for level 26,24 it must be NULL
|
|---|
| 108 | * for level 25,23 it must be non-NULL
|
|---|
| 109 | */
|
|---|
| 110 | } in;
|
|---|
| 111 | struct _libnet_SetPassword_out out;
|
|---|
| 112 | } samr_handle;
|
|---|
| 113 |
|
|---|
| 114 | struct {
|
|---|
| 115 | enum libnet_SetPassword_level level;
|
|---|
| 116 | struct _libnet_SetPassword_in in;
|
|---|
| 117 | struct _libnet_SetPassword_out out;
|
|---|
| 118 | } samr;
|
|---|
| 119 |
|
|---|
| 120 | struct {
|
|---|
| 121 | enum libnet_SetPassword_level level;
|
|---|
| 122 | struct _libnet_SetPassword_in in;
|
|---|
| 123 | struct _libnet_SetPassword_out out;
|
|---|
| 124 | } krb5;
|
|---|
| 125 |
|
|---|
| 126 | struct {
|
|---|
| 127 | enum libnet_SetPassword_level level;
|
|---|
| 128 | struct _libnet_SetPassword_in in;
|
|---|
| 129 | struct _libnet_SetPassword_out out;
|
|---|
| 130 | } ldap;
|
|---|
| 131 |
|
|---|
| 132 | struct {
|
|---|
| 133 | enum libnet_ChangePassword_level level;
|
|---|
| 134 | struct _libnet_SetPassword_in in;
|
|---|
| 135 | struct _libnet_SetPassword_out out;
|
|---|
| 136 | } rap;
|
|---|
| 137 | };
|
|---|