You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Need option to set permissions on created files/dir #346
With a recent change in Qt, there is a check for correct permission on the user runtime directory (/run/user/xxxx), where when the permission is wrong, we will never get the runtime directory from QStandardPaths::RuntimeLocation. When this fails, many thing became broken. For example we are unable to identify whether a Qt app is running under Flatpak.
The error from Qt is:
QStandardPaths: wrong permissions on runtime directory /run/user/1000, 7755 instead of 7700
We use bwrap --directory to make the runtime directory on the root tmpfs, but there is currently no way to tell bwrap to create it with some particular permissions.
I guess we would need to add a way to chmod the directory.
@grulja did you tried submit revert that patch upstream considering it breaks flatpak?
I did not, because to me it doesn't seem to be a Qt issue. In my opinion they are correct that they shouldn't be changing the permissions of the runtime directory.
I did not, because to me it doesn't seem to be a Qt issue. In my opinion they are correct that they shouldn't be changing the permissions of the runtime directory.
@grulja the problem isn't they change permissions, the problem is they stop using existing runtime dir when it has different permissions than they expect. Runtime dir isn't solely owned by Qt and they shouldn't put themselves in position to decide what is correct runtime dir and what isn't.
@grulja: I agree qt shouldn't be changing permissions but it seems to enforce the exact set of permissions, but it should IMO just check that the permissions are sufficient for Qt (which they would be I think as Qt wants 700 and bubblewrap provides 755).
In the gpg-agent case that requires the same functionality enforcing the permissions probably makes more sense.
"--file 13 /etc/my.cnf " would also create a file with perms 666 by default, and MySQL would simply refuse reading it because of:
"Warning: World-writable config file '/etc/my.cnf' is ignored"
I'd suggest allowing to specify umask/chmod for created files (folders).
#406 implements options that would let you use --dir /run/user/1000 --chmod 0700 /run/user/1000 - or alternatively --perms 0700 --dir /run/user/1000, but that only works if you make sure /run/user/1000 doesn't already exist.
Activity
[-]Wrong permission on user runtime directory[/-][+]Need option to set permissions on created files/dir[/+]alexlarsson commentedon Feb 6, 2020
We use bwrap --directory to make the runtime directory on the root tmpfs, but there is currently no way to tell bwrap to create it with some particular permissions.
I guess we would need to add a way to chmod the directory.
Erick555 commentedon Feb 28, 2020
@grulja did you tried submit revert that patch upstream considering it breaks flatpak?
Erick555 commentedon Feb 29, 2020
Reverting only the last chunk should suffice:
grulja commentedon Mar 2, 2020
I did not, because to me it doesn't seem to be a Qt issue. In my opinion they are correct that they shouldn't be changing the permissions of the runtime directory.
Erick555 commentedon Mar 2, 2020
@grulja the problem isn't they change permissions, the problem is they stop using existing runtime dir when it has different permissions than they expect. Runtime dir isn't solely owned by Qt and they shouldn't put themselves in position to decide what is correct runtime dir and what isn't.
cmollekopf commentedon Mar 9, 2020
@grulja: I agree qt shouldn't be changing permissions but it seems to enforce the exact set of permissions, but it should IMO just check that the permissions are sufficient for Qt (which they would be I think as Qt wants 700 and bubblewrap provides 755).
In the gpg-agent case that requires the same functionality enforcing the permissions probably makes more sense.
smtalk commentedon Apr 15, 2020
"--file 13 /etc/my.cnf " would also create a file with perms 666 by default, and MySQL would simply refuse reading it because of:
"Warning: World-writable config file '/etc/my.cnf' is ignored"
I'd suggest allowing to specify umask/chmod for created files (folders).
Implement --perms and --chmod
smcv commentedon Feb 16, 2021
#406 implements options that would let you use
--dir /run/user/1000 --chmod 0700 /run/user/1000- or alternatively--perms 0700 --dir /run/user/1000, but that only works if you make sure/run/user/1000doesn't already exist.smcv commentedon Feb 16, 2021
Workaround: use
--bind-file 13 /etc/my.cnf, which defaults to 0600.Or, #406 would let you use
--perms 0600 --bind-file 13 /etc/my.cnf.Implement --perms and --chmod
Implement --perms and --chmod
Implement --perms and --chmod
Implement --perms and --chmod
Implement --perms and --chmod
Implement --perms and --chmod
Implement --perms and --chmod