*/
struct samr_LogonHours samdb_result_logon_hours(TALLOC_CTX *mem_ctx, struct ldb_message *msg, const char *attr)
{
- struct samr_LogonHours hours;
+ struct samr_LogonHours hours = {};
size_t units_per_week = 168;
const struct ldb_val *val = ldb_msg_find_ldb_val(msg, attr);
- ZERO_STRUCT(hours);
-
if (val) {
units_per_week = val->length * 8;
}
static int setup_supplemental_field(struct setup_password_fields_io *io)
{
struct ldb_context *ldb;
- struct supplementalCredentialsBlob scb;
+ struct supplementalCredentialsBlob scb = {};
struct supplementalCredentialsBlob *old_scb = NULL;
/*
* Packages +
* WDigest, CLEARTEXT, userPassword, SambaGPG)
*/
uint32_t num_names = 0;
- const char *names[1+NUM_PACKAGES];
+ const char *names[1+NUM_PACKAGES] = {};
uint32_t num_packages = 0;
- struct supplementalCredentialsPackage packages[1+NUM_PACKAGES];
+ struct supplementalCredentialsPackage packages[1+NUM_PACKAGES] = {};
struct supplementalCredentialsPackage *pp = packages;
int ret;
enum ndr_err_code ndr_err;
bool do_samba_gpg = false;
struct loadparm_context *lp_ctx = NULL;
- ZERO_STRUCT(names);
- ZERO_STRUCT(packages);
-
ldb = ldb_module_get_ctx(io->ac->module);
lp_ctx = talloc_get_type(ldb_get_opaque(ldb, "loadparm"),
struct loadparm_context);
*prev = *pp;
*pp = temp;
- ZERO_STRUCT(scb);
scb.sub.signature = SUPPLEMENTAL_CREDENTIALS_SIGNATURE;
scb.sub.num_packages = num_packages;
scb.sub.packages = packages;
struct dom_sid *account_sid = NULL;
int rodc_krbtgt = 0;
- ZERO_STRUCTP(io);
+ *io = (struct setup_password_fields_io) {};
/* Some operations below require kerberos contexts */