psl-omi-provider icon indicating copy to clipboard operation
psl-omi-provider copied to clipboard

Build error on Raspbian

Open gniemirowski opened this issue 7 years ago • 4 comments

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?

gniemirowski avatar Jul 26 '18 11:07 gniemirowski

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

dantraMSFT avatar Jul 26 '18 17:07 dantraMSFT

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.

gniemirowski avatar Jul 27 '18 12:07 gniemirowski

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

dantraMSFT avatar Jul 27 '18 22:07 dantraMSFT

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

gniemirowski avatar Jul 29 '18 22:07 gniemirowski