svn commit: samba r17335 - in branches/SAMBA_3_0/source/utils: .
vlendec at samba.org
vlendec at samba.org
Mon Jul 31 06:01:55 GMT 2006
Author: vlendec
Date: 2006-07-31 06:01:54 +0000 (Mon, 31 Jul 2006)
New Revision: 17335
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=17335
Log:
Some more fixes to net rpc vampire ldif. Still not good though :-(
Volker
Modified:
branches/SAMBA_3_0/source/utils/net_rpc_samsync.c
Changeset:
Modified: branches/SAMBA_3_0/source/utils/net_rpc_samsync.c
===================================================================
--- branches/SAMBA_3_0/source/utils/net_rpc_samsync.c 2006-07-31 04:30:55 UTC (rev 17334)
+++ branches/SAMBA_3_0/source/utils/net_rpc_samsync.c 2006-07-31 06:01:54 UTC (rev 17335)
@@ -1537,6 +1537,7 @@
fstring description, fullname, sambaSID;
uchar lm_passwd[16], nt_passwd[16];
char *flags, *user_rdn;
+ const char *ou;
const char* nopasswd = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
static uchar zero_buf[16];
uint32 rid = 0, group_rid = 0, gidNumber = 0;
@@ -1564,7 +1565,11 @@
} else {
pstr_sprintf(homedir, "/nobodyshomedir");
}
- }
+ ou = lp_ldap_user_suffix();
+ } else {
+ ou = lp_ldap_machine_suffix();
+ pstr_sprintf(homedir, "/machinehomedir");
+ }
/* Get the logon script */
unistr2_to_ascii(logonscript, &(delta->account_info.uni_logon_script),
@@ -1633,7 +1638,7 @@
/* Add the user to the temporary add ldif file */
/* this isn't quite right...we can't assume there's just OU=. jmcd */
- user_rdn = sstring_sub(lp_ldap_user_suffix(), '=', ',');
+ user_rdn = sstring_sub(ou, '=', ',');
fprintf(add_fd, "# %s, %s, %s\n", username, user_rdn, suffix);
fprintf_attr(add_fd, "dn", "uid=%s,ou=%s,%s", username, user_rdn,
suffix);
@@ -1645,10 +1650,10 @@
fprintf(add_fd, "objectClass: sambaSamAccount\n");
fprintf_attr(add_fd, "cn", "%s", username);
fprintf_attr(add_fd, "sn", "%s", username);
- fprintf_attr(add_fd, "uid" "%s", username);
+ fprintf_attr(add_fd, "uid", "%s", username);
fprintf(add_fd, "uidNumber: %d\n", ldif_uid);
fprintf(add_fd, "gidNumber: %d\n", gidNumber);
- fprintf_attr(add_fd, "homeDirectory", "%s\n", homedir);
+ fprintf_attr(add_fd, "homeDirectory", "%s", homedir);
if (*homepath)
fprintf_attr(add_fd, "sambaHomePath", "%s", homepath);
if (*homedrive)
@@ -1736,16 +1741,17 @@
/* Write the data to the temporary add ldif file */
fprintf(add_fd, "# %s, %s, %s\n", aliasname, group_attr,
suffix);
- fprintf(add_fd, "dn: cn=%s,ou=%s,%s\n", aliasname, group_attr,
- suffix);
+ fprintf_attr(add_fd, "dn", "cn=%s,ou=%s,%s", aliasname, group_attr,
+ suffix);
fprintf(add_fd, "objectClass: posixGroup\n");
fprintf(add_fd, "objectClass: sambaGroupMapping\n");
fprintf(add_fd, "cn: %s\n", aliasname);
fprintf(add_fd, "gidNumber: %d\n", ldif_gid);
fprintf(add_fd, "sambaSID: %s\n", groupmap->sambaSID);
fprintf(add_fd, "sambaGroupType: %d\n", grouptype);
- fprintf(add_fd, "displayName: %s\n", aliasname);
- fprintf(add_fd, "description: %s\n", description);
+ fprintf_attr(add_fd, "displayName", "%s", aliasname);
+ if (description[0])
+ fprintf_attr(add_fd, "description", "%s", description);
fprintf(add_fd, "\n");
fflush(add_fd);
More information about the samba-cvs
mailing list