/srv/irclogs.ubuntu.com/2016/09/22/#launchpad-dev.txt

timrcwgrant: Long time no speak :) I've observed strange behavior with "apt-cache show"... I was hoping you could set me straight :)03:57
wgranttimrc: Hi! It's been a while. What's the issue?04:00
timrcwgrant: This one is weird.  Ansible has a module called 'apt_repository' and this module will create a sources file in /etc/apt/sources.list.d if it doesn't already exist and give it a file mode.  This file mode _weirdly_ defaults to 420 (root user readable, root group writeable)04:01
wgrantThat sounds like a very special module.04:02
timrcIf you were to "apt-cache show some-package" as a non-root user, apt-cache show wouldn't find anything.04:02
timrcThe reason _seems_ to be that it scans /etc/apt/sources.list.d and if it can _open_ the file, it will use it when scanning /var/lib/apt/lists04:03
timrcBut in my case the user executing "apt-cache show" can read the /var/lib/apt/lists location.04:03
timrcSo I could literally grep for the package I'm interested in /var/lib/apt/lists but I could not discover it using "apt-cache show"04:04
wgranttimrc: That's normal. /etc/apt/sources.list and co are all meant to be world-readable.04:05
wgrantThere are separate files for creds if need be.04:05
timrcOkay so the assumption is that you're not using weird modes on /etc/apt/sources.list04:06
timrcThough wouldn't it be better to just do the c++ equivalent of "ls -1 /etc/apt/sources.list" and use that to compose your search space?04:06
timrcOh wait scratch that, it needs the url to reconstruct the cache file name.04:07
timrcwgrant: Thanks =)04:10
wgranttimrc: Right, it could approximate that by just looking at every file in /var/lib/apt/lists, but there can be other properties in sources.list (eg. disabling signature verification) that mean it can't really do that.04:15
timrcWow... so the person who wrote this module had the right idea.  This is a real bug... the default mode is 0644, but he does int('0644', 8) which turns it into 420 and then I guess does a chmod 420 on the file.04:21
wgrantHeh04:22
wgrantThat'd do it.04:22
timrcI just thought he was smoking pot.04:22
=== frankban|afk is now known as frankban
=== mup_ is now known as mup
=== frankban is now known as frankban|afk

Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!