s4-python: Properly call PyObject_Del from all destructors.
[kai/samba.git] / source4 / libnet / libnet_user.h
index 2973915c008607b942dce99edd85596a15a31088..8203d14c337995f87e90aa23f69b6accdb7db117 100644 (file)
@@ -67,7 +67,7 @@ struct libnet_ModifyUser {
 
 #define SET_FIELD_LSA_STRING(new, current, mod, field, flag) \
        if (new.field != NULL && \
-           !strequal_w(current->field.string, new.field)) { \
+           !strequal_m(current->field.string, new.field)) { \
                \
                mod->field = talloc_strdup(mem_ctx, new.field); \
                if (mod->field == NULL) return NT_STATUS_NO_MEMORY; \
@@ -85,13 +85,37 @@ struct libnet_ModifyUser {
                } \
        }
 
+#define SET_FIELD_UINT32(new, current, mod, field, flag) \
+       if (current->field != new.field) { \
+               mod->field = new.field; \
+               mod->fields |= flag; \
+       }
+
+#define SET_FIELD_ACCT_FLAGS(new, current, mod, field, flag) \
+       if (new.field) { \
+               if (current->field != new.field) {      \
+                       mod->field = new.field;         \
+                       mod->fields |= flag;            \
+               }                                       \
+       }
+
+enum libnet_UserInfo_level {
+       USER_INFO_BY_NAME=0,
+       USER_INFO_BY_SID
+};
 
 struct libnet_UserInfo {
        struct {
-               const char *user_name;
                const char *domain_name;
+               enum libnet_UserInfo_level level;
+               union {
+                       const char *user_name;
+                       const struct dom_sid *user_sid;
+               } data;
        } in;
        struct {
+               struct dom_sid *user_sid;
+               struct dom_sid *primary_group_sid;
                const char *account_name;
                const char *full_name;
                const char *description;
@@ -107,7 +131,6 @@ struct libnet_UserInfo {
                struct timeval *last_logoff;
                struct timeval *last_password_change;
                uint32_t acct_flags;
-               
                const char *error_string;
        } out;
 };
@@ -117,11 +140,11 @@ struct libnet_UserList {
        struct {
                const char *domain_name;
                int page_size;
-               uint resume_index;
+               uint32_t resume_index;
        } in;
        struct {
                int count;
-               uint resume_index;
+               uint32_t resume_index;
 
                struct userlist {
                        const char *sid;