patch Bad char conversion Illegal multibyte prozeduranzahl

Heiko L. h.lehmann at fh-lausitz.de
Wed Apr 7 13:53:14 MDT 2010


Hallo,

I have a problem and their workaround.

Is it welcome?

regards heiko


problem:
- after (successfull) login into NT-Domain get error:
   Die Prozeduranzahl liegt auerhalb des erlaubten Bereichs
   (The procedure number is out of range ???)

cause:
- first/lastname has german umlaut
  Error:  "Bad char conversion"

workaround:
- patch 100407.samba-3.5.1_fix_converr.patch [1]
  (tested on 3.5.1 3.5.2)
- details s. diag

-----------------------------------------------------------------
diag:

- test 6 loglevel 10

 [2010/03/25 14:52:43,  3] auth/auth.c:check_ntlm_password(223)
  check_ntlm_password: guest had nothing to say
  pdb_set_profile_path: setting profile path \\mbserver\Profiles\zfroehli,
 was
 _netr_LogonSamLogon: check_password returned status NT_STATUS_OK
 [2010/03/25 14:52:43,  3] lib/charcnv.c:convert_string_internal(263)
  convert_string_internal: Conversion error: Illegal multibyte
 sequence(lich)
 [2010/03/25 14:52:43,  1] librpc/ndr/ndr.c:ndr_push_error(493)
  ndr_push_error(5): Bad char conversion
 [2010/03/25 14:52:43,  0] rpc_server/srv_pipe.c:api_rpcTNP(2381)
  api_rpcTNP: netlogon: NETR_LOGONSAMLOGON failed.


  -> sequence(lich) should be "Fröhlich"

- test 7 without diaeresis

 # diff passwd.old passwd
 < ....Fr&ouml;hlich...
 > ....Froehlich...

  netlogon successfully

  -> problem not exist anymore...


- env

  # grep "smbd version" log.smbd
  smbd version 3.3.12 started.

  # echo $LANG
  de_DE.UTF-8


- 11 diag conv

http://forum.soft32.com/linux/smbd-crash-character-conversion-ftopict366690.html
 [Samba] smbd crash on character conversion

 find . -type f -exec grep "Illegal multibyte" {} \; -print

  vi ./lib/charcnv.c
    251         retval = smb_iconv(descriptor, &inbuf, &i_len, &outbuf,
&o_len)
       ;
    276                         case EILSEQ:
    277                                 reason="Illegal multibyte sequence";
    278                                 if (!conv_silent)
    279                                        
DEBUG(3,("convert_string_intern
       al: Conversion error: %s(%s)\n",reason,inbuf));
    280                                 if (allow_bad_conv)
    281                                         goto use_as_is;
    282
    283                                 return (size_t)-1;
    284                         default:
    285                                 if (!conv_silent)

    382  * @param destlen maximal length allowed for string - *NEVER* -1.
    383  * @param allow_bad_conv determines if a "best effort" conversion
is ac
       ceptable (never returns errors)
    384  * @returns the number of bytes occupied in the destination

    - param ???

    - woher kommt
    392 size_t convert_string(charset_t from, charset_t to,
    393                       void const *src, size_t srclen,
    394                       void *dest, size_t destlen, bool
allow_bad_conv)
    395 {


  # find . -name "*.c" -type f -exec grep "convert_string(" {} \; -print |
more
  ...
        ret = convert_string(CH_UNIX, CH_DOS, src, src_len, dest,
dest_len, True
);
                size_t mb_len = convert_string(CH_UTF16LE, CH_DOS,
buffer+i, siz
eof(smb_ucs2_t), mb, sizeof(mb), False);

   - no param ....



- test19 pdbedit

BENUTZER=joerbram
pdbedit -Lv $BENUTZER | grep ^Full | cut -d : -f 2 | sed "s/^ *//g" |
hexdump -C
grep $BENUTZER /etc/passwd| cut -d : -f 5 | hexdump -C


    - result:
    00000000  74 65 73 74 20 6a f6 72  62 72 61 6d 0a           |test
j.rbram.|
    00000000  74 65 73 74 20 6a f6 72  62 72 61 6d 0a           |test
j.rbram.|



- test21 3.5.2 (releasedate: today, s. 100330.samba-3.5)
  -   add patch 100407.samba-3.5.1_fix_converr.patch [1]

  source3]# cat  ../../100407.samba-3.5.1_fix_converr.patch | patch -p0

  -> result:  netlogon successfully

 [2010/04/07 15:29:29.898781,  3] lib/charcnv.c:279(convert_string_internal)
  convert_string_internal: Conversion error: Illegal multibyte
sequence(�rbram
)
 [2010/04/07 15:29:29.898819,  5] rpc_server/srv_pipe.c:2468(api_rpcTNP)
  api_rpcTNP: called \netlogon successfully
 [2010/04/07 15:29:29.899158,  3]
rpc_server/srv_pipe_hnd.c:344(free_pipe_contex
t)
  free_pipe_context: destroying talloc pool of size 1590

  -> netlogon successfully

  - note:
    - if you rerun test req. restart smbd (cache)

- summary:
    - problem fixed by patch 100407.samba-3.5.1_fix_converr.patch



--------------------------------------------------------
[1] http://www2.fh-lausitz.de/launic/comp/net/100323.prob.mb.samba.uml/





More information about the samba-technical mailing list