Jump to content

Mod Manager sets permissions wrongly


Aeioyoo

Recommended Posts

We have custom scripts for mod installs that rename folders, move stuff etc.

 

However, by default TCAdmin sets file permissions AFTER all custom scripts

5354a4.jpg

 

This means if you execute as service's user, it can't use any extracted files, which is an issue.

 

Right now only solutions are having a seperate script which chowns the extracted files, or run as service user and risk unintended consequences.

Link to comment
Share on other sites

  • 1 year later...

TCAdmin should set permissions after the custom script has run.
If you're using IronPython, scripts will never execute as the service's user. They'll always execute as an administrator.

You can use the following to set correct permissions:
 

from System import Environment, PlatformID
from TCAdmin.SDK.Misc import Linux, Windows

if Environment.OSVersion.Platform == PlatformID.Unix :
  if Linux.IsRoot() :
    Linux.SetDirectoryOwnerAutoDetect('/path/', True)
else :
 owner = Windows.GetOwner(ThisService.RootDirectory)
 Windows.SetDirectoryOwner('C:\path\', str(owner), True)

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Terms of Use