Skip to content
This repository has been archived by the owner on Jun 13, 2023. It is now read-only.

Build error on Raspbian #124

Open
gniemirowski opened this issue Jul 26, 2018 · 4 comments
Open

Build error on Raspbian #124

gniemirowski opened this issue Jul 26, 2018 · 4 comments

Comments

@gniemirowski
Copy link

I have following build error on Raspian Stretch (32-bit Linux for Raspberry Pi):

/home/pi/psl-omi-provider/src/Shell.c: In function ‘Shell_CreateInstance’:
/home/pi/psl-omi-provider/src/Shell.c:956:67: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
         if (Stprintf(shellData->shellId, ID_LENGTH, MI_T("%llx"), (MI_Uint64) shellData) < 0)
                                                                   ^
/home/pi/psl-omi-provider/src/Shell.c: In function ‘Shell_Invoke_Command’:
/home/pi/psl-omi-provider/src/Shell.c:1362:67: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
         Stprintf(commandData->commandId, ID_LENGTH, MI_T("%llx"), (MI_Uint64)commandData);
                                                                   ^
cc1: all warnings being treated as errors
CMakeFiles/psrpomiprov.dir/build.make:62: recipe for target 'CMakeFiles/psrpomiprov.dir/Shell.c.o' failed
make[3]: *** [CMakeFiles/psrpomiprov.dir/Shell.c.o] Error 1

Is it possible to build for 32-bit Linux?

@dantraMSFT
Copy link
Contributor

We don't support 32 bit builds for PSRP. Are you also porting OMI to Raspberry Pi?

@gniemirowski
Copy link
Author

No, I just wanted to build PSRP. The build succeeds after fixing those two lines (%llx changed to %lx, MI_Uint64 changed to MI_Uint32). Unfortunately when I try to connect using basic auth I get MI_RESULT_ACCESS_DENIED. There is no problem when connecting from Windows client using basic auth, so I guess there is no problem with server machine.

@dantraMSFT
Copy link
Contributor

dantraMSFT commented Jul 27, 2018

if you want to use basic auth, you have to use https (-UseSSL). PSRP/Linux does not support basic auth unless used for HTTPS.

See this doc:
https://github.com/PowerShell/PowerShell-Docs/blob/staging/reference/6/Microsoft.PowerShell.Core/About/about_Remote_Requirements.md#basic-authentication-limitations-on-linux-and-macos

NOTE: If you're doing this for testing purposes, you can install a self-signed cert on the target.

If you do, you'll create a PSSessionOption instance as well when creating the PSSession. Something like the following:

$opt = [System.Management.automation.Remoting.PSSessionOption]::new()
$opt.SkipCACheck = $true
$opt.SkipCNCheck = $true
$cred = get-credential myuser

$session = New-PSSession -ComputerName myhost -Authentication Basic -Credential $cred -SessionOption $opt -UseSSL

@gniemirowski
Copy link
Author

Thanks, it works now :) Maybe README.md should be updated?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants