Bug 10308 - String Conversion Errors with Samba 4.1.0 Build on AIX 7.1
Summary: String Conversion Errors with Samba 4.1.0 Build on AIX 7.1
Status: RESOLVED FIXED
Alias: None
Product: Samba 4.1 and newer
Classification: Unclassified
Component: Build (show other bugs)
Version: 4.1.0
Hardware: All AIX
: P5 normal (vote)
Target Milestone: ---
Assignee: Karolin Seeger
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-12-05 18:40 UTC by John Janosik
Modified: 2014-03-25 09:28 UTC (History)
3 users (show)

See Also:


Attachments
possible patch (1.67 KB, patch)
2013-12-07 10:18 UTC, Christian Ambach
no flags Details
Patch for 4.x and 4.1 with cherry-pick information (1.54 KB, patch)
2014-03-03 20:36 UTC, Christian Ambach
abartlet: review+
Details

Note You need to log in before you can comment on or make changes to this bug.
Description John Janosik 2013-12-05 18:40:57 UTC
After building Samba 4.1.0 on AIX 7.1 with IBM XL/C 12.1 the resulting binaries do not work due to errors reading the configuration from the registry.  Here are some example errors from smbd:

[2013/12/04 17:10:02.601490,  0] ../lib/util/charset/convert_string.c:391(convert_string_talloc_handle)
  convert_string_talloc: Conversion not supported.
[2013/12/04 17:10:02.601752,  0] ../source3/param/loadparm.c:3067(lp_set_enum_parm)
  WARNING: Ignoring invalid value '(NULL)' for parameter 'security'
[2013/12/04 17:10:02.602315,  0] ../source3/param/loadparm.c:1319(lp_bool)
  lp_bool(): value is NULL or empty!
[2013/12/04 17:10:02.602739,  0] ../source3/param/loadparm.c:1319(lp_bool)
  lp_bool(): value is NULL or empty!
[2013/12/04 17:10:02.603025,  0] ../source3/param/loadparm.c:1319(lp_bool)
  lp_bool(): value is NULL or empty!
[2013/12/04 17:10:02.603377,  0] ../source3/param/loadparm.c:1290(lp_int)
  lp_int(): value is NULL or empty!
[2013/12/04 17:10:02.603737,  0] ../source3/param/loadparm.c:1319(lp_bool)
  lp_bool(): value is NULL or empty!
[2013/12/04 17:10:03.210354,  0] ../source3/auth/auth_util.c:786(get_guest_info3)
  SamInfo3_for_guest: Unable to locate guest account []!
[2013/12/04 17:10:03.210624,  0] ../source3/auth/auth_util.c:855(make_new_session_info_guest)
  get_guest_info3 failed with NT_STATUS_NO_SUCH_USER
[2013/12/04 17:10:03.210799,  0] ../source3/smbd/server.c:1448(main)
  ERROR: failed to setup guest info.

Trying to set or view the configuration with the net command also fails:

> net conf setparm global security user
convert_string_talloc: Conversion not supported.
Error setting value 'security': SBC_ERR_NOMEM

> net conf list
<CUT LINES>
convert_string_talloc: Conversion not supported.
[global]
        security = 
        afs username map = 
        hide dot files = 
        wide links = 
        unix extensions = 
        deadtime = 
        log file = 
        debug pid = 
        guest account = 
        invalid users = 
        log level = 
        netbios name = 

I know the values for these configuration settings are not NULL, I imported the registry ctdb database from a working server. 

Building Samba 3.6.X with the autoconf build did not have these problems.  Christian Ambach suggested in another bug that these problems are probably related to incorrect detection of iconv support.
Comment 1 Christian Ambach 2013-12-05 19:56:54 UTC
Had a look at a config.log that John posted earlier: the icon library on his machine exists but denies any of the requested translations in the configure checks.

So finally it ends up with
/* #undef HAVE_CHARSET_CP850 */
/* #undef HAVE_CHARSET_IBM850 */
/* #undef HAVE_CHARSET_UTF_8 */
/* #undef HAVE_CHARSET_UTF8 */
#define DEFAULT_DOS_CHARSET False
#define DEFAULT_UNIX_CHARSET False

The last two come from source3/build/charset.py

Setting those to False is definitely wrong, looks we need to find a better default value here.
Not sure what the autoconf build set in the past, this will need some digging.
Comment 2 John Janosik 2013-12-05 21:28:22 UTC
I checked the config.log from an autoconf build of Samba 3.6 for my production servers.  The include/config.h file has:

/* Default display charset name */
#define DEFAULT_DISPLAY_CHARSET "ASCII"

/* Default dos charset name */
#define DEFAULT_DOS_CHARSET "ASCII"

/* Default unix charset name */
#define DEFAULT_UNIX_CHARSET "UTF8

I see the following after the check for iconv in the config.log for this build:

configure:22706: result: no
configure:22805: WARNING: Sufficient support for iconv function was not found.
    Install libiconv from http://freshmeat.net/projects/libiconv/ for better charset compatibility!


Looks like the include/config.h settings in my 3.6 build come from the section of configure that is producing the warning above:


if test x"$ICONV_FOUND" = x"no" -o x"$samba_cv_HAVE_NATIVE_ICONV" != x"yes" ; then
    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Sufficient support for iconv function was not found.
    Install libiconv from http://freshmeat.net/projects/libiconv/ for better charset compatibility!" >&5
$as_echo "$as_me: WARNING: Sufficient support for iconv function was not found.
    Install libiconv from http://freshmeat.net/projects/libiconv/ for better charset compatibility!" >&2;}

cat >>confdefs.h <<_ACEOF
#define DEFAULT_DOS_CHARSET "ASCII"
_ACEOF


cat >>confdefs.h <<_ACEOF
#define DEFAULT_DISPLAY_CHARSET "ASCII"
_ACEOF


cat >>confdefs.h <<_ACEOF
#define DEFAULT_UNIX_CHARSET "UTF8"
_ACEOF

fi
Comment 3 Christian Ambach 2013-12-07 10:18:37 UTC
Created attachment 9516 [details]
possible patch

Can you try if this patch helps?
Comment 4 John Janosik 2013-12-09 17:23:55 UTC
I haven't got the the point of testing binaries yet, but after running configure with the path I have:

> grep CHARSET bin/default/include/config.h 
/* #undef HAVE_CHARSET_CP850 */
/* #undef HAVE_CHARSET_IBM850 */
/* #undef HAVE_CHARSET_UTF_8 */
/* #undef HAVE_CHARSET_UTF8 */
#define DEFAULT_DOS_CHARSET "ASCII"
#define DEFAULT_UNIX_CHARSET "UTF8"

So that looks better.
Comment 5 Christian Ambach 2014-03-03 20:36:57 UTC
Created attachment 9748 [details]
Patch for 4.x and 4.1 with cherry-pick information
Comment 6 Christian Ambach 2014-03-05 19:26:24 UTC
Karolin,

please pick for 4.0.x and 4.1.x
Comment 7 Karolin Seeger 2014-03-10 15:12:10 UTC
(In reply to comment #6)
> Karolin,
> 
> please pick for 4.0.x and 4.1.x

Pushed to autobuild-v4-1-test and autobuild-v4-0-test.
Comment 8 Karolin Seeger 2014-03-25 09:28:11 UTC
(In reply to comment #7)
> (In reply to comment #6)
> > Karolin,
> > 
> > please pick for 4.0.x and 4.1.x
> 
> Pushed to autobuild-v4-1-test and autobuild-v4-0-test.

Pushed to v4-1-test and v4-0-test.
Closing out bug report.

Thanks!