Many thanks. I will look in detail at the links to the PIE links you 
provided to see if anything jumps out at me.

One possible concern in your patch for make_mysql_tables.in:
If the line:

SET SESSION sql_mode = (SELECT REPLACE(@@sql_mode,'NO_ZERO_DATE', ''));

simply sets the NO_ZERO_DATE to NULL rather than 1, all is OK and you 
can skip the rest of this paragraph.  However, on the off chance that it 
tells MySQL not to permit any zero value for a date, then Bacula will 
fail.  Bacula does not need the default value to be zero, but Bacula 
does set a zero value (a valid Unix/Linux value) in a number of the 
DATETIME fields.  If MySQL either changes the value or fails the SQL 
command, Bacula will fail.

In the community version 7.4.1, I edited the make_mysql_tables.in to 
remove all the DATETIME default values of 0 which were the cause the 
incompatibility.  Consequently, if you include my new 
make_mysql_tables.in you should not need for the above SET SESSION line.

I'll leave it to you to decide what to do, if anything.

Best regards,
Kern


On 06/24/2016 05:54 PM, Nish Aravamudan wrote:
> On 24.06.2016 [06:07:06 -0000], Kern Sibbald wrote:
>> Hello Nish,
>>
>> Thanks for taking the time to send me a personal note.  After more
>> research, I agree 100% with you that it is not related to stripping the
>> binaries.  I deduce from Hiroaki's analysis that the problem is that the
>> addresses in the shared object that are exported are modified with the
>> -Bsymbolic-functions from what Bacula expects.  While setting the
>> default values of directives, Bacula compares addresses of function
>> pointers.  If these function pointers are changed from what Bacula
>> expects, setting the default value fails.  Bacula does not use position
>> independent executables (at least we do not set it in our LDFLAGS).
> Yep, and Ubuntu uses PIE by default in 16.10 (on some archs), but I'm
> not sure it's set in 16.04 based upon the buildlog at
> https://launchpadlibrarian.net/267315679/buildlog_ubuntu-xenial-amd64.bacula_7.4.1~dfsg-1.1~ppa7_BUILDING.txt.gz.
>  More details on
> PIE in Ubuntu: https://wiki.ubuntu.com/Security/Features#pie.
>
>> In a future version (hopefully the next one), I will identify the
>> function pointers with a unique index for each function, then instead of
>> comparing function pointers, I will compare indexes. This will
>> definitively avoid the problem.  Thanks for making the Ubuntu build work
>> again.
> Yep, that makes sense!
>
>> On a different issue:
>> If you would like, I will be happy to look at your patch for [Bug
>> 1570923] Re: bacula-dir won't start with "undefined symbol: mysql_init",
>> however, I don't know where to find it.
> So the PPA build has the following changes, with my commentary in []:
>
> bacula (7.4.1~dfsg-1.1~ppa7) xenial; urgency=medium
>
>    * debian/patches/libmysqlclient_r.patch: Fix bug where MySQL 5.7 is
>      improperly linked on Ubuntu 16.04.  Closes LP: #1570923.
>      [ backport of
> http://www.bacula.org/git/cgit.cgi/bacula/commit/?h=Branch-7.4&id=d3196af3e6c9f65b9f0790625a2e844dcb5fd190
>  ]
>    * debian/patches/mysql_install_update.patch: mysql database
>      install/update scripts patch. Fixes bug #1901.
>      [ backport of
> http://www.bacula.org/git/cgit.cgi/bacula/commit/?h=Branch-7.4&id=074419ac0c9dbbde2e4d2f5ccb6d4ca85c6ec8a9
>  ]
>    * debian/patches/disable_mysql_NO_ZERO_DATE.patch: Disable
>      NO_ZERO_DATE mode for MySQL table creation.
>      [ Without this, I get an error from MySQL 5.7 (strict mode) about
>        the CleaningDate field having an invalid default.
> --- bacula-7.4.1~dfsg.orig/src/cats/make_mysql_tables.in
> +++ bacula-7.4.1~dfsg/src/cats/make_mysql_tables.in
> @@ -14,6 +14,8 @@ PATH="$bindir:$PATH"
>   db_name=${db_name:-@db_name@}
>
>   if mysql -D ${db_name} $* -f <<END-OF-DATA
> +SET SESSION sql_mode = (SELECT REPLACE(@@sql_mode,'NO_ZERO_DATE', ''));
> +
>   --
>   -- Note, we use BLOB rather than TEXT because in MySQL,
>   --  BLOBs are identical to TEXT except that BLOB is case
>       ]
>    * d/rules: do not use -Bsymoblic-functions when linking.
>      [ The result from this bug and Hiroaki's analysis ]
>
>   -- Nishanth Aravamudan <nish.aravamu...@canonical.com>  Thu, 23 Jun
> 2016 12:35:56 -0700
>
> I'll clean-up the changelog to ensure the bugs get auto-tagged
> appropriately and submit it for SRU.
>

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1553563

Title:
  bconsole to Bacula Director fails with authorization problem message

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/bacula/+bug/1553563/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to