managing security on a folder after deployment

Questions about WAPT Packaging / Requests and help regarding Wapt packages.
Forum Rules
Community Forum Rules
* English support on www.reddit.com/r/wapt
* French community support is available on this forum
* Please prefix the topic title with [RESOLVED] if it is resolved.
* Please do not edit a topic that is tagged [RESOLVED]. Open a new topic referencing the old one.
* Specify the installed WAPT version, full version, and build number (2.2.1.11957 / 2.2.2.12337 / etc.) as well as the Enterprise/Discovery edition.
* Versions 1.8.2 and earlier are no longer supported. The only questions accepted regarding version 1.8.2 are related to upgrading to a supported version (2.1, 2.2, etc.).
* Specify the server OS (Linux/Windows) and version (Debian Buster/Bullseye - CentOS 7 - Windows Server 2012/2016/2019).
* Specify the OS of the administration/package creation machine and the machine with the problematic agent, if applicable (Windows 7/10/11/Debian 11/etc.).
* Avoid asking multiple questions when opening a topic, otherwise it may be ignored. If there are multiple topics, open separate topics, preferably one after the other and not all at the same time (i.e., do not spam the forum).
* Include code snippets, screenshots, and other images directly in the post. Links to Pastebin, Bitly, and other third-party sites will be systematically removed.
* As with any community forum, support is provided voluntarily by members. If you require commercial support, you can contact Tranquil IT's sales department at 02.40.97.57.55
Locked
gbt
Messages: 3
Registration: February 28, 2017 - 08:46

February 28, 2017 - 11:36

Hello,
in a package I run a script at the end that should grant rights to a domain group on a directory of the deployed application.

My script, essai.bat, is:
icacls c:\temp\essai.txt /T /grant "adgroup@mydomain":f
icacls c:\temp\essai.txt /T /grant "everyone":r

The result: the "everyone" group is added, but not the domain group.

Manually running the script gives the expected result.

Thank you all.
User avatar
agauvrit
WAPT Expert
Messages: 238
Registration: Nov 17, 2016 - 10:25
Location: Nantes
Contact :

March 24, 2017 - 2:26 PM

Good morning,

Is this script called by the setup.py file in the WAPT package?

Have you tried executing these lines directly in a run() command?

Code: Select all

run([makepath(WAPT.wapt_base_dir,'vc_redist','icacls.exe'),r'c:\temp\essai.txt','/T /grant "adgroup@mondomaine":f'])
run([makepath(WAPT.wapt_base_dir,'vc_redist','icacls.exe'),r'c:\temp\essai.txt','/T /grant "tout le monde":r'])
Sincerely,

Alexander
gbt
Messages: 3
Registration: February 28, 2017 - 08:46

May 9, 2017 - 08:23

Hi agauvrit,

the script is indeed called from setup.py.
Thank you for the tip about wapt's icacls: it works with a run. :D

Thanks for your help,
Olivier
Gaelds
Messages: 254
Registration: Nov 22, 2015 - 08:37

October 24, 2017 - 09:21

I've tried several different settings for icacls but I keep getting a "returned non-zero exit status 87" error
What settings are needed to grant access to a folder to all users or everyone?

Code: Select all

 run([makepath(WAPT.wapt_base_dir,'vc_redist','icacls.exe'),r'C:\Program Files\SolidWorks Corp','/grant *S-1-1-0:(OI)(CI)M /C /T'])
CalledProcessErrorOutput: Command ['C:\\wapt\\vc_redist\\icacls.exe', 'C:\\Program Files\\SolidWorks Corp', '/grant *S-1-1-0:(OI)(CI)M /C /T'] returned non-zero exit status 87.
Output:u'Param\xe8be invalid \xab\xa0/grant *S-1-1-0:(OI)(CI)M /C /T\xa0\xbb\r\r\n'


The control operates manually.
User avatar
agauvrit
WAPT Expert
Messages: 238
Registration: Nov 17, 2016 - 10:25
Location: Nantes
Contact :

October 24, 2017 - 2:54 PM

Good morning,

Slashes in arguments are interpreted differently; try putting an 'r' in front of the argument list:

Code: Select all

run(makepath(WAPT.wapt_base_dir,'vc_redist','icacls.exe'),r'C:\Program Files\SolidWorks Corp',r'/grant *S-1-1-0:(OI)(CI)M /C /T')
Sincerely,

Alexander
Gaelds
Messages: 254
Registration: Nov 22, 2015 - 08:37

November 6, 2017 - 10:12

So I'm getting a new error message: TypeError: unsupported operand type(s) for +: 'float' and 'str'

with this command:

Code: Select all

run(makepath(WAPT.wapt_base_dir,'vc_redist','icacls.exe'),r'C:\Program Files\SolidWorks Corp',r'/grant *S-1-1-0:(OI)(CI)M /C /T')
Gaelds
Messages: 254
Registration: Nov 22, 2015 - 08:37

January 9, 2018 - 11:13

Sorry, but I'm still stuck using icacls with wapt. On another package where I want to give all users permissions to a directory, I get the following message:
TypeError: unsupported operand type(s) for +: 'float' and 'str'
for the following code:
run(makepath(WAPT.wapt_base_dir,'vc_redist','icacls.exe'),r'%s' %destdir,r'/grant *S-1-1-0:(OI)(CI)M /C /T')

The equivalent command launched manually works:

Code: Select all

C:\wapt\vc_redist\icacls.exe C:\ProFluid44 /grant *S-1-1-0:(OI)(CI)M /C /T
Locked