Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unsecure permissions for /tmp/tuniqueinstance_USER_cudatext.0 #4094

Open
bogen85 opened this issue Apr 23, 2022 · 4 comments
Open

Unsecure permissions for /tmp/tuniqueinstance_USER_cudatext.0 #4094

bogen85 opened this issue Apr 23, 2022 · 4 comments

Comments

@bogen85
Copy link
Contributor

bogen85 commented Apr 23, 2022

Where USER is the username of the one running CudaText.

This is a follow up to #4079 which was closed (as the issue of uniqueness of the name on a multi user system was resolved).

CudaText 1.162.5.0 contained the fix for #4079 but the permissions issue noted there is still unresolved in that release.

Permission should be 0600 on unix-like systems, not 0664
( rw------- instead of rw-rw-r-- )

This issue serves a placeholder until the permissions issue is resolved.

@Alexey-T
Copy link
Owner

Currently this filename is createed very deeply in FPC code so I (not sure) don't have access to this filename (no property for filename, seems).

@bogen85
Copy link
Contributor Author

bogen85 commented Apr 23, 2022

Understood. I'll take a look when I get a chance and see if I can figure something out.

One of the proposed fixes for #4079 was to put this file in a temp folder in the user's home directory.

This would mitigate the permissions issue as well, if it is possible to use a folder in the user's home directory.

@Alexey-T
Copy link
Owner

For that, we need to change GetTempDir(true) to GetTempDir(false) here

constructor TPipeClientComm.Create(AOWner: TSimpleIPCClient);
begin
  inherited Create(AOWner);
  FFileName:=Owner.ServerID;
  If (Owner.ServerInstance<>'') then
    FFileName:=FFileName+'-'+Owner.ServerInstance;
  if FFileName[1]<>'/' then
    FFileName:=GetTempDir(true)+FFileName;
end;

this is in FPC again.
fpcsrc/packages/fcl-process/src/unix/simpleipc.inc

@Alexey-T
Copy link
Owner

Made an issue
https://gitlab.com/freepascal.org/fpc/source/-/issues/39690

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants