[Samba] how to submit patches ? (patch for pdb_xml.c included)
Ilia Chipitsine
ilia at paramon.ru
Thu Sep 16 06:47:39 GMT 2004
Dear Sirs,
I wrote a patch for pdbedit (pdb_xml.c) which handles cases with national
alphabet characters in GECOS fields. I sent it directly to Jelmer
Vernooij, but there was no answer.
Who can review the supplied patch ?
Cheers,
Ilia Chipitsine
-------------- next part --------------
--- pdb_xml.c.orig Tue Aug 31 12:12:02 2004
+++ pdb_xml.c Tue Aug 31 12:12:07 2004
@@ -373,6 +373,7 @@
fstring sid_str;
xmlNodePtr cur, user, pass, root;
pdb_xml *data;
+ char *fullname_utf8;
DEBUG(10, ("xmlsam_add_sam_account called!\n"));
@@ -427,8 +428,14 @@
if (pdb_get_nt_username(u) && strcmp(pdb_get_nt_username(u), ""))
xmlNewChild(user, data->ns, "nt_username", pdb_get_nt_username(u));
- if (pdb_get_fullname(u) && strcmp(pdb_get_fullname(u), ""))
- xmlNewChild(user, data->ns, "fullname", pdb_get_fullname(u));
+ if(push_utf8_allocate(&fullname_utf8,pdb_get_fullname(u)) == (size_t)-1){
+ return NT_STATUS_NO_MEMORY;
+ }
+
+ if (fullname_utf8 && strcmp(fullname_utf8, ""))
+ xmlNewChild(user, data->ns, "fullname", fullname_utf8);
+
+ SAFE_FREE(fullname_utf8);
if (pdb_get_homedir(u) && strcmp(pdb_get_homedir(u), ""))
xmlNewChild(user, data->ns, "homedir", pdb_get_homedir(u));
@@ -497,7 +504,7 @@
xmlNewChild(user, data->ns, "bad_password_count", iota(pdb_get_bad_password_count(u)));
xmlNewChild(user, data->ns, "logon_count", iota(pdb_get_logon_count(u)));
xmlNewChild(user, data->ns, "unknown_6", iota(pdb_get_unknown_6(u)));
- xmlSaveFile(data->location, data->doc);
+ xmlSaveFileEnc(data->location, data->doc,"UTF-8");
return NT_STATUS_OK;
}
More information about the samba
mailing list