debtags update called from packagesearch results in
/var/lib/debtags/* files to have restricitve permissions
Benjamin Mesing
bensmail at gmx.net
Tue Oct 10 07:11:34 UTC 2006
Hello,
> Wow. What the... What is the umask you have in pkgsearch? It should
> just follow the umask...
Ahh, that's the problem!
root umask is 022 and the umask of my user is 027. So when launching
"debtags update" from inside packagesearch using "su -c" the users umask
is used, resulting in the problems described. When launching "debtags
update" from a root login, roots umask is applied and nothing goes
wrong.
> This is the code I use:
>
> // Read the current umask
> mode_t mask = umask(0);
> umask(mask);
> // Set the file permissions
> if (fchmod(fd, 0666 & ~mask) == -1)
> throw wibble::exception::System("setting permissions on file " + tmpname);
>
> And still, I'd only use that code on the .idx files, not on the other
> files. It sounds to me that the umask at rebuilding time has something
> wrong.
I would vote for not considering the umask setting when building the
index files, in fact all files in /var/lib/debtags should be explicitly
set to 0644. Otherwise only root will be able to use debtags, if root's
umask is set to "XX7". I would consider that to be a bug in debtags.
Do you agree or should I fix the umask on the packagesearch side?
Best regards
Ben
More information about the Debtags-devel
mailing list