]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
netapi: fix acct_flags handling in convert_USER_INFO_X_to_samr_user_info21.
authorGünther Deschner <gd@samba.org>
Tue, 26 Aug 2008 23:36:06 +0000 (01:36 +0200)
committerGünther Deschner <gd@samba.org>
Fri, 29 Aug 2008 11:57:55 +0000 (13:57 +0200)
Guenther

source/lib/netapi/user.c

index 70bb353317fbd26ca9b55b4ef973df4426bcc72a..8fa0710dc166f8af43169f3f7e1ee6b147a2b2c8 100644 (file)
 static void convert_USER_INFO_X_to_samr_user_info21(struct USER_INFO_X *infoX,
                                                    struct samr_UserInfo21 *info21)
 {
-       uint32_t fields_present = SAMR_FIELD_ACCT_FLAGS;
+       uint32_t fields_present = 0;
        struct samr_LogonHours zero_logon_hours;
        struct lsa_BinaryString zero_parameters;
-       uint32_t acct_flags = 0;
        NTTIME password_age;
 
        ZERO_STRUCTP(info21);
        ZERO_STRUCT(zero_logon_hours);
        ZERO_STRUCT(zero_parameters);
 
+       if (infoX->usriX_flags) {
+               fields_present |= SAMR_FIELD_ACCT_FLAGS;
+       }
        if (infoX->usriX_name) {
                fields_present |= SAMR_FIELD_ACCOUNT_NAME;
        }
@@ -68,8 +70,6 @@ static void convert_USER_INFO_X_to_samr_user_info21(struct USER_INFO_X *infoX,
                fields_present |= SAMR_FIELD_FULL_NAME;
        }
 
-       acct_flags |= infoX->usriX_flags | ACB_NORMAL;
-
        unix_to_nt_time_abs(&password_age, infoX->usriX_password_age);
 
        /* TODO: infoX->usriX_priv */
@@ -92,7 +92,7 @@ static void convert_USER_INFO_X_to_samr_user_info21(struct USER_INFO_X *infoX,
                              &zero_parameters,
                              0,
                              0,
-                             acct_flags,
+                             infoX->usriX_flags,
                              fields_present,
                              zero_logon_hours,
                              0,
@@ -359,6 +359,8 @@ WERROR NetUserAdd_r(struct libnetapi_ctx *ctx,
                goto done;
        }
 
+       uX.usriX_flags |= ACB_NORMAL;
+
        status = set_user_info_USER_INFO_X(ctx, pipe_cli,
                                           &cli->user_session_key,
                                           &user_handle,