]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3:rpc_server: Add copy_pwd_expired_to_sam_passwd() for SAMR
authorAndreas Schneider <asn@samba.org>
Sun, 22 Aug 2021 16:37:28 +0000 (18:37 +0200)
committerAndreas Schneider <asn@cryptomilk.org>
Thu, 28 Jul 2022 11:51:29 +0000 (11:51 +0000)
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
source3/rpc_server/samr/srv_samr_util.c
source3/rpc_server/samr/srv_samr_util.h

index e48c020e85404380636b65f18a92806942208ab7..c7aead08161a74b2181e695827c4e7b3c082cf0a 100644 (file)
@@ -751,3 +751,18 @@ void copy_id26_to_sam_passwd(struct samu *to,
 
        copy_id21_to_sam_passwd("INFO_26", to, &i);
 }
+
+void copy_pwd_expired_to_sam_passwd(struct samu *to,
+                                   uint8_t password_expired)
+{
+       struct samr_UserInfo21 i = {
+               .fields_present = SAMR_FIELD_EXPIRED_FLAG,
+               .password_expired = password_expired,
+       };
+
+       if (to == NULL) {
+               return;
+       }
+
+       copy_id21_to_sam_passwd("INFO_GENERIC", to, &i);
+}
index c0c4808f330ef3ad08c7e050fc471bbee0c4fc05..6263c8690dcdb892e143fb315391d7125046aa81 100644 (file)
@@ -63,6 +63,8 @@ void copy_id25_to_sam_passwd(struct samu *to,
                             struct samr_UserInfo25 *from);
 void copy_id26_to_sam_passwd(struct samu *to,
                             struct samr_UserInfo26 *from);
+void copy_pwd_expired_to_sam_passwd(struct samu *to,
+                                   uint8_t password_expired);
 
 /* The following definitions come from rpc_server/srv_samr_chgpasswd.c  */