oracle / oracle/oci-cli

OCI in powershell 7 show erros of file permissions

Open
#655 11 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

SDK
Dominant language
Python
Stars
669
Forks
236
Avg merge
1m
Merged PRs (30d)
4

Description

Running any command with oci in powershell 7.3.3 the follow warning appears:

WARNING: Permissions on C:\Users\giova\.oci\config are too open.
The following users  / groups have permissions to the file and should not: Get-Acl : The 'Get-Acl' command was found in the module 'Microsoft.PowerShell.Security', but the module could not be, loaded. For more information, run 'Import-Module Microsoft.PowerShell.Security'., At line:1 char:37, + $ex_perms=@();$defaults=@();$macls=(Get-Acl "C:\Users\giova\.oci\conf ..., +                                     ~~~~~~~, + CategoryInfo          : ObjectNotFound: (Get-Acl:String) [], CommandNotFoundException, + FullyQualifiedErrorId : CouldNotAutoloadMatchingModule.
To fix this please try executing the following command:
oci setup repair-file-permissions --file C:\Users\giova\.oci\config
Alternatively to hide this warning, you may set an environment variable; Windows and PowerShell commands follow:
SET OCI_CLI_SUPPRESS_FILE_PERMISSIONS_WARNING=True
$Env:OCI_CLI_SUPPRESS_FILE_PERMISSIONS_WARNING="True"

WARNING: Permissions on C:\Users\giova\.oci\config are too open.
The following users  / groups have permissions to the file and should not: Get-Acl : The 'Get-Acl' command was found in the module 'Microsoft.PowerShell.Security', but the module could not be, loaded. For more information, run 'Import-Module Microsoft.PowerShell.Security'., At line:1 char:37, + $ex_perms=@();$defaults=@();$macls=(Get-Acl "C:\Users\giova\.oci\conf ..., +                                     ~~~~~~~, + CategoryInfo          : ObjectNotFound: (Get-Acl:String) [], CommandNotFoundException, + FullyQualifiedErrorId : CouldNotAutoloadMatchingModule.
To fix this please try executing the following command:
oci setup repair-file-permissions --file C:\Users\giova\.oci\config
Alternatively to hide this warning, you may set an environment variable; Windows and PowerShell commands follow:
SET OCI_CLI_SUPPRESS_FILE_PERMISSIONS_WARNING=True
$Env:OCI_CLI_SUPPRESS_FILE_PERMISSIONS_WARNING="True"

WARNING: Permissions on C:\Users\giova\.oci\oci_api_key-nopass.pem are too open.
The following users  / groups have permissions to the file and should not: Get-Acl : The 'Get-Acl' command was found in the module 'Microsoft.PowerShell.Security', but the module could not be, loaded. For more information, run 'Import-Module Microsoft.PowerShell.Security'., At line:1 char:37, + $ex_perms=@();$defaults=@();$macls=(Get-Acl "C:\Users\giova\.oci\oci_ ..., +                                     ~~~~~~~, + CategoryInfo          : ObjectNotFound: (Get-Acl:String) [], CommandNotFoundException, + FullyQualifiedErrorId : CouldNotAutoloadMatchingModule.
To fix this please try executing the following command:

Running the command oci setup repair-file-permissions --file C:\Users\giova.oci\config has no effect.

I think the problem is the module Microsoft.Powershell.Security not being loaded then the command fails and oci thinks the file permissions are open when they are not.

Running the command on the old powershell 5 works.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The payload names no source files or tests; start by reproducing an OCI CLI command and repair-file-permissions in PowerShell 7.3.3, then compare the same commands in PowerShell 5. Trace the file-permission warning and Microsoft.PowerShell.Security handling. Done means valid permissions no longer produce the warning and repair-file-permissions has an observable effect.

Written by the indexing model from the issue text.

Assessment

Tech stack
powershell, python
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.