diff options
author | Jeremy Allison <jra@samba.org> | 1998-01-16 06:29:38 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 1998-01-16 06:29:38 +0000 |
commit | 6040d7a39e5d5ab426905aa79b871df815fb9b62 (patch) | |
tree | 0dfa1d20cf2ad7404fac5647c866413984875ce5 /source | |
parent | ab8d615fe2004c3ca93dd2978ba988ea89d7fd74 (diff) | |
download | samba-6040d7a39e5d5ab426905aa79b871df815fb9b62.tar.gz |
Makefile: Added new codepage - 866.
charset.c: Supporting code for codepage 866.
clientutil.c: Fix compile bug in little-used #define.
includes.h: Supporting code for codepage 866.
make_smbcodepage.c: Supporting code for codepage 866.
pcap.c: Fix bug for lpstat.
Jeremy.
Diffstat (limited to 'source')
-rw-r--r-- | source/client/clientutil.c | 2 | ||||
-rw-r--r-- | source/include/includes.h | 4 | ||||
-rw-r--r-- | source/lib/charset.c | 11 | ||||
-rw-r--r-- | source/printing/pcap.c | 4 | ||||
-rw-r--r-- | source/utils/make_smbcodepage.c | 10 |
5 files changed, 16 insertions, 15 deletions
diff --git a/source/client/clientutil.c b/source/client/clientutil.c index 7c145bf59ee..e3786d60297 100644 --- a/source/client/clientutil.c +++ b/source/client/clientutil.c @@ -908,7 +908,7 @@ BOOL cli_open_sockets(int port ) interpret_addr(lp_socket_address()))) != -1) { set_socket_options(bcast, "SO_BROADCAST"); - if ((ip_list = name_query(bcast, host, name_type, True, True, *iface_bcast(dest_ip), + if (ip_list = name_query(bcast, host, name_type, True, True, *iface_bcast(dest_ip), &count,0)) { dest_ip = ip_list[0]; free(ip_list); diff --git a/source/include/includes.h b/source/include/includes.h index 3dbe6780a58..2d2ff63f888 100644 --- a/source/include/includes.h +++ b/source/include/includes.h @@ -1168,6 +1168,10 @@ extern char *sys_errlist[]; #include "kanji.h" #include "charset.h" +#ifndef MAXCODEPAGELINES +#define MAXCODEPAGELINES 256 +#endif + /***** automatically generated prototypes *****/ #include "proto.h" diff --git a/source/lib/charset.c b/source/lib/charset.c index e29e60303aa..95b3d01627e 100644 --- a/source/lib/charset.c +++ b/source/lib/charset.c @@ -216,11 +216,11 @@ static codepage_p load_client_codepage( int client_codepage ) /* Check if it is at least big enough to hold the required data. Should be 2 byte version, 2 byte codepage, 4 byte length, plus zero or more bytes of data. Note that the data cannot be more - than 512 bytes - giving a max size of 520. + than 4 * MAXCODEPAGELINES bytes. */ size = (unsigned int)st.st_size; - if( size < CODEPAGE_HEADER_SIZE || size > (CODEPAGE_HEADER_SIZE + 256)) + if( size < CODEPAGE_HEADER_SIZE || size > (CODEPAGE_HEADER_SIZE + 4 * MAXCODEPAGELINES)) { DEBUG(0,("load_client_codepage: file %s is an incorrect size for a \ code page file.\n", codepage_file_name)); @@ -323,10 +323,9 @@ initialise the client codepage. void codepage_initialise(int client_codepage) { int i; - codepage_p cp = NULL; - static BOOL done = False; + static codepage_p cp = NULL; - if(done == True) + if(cp != NULL) { DEBUG(6, ("codepage_initialise: called twice - ignoring second client code page = %d\n", @@ -361,8 +360,6 @@ for code page %d failed. Using default client codepage 850\n", for(i = 0; !((cp[i][0] == '\0') && (cp[i][1] == '\0')); i++) add_dos_char(cp[i][0], (BOOL)cp[i][2], cp[i][1], (BOOL)cp[i][3]); } - - done = True; } /******************************************************************* diff --git a/source/printing/pcap.c b/source/printing/pcap.c index ff0a2b54772..bff81b8661d 100644 --- a/source/printing/pcap.c +++ b/source/printing/pcap.c @@ -267,7 +267,7 @@ BOOL pcap_printername_ok(char *pszPrintername, char *pszPrintcapname) #endif #ifdef AIX - if (strlocate(psz,"/qconfig") != NULL) + if (strlocate(psz,"/qconfig")) return(ScanQconfig(psz,pszPrintername)); #endif @@ -336,7 +336,7 @@ void pcap_printer_fn(void (*fn)()) #endif #ifdef AIX - if (strlocate(psz,"/qconfig") != NULL) + if (strlocate(psz,"/qconfig")) { ScanQconfig_fn(psz,fn); return; diff --git a/source/utils/make_smbcodepage.c b/source/utils/make_smbcodepage.c index b4cb1523349..06bc694e208 100644 --- a/source/utils/make_smbcodepage.c +++ b/source/utils/make_smbcodepage.c @@ -167,7 +167,7 @@ int do_compile(int codepage, char *input_file, char *output_file) FILE *fp = NULL; uint32 size = 0; char *buf = NULL; - char output_buf[CODEPAGE_HEADER_SIZE + 512]; + char output_buf[CODEPAGE_HEADER_SIZE + 4 * MAXCODEPAGELINES]; int num_lines = 0; int i = 0; struct stat st; @@ -223,11 +223,11 @@ The maximum size I will believe is 100k.\n", prog_name, size); num_lines = clean_data( &buf, &size); - /* There can be a maximum of 128 lines. */ - if(num_lines > 128) + /* There can be a maximum of MAXCODEPAGELINES lines. */ + if(num_lines > MAXCODEPAGELINES) { - fprintf(stderr, "%s: There can be a maximum 128 lines of data in a codepage \ -definition file. File %s has %d.\n", prog_name, input_file, num_lines); + fprintf(stderr, "%s: There can be a maximum %d lines of data in a codepage \ +definition file. File %s has %d.\n", prog_name, MAXCODEPAGELINES, input_file, num_lines); exit(1); } |