Print this page
MFV: illumos-gate@62f63298eba531d48f87aa8c2089298cb7821962
9881 smbd terminated by SIGABRT after smb_account_free()
Reviewed by: Gordon Ross <gordon.w.ross@gmail.com>
Reviewed by: Jason King <jason.brian.king@gmail.com>
Approved by: Dan McDonald <danmcd@joyent.com>
Author: Vitaliy Gusev <gusev.vitaliy@gmail.com>
Conflicts:
        usr/src/lib/smbsrv/libsmb/common/smb_sam.c
NEX-15052 Need a way to add appliance local user/group ACE from Windows
Reviewed by: Gordon Ross <gordon.ross@nexenta.com>
Reviewed by: Evan Layton <evan.layton@nexenta.com>
NEX-15052 Need a way to add appliance local user/group ACE from Windows
Reviewed by: Gordon Ross <gordon.ross@nexenta.com>
Reviewed by: Evan Layton <evan.layton@nexenta.com>
SMB-50 User-mode SMB server
 Includes work by these authors:
 Thomas Keiser <thomas.keiser@nexenta.com>
 Albert Lee <trisk@nexenta.com>

@@ -20,11 +20,12 @@
  */
 /*
  * Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  *
- * Copyright 2013 Nexenta Systems, Inc.  All rights reserved.
+ * Copyright 2017 Nexenta Systems, Inc.  All rights reserved.
+ * Copyright 2018 RackTop Systems.
  */
 
 #include <strings.h>
 #include <smbsrv/libsmb.h>
 

@@ -257,10 +258,11 @@
                         account->a_type = SidTypeUser;
                         if (smb_pwd_getpwuid(id, &smbpw) == NULL)
                                 return (NT_STATUS_NO_SUCH_USER);
 
                         account->a_name = strdup(smbpw.pw_name);
+                        account->a_flags = smbpw.pw_flags;
                         break;
 
                 case SMB_IDMAP_GROUP:
                         account->a_type = SidTypeAlias;
                         (void) smb_sid_getrid(sid, &rid);

@@ -475,18 +477,21 @@
         return (ismember);
 }
 
 /*
  * Frees memories allocated for the passed account fields.
+ * Initializes @account after all.
  */
 void
 smb_account_free(smb_account_t *account)
 {
         free(account->a_name);
         free(account->a_domain);
         smb_sid_free(account->a_sid);
         smb_sid_free(account->a_domsid);
+
+        bzero(account, sizeof (smb_account_t));
 }
 
 /*
  * Validates the given account.
  */