smbmount и русские буковки... (rus samba smbfs charset patch)
Ключевые слова: rus, samba, smbfs, charset, patch, (найти похожие документы)
- RU.UNIX.LINUX (2:5077/15.22) -------------------------------- RU.UNIX.LINUX -
From : Sergey Suleimanov 2:5069/14.13 26 Feb 00 17:39:38
Subj : smbmount и русские буковки...
-------------------------------------------------------------------------------
>>>>> "Vladimir" == Vladimir Remnev writes:
VP> Так все-таки, где URL с патчами ?
Vladimir> Во-во, забодали, входит - не входит. Люди уже более месяца
Vladimir> ответ ждут.
Если согласен на quick&dirty, то вот:
diff -Nu fs/smbfs.orig/Makefile fs/smbfs/Makefile
- --- fs/smbfs.orig/Makefile Sun Oct 12 21:17:05 1997
+++ fs/smbfs/Makefile Wed Dec 29 14:29:00 1999
@@ -8,7 +8,7 @@
# Note 2! The CFLAGS definitions are now in the main makefile...
O_TARGET := smbfs.o
-O_OBJS := proc.o dir.o cache.o sock.o inode.o file.o ioctl.o
+O_OBJS := proc.o dir.o cache.o sock.o inode.o file.o ioctl.o rus_conv.o
M_OBJS := $(O_TARGET)
# If you want debugging output, please uncomment the following line
diff -Nu fs/smbfs.orig/proc.c fs/smbfs/proc.c
- --- fs/smbfs.orig/proc.c Thu Jan 6 20:04:48 2000
+++ fs/smbfs/proc.c Sat Jan 8 21:11:57 2000
@@ -170,6 +170,8 @@
if (server->opt.protocol <= SMB_PROTOCOL_COREPLUS)
str_upper(start, buf - start);
+ koi2dos(start);
+
return buf;
}
@@ -1317,6 +1319,8 @@
len--;
entry->len = len;
+ dos2koi(entry->name);
+
switch (server->opt.case_handling)
{
case SMB_CASE_UPPER:
@@ -1503,6 +1507,8 @@
printk("smb_decode_long_dirent: Unknown level %d\n", level);
result = p + WVAL(p, 0);
}
+
+ dos2koi(entry->name);
switch (server->opt.case_handling)
{
diff -Nu fs/smbfs.orig/rus_conv.c fs/smbfs/rus_conv.c
- --- fs/smbfs.orig/rus_conv.c Thu Jan 1 03:00:00 1970
+++ fs/smbfs/rus_conv.c Sat Jan 8 21:00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fd, 0xfa, 0xf6,
+ 0xcd, 0xba, 0xd5, 0xf1, 0xd6, 0xc9, 0xb8, 0xb7,
+ 0xbb, 0xd4, 0xd3, 0xc8, 0xbe, 0xbd, 0xbc, 0xc6,
+ 0xc7, 0xcc, 0xb5, 0xf0, 0xb6, 0xb9, 0xd1, 0xd2,
+ 0xcb, 0xcf, 0xd0, 0xca, 0xd8, 0xd7, 0xce, 0xfc,
+ 0xee, 0xa0, 0xa1, 0xe6, 0xa4, 0xa5, 0xe4, 0xa3,
+ 0xe5, 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae,
+ 0xaf, 0xef, 0xe0, 0xe1, 0xe2, 0xe3, 0xa6, 0xa2,
+ 0xec, 0xeb, 0xa7, 0xe8, 0xed, 0xe9, 0xe7, 0xea,
+ 0x9e, 0x80, 0x81, 0x96, 0x84, 0x85, 0x94, 0x83,
+ 0x95, 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x48, 0x8e,
+ 0x8f, 0x9f, 0x90, 0x91, 0x92, 0x93, 0x86, 0x82,
+ 0x9c, 0x9b, 0x87, 0x98, 0x9d, 0x99, 0x97, 0x9a
+};
+void dos2koi(unsigned char *text) {
+ unsigned char *txt;
+ for (txt=text;*txt;txt++)
+ if(*txt >= 0x80)
+ *txt = dos_koi8[*txt - 0x80];
+}
+void koi2dos(unsigned char *text) {
+ unsigned char *txt;
+ for (txt=text;*txt;txt++)
+ if(*txt >= 0x80)
+ *txt = koi8_dos[*txt - 0x80];
+}
--
Sergey Suleimanov
--- fs/smbfs.orig/Makefile Sun Oct 12 21:17:05 1997
* Origin: Euro-Asian Trade-Industrial Bank (2:5069/14.13@fidonet)