timrc | wgrant: Long time no speak :) I've observed strange behavior with "apt-cache show"... I was hoping you could set me straight :) | 03:57 |
---|---|---|
wgrant | timrc: Hi! It's been a while. What's the issue? | 04:00 |
timrc | wgrant: 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 |
wgrant | That sounds like a very special module. | 04:02 |
timrc | If you were to "apt-cache show some-package" as a non-root user, apt-cache show wouldn't find anything. | 04:02 |
timrc | The 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/lists | 04:03 |
timrc | But in my case the user executing "apt-cache show" can read the /var/lib/apt/lists location. | 04:03 |
timrc | So 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 |
wgrant | timrc: That's normal. /etc/apt/sources.list and co are all meant to be world-readable. | 04:05 |
wgrant | There are separate files for creds if need be. | 04:05 |
timrc | Okay so the assumption is that you're not using weird modes on /etc/apt/sources.list | 04:06 |
timrc | Though 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 |
timrc | Oh wait scratch that, it needs the url to reconstruct the cache file name. | 04:07 |
timrc | wgrant: Thanks =) | 04:10 |
wgrant | timrc: 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 |
timrc | Wow... 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 |
wgrant | Heh | 04:22 |
wgrant | That'd do it. | 04:22 |
timrc | I 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!