ID 351248 - [LINUX] safe mode will write files to the application-based plugins directory if user has full permissions

Follow

Problem summary
In a Linux environment, users by default are not given permission to write to their application-based 'usr/local/NukeVersion/plugins' or '/usr/home/NukeVersion/plugins' folder. As changing any information in the application-based location is not recommended.

If permissions allows access to these folders, when safe mode is launched two files will be created in the applications directory: uistate.ini and preferences.nk (see below)
​​

​​

This is caused by the user having full access permissions to either the folder structure the highest permissions and can be reproduced by either:

- Installing Nuke to your /home/username (giving the user full permissions on the file structure)

- Allowing full permissions to the applications-based plugin folder through either sudo or through an admin's account.

On further investigation, the two files appear to be generated after the following 'Usage Statistics' prompt (see below)


The files contain your current preferences and the selection you chose for hte above usage statistics (see below)
​  ​


Note: These files are only added to this folder and tests with altering the contents show no changes to your working environment.

Customer reported version
nuke.10.5v7

Customer reported platform
fedora

Steps to reproduce

1) Ensure that your Nuke is installed in the '/usr/local' directory

2) Open the 'usr/local/NukeVersion/plugin' location and sort by creation date, ensuring​ that you can see the last created file. Leave this window open and visible. (see below)


2) Open a Terminal window and enter the below command. This will allow all users to read, write and execute. Also ensure sudo is entered to allow admin privileges.

sudo chmod 777 -R /usr/local/Nuke10.5v7/plugins
Note: Be careful using sudo, as sudo is root.

3) Now that the folder has full write permissions, run the following terminal command to launch the Nuke release in safe mode, in this example it is Nuke 10.5v7.
'/usr/local/Nuke10.5v7/Nuke10.5' --safe

4) Press either yes or no when you are prompted with the 'Usage Statistics' message box.

5) View the plugins directory you had open before, you will now notice the edition of the above mentioned files.

Result: The two files from the prompt have been created in your applications directory and not your user directory.

6) Change the permissions back to the standard permissions using the following terminal command.
sudo chmod 755 -R /usr/local/Nuke10.5v7/plugins

7) Run the below terminal code as per above to run Nuke in safe mode
'/usr/local/Nuke10.5v7/Nuke10.5' --safe
Result: The files will not be written to this directory as expected

Workaround
As per above, if you find your files are being written to the application-based directory, ensure that you set your permissions for this folder and its parent folder to 755 permissions using the following command:
sudo chmod 755 -R /usr/local/Nuke10.5v7/plugins
In addition, ensure that anyone that has global admin privileges is aware of this issue, until revised in a future Nuke release.

Reproduced by support
This bug has been reproduced in:
Nuke 11.1v3 - CentOS 6.9
Nuke 11.1v1 - CentOS 6.9
Nuke 11.0v4 - CentOS 6.9
Nuke 11.0v1 - CentOS 6.9
Nuke 10.5v7 - CentOS 6.9
Nuke 10.5v1 - CentOS 6.9
Nuke 10.0v6 - CentOS 6.9
Nuke 10.0v4 - CentOS 6.9 - regression

Unable to reproduce bug in:
Nuke 11.1v3 - Windows 7 - MacOS 10.13.4
Nuke 10.0v4 - Windows 7 - MacOS 10.13.4
Nuke 10.0v3 - CentOS 6.9 - Windows 7 - MacOS 10.13.4

Earliest version tested
Nuke 10.0v3
- This user statistics prompt that appears to be causing the issue, was not present in Nuke 10.0v3

Expected behaviour
There should not be any data created in the application directories, especially in safe mode

Actual behaviour
Two files are being created from using safe mode into an applications directory.

    We're sorry to hear that

    Please tell us why