Bug 141026 - Lock files and privacy (leaking user and computer name)
Summary: Lock files and privacy (leaking user and computer name)
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
(earliest affected)
Hardware: All All
: medium enhancement
Assignee: Siddhant Chaudhary
Whiteboard: target:7.5.0 reviewed:2022
Keywords: difficultyMedium, easyHack, skillCpp, topicUI
Depends on:
Blocks: File-Lock
  Show dependency treegraph
Reported: 2021-03-14 17:11 UTC by Matheod
Modified: 2024-02-15 09:56 UTC (History)
10 users (show)

See Also:
Crash report or crash signature:

Image of UI based OpenLockedQueryBox (128.47 KB, image/png)
2022-03-31 06:16 UTC, Siddhant Chaudhary
Two current File In Use dialogs (25.57 KB, image/png)
2022-06-20 16:11 UTC, Mike Kaganski

Note You need to log in before you can comment on or make changes to this bug.
Description Matheod 2021-03-14 17:11:21 UTC
As a teacher, I create my documents on my personnal computer.
I then display my document on the blackboard with a video projector.

However, I some time end-up with a message telling me my file is locked from editing by XXX. With XXX being my personnel computer name and username (it also contain path to libreoffice which can also leak some informations). All student can see this message. The issue is that my username on my computer is not my real name but the nickname I use on internet. Which means student can see my private nickname and hence see what I say on internet.

Two solutions would be possible :
→ don't show the user/computer name immediatly on the popup but put to button "Show more" to display them.
→ add a settings somewhere in libreoffice to anonymise data in lock file / allow to choose computer / user name in lock file
(or both solution)
Comment 1 Roman Kuznetsov 2021-03-17 18:08:50 UTC
Mike, what do you think here?
Comment 2 Mike Kaganski 2021-03-17 18:45:17 UTC
I think that it's easy not to use nickname used on the Internet. It only takes a change in Options.
Comment 3 Heiko Tietze 2021-05-03 10:20:34 UTC Comment hidden (off-topic)
Comment 4 Mike Kaganski 2021-05-03 10:37:34 UTC
(In reply to Heiko Tietze from comment #3)

The problem of @Matheod was that the normal message telling the user who has locked the file was "nickname used on Internet". This was a user error, when user opened a file on some system, then was attempting to open the same file on another system (and got a legitimate warning - usually in a network environment, this message allows one to know whom to ask to close the file), and the specific situation was that the display was demonstrated to some other people at that time, and user wanted to not show the nickname to those other people. Quite a complex combination, with a simple solution: in your LibreOffice, enter "nickname *not* used on Internet" in Options, instead of "nickname used on Internet".

However, the idea to hide the details under a "[+] Show Details" in the dialog looks unproblematic, and if someone wants to implement it, please do. So both WONTFIX and EASYHACK seem appropriate to me.
Comment 5 Matheod 2021-05-03 12:43:17 UTC
The name displayed is the computer name and OS session name and not the name set in Libreoffice option.
Comment 6 Heiko Tietze 2021-05-07 07:12:33 UTC
The topic was on the agenda for the design team meeting. We agree that hiding sensible information would be nice to have. 

Such a "Show Details" expander could be easily implemented.

uui/source/iahndl-locking.cxx uses STR_OPENLOCKED_MSG that needs to be split into two parts, one sentence being always shown the other enclosed in an expander. Difficulty medium since it is a standard dialog now that could be replaced by a UI based dialog.
Comment 7 Siddhant Chaudhary 2022-03-14 18:25:48 UTC
Hi. I would like to work on this issue. 

As of now I can see that STR_OPENLOCKED_MSG (in this file: https://opengrok.libreoffice.org/xref/core/uui/inc/strings.hrc?r=f9ab3136) takes three arguments, of which ARG1 is the file, ARG2 is the username. I'm not sure what ARG3 is. Can someone please clarify this? Then we can probably split this into two strings in which ARG1 and ARG2 go into the "Show Details" expander, and ARG3 remains visible in the dialogue by default. 

Also, in the handleLockedDocumentRequest_ function in  /core/uui/source/iahndl-locking.cxx, can someone tell me exactly how the dialog box is created and how the arguments are passed to STR_OPENLOCKED_MSG to create the dialogue string? Seeing the function for the first time is a bit confusing. 

Also, what should I learn to be able to add the "Show Details" expander?

Thanks for any help!
Comment 8 Heiko Tietze 2022-03-15 08:38:57 UTC
(In reply to Siddhant Chaudhary from comment #7)
> Hi. I would like to work on this issue. 

Great! To learn how exactly the code works you could debug uui/source/iahndl.cxx UUIInteractionHelper::replaceMessageWithArguments().
Comment 9 Siddhant Chaudhary 2022-03-16 22:00:53 UTC

I tried debugging UUIInteractionHelper::replaceMessageWithArguments(), and now I have a sense of what's going on. I also understood how the dialog box is created (in the AlreadyOpenQueryBox constructor in uui/source/alreadyopen.cxx); now I just need to figure out how the expander button can be implemented (like, what all classes/functions do I need to work with). Can you point me out to this?

Also, on a side note, I think the original problem in this bug only addressed the UUI_DOC_LOAD_LOCK flag (which uses STR_OPENLOCKED_MSG); I think a similar problem also holds for the UUI_DOC_OWN_LOAD_LOCK flag (for that, STR_ALREADYOPEN_MSG is used). Thought that does not print out the username (it just says locked for editing by yourself), the essence is the same. Should this also be addressed, or can we leave it like it is?
Comment 10 Heiko Tietze 2022-03-17 07:16:43 UTC
(In reply to Siddhant Chaudhary from comment #9)
> Should this also be addressed, or can we leave it like it is?

Sure, if you can kill two birds with one stone.
Comment 11 Siddhant Chaudhary 2022-03-31 06:16:36 UTC
Created attachment 179226 [details]
Image of UI based OpenLockedQueryBox
Comment 12 Siddhant Chaudhary 2022-03-31 06:20:40 UTC

I've implemented OpenLockedQueryBox as a UI based dialog. Please see the image attachment of how it looks like, and I'd love to know if any changes need to be made.

For the icon image, I wanted to add the dialog-question icon (the same icon as in the original standard dialog), but it looks like LO doesn't have support for that yet. So, I can either remove the icon all together if it isn't needed, otherwise I can add a new image; but I haven't figured out how to do that yet, and any help will be great.

For the code, I submitted a patch to Gerrit: https://gerrit.libreoffice.org/c/core/+/132342

Could you please review it, and let me know what things need to be changed?

Comment 13 Commit Notification 2022-06-20 13:47:32 UTC
Siddhant Chaudhary committed a patch related to this issue.
It has been pushed to "master":


tdf#141026 Put user and computer name into collapsed section

It will be available in 7.5.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:

Affected users are encouraged to test the fix and report feedback.
Comment 14 Matheod 2022-06-20 14:18:03 UTC
(In reply to Siddhant Chaudhary from comment #11)
> Created attachment 179226 [details]
> Image of UI based OpenLockedQueryBox

Look perfect, thanks.
Comment 15 Mike Kaganski 2022-06-20 16:11:51 UTC
Created attachment 180851 [details]
Two current File In Use dialogs

Thanks for implementing this!

The dialog needs some more love.
1. Please enable extended tips (Options->LibreOffice->General). Then the dialog shows unwanted tooltips everywhere.
2. The dialog now looks completely different compared to e.g. "the file is locked by yourself from a different session". The icon, size, button layout, their names are all different.
Comment 16 Hossein 2022-07-05 23:57:36 UTC
Re-evaluating the EasyHack in 2022

This task is still relevant, as the provided solution only addresses part of the problem. Please see comment #9, 2nd paragraph for the remaining part.
Comment 17 Siddhant Chaudhary 2022-07-10 14:06:41 UTC

I had a minor question about Comment 15: can someone tell how to enable extended tips, i.e what code changes do I need to make to do that? I'm not exactly sure how this is done.

Also, I had put a new comment about the code structure on the gerrit patch: https://gerrit.libreoffice.org/c/core/+/132342. It will be great if someone can give their thoughts on this.
Comment 18 Heiko Tietze 2022-07-11 07:37:16 UTC
(In reply to Siddhant Chaudhary from comment #17)
> I had a minor question about Comment 15: can someone tell how to enable
> extended tips, i.e what code changes do I need to make to do that? I'm not
> exactly sure how this is done.

How to enable: https://help.libreoffice.org/latest/en-US/text/shared/05/00000120.html

Regarding the code, search for extended_tip to find prototypes.

@Seth, @Olivier: How to implement extended tips could be added to the wiki.
Comment 19 Mike Kaganski 2022-07-11 07:42:43 UTC
(In reply to Siddhant Chaudhary from comment #17)
> I had a minor question about Comment 15: can someone tell how to enable
> extended tips, i.e what code changes do I need to make to do that? I'm not
> exactly sure how this is done.

I am sorry if I created a confusion with unclear wording in comment 15. I didn't suggest to add extended tips to the dialog; instead, I described how you can *discover* the existing problem in the UI: *if* you enable display of extended tips, you will see the *incorrect/unwanted* extended tips in the dialog, which should *either* be removed, *or* changes to be meaningful.

I can't comment on the code pointers how to implement either fix, sorry.
Comment 20 Dan.Ka 2024-02-14 10:56:29 UTC
Is it possible to set the  section "[+] Show Details" to be shown/folded out by default?

Use case: 
In our office we are using LibreOffice. Our documents reside on a server share that everybody in our office can access. We rely on the lock file mechanism to prevent people from editing the same document at the same time. Sometime people forget to close documents. So we rely on the information presented under "[+] Show Details" to identify this person who holds the lock. Then we can ask this person to close the file and thus release the lock.