svn commit: samba r11327 - branches/SAMBA_3_0/source/utils trunk/source/utils

vlendec at samba.org vlendec at samba.org
Thu Oct 27 12:47:09 GMT 2005


Author: vlendec
Date: 2005-10-27 12:47:06 +0000 (Thu, 27 Oct 2005)
New Revision: 11327

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=11327

Log:
Make user domain settable by pdbedit
Modified:
   branches/SAMBA_3_0/source/utils/pdbedit.c
   trunk/source/utils/pdbedit.c


Changeset:
Modified: branches/SAMBA_3_0/source/utils/pdbedit.c
===================================================================
--- branches/SAMBA_3_0/source/utils/pdbedit.c	2005-10-27 12:45:10 UTC (rev 11326)
+++ branches/SAMBA_3_0/source/utils/pdbedit.c	2005-10-27 12:47:06 UTC (rev 11327)
@@ -35,7 +35,7 @@
 #define BIT_LOGSCRIPT	0x00000800
 #define BIT_PROFILE	0x00001000
 #define BIT_MACHINE	0x00002000
-#define BIT_RESERV_4	0x00004000
+#define BIT_USERDOMAIN	0x00004000
 #define BIT_USER	0x00008000
 #define BIT_LIST	0x00010000
 #define BIT_MODIFY	0x00020000
@@ -52,7 +52,7 @@
 #define BIT_LOGONHOURS	0x10000000
 
 #define MASK_ALWAYS_GOOD	0x0000001F
-#define MASK_USER_GOOD		0x00401F60
+#define MASK_USER_GOOD		0x00405F60
 
 /*********************************************************
  Add all currently available users to another db
@@ -324,6 +324,7 @@
 			  const char *drive, const char *script, 
 			  const char *profile, const char *account_control,
 			  const char *user_sid, const char *group_sid,
+			  const char *user_domain,
 			  const BOOL badpw, const BOOL hours,
 			  time_t pwd_can_change, time_t pwd_must_change)
 {
@@ -378,6 +379,8 @@
 		pdb_set_logon_script(sam_pwent, script, PDB_CHANGED);
 	if (profile)
 		pdb_set_profile_path (sam_pwent, profile, PDB_CHANGED);
+	if (user_domain)
+		pdb_set_domain(sam_pwent, user_domain, PDB_CHANGED);
 
 	if (account_control) {
 		uint16 not_settable = ~(ACB_DISABLED|ACB_HOMDIRREQ|ACB_PWNOTREQ|
@@ -677,6 +680,7 @@
 	static BOOL  force_initialised_password = False;
 	static char *logon_script = NULL;
 	static char *profile_path = NULL;
+	static char *user_domain = NULL;
 	static char *account_control = NULL;
 	static char *account_policy = NULL;
 	static char *user_sid = NULL;
@@ -705,6 +709,7 @@
 		{"drive",	'D', POPT_ARG_STRING, &home_drive, 0, "set home drive", NULL},
 		{"script",	'S', POPT_ARG_STRING, &logon_script, 0, "set logon script", NULL},
 		{"profile",	'p', POPT_ARG_STRING, &profile_path, 0, "set profile path", NULL},
+		{"domain",	'I', POPT_ARG_STRING, &user_domain, 0, "set a users' domain", NULL},
 		{"user SID",	'U', POPT_ARG_STRING, &user_sid, 0, "set user SID or RID", NULL},
 		{"group SID",	'G', POPT_ARG_STRING, &group_sid, 0, "set group SID or RID", NULL},
 		{"create",	'a', POPT_ARG_NONE, &add_user, 0, "create user", NULL},
@@ -766,6 +771,7 @@
 			(home_drive ? BIT_HDIRDRIVE : 0) +
 			(logon_script ? BIT_LOGSCRIPT : 0) +
 			(profile_path ? BIT_PROFILE : 0) +
+			(user_domain ? BIT_USERDOMAIN : 0) +
 			(machine ? BIT_MACHINE : 0) +
 			(user_name ? BIT_USER : 0) +
 			(list_users ? BIT_LIST : 0) +
@@ -998,6 +1004,7 @@
 					      logon_script,
 					      profile_path, account_control,
 					      user_sid, group_sid,
+					      user_domain,
 					      badpw_reset, hours_reset,
 					      pwd_can_change, pwd_must_change);
 error:

Modified: trunk/source/utils/pdbedit.c
===================================================================
--- trunk/source/utils/pdbedit.c	2005-10-27 12:45:10 UTC (rev 11326)
+++ trunk/source/utils/pdbedit.c	2005-10-27 12:47:06 UTC (rev 11327)
@@ -35,7 +35,7 @@
 #define BIT_LOGSCRIPT	0x00000800
 #define BIT_PROFILE	0x00001000
 #define BIT_MACHINE	0x00002000
-#define BIT_RESERV_4	0x00004000
+#define BIT_USERDOMAIN	0x00004000
 #define BIT_USER	0x00008000
 #define BIT_LIST	0x00010000
 #define BIT_MODIFY	0x00020000
@@ -52,7 +52,7 @@
 #define BIT_LOGONHOURS	0x10000000
 
 #define MASK_ALWAYS_GOOD	0x0000001F
-#define MASK_USER_GOOD		0x00401F60
+#define MASK_USER_GOOD		0x00405F60
 
 /*********************************************************
  Add all currently available users to another db
@@ -324,6 +324,7 @@
 			  const char *drive, const char *script, 
 			  const char *profile, const char *account_control,
 			  const char *user_sid, const char *group_sid,
+			  const char *user_domain,
 			  const BOOL badpw, const BOOL hours,
 			  time_t pwd_can_change, time_t pwd_must_change)
 {
@@ -378,6 +379,8 @@
 		pdb_set_logon_script(sam_pwent, script, PDB_CHANGED);
 	if (profile)
 		pdb_set_profile_path (sam_pwent, profile, PDB_CHANGED);
+	if (user_domain)
+		pdb_set_domain(sam_pwent, user_domain, PDB_CHANGED);
 
 	if (account_control) {
 		uint16 not_settable = ~(ACB_DISABLED|ACB_HOMDIRREQ|ACB_PWNOTREQ|
@@ -677,6 +680,7 @@
 	static BOOL  force_initialised_password = False;
 	static char *logon_script = NULL;
 	static char *profile_path = NULL;
+	static char *user_domain = NULL;
 	static char *account_control = NULL;
 	static char *account_policy = NULL;
 	static char *user_sid = NULL;
@@ -705,6 +709,7 @@
 		{"drive",	'D', POPT_ARG_STRING, &home_drive, 0, "set home drive", NULL},
 		{"script",	'S', POPT_ARG_STRING, &logon_script, 0, "set logon script", NULL},
 		{"profile",	'p', POPT_ARG_STRING, &profile_path, 0, "set profile path", NULL},
+		{"domain",	'I', POPT_ARG_STRING, &user_domain, 0, "set a users' domain", NULL},
 		{"user SID",	'U', POPT_ARG_STRING, &user_sid, 0, "set user SID or RID", NULL},
 		{"group SID",	'G', POPT_ARG_STRING, &group_sid, 0, "set group SID or RID", NULL},
 		{"create",	'a', POPT_ARG_NONE, &add_user, 0, "create user", NULL},
@@ -766,6 +771,7 @@
 			(home_drive ? BIT_HDIRDRIVE : 0) +
 			(logon_script ? BIT_LOGSCRIPT : 0) +
 			(profile_path ? BIT_PROFILE : 0) +
+			(user_domain ? BIT_USERDOMAIN : 0) +
 			(machine ? BIT_MACHINE : 0) +
 			(user_name ? BIT_USER : 0) +
 			(list_users ? BIT_LIST : 0) +
@@ -998,6 +1004,7 @@
 					      logon_script,
 					      profile_path, account_control,
 					      user_sid, group_sid,
+					      user_domain,
 					      badpw_reset, hours_reset,
 					      pwd_can_change, pwd_must_change);
 error:



More information about the samba-cvs mailing list