#798462 libsasl2-2: recreate and use /etc/sasl2/ for new installations

Package:
libsasl2-2
Source:
cyrus-sasl2
Description:
Cyrus SASL - authentication abstraction library
Submitter:
David Magda
Date:
2022-04-15 12:15:02 UTC
Severity:
wishlist
Tags:
#798462#5
Date:
2015-09-09 14:52:33 UTC
From:
To:
The upstream code uses /etc/sasl2/ as the default configuration directory,
as is illustrated in libsasl2.so:

$ strings /usr/lib/x86_64-linux-gnu/libsasl2.so.2 | grep etc
sasl_auxprop_getctx
/etc/sasl2:/etc/sasl:/usr/lib/x86_64-linux-gnu/sasl2:/usr/lib/sasl2

However the Debian package, for new installations, uses the last-on-the-list
directory /usr/lib/sasl2/. Would it be possible to start using /etc/sasl2/
going forward?


Perhaps something like the following for Debian 9/stretch:
 * new installation:
   * create /etc/sasl2/, put files there
   * link /usr/lib/sasls2 to /etc/sasl2
 * upgrade:
   * check for presense of /etc/sasl2 and /usr/lib/sasl2
     * if both exist, do nothing
     * if only one exists, link the other to it
       * /usr/lib/sasl2 will probably exist, so link /etc/sasl2 to it
 * update documentation to refer to /etc/sasl2 exclusively
 * add a README to inform folks that /usr/lib/sasl2 is depreciated, and
   they should put/move all file from it to /etc/sasl2

Then in Debian 10/buster, don't create /usr/lib/sasl2 in the .deb file. Also
perhaps try removing it completely from the search path early in the release
cycle.

#798462#10
Date:
2015-09-10 13:42:29 UTC
From:
To:
Hi David,

could you please describe what problem are you trying to solve?

Cheers,
Ondrej

#798462#17
Date:
2015-09-10 14:17:08 UTC
From:
To:
Consistency.

Just about all configuration items on a Linux/Unix system are placed in
/etc, except for the Cyrus SASL packages where there is no
/etc/sasl{,2}/, but rather a /usr/lib/sasl2 (and
/usr/lib/x86_64-linux-gnu/sasl2). It's confusing because /etc/sasldb2
and /etc/saslauthd.conf are in /etc, but not smtpd.conf, slapd.conf,
etc., by default.

The fact that I had to run strings(1) to figure out that /etc/sasl2 is
even possible for the Debian packages is slightly silly IMHO.

RH/CentOS has both /etc/sasl2 and /usr/lib64/sasl2 in their RPMs
(without the (perhaps over-complicated?) linking) I proposed. At the
very least, having /etc/sasl2 in the .deb file would help in that you
can easy figure things out with an 'ls -ld /etc/sasl*'. As someone new
to SASL, /usr/lib/sasl2/*.conf is very odd:

https://en.wikipedia.org/wiki/Principle_of_least_astonishment

I just think it would be better for everyone if things were more
consistent, especially those of us who are new to SASL and trying to
figure things out the first time.

#798462#22
Date:
2015-09-10 19:42:15 UTC
From:
To:
So if I understand you correctly, you want to add "/etc/sasl2" directory
to the package + on upgrades and change the documentation (perphaps
adding README.Debian to the package)?

Feel free to send a patch to accomplish that, it seems reasonable to do
this. (I am not checking the source package, since I am at home
computer, responding really quickly to you, so I don't know the current
status of the package.)

BTW cyrus-sasl2 is still in dire need of co-maintainers...

Cheers,
Ondrej

#798462#27
Date:
2017-04-13 15:33:30 UTC
From:
To:
I was reviewing some stuff and ran across this bug I filed a while ago.
I do not know if this is the best way to do this, but:

I have created a "preinst" script to try to create /etc/sasl2/ by
default, but handle situations where /usr/lib/sasl2/ already exists (and
create softlinks for compat). There is also a "postrm" script to try to
handle the various clean-up situations.

Please see attached.

Regards,
David

#798462#34
Date:
2022-04-15 12:12:54 UTC
From:
To:
Your assumption seems that only the /usr/lib/sasl2 directory is taken into account.
However, the programs read also /etc/sasl2 because configdir contains both.

I do not think it is a good idea to introduce this script trickery to let them point to the same
actual directory. What is wrong with having two differnt places to store config files?
Linking from /usr/... to /etc/ and vice versa is a very bad idea.