[GH-ISSUE #268] Quick help needed - finding userinfo.db path for a given UID based on, well, UID #212

Closed
opened 2026-02-26 12:34:17 +03:00 by kerem · 3 comments
Owner

Originally created by @LindaFerum on GitHub (Jun 27, 2024).
Original GitHub issue: https://github.com/cbeuw/Cloak/issues/268

So I'm prototyping something that uses Cloak and of course I need the long since requested feature of "regularly reset user quotas"

I've been trying out various bolt db tools with some bash glue and getting promising results but I still can't sort out how to go from "user's UID" (which I of course know) to a particular path in the userinfo.db (as seen in say boltbrowser database viewer etc.)

for very small number of users one could configure pairs in such a way that their value would serve as indirect identifier (setting up expiry to a particular long value that would also identify user, etc. and then leverage that) but that strikes me as very dirty hackage and I would like to have a cleaner solution

Please pardon for shameless tag @notsure2 @cbeuw but my crops are dying (technically not germinating unless I can sort this one out ;-) )

Originally created by @LindaFerum on GitHub (Jun 27, 2024). Original GitHub issue: https://github.com/cbeuw/Cloak/issues/268 So I'm prototyping something that uses Cloak and of course I need the long since requested feature of "regularly reset user quotas" I've been trying out various bolt db tools with some bash glue and getting promising results but I still can't sort out how to go from "user's UID" (which I of course know) to a particular path in the userinfo.db (as seen in say boltbrowser database viewer etc.) for very small number of users one could configure pairs in such a way that their value would serve as indirect identifier (setting up expiry to a particular long value that would also identify user, etc. and then leverage that) but that strikes me as very dirty hackage and I would like to have a cleaner solution Please pardon for shameless tag @notsure2 @cbeuw but my crops are dying (technically not germinating unless I can sort this one out ;-) )
kerem closed this issue 2026-02-26 12:34:17 +03:00
Author
Owner

@LindaFerum commented on GitHub (Jun 27, 2024):

gently tagging @HirbodBehnam in the hope they may have some insight into this

<!-- gh-comment-id:2194300203 --> @LindaFerum commented on GitHub (Jun 27, 2024): gently tagging @HirbodBehnam in the hope they may have some insight into this
Author
Owner

@LindaFerum commented on GitHub (Jun 27, 2024):

Okay, I see, the buckets are the UIDs but the base64 encoding is throwing most command line tools off (boltbrowser somehow manages to represent them conveniently but that doesn't help me do anything useful with CLI)

<!-- gh-comment-id:2194331183 --> @LindaFerum commented on GitHub (Jun 27, 2024): Okay, I see, the buckets are the UIDs but the base64 encoding is throwing most command line tools off (boltbrowser somehow manages to represent them conveniently but that doesn't help me do anything useful with CLI)
Author
Owner

@LindaFerum commented on GitHub (Jun 27, 2024):

Okay I sorted it out myself, so leaving a breadcrumb of recipe for posterity and anyone else trying to hack together things with cloak.

One can use base64 --decode to pass "CLI readable UID" to a bolt database command line tool.

Simple test bash oneliner so future generations of cloak users have it easier than I did ;-) :

sudo bash -c "echo "test" ; echo "" ; varbuck=$(printf "JatJTpCUBipHu3+qiJ0xBA==" | base64 --decode) ; echo "" ; echo "$varbuck" ; echo "" ; /home/boss/go/bin/bbolt keys /etc/cloak/userinfo.db "$varbuck""

From here on, manipulating the userinfo.db using command line tools (and thus cron) becomes much more plausible

<!-- gh-comment-id:2194359022 --> @LindaFerum commented on GitHub (Jun 27, 2024): Okay I sorted it out myself, so leaving a breadcrumb of recipe for posterity and anyone else trying to hack together things with cloak. One can use base64 --decode to pass "CLI readable UID" to a bolt database command line tool. Simple test bash oneliner so future generations of cloak users have it easier than I did ;-) : sudo bash -c "echo "test" ; echo "" ; varbuck=$(printf "JatJTpCUBipHu3+qiJ0xBA==" | base64 --decode) ; echo "" ; echo "$varbuck" ; echo "" ; /home/boss/go/bin/bbolt keys /etc/cloak/userinfo.db "$varbuck"" From here on, manipulating the userinfo.db using command line tools (and thus cron) becomes much more plausible
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/Cloak#212
No description provided.