Bug in lin_tokens.cpp

Dear all,

there is a bug in lin_tokens.cpp (client:,

this part of the code:
if( (mode & igrp) == igrp) {
int64 tid = read_token_lazy_cache(cache, dao, false, uid);

should be:
if( (mode & igrp) == igrp) {
int64 tid = read_token_lazy_cache(cache, dao, false, gid);

i.e., the last argument in read_token_lazy_cache is incorrect.

The bug triggers the following false error report in the log:
“Error getting internal id for group with id XXX”

This happens especially when there is a larger diversity between uids and gids definitions. Then, there is a lower chance that no group corresponds to provided uid. In our cases, this happens for a huge number of files (hundreds of thousands), slowing processing, and flooding the log with incorrect error reports.

Best regards

1 Like

While here, is there any good docs on the code? How all the files fit together, what does what, which files are threads and do what on server or client, etc? I’m looking through the code to figure out overall structure of how the app runs both sides, how easy/hard it is to add functionality, etc.

Might have been useful to add “Somewhere round line 674”. In urbackupclient/lin_tokens.cpp

Save anyone wanting to fix it that finds this a bit of hunting round. :upside_down_face:

1 Like

Thanks for the heads up! Fixed.