svn commit: samba r16659 - in trunk/source: include libmsrpc passdb
rpc_parse rpc_server rpcclient
jerry at samba.org
jerry at samba.org
Wed Jun 28 22:23:09 GMT 2006
Author: jerry
Date: 2006-06-28 22:23:05 +0000 (Wed, 28 Jun 2006)
New Revision: 16659
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=16659
Log:
The NetUserSetInfo() calls > 1000 thunkn to set_user_info2(21)
on the wire.
level 1007 ==> sets the descriptions
level 1012 ==> sets the comment
Yes. description and comment are different strings.
MMC displays the description. Note that the ADMIN_DESC
and DESCRIPTION flasg in passdb.h were reversed.
Modified:
trunk/source/include/passdb.h
trunk/source/include/rpc_samr.h
trunk/source/libmsrpc/libmsrpc_internal.c
trunk/source/passdb/passdb.c
trunk/source/passdb/pdb_get_set.c
trunk/source/rpc_parse/parse_samr.c
trunk/source/rpc_server/srv_samr_nt.c
trunk/source/rpc_server/srv_samr_util.c
trunk/source/rpcclient/cmd_samr.c
Changeset:
Modified: trunk/source/include/passdb.h
===================================================================
--- trunk/source/include/passdb.h 2006-06-28 22:23:00 UTC (rev 16658)
+++ trunk/source/include/passdb.h 2006-06-28 22:23:05 UTC (rev 16659)
@@ -34,8 +34,8 @@
#define ACCT_FULL_NAME 0x00000002
#define ACCT_RID 0x00000004
#define ACCT_PRIMARY_GID 0x00000008
-#define ACCT_ADMIN_DESC 0x00000010
-#define ACCT_DESCRIPTION 0x00000020
+#define ACCT_DESCRIPTION 0x00000010
+#define ACCT_COMMENT 0x00000020
#define ACCT_HOME_DIR 0x00000040
#define ACCT_HOME_DRIVE 0x00000080
#define ACCT_LOGON_SCRIPT 0x00000100
@@ -90,7 +90,7 @@
PDB_UNIXHOMEDIR,
PDB_ACCTDESC,
PDB_WORKSTATIONS,
- PDB_UNKNOWNSTR,
+ PDB_COMMENT,
PDB_MUNGEDDIAL,
PDB_HOURS,
PDB_FIELDS_PRESENT,
@@ -160,7 +160,7 @@
const char *profile_path; /* profile path string */
const char *acct_desc; /* user description string */
const char *workstations; /* login from workstations string */
- const char *unknown_str; /* don't know what this is, yet. */
+ const char *comment;
const char *munged_dial; /* munged path name and dial-back tel number */
DOM_SID user_sid;
Modified: trunk/source/include/rpc_samr.h
===================================================================
--- trunk/source/include/rpc_samr.h 2006-06-28 22:23:00 UTC (rev 16658)
+++ trunk/source/include/rpc_samr.h 2006-06-28 22:23:05 UTC (rev 16659)
@@ -174,7 +174,7 @@
UNIHDR hdr_profile_path; /* profile path unicode string header */
UNIHDR hdr_acct_desc ; /* user description */
UNIHDR hdr_workstations; /* comma-separated workstations user can log in from */
- UNIHDR hdr_unknown_str ; /* don't know what this is, yet. */
+ UNIHDR hdr_comment;
UNIHDR hdr_munged_dial ; /* munged path name and dial-back tel number */
uint8 lm_pwd[16]; /* lm user passwords */
@@ -211,7 +211,7 @@
UNISTR2 uni_profile_path; /* profile path unicode string */
UNISTR2 uni_acct_desc ; /* user description unicode string */
UNISTR2 uni_workstations; /* login from workstations unicode string */
- UNISTR2 uni_unknown_str ; /* don't know what this is, yet. */
+ UNISTR2 uni_comment;
UNISTR2 uni_munged_dial ; /* munged path name and dial-back tel no */
LOGON_HRS logon_hrs;
@@ -250,7 +250,7 @@
UNIHDR hdr_profile_path; /* profile path unicode string header */
UNIHDR hdr_acct_desc ; /* user description */
UNIHDR hdr_workstations; /* comma-separated workstations user can log in from */
- UNIHDR hdr_unknown_str ; /* don't know what this is, yet. */
+ UNIHDR hdr_comment;
UNIHDR hdr_munged_dial ; /* munged path name and dial-back tel number */
uint8 lm_pwd[16]; /* lm user passwords */
@@ -274,7 +274,7 @@
UNISTR2 uni_profile_path; /* profile path unicode string */
UNISTR2 uni_acct_desc ; /* user description unicode string */
UNISTR2 uni_workstations; /* login from workstations unicode string */
- UNISTR2 uni_unknown_str ; /* don't know what this is, yet. */
+ UNISTR2 uni_comment;
UNISTR2 uni_munged_dial ; /* munged path name and dial-back tel no */
} SAM_USER_INFO_25;
@@ -304,7 +304,7 @@
UNIHDR hdr_profile_path; /* profile path unicode string header */
UNIHDR hdr_acct_desc ; /* user description */
UNIHDR hdr_workstations; /* comma-separated workstations user can log in from */
- UNIHDR hdr_unknown_str ; /* don't know what this is, yet. */
+ UNIHDR hdr_comment;
UNIHDR hdr_munged_dial ; /* munged path name and dial-back tel number */
uint8 lm_pwd[16]; /* lm user passwords */
@@ -340,7 +340,7 @@
UNISTR2 uni_profile_path; /* profile path unicode string */
UNISTR2 uni_acct_desc ; /* user description unicode string */
UNISTR2 uni_workstations; /* login from workstations unicode string */
- UNISTR2 uni_unknown_str ; /* don't know what this is, yet. */
+ UNISTR2 uni_comment;
UNISTR2 uni_munged_dial ; /* munged path name and dial-back tel number */
LOGON_HRS logon_hrs;
Modified: trunk/source/libmsrpc/libmsrpc_internal.c
===================================================================
--- trunk/source/libmsrpc/libmsrpc_internal.c 2006-06-28 22:23:00 UTC (rev 16658)
+++ trunk/source/libmsrpc/libmsrpc_internal.c 2006-06-28 22:23:05 UTC (rev 16659)
@@ -327,7 +327,7 @@
SAM_USERINFO_CTR *ctr = NULL;
/*the flags we are 'setting'- include/passdb.h*/
- uint32 flags = ACCT_USERNAME | ACCT_FULL_NAME | ACCT_PRIMARY_GID | ACCT_ADMIN_DESC | ACCT_DESCRIPTION |
+ uint32 flags = ACCT_USERNAME | ACCT_FULL_NAME | ACCT_PRIMARY_GID | ACCT_DESCRIPTION | ACCT_COMMENT |
ACCT_HOME_DIR | ACCT_HOME_DRIVE | ACCT_LOGON_SCRIPT | ACCT_PROFILE | ACCT_WORKSTATIONS |
ACCT_FLAGS;
Modified: trunk/source/passdb/passdb.c
===================================================================
--- trunk/source/passdb/passdb.c 2006-06-28 22:23:00 UTC (rev 16658)
+++ trunk/source/passdb/passdb.c 2006-06-28 22:23:05 UTC (rev 16659)
@@ -111,7 +111,7 @@
user->profile_path = "";
user->acct_desc = "";
user->workstations = "";
- user->unknown_str = "";
+ user->comment = "";
user->munged_dial = "";
user->plaintext_pw = NULL;
Modified: trunk/source/passdb/pdb_get_set.c
===================================================================
--- trunk/source/passdb/pdb_get_set.c 2006-06-28 22:23:00 UTC (rev 16658)
+++ trunk/source/passdb/pdb_get_set.c 2006-06-28 22:23:05 UTC (rev 16659)
@@ -288,9 +288,9 @@
return sampass->workstations;
}
-const char *pdb_get_unknown_str(const struct samu *sampass)
+const char *pdb_get_comment(const struct samu *sampass)
{
- return sampass->unknown_str;
+ return sampass->comment;
}
const char *pdb_get_munged_dial(const struct samu *sampass)
@@ -752,23 +752,22 @@
}
/*********************************************************************
- Set the user's 'unknown_str', whatever the heck this actually is...
********************************************************************/
-BOOL pdb_set_unknown_str(struct samu *sampass, const char *unknown_str, enum pdb_value_state flag)
+BOOL pdb_set_comment(struct samu *sampass, const char *comment, enum pdb_value_state flag)
{
- if (unknown_str) {
- sampass->unknown_str = talloc_strdup(sampass, unknown_str);
+ if (comment) {
+ sampass->comment = talloc_strdup(sampass, comment);
- if (!sampass->unknown_str) {
- DEBUG(0, ("pdb_set_unknown_str: talloc_strdup() failed!\n"));
+ if (!sampass->comment) {
+ DEBUG(0, ("pdb_set_comment: talloc_strdup() failed!\n"));
return False;
}
} else {
- sampass->unknown_str = PDB_NOT_QUITE_NULL;
+ sampass->comment = PDB_NOT_QUITE_NULL;
}
- return pdb_set_init_flags(sampass, PDB_UNKNOWNSTR, flag);
+ return pdb_set_init_flags(sampass, PDB_COMMENT, flag);
}
/*********************************************************************
Modified: trunk/source/rpc_parse/parse_samr.c
===================================================================
--- trunk/source/rpc_parse/parse_samr.c 2006-06-28 22:23:00 UTC (rev 16658)
+++ trunk/source/rpc_parse/parse_samr.c 2006-06-28 22:23:05 UTC (rev 16659)
@@ -5741,8 +5741,8 @@
copy_unistr2(&usr->uni_workstations, wkstas);
init_uni_hdr(&usr->hdr_workstations, &usr->uni_workstations);
- copy_unistr2(&usr->uni_unknown_str, unk_str);
- init_uni_hdr(&usr->hdr_unknown_str, &usr->uni_unknown_str);
+ copy_unistr2(&usr->uni_comment, unk_str);
+ init_uni_hdr(&usr->hdr_comment, &usr->uni_comment);
copy_unistr2(&usr->uni_munged_dial, mung_dial);
init_uni_hdr(&usr->hdr_munged_dial, &usr->uni_munged_dial);
@@ -5835,8 +5835,8 @@
init_unistr2(&usr->uni_workstations, wkstas, UNI_FLAGS_NONE);
init_uni_hdr(&usr->hdr_workstations, &usr->uni_workstations);
- init_unistr2(&usr->uni_unknown_str, unk_str, UNI_FLAGS_NONE);
- init_uni_hdr(&usr->hdr_unknown_str, &usr->uni_unknown_str);
+ init_unistr2(&usr->uni_comment, unk_str, UNI_FLAGS_NONE);
+ init_uni_hdr(&usr->hdr_comment, &usr->uni_comment);
init_unistr2_from_datablob(&usr->uni_munged_dial, &blob);
init_uni_hdr(&usr->hdr_munged_dial, &usr->uni_munged_dial);
@@ -5895,7 +5895,7 @@
return False;
if(!smb_io_unihdr("hdr_workstations", &usr->hdr_workstations, ps, depth)) /* wkstas user can log on from */
return False;
- if(!smb_io_unihdr("hdr_unknown_str ", &usr->hdr_unknown_str, ps, depth)) /* unknown string */
+ if(!smb_io_unihdr("hdr_comment ", &usr->hdr_comment, ps, depth)) /* unknown string */
return False;
if(!smb_io_unihdr("hdr_munged_dial ", &usr->hdr_munged_dial, ps, depth)) /* wkstas user can log on from */
return False;
@@ -5963,7 +5963,7 @@
if(!smb_io_unistr2("uni_workstations", &usr->uni_workstations, usr->hdr_workstations.buffer, ps, depth)) /* worksations user can log on from */
return False;
- if(!smb_io_unistr2("uni_unknown_str ", &usr->uni_unknown_str, usr->hdr_unknown_str.buffer, ps, depth)) /* unknown string */
+ if(!smb_io_unistr2("uni_comment ", &usr->uni_comment, usr->hdr_comment.buffer, ps, depth)) /* unknown string */
return False;
if(!smb_io_unistr2("uni_munged_dial ", &usr->uni_munged_dial, usr->hdr_munged_dial.buffer, ps, depth))
@@ -6025,7 +6025,7 @@
return False;
if(!smb_io_unihdr("hdr_workstations", &usr->hdr_workstations, ps, depth)) /* wkstas user can log on from */
return False;
- if(!smb_io_unihdr("hdr_unknown_str ", &usr->hdr_unknown_str, ps, depth)) /* unknown string */
+ if(!smb_io_unihdr("hdr_comment ", &usr->hdr_comment, ps, depth)) /* unknown string */
return False;
if(!smb_io_unihdr("hdr_munged_dial ", &usr->hdr_munged_dial, ps, depth)) /* wkstas user can log on from */
return False;
@@ -6076,7 +6076,7 @@
if(!smb_io_unistr2("uni_workstations", &usr->uni_workstations, usr->hdr_workstations.buffer, ps, depth)) /* worksations user can log on from */
return False;
- if(!smb_io_unistr2("uni_unknown_str ", &usr->uni_unknown_str, usr->hdr_unknown_str.buffer, ps, depth)) /* unknown string */
+ if(!smb_io_unistr2("uni_comment ", &usr->uni_comment, usr->hdr_comment.buffer, ps, depth)) /* unknown string */
return False;
if(!smb_io_unistr2("uni_munged_dial ", &usr->uni_munged_dial, usr->hdr_munged_dial.buffer, ps, depth))
@@ -6182,8 +6182,8 @@
copy_unistr2(&usr->uni_workstations, wkstas);
init_uni_hdr(&usr->hdr_workstations, &usr->uni_workstations);
- copy_unistr2(&usr->uni_unknown_str, unk_str);
- init_uni_hdr(&usr->hdr_unknown_str, &usr->uni_unknown_str);
+ copy_unistr2(&usr->uni_comment, unk_str);
+ init_uni_hdr(&usr->hdr_comment, &usr->uni_comment);
copy_unistr2(&usr->uni_munged_dial, mung_dial);
init_uni_hdr(&usr->hdr_munged_dial, &usr->uni_munged_dial);
@@ -6331,8 +6331,8 @@
init_unistr2(&usr->uni_workstations, workstations, UNI_STR_TERMINATE);
init_uni_hdr(&usr->hdr_workstations, &usr->uni_workstations);
- init_unistr2(&usr->uni_unknown_str, NULL, UNI_STR_TERMINATE);
- init_uni_hdr(&usr->hdr_unknown_str, &usr->uni_unknown_str);
+ init_unistr2(&usr->uni_comment, NULL, UNI_STR_TERMINATE);
+ init_uni_hdr(&usr->hdr_comment, &usr->uni_comment);
init_unistr2_from_datablob(&usr->uni_munged_dial, &munged_dial_blob);
init_uni_hdr(&usr->hdr_munged_dial, &usr->uni_munged_dial);
@@ -6398,7 +6398,7 @@
return False;
if(!smb_io_unihdr("hdr_workstations", &usr->hdr_workstations, ps, depth)) /* wkstas user can log on from */
return False;
- if(!smb_io_unihdr("hdr_unknown_str ", &usr->hdr_unknown_str, ps, depth)) /* unknown string */
+ if(!smb_io_unihdr("hdr_comment ", &usr->hdr_comment, ps, depth)) /* unknown string */
return False;
if(!smb_io_unihdr("hdr_munged_dial ", &usr->hdr_munged_dial, ps, depth)) /* wkstas user can log on from */
return False;
@@ -6438,25 +6438,25 @@
/* here begins pointed-to data */
- if(!smb_io_unistr2("uni_user_name ", &usr->uni_user_name,usr->hdr_user_name.buffer, ps, depth)) /* username unicode string */
+ if(!smb_io_unistr2("uni_user_name ", &usr->uni_user_name,usr->hdr_user_name.buffer, ps, depth))
return False;
- if(!smb_io_unistr2("uni_full_name ", &usr->uni_full_name, usr->hdr_full_name.buffer, ps, depth)) /* user's full name unicode string */
+ if(!smb_io_unistr2("uni_full_name ", &usr->uni_full_name, usr->hdr_full_name.buffer, ps, depth))
return False;
- if(!smb_io_unistr2("uni_home_dir ", &usr->uni_home_dir, usr->hdr_home_dir.buffer, ps, depth)) /* home directory unicode string */
+ if(!smb_io_unistr2("uni_home_dir ", &usr->uni_home_dir, usr->hdr_home_dir.buffer, ps, depth))
return False;
- if(!smb_io_unistr2("uni_dir_drive ", &usr->uni_dir_drive, usr->hdr_dir_drive.buffer, ps, depth)) /* home directory drive unicode string */
+ if(!smb_io_unistr2("uni_dir_drive ", &usr->uni_dir_drive, usr->hdr_dir_drive.buffer, ps, depth))
return False;
- if(!smb_io_unistr2("uni_logon_script", &usr->uni_logon_script, usr->hdr_logon_script.buffer, ps, depth)) /* logon script unicode string */
+ if(!smb_io_unistr2("uni_logon_script", &usr->uni_logon_script, usr->hdr_logon_script.buffer, ps, depth))
return False;
- if(!smb_io_unistr2("uni_profile_path", &usr->uni_profile_path, usr->hdr_profile_path.buffer, ps, depth)) /* profile path unicode string */
+ if(!smb_io_unistr2("uni_profile_path", &usr->uni_profile_path, usr->hdr_profile_path.buffer, ps, depth))
return False;
- if(!smb_io_unistr2("uni_acct_desc ", &usr->uni_acct_desc, usr->hdr_acct_desc.buffer, ps, depth)) /* user desc unicode string */
+ if(!smb_io_unistr2("uni_acct_desc ", &usr->uni_acct_desc, usr->hdr_acct_desc.buffer, ps, depth))
return False;
- if(!smb_io_unistr2("uni_workstations", &usr->uni_workstations, usr->hdr_workstations.buffer, ps, depth)) /* worksations user can log on from */
+ if(!smb_io_unistr2("uni_workstations", &usr->uni_workstations, usr->hdr_workstations.buffer, ps, depth))
return False;
- if(!smb_io_unistr2("uni_unknown_str ", &usr->uni_unknown_str, usr->hdr_unknown_str.buffer, ps, depth)) /* unknown string */
+ if(!smb_io_unistr2("uni_comment", &usr->uni_comment, usr->hdr_comment.buffer, ps, depth))
return False;
- if(!smb_io_unistr2("uni_munged_dial ", &usr->uni_munged_dial,usr->hdr_munged_dial.buffer, ps, depth)) /* worksations user can log on from */
+ if(!smb_io_unistr2("uni_munged_dial ", &usr->uni_munged_dial,usr->hdr_munged_dial.buffer, ps, depth))
return False;
/* ok, this is only guess-work (as usual) */
Modified: trunk/source/rpc_server/srv_samr_nt.c
===================================================================
--- trunk/source/rpc_server/srv_samr_nt.c 2006-06-28 22:23:00 UTC (rev 16658)
+++ trunk/source/rpc_server/srv_samr_nt.c 2006-06-28 22:23:05 UTC (rev 16659)
@@ -3103,9 +3103,11 @@
}
/* we need to separately check for an account rename first */
+
if (rpcstr_pull(new_name, id21->uni_user_name.buffer,
- sizeof(new_name), id21->uni_user_name.uni_str_len*2, 0) &&
- (!strequal(new_name, pdb_get_username(pwd)))) {
+ sizeof(new_name), id21->uni_user_name.uni_str_len*2, 0)
+ && (!strequal(new_name, pdb_get_username(pwd))))
+ {
/* check to see if the new username already exists. Note: we can't
reliably lock all backends, so there is potentially the
Modified: trunk/source/rpc_server/srv_samr_util.c
===================================================================
--- trunk/source/rpc_server/srv_samr_util.c 2006-06-28 22:23:00 UTC (rev 16658)
+++ trunk/source/rpc_server/srv_samr_util.c 2006-06-28 22:23:05 UTC (rev 16659)
@@ -195,14 +195,13 @@
pdb_set_workstations(to , new_string, PDB_CHANGED);
}
- /* is this right? */
- if ((from->fields_present & ACCT_ADMIN_DESC) &&
- (from->hdr_unknown_str.buffer)) {
- old_string = pdb_get_unknown_str(to);
- new_string = unistr2_static(&from->uni_unknown_str);
- DEBUG(10,("INFO_21 UNI_UNKNOWN_STR: %s -> %s\n",old_string, new_string));
+ if ((from->fields_present & ACCT_COMMENT) &&
+ (from->hdr_comment.buffer)) {
+ old_string = pdb_get_comment(to);
+ new_string = unistr2_static(&from->uni_comment);
+ DEBUG(10,("INFO_21 UNI_COMMENT: %s -> %s\n",old_string, new_string));
if (STRING_CHANGED)
- pdb_set_unknown_str(to , new_string, PDB_CHANGED);
+ pdb_set_comment(to, new_string, PDB_CHANGED);
}
if ((from->fields_present & ACCT_CALLBACK) &&
@@ -445,14 +444,13 @@
pdb_set_workstations(to , new_string, PDB_CHANGED);
}
- /* is this right? */
- if ((from->fields_present & ACCT_ADMIN_DESC) &&
- (from->hdr_unknown_str.buffer)) {
- old_string = pdb_get_unknown_str(to);
- new_string = unistr2_static(&from->uni_unknown_str);
+ if ((from->fields_present & ACCT_COMMENT) &&
+ (from->hdr_comment.buffer)) {
+ old_string = pdb_get_comment(to);
+ new_string = unistr2_static(&from->uni_comment);
DEBUG(10,("INFO_23 UNI_UNKNOWN_STR: %s -> %s\n",old_string, new_string));
if (STRING_CHANGED)
- pdb_set_unknown_str(to , new_string, PDB_CHANGED);
+ pdb_set_comment(to , new_string, PDB_CHANGED);
}
if ((from->fields_present & ACCT_CALLBACK) &&
@@ -683,14 +681,13 @@
pdb_set_workstations(to , new_string, PDB_CHANGED);
}
- /* is this right? */
- if ((from->fields_present & ACCT_ADMIN_DESC) &&
- (from->hdr_unknown_str.buffer)) {
- old_string = pdb_get_unknown_str(to);
- new_string = unistr2_static(&from->uni_unknown_str);
+ if ((from->fields_present & ACCT_COMMENT) &&
+ (from->hdr_comment.buffer)) {
+ old_string = pdb_get_comment(to);
+ new_string = unistr2_static(&from->uni_comment);
DEBUG(10,("INFO_25 UNI_UNKNOWN_STR: %s -> %s\n",old_string, new_string));
if (STRING_CHANGED)
- pdb_set_unknown_str(to , new_string, PDB_CHANGED);
+ pdb_set_comment(to , new_string, PDB_CHANGED);
}
if ((from->fields_present & ACCT_CALLBACK) &&
Modified: trunk/source/rpcclient/cmd_samr.c
===================================================================
--- trunk/source/rpcclient/cmd_samr.c 2006-06-28 22:23:00 UTC (rev 16658)
+++ trunk/source/rpcclient/cmd_samr.c 2006-06-28 22:23:05 UTC (rev 16659)
@@ -77,7 +77,7 @@
unistr2_to_ascii(temp, &usr->uni_workstations, sizeof(temp)-1);
printf("\tWorkstations:\t%s\n", temp);
- unistr2_to_ascii(temp, &usr->uni_unknown_str, sizeof(temp)-1);
+ unistr2_to_ascii(temp, &usr->uni_comment, sizeof(temp)-1);
printf("\tUnknown Str :\t%s\n", temp);
unistr2_to_ascii(temp, &usr->uni_munged_dial, sizeof(temp)-1);
More information about the samba-cvs
mailing list