[Dovecot] 2.1.rc1 (51d87deb5c26): %{gid} modification problem
I tried to apply the X modifier to the %{gid} variable: 'mail_attachment_dir = /srv/mail/.SiS/%X{gid}'. But the name of the created directory is '0', instead of '11172'.
Regards, Pascal
The trapper recommends today: c01dcofe.1134416@localdomain.org
On 12/10/2011 04:39 PM Pascal Volk wrote:
But the name of the created directory is '0', instead of '11172'.
0 was the hex version of a empty string. For now I've reverted changeset 499e4916bed5. This brings the content of %{gid} back and %X{gid} works now as expected.
Regards, Pascal
The trapper recommends today: beeffeed.1134417@localdomain.org
On 12/10/2011 05:09 PM Pascal Volk wrote:
… For now I've reverted changeset 499e4916bed5.
OK, I found the problem. You forgot to append the GID to the var_expand_table before returning it. The attached patch works fine for me.
It also adds the short variable %g. I hope that's OK.
Regards, Pascal
The trapper recommends today: beeffeed.1134417@localdomain.org
On Sat, 2011-12-10 at 17:46 +0100, Pascal Volk wrote:
On 12/10/2011 05:09 PM Pascal Volk wrote:
… For now I've reverted changeset 499e4916bed5.
OK, I found the problem. You forgot to append the GID to the var_expand_table before returning it. The attached patch works fine for me.
Yes, fixed that :)
It also adds the short variable %g. I hope that's OK.
I think %{gid} is used so rarely that it doesn't really need a short variable. It probably would be better in future to avoid short variables entirely in most places.
I also did larger changes to mail-storage-service.c so that in situations when %var expansion is done while running as root, the uid/gid expand properly instead of expanding to 0. This probably happens with some doveadm -A commands or something..
participants (2)
-
Pascal Volk
-
Timo Sirainen