Netapp in Samba NT domain
Oleg Polyakov
pol at ecircles.com
Thu Aug 12 23:11:15 GMT 1999
I had problems with Netapp filer - it did
not want to enter Samba NT domain.
For now problem is solved.
I hope solution could help somebody.
The version of filer OS is 5.5.2.
I'm using FreeBSD 2.2.8 and Samba HEAD branch.
The source text in Samba 2.0.5 is approximately
same.
Problem:
Netapp filer couldn't enter Samba NT
domain.
Explanation:
1.Netapp sends TconX request in unicode, not ascii.
2.Netapp send SMBtrans request in unicode, not ascii.
Solution:
The patch is looks like this:
*** reply.c.orig Thu Aug 12 15:02:14 1999
--- reply.c Fri Aug 6 17:34:52 1999
***************
*** 303,307 ****
char *path;
char *p;
!
*service = *user = *password = *devicename = 0;
--- 303,309 ----
char *path;
char *p;
! int i;
! pstring upath;
!
*service = *user = *password = *devicename = 0;
***************
*** 323,326 ****
--- 325,340 ----
*password = 0;
passlen = strlen(password);
+ }
+
+ /* Netapp unicode issues */
+
+ if ((*path=='\\')&&(*(path+1)=='\0')) { /* unicode */
+ for(i=0;i<smb_buflen(inbuf)-passlen;i=i+2) {
+ if (*(path+i))=='\0') break;
+ strncat(service,path+i,1);
+ }
+ fstrcpy(upath,service);
+
memcpy(upath+strlen(upath)+1,path+i+2,smb_buflen(inbuf)-passlen-i-2);
+ path = upath;
}
*** ipc.c.orig Thu Aug 12 15:02:01 1999
--- ipc.c Fri Aug 6 17:37:43 1999
***************
*** 3509,3514 ****
--- 3509,3525 ----
int suwcnt = CVAL(inbuf,smb_vwv13);
+ int i;
+
bzero(name, sizeof(name));
fstrcpy(name,smb_buf(inbuf));
+
+ /* Netapp unicode issues */
+
+ if ((*smb_buf(inbuf)=='\0')&&(*(smb_buf(inbuf)+1)=='\\')) {
+ for(i=1;i<smb_buflen(inbuf);i=i+2) {
+ if (*(smb_buf(inbuf)+i)=='\0') break;
+ strncat(name,smb_buf(inbuf)+i,1);
+ }
+ }
if (dscnt > tdscnt || pscnt > tpscnt) {
Oleg Polyakov
pol at ecircles.com
More information about the samba-ntdom
mailing list