#1000174 bacula-director-pgsql: setup fails with "Unrecognized role option"

#1000174#5
Date:
2021-11-18 23:55:18 UTC
From:
To:
Dear Maintainer,

I left the severity at normal because I suspect there is an easy
work-around; the problem actually leaves the package uninstalled or at
least not operable, and so it might be considered more serious.

   * What led up to the situation?
   Installing the bacula package onto a system with postgres already
   present, but no prior bacula installation.
   Opted for the PG based backend.
   Elected the default dbconfig controlled setup.
   Entered eiXu7Boo{z'a as the password for the database (twice)

   * What exactly did you do (or not do) that was effective (or
     ineffective)?
   I plan to retry with a password that does not include the ' character.

   * What was the outcome of the original actions?
   With the original password the installer (aptitude) showed the
   following:
   ERROR: unrecognized role option "a" LINE 1: CREATE USER "bacula"
   WITH PASSWORD 'eiXu7Boo{z\'a' ^ .  It offers several options for
   how to proceed, with the caution that some may leave bacula inoperable.

   * What outcome did you expect instead?
   That a PG account with the password I gave would be created.

My theory is that, despite the \ that was stuffed before it, the
second ' was parsed as ending the password and the a that followed it
was taken to be a role option.

The root cause may lie with another package, maybe dbconfig
or the PG client libs.  Feel free to reassign.

*** End of the template - remove these template lines ***

#1000174#10
Date:
2022-05-30 14:17:11 UTC
From:
To:
Hi Paul,

these two bugs happen during the dbconfig actions, so I'm reassigning
them there.

Regards

Carsten

#1000174#19
Date:
2022-05-30 19:48:04 UTC
From:
To:
Control: reassing 1000174 dbconfig-common
Control: tags 1000174 confirmed
Control: merge 716841 1000174

Yes, the first one it's a long standing and nasty problem that I don't
have a good solution for. Ideas welcome.

Paul

#1000174#26
Date:
2022-06-15 22:03:37 UTC
From:
To:
Exactly what is the "long standing and nasty problem"?

If my theory about ' being a problem is right (and I did get past this
problem when I omitted it), a stop gap would be to tell people not to
use that character in their password.  It does seem odd that the \'
isn't working to quote it.

Ross

P.S. For some reason I don't seem to have gotten the email with Paul's response.

#1000174#31
Date:
2022-06-16 07:01:50 UTC
From:
To:
Hi

bug #716841

I suppose we could indeed mention this in the text.

See https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=716841#10  I now
see that I thought of a potential solution in 2014 but apparently nobody
implemented that (I'm nearly the only one ever working on dbconfig-common).

The Debian bug tracker doesn't subscribe submitters by default. If you
want to follow replies to the bug, you need to subscribe, or ask to be
CC-ed.

Paul