diff options
author | Samba Release Account <samba-bugs@samba.org> | 1997-01-09 18:02:17 +0000 |
---|---|---|
committer | Samba Release Account <samba-bugs@samba.org> | 1997-01-09 18:02:17 +0000 |
commit | 8bc7d6bebd4fcf8c95cb6d58da14404a5e46de91 (patch) | |
tree | 177e5074c6a987134ff6f4019d6c482b92c70509 /source3/lib | |
parent | 43d414b4508ea46252aed52341d29dae007bb93b (diff) | |
download | samba-8bc7d6bebd4fcf8c95cb6d58da14404a5e46de91.tar.gz samba-8bc7d6bebd4fcf8c95cb6d58da14404a5e46de91.tar.bz2 samba-8bc7d6bebd4fcf8c95cb6d58da14404a5e46de91.zip |
Makefile: Changes to split Solaris into Solaris2.3 and previous, and 2.4 and after from Paul Eggert.
Makefile: Added AMIGA changes from Rask Ingemann Lambertsen <rask@k4315.kampsax.dtu.dk>.
charset.c: Patch for Western European Languages from Josef Hinteregger <joehtg@joehtg.co.at>
charset.h: Patch for Western European Languages from Josef Hinteregger <joehtg@joehtg.co.at>
clitar.c: Patch to re-sync after read fail from (lost contributor name, sorry).
includes.h: Patch for AMIGA from Rask Ingemann Lambertsen <rask@k4315.kampsax.dtu.dk>
includes.h: Patch for SunOS atexit by Jeremy (jra@cygnus.com)
interface.c: Patch for AMIGA from Rask Ingemann Lambertsen <rask@k4315.kampsax.dtu.dk>
kanji.h: Patch for Western European Languages from Josef Hinteregger <joehtg@joehtg.co.at>
locking.c: Patch to fix file locking from Jeremy (jra@cygnus.com)
locking.c: Patch to add granularity of lock files to usec by Jeremy (jra@cygnus.com)
pipes.c: Patch to fix file locking from Jeremy (jra@cygnus.com)
proto.h: Patch to fix file locking from Jeremy (jra@cygnus.com)
reply.c: Patch to fix file locking from Jeremy (jra@cygnus.com)
server.c: Patch to fix file locking from Jeremy (jra@cygnus.com)
server.c: Patch for FAST_SHARE_MODE fix from (lost contributor name, sorry).
smb.h: Patch to fix file locking from Jeremy (jra@cygnus.com)
smb.h: Patch to add granularity of lock files to usec by Jeremy (jra@cygnus.com)
status.c: Patch to fix file locking from Jeremy (jra@cygnus.com)
statuc.c: Patch to add granularity of lock files to usec by Jeremy (jra@cygnus.com)
system.c: Patch for Western European Languages from Josef Hinteregger <joehtg@joehtg.co.at>
trans2.c: Patch to fix file locking from Jeremy (jra@cygnus.com)
trans2.c: Patch to fix volume name reported to Win95 from Jeremy (jra@cygnus.com)
util.c: Patch for Western European Languages from Josef Hinteregger <joehtg@joehtg.co.at>
util.c: Patch to fix client_name from continuously returning UNKNOWN (from various contributors).
version.h: Update to 1.9.16p10.
(This used to be commit 03d28fa32eb094affa33133ebe2602fdb70f6361)
Diffstat (limited to 'source3/lib')
-rw-r--r-- | source3/lib/charcnv.c | 35 | ||||
-rw-r--r-- | source3/lib/charset.c | 116 | ||||
-rw-r--r-- | source3/lib/interface.c | 2 | ||||
-rw-r--r-- | source3/lib/system.c | 4 | ||||
-rw-r--r-- | source3/lib/util.c | 10 |
5 files changed, 112 insertions, 55 deletions
diff --git a/source3/lib/charcnv.c b/source3/lib/charcnv.c index d9ee551d6a..4654101a5c 100644 --- a/source3/lib/charcnv.c +++ b/source3/lib/charcnv.c @@ -20,6 +20,7 @@ */ #include "includes.h" +#define CTRLZ 26 extern int DEBUGLEVEL; static char cvtbuf[1024]; @@ -52,20 +53,30 @@ static void update_map(char * str) { static void initiso() { + int i; if (!mapsinited) initmaps(); - update_map("\241\255\242\233\243\234\244\236\245\235\246\272\247\025\250\251"); - update_map("\251\273\252\246\253\256\254\252\255\274\256\310\257\257\260\370"); - update_map("\261\361\262\375\263\264\264\265\265\266\266\024\267\371\270\267"); - update_map("\271\270\272\247\273\275\274\254\275\253\276\276\277\250\200\277"); - update_map("\301\300\302\301\303\302\304\216\305\217\306\222\307\200\310\303"); - update_map("\311\220\312\305\313\306\314\307\315\315\316\317\317\320\320\311"); - update_map("\321\245\322\321\323\322\324\323\325\324\326\231\327\312\330\325"); - update_map("\331\326\332\327\333\330\334\232\335\313\336\314\337\341\340\205"); - update_map("\341\240\342\203\343\331\344\204\345\206\346\221\347\207\350\212"); - update_map("\351\202\352\210\353\211\354\215\355\241\356\214\357\213\360\316"); - update_map("\361\244\362\225\363\242\364\223\365\332\366\224\367\366\370\362"); - update_map("\371\227\372\243\373\226\374\201\375\304\376\263\377\230"); + /* Do not map undefined characters to some accidental code */ + for (i = 128; i < 256; i++) + { + unix2dos[i] = CTRLZ; + dos2unix[i] = CTRLZ; + } + +/* MSDOS Code Page 850 -> ISO-8859 */ +update_map("\240\377\241\255\242\275\243\234\244\317\245\276\246\335\247\365"); +update_map("\250\371\251\270\252\246\253\256\254\252\255\360\256\251\257\356"); +update_map("\260\370\261\361\262\375\263\374\264\357\265\346\266\364\267\372"); +update_map("\270\367\271\373\272\247\273\257\274\254\275\253\276\363\277\250"); +update_map("\300\267\301\265\302\266\303\307\304\216\305\217\306\222\307\200"); +update_map("\310\324\311\220\312\322\313\323\314\336\315\326\316\327\317\330"); +update_map("\320\321\321\245\322\343\323\340\324\342\325\345\326\231\327\236"); +update_map("\330\235\331\353\332\351\333\352\334\232\335\355\336\350\337\341"); +update_map("\340\205\341\240\342\203\343\306\344\204\345\206\346\221\347\207"); +update_map("\350\212\351\202\352\210\353\211\354\215\355\241\356\214\357\213"); +update_map("\360\320\361\244\362\225\363\242\364\223\365\344\366\224\367\366"); +update_map("\370\233\371\227\372\243\373\226\374\201\375\354\376\347\377\230"); + } /* diff --git a/source3/lib/charset.c b/source3/lib/charset.c index cd8c7577c9..65e0cc9a34 100644 --- a/source3/lib/charset.c +++ b/source3/lib/charset.c @@ -28,20 +28,20 @@ char xx_dos_char_map[256]; char xx_upper_char_map[256]; char xx_lower_char_map[256]; -char *dos_char_map = NULL; -char *upper_char_map = NULL; -char *lower_char_map = NULL; +char *dos_char_map = xx_dos_char_map; +char *upper_char_map = xx_upper_char_map; +char *lower_char_map = xx_lower_char_map; static void add_dos_char(int lower, int upper) { + lower &= 0xff; + upper &= 0xff; DEBUG(6,("Adding chars 0%o 0%o\n",lower,upper)); - if (lower) dos_char_map[(char)lower] = 1; - if (upper) dos_char_map[(char)upper] = 1; + if (lower) dos_char_map[lower] = 1; + if (upper) dos_char_map[upper] = 1; if (lower && upper) { - lower_char_map[(char)upper] = (char)lower; - upper_char_map[(char)lower] = (char)upper; - lower_char_map[(char)lower] = (char)lower; - upper_char_map[(char)upper] = (char)upper; + lower_char_map[upper] = (char)lower; + upper_char_map[lower] = (char)upper; } } @@ -52,12 +52,14 @@ void charset_initialise(void) { int i; - dos_char_map = &xx_dos_char_map[128]; - upper_char_map = &xx_upper_char_map[128]; - lower_char_map = &xx_lower_char_map[128]; +#ifdef LC_ALL + /* include <locale.h> in includes.h if available for OS */ + /* we take only standard 7-bit ASCII definitions from ctype */ + setlocale(LC_ALL,"C"); +#endif - for (i= -128;i<=127;i++) { - dos_char_map[(char)i] = 0; + for (i= 0;i<=255;i++) { + dos_char_map[i] = 0; } for (i=0;i<=127;i++) { @@ -65,29 +67,83 @@ void charset_initialise(void) add_dos_char(i,0); } - for (i= -128;i<=127;i++) { + for (i=0; i<=255; i++) { char c = (char)i; upper_char_map[i] = lower_char_map[i] = c; - if (isupper(c)) lower_char_map[c] = tolower(c); - if (islower(c)) upper_char_map[c] = toupper(c); + if (isupper(c)) lower_char_map[i] = tolower(c); + if (islower(c)) upper_char_map[i] = toupper(c); } - /* valid for all DOS PC */ - add_dos_char(142,0); /* A trema */ - add_dos_char(143,0); /* A o */ - add_dos_char(144,0); /* E ' */ - add_dos_char(146,0); /* AE */ - add_dos_char(153,0); /* O trema */ - add_dos_char(154,0); /* U trema */ - add_dos_char(165,0); /* N tilda */ - add_dos_char(128,0); /* C cedille */ +#define CP850 +#ifdef CP850 +/* lower->upper mapping for IBM Code Page 850 */ + +/* dec col/row oct hex description */ +/* 133 08/05 205 85 a grave */ +/* 183 11/07 267 B7 A grave */ add_dos_char(0205,0267); +/* 160 10/00 240 A0 a acute */ +/* 181 11/05 265 B5 A acute */ add_dos_char(0240,0265); +/* 131 08/03 203 83 a circumflex */ +/* 182 11/06 266 B6 A circumflex */ add_dos_char(0203,0266); +/* 198 12/06 306 C6 a tilde */ +/* 199 12/07 307 C7 A tilde */ add_dos_char(0306,0307); +/* 132 08/04 204 84 a diaeresis */ +/* 142 08/14 216 8E A diaeresis */ add_dos_char(0204,0216); +/* 134 08/06 206 86 a ring */ +/* 143 08/15 217 8F A ring */ add_dos_char(0206,0217); +/* 145 09/01 221 91 ae diphthong */ +/* 146 09/02 222 92 AE diphthong */ add_dos_char(0221,0222); +/* 128 08/00 200 80 C cedilla */ +/* 135 08/07 207 87 c cedilla */ add_dos_char(0207,0200); +/* 138 08/10 212 8A e grave */ +/* 212 13/04 324 D4 E grave */ add_dos_char(0212,0324); +/* 130 08/02 202 82 e acute */ +/* 144 09/00 220 90 E acute */ add_dos_char(0202,0220); +/* 136 08/08 210 88 e circumflex */ +/* 210 13/02 322 D2 E circumflex */ add_dos_char(0210,0322); +/* 137 08/09 211 89 e diaeresis */ +/* 211 13/03 323 D3 E diaeresis */ add_dos_char(0211,0323); +/* 141 08/13 215 8D i grave */ +/* 222 13/14 336 DE I grave */ add_dos_char(0215,0336); +/* 161 10/01 241 A1 i acute */ +/* 214 13/06 326 D6 I acute */ add_dos_char(0241,0326); +/* 140 08/12 214 8C i circumflex */ +/* 215 13/07 327 D7 I circumflex */ add_dos_char(0214,0327); +/* 139 08/11 213 8B i diaeresis */ +/* 216 13/08 330 D8 I diaeresis */ add_dos_char(0213,0330); +/* 208 13/00 320 D0 Icelandic eth */ +/* 209 13/01 321 D1 Icelandic Eth */ add_dos_char(0320,0321); +/* 164 10/04 244 A4 n tilde */ +/* 165 10/05 245 A5 N tilde */ add_dos_char(0244,0245); +/* 149 09/05 225 95 o grave */ +/* 227 14/03 343 E3 O grave */ add_dos_char(0225,0343); +/* 162 10/02 242 A2 o acute */ +/* 224 14/00 340 E0 O acute */ add_dos_char(0242,0340); +/* 147 09/03 223 93 o circumflex */ +/* 226 14/02 342 E2 O circumflex */ add_dos_char(0223,0342); +/* 228 14/04 344 E4 o tilde */ +/* 229 14/05 345 E5 O tilde */ add_dos_char(0344,0345); +/* 148 09/04 224 94 o diaeresis */ +/* 153 09/09 231 99 O diaeresis */ add_dos_char(0224,0231); +/* 155 09/11 233 9B o slash */ +/* 157 09/13 235 9D O slash */ add_dos_char(0233,0235); +/* 151 09/07 227 97 u grave */ +/* 235 14/11 353 EB U grave */ add_dos_char(0227,0353); +/* 163 10/03 243 A3 u acute */ +/* 233 14/09 351 E9 U acute */ add_dos_char(0243,0351); +/* 150 09/06 226 96 u circumflex */ +/* 234 14/10 352 EA U circumflex */ add_dos_char(0226,0352); +/* 129 08/01 201 81 u diaeresis */ +/* 154 09/10 232 9A U diaeresis */ add_dos_char(0201,0232); +/* 236 14/12 354 EC y acute */ +/* 237 14/13 355 ED Y acute */ add_dos_char(0354,0355); +/* 231 14/07 347 E7 Icelandic thorn */ +/* 232 14/08 350 E8 Icelandic Thorn */ add_dos_char(0347,0350); + add_dos_char(156,0); /* Pound */ - add_dos_char(183,0); /* A ` (WIN)*/ - add_dos_char(157,0); /* Phi (WIN)*/ - add_dos_char(212,0); /* E` (WIN)*/ +#endif } - /******************************************************************* add characters depending on a string passed by the user ********************************************************************/ diff --git a/source3/lib/interface.c b/source3/lib/interface.c index 59a542ca0e..1c41293cf7 100644 --- a/source3/lib/interface.c +++ b/source3/lib/interface.c @@ -154,7 +154,7 @@ static void get_broadcast(struct in_addr *if_ipaddr, } } } -#elif defined(__FreeBSD__) || defined(NETBSD) +#elif defined(__FreeBSD__) || defined(NETBSD) || defined(AMIGA) ifc.ifc_len = sizeof(buff); ifc.ifc_buf = buff; if (ioctl(sock, SIOCGIFCONF, &ifc) < 0) { diff --git a/source3/lib/system.c b/source3/lib/system.c index 995c6beed5..ac97449da2 100644 --- a/source3/lib/system.c +++ b/source3/lib/system.c @@ -198,14 +198,10 @@ for rename() ********************************************************************/ int sys_rename(char *from, char *to) { -#ifdef KANJI pstring zfrom, zto; strcpy (zfrom, dos_to_unix (from, False)); strcpy (zto, dos_to_unix (to, False)); return rename (zfrom, zto); -#else - return rename (from, to); -#endif /* KANJI */ } /******************************************************************* diff --git a/source3/lib/util.c b/source3/lib/util.c index 8730ae3143..318ac3fc61 100644 --- a/source3/lib/util.c +++ b/source3/lib/util.c @@ -957,9 +957,6 @@ void unix_format(char *fname) { pstring namecopy; string_replace(fname,'\\','/'); -#ifndef KANJI - dos2unix_format(fname, True); -#endif /* KANJI */ if (*fname == '/') { @@ -974,9 +971,6 @@ void unix_format(char *fname) ****************************************************************************/ void dos_format(char *fname) { -#ifndef KANJI - unix2dos_format(fname, True); -#endif /* KANJI */ string_replace(fname,'/','\\'); } @@ -3083,6 +3077,7 @@ char *client_name(void) if (getpeername(Client, &sa, &length) < 0) { DEBUG(0,("getpeername failed\n")); + done = False; return name_buf; } @@ -3092,6 +3087,7 @@ char *client_name(void) AF_INET)) == 0) { DEBUG(1,("Gethostbyaddr failed for %s\n",client_addr())); StrnCpy(name_buf,client_addr(),sizeof(name_buf) - 1); + done = False; } else { StrnCpy(name_buf,(char *)hp->h_name,sizeof(name_buf) - 1); if (!matchname(name_buf, sockin->sin_addr)) { @@ -3362,14 +3358,12 @@ char *readdirname(void *p) dname = ptr->d_name; -#ifdef KANJI { static pstring buf; strcpy(buf, dname); unix_to_dos(buf, True); dname = buf; } -#endif #ifdef NEXT2 if (telldir(p) < 0) return(NULL); |