<div dir="ltr">Package: libp11-kit0<div>Version: 0.23.3-2</div><div>Severity: important</div><div><br></div><div>In my setup I have opencryptoki installed (because it's a dependency of tpm-tools, not because I actually need opencryptoki).  This means that the /etc/pkcs11 directory looks like this:</div><div><br></div><div><div>$ ls -ld /etc/pkcs11 /etc/pkcs11/</div><div>lrwxrwxrwx 1 root root     21 Jan  3 14:14 /etc/pkcs11 -> /var/lib/opencryptoki</div><div>drwxrwx--- 8 root pkcs11 4096 Apr 21 10:33 /etc/pkcs11/</div></div><div><br></div><div>I also have an apt configuration that is pointing apt to use a pkcs11 provider.</div><div><br></div><div>When doing the actual https run, apt runs with the user "_apt" and group "nogroup". This means that apt has no permission to access the /etc/pkcs11 directory as shipped by opencryptoki.</div><div><br></div><div>So, this happens:</div><div>p11-kit: couldn't open config file: /etc/pkcs11/pkcs11.conf: Permission denied<br></div><div><br></div><div>The workaround is to change the permissions of the directory to add world execution:</div><div>sudo chmod o+x /etc/pkcs11<br></div><div><br></div><div>While this is ok as a workaround, it seems rather silly that libp11-kit works fine when the file doesn't exist (there's no pkcs11.conf inside /etc/pkcs11), but not when it can't access it.  This is rooted in this line:<br></div><div><br></div><div><a href="http://sources.debian.net/src/p11-kit/0.23.3-2/p11-kit/conf.c/?hl=201#L220">http://sources.debian.net/src/p11-kit/0.23.3-2/p11-kit/conf.c/?hl=201#L220</a><br></div><div>config = _p11_conf_parse_file (system_conf, NULL, CONF_IGNORE_MISSING);<br></div><div><br></div><div>Making this change would fix the issue:</div><div>config = _p11_conf_parse_file (system_conf, NULL, CONF_IGNORE_MISSING | CONF_IGNORE_<span style="color:rgb(34,34,34);font-family:arial,helvetica,sans-serif;font-size:13px">ACCESS_DENIED</span>);</div><div><br></div></div><div dir="ltr">-- <br></div><div data-smartmail="gmail_signature"><div dir="ltr">Cheers,<div>Marga</div></div></div>