uni_full_name and uni_acct_desc in SAM_USER_INFO_21 swapped?

Jim McDonough jmcd at us.ibm.com
Tue Feb 20 20:47:53 GMT 2001


Ok, this is the exact same patch on the current (1:45PM MST) srv_samr_nt.c.
I didn't change the header file (a bit scarier).  I also didn't follow
Toomas' advice yet.  I'll work on both of those...

--- source/rpc_server/srv_samr_nt.c      Tue Feb 20 13:44:11 2001
+++ ../../mine/samba-2.2/source/rpc_server/srv_samr_nt.c     Tue Feb 20
13:42:14 2001
@@ -282,6 +282,7 @@
     /* now current_idx == start_idx */
     while ((*num_entries) < max_num_entries) {
          int user_name_len;
+         int full_name_len;
          char *unmap_name;

          /* This does the original UNIX user itself */
@@ -295,6 +296,7 @@
               }

               user_name_len = strlen(pwd->pw_name);
+              full_name_len = strlen(pwd->pw_gecos);

               /* skip the trust account stored in the /etc/passwd file */
               if (pwd->pw_name[user_name_len-1]=='$')
@@ -304,6 +306,10 @@
               ZERO_STRUCTP(&pw_buf[(*num_entries)]);
               init_unistr2(&pw_buf[(*num_entries)].uni_user_name,
pwd->pw_name, user_name_len);
               init_uni_hdr(&pw_buf[(*num_entries)].hdr_user_name,
user_name_len);
+              if (full_name_len) {
+                init_unistr2(&pw_buf[(*num_entries)].uni_acct_desc,
pwd->pw_gecos, full_name_len);
+                init_uni_hdr(&pw_buf[(*num_entries)].hdr_acct_desc,
full_name_len);
+              }
               pw_buf[(*num_entries)].user_rid = pw_rid;
               memset((char *)pw_buf[(*num_entries)].nt_pwd, '\0', 16);


----------------------------
Jim McDonough
Linux Technology Center
IBM Boulder

Notes: Jim McDonough/Boulder/IBM @ IBMUS
VNET: JMCD at IBMUSM54
Internet: jmcd at us.ibm.com

Phone: (303) 924-5822
T/L: 263-5822


Jeremy Allison <jeremy at valinux.com> on 02/20/2001 12:00:12 PM

To:   Jim McDonough/Boulder/IBM at IBMUS
cc:   samba-technical at samba.org
Subject:  Re: uni_full_name and uni_acct_desc in SAM_USER_INFO_21 swapped?



On Tue, Feb 20, 2001 at 11:51:57AM -0700, Jim McDonough wrote:
> I was trying to get Full Name to show up on User Manager for domains, on
> both NT4 and 2K, so I added some code to get_passwd_entries in
srv_samr.c.
> However, when I used uni_full_name, that text showed up in the
> "Description" column, and uni_acct_desc text showed up in the "Full Name"
> column in usrmgr.exe.  Is it possible these two fields are swapped?
>

Very possible. I'm currently merging the TNG code into
the 2.2 samr code (look at the new code in rpc_server/srv_samr_nt.c
for the implementation file) - can you send me a patch w.r.t.
that file ?

A warning though, I'm changing this code minute by minute...

Jeremy.

--
--------------------------------------------------------
Buying an operating system without source is like buying
a self-assembly Space Shuttle with no instructions.
--------------------------------------------------------







More information about the samba-technical mailing list