#include "libnet/libnet_samsync.h"
#include "../libcli/security/security.h"
#include "passdb.h"
+#include "lib/util/base64.h"
/* Convert a struct samu_DELTA to a struct samu. */
#define STRING_CHANGED (old_string && !new_string) ||\
if (r->parameters.array) {
DATA_BLOB mung;
- char *newstr;
+ char *newstr = NULL;
old_string = pdb_get_munged_dial(account);
mung.length = r->parameters.length * 2;
mung.data = (uint8_t *) r->parameters.array;
- newstr = (mung.length == 0) ? NULL :
- base64_encode_data_blob(talloc_tos(), mung);
+
+ if (mung.length != 0) {
+ newstr = base64_encode_data_blob(talloc_tos(), mung);
+ SMB_ASSERT(newstr != NULL);
+ }
if (STRING_CHANGED_NC(old_string, newstr))
pdb_set_munged_dial(account, newstr, PDB_CHANGED);
/* Create appropriate user */
if (acct_flags & ACB_NORMAL) {
- add_script = lp_adduser_script(mem_ctx);
+ add_script = lp_add_user_script(mem_ctx);
} else if ( (acct_flags & ACB_WSTRUST) ||
(acct_flags & ACB_SVRTRUST) ||
(acct_flags & ACB_DOMTRUST) ) {
nt_errstr(status));
}
- u_max_age = uint64s_nt_time_to_unix_abs((uint64 *)&r->max_password_age);
- u_min_age = uint64s_nt_time_to_unix_abs((uint64 *)&r->min_password_age);
- u_logout = uint64s_nt_time_to_unix_abs((uint64 *)&r->force_logoff_time);
+ u_max_age = uint64s_nt_time_to_unix_abs((uint64_t *)&r->max_password_age);
+ u_min_age = uint64s_nt_time_to_unix_abs((uint64_t *)&r->min_password_age);
+ u_logout = uint64s_nt_time_to_unix_abs((uint64_t *)&r->force_logoff_time);
domname = r->domain_name.string;
if (!domname) {
return nt_status;
if (!pdb_set_account_policy(PDB_POLICY_MAX_PASSWORD_AGE,
- (uint32)u_max_age))
+ (uint32_t)u_max_age))
return nt_status;
if (!pdb_set_account_policy(PDB_POLICY_MIN_PASSWORD_AGE,
- (uint32)u_min_age))
+ (uint32_t)u_min_age))
return nt_status;
if (!pdb_set_account_policy(PDB_POLICY_TIME_TO_LOGOUT,
- (uint32)u_logout))
+ (uint32_t)u_logout))
return nt_status;
if (lockstr) {