New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xfreerdp: kbd and size cannot be specified together #4257

Closed
metalefty opened this Issue Nov 21, 2017 · 10 comments

Comments

Projects
None yet
2 participants
@metalefty

metalefty commented Nov 21, 2017

Hello,

I'm experiencing a strange xfreerdp behaviour. It seems the behaviour occurs when both /kbd and /size option are specified in CLI option. xfreerdp doesn't start and shows usage. My xfreerdp is built from master b5d2578.

EDITED:
I realized at later that, actually, the issue occurs /kbd is given in name and also /size is given. If the /kbd is given in hex, it works.

This is FreeRDP version 2.0.0-dev (n/a)
Build configuration: BUILD_TESTING=OFF BUILTIN_CHANNELS=ON HAVE_AIO_H= HAVE_EVENTFD_H= HAVE_EXECINFO_H=1 HAVE_FCNTL_H=1 HAVE_FLAG_SEARCH_PATHS_FIRST=1 HAVE_INTTYPES_H=1 HAVE_MATH_C99_LONG_DOUBLE=1 HAVE_POLL_H=1 HAVE_PTHREAD_MUTEX_TIMEDLOCK_LIB= HAVE_PTHREAD_MUTEX_TIMEDLOCK_LIBS= HAVE_PTHREAD_MUTEX_TIMEDLOCK_SYMBOL= HAVE_SYSLOG_H=1 HAVE_SYS_FILIO_H=1 HAVE_SYS_MODEM_H= HAVE_SYS_SELECT_H=1 HAVE_SYS_SOCKIO_H=1 HAVE_SYS_STRTIO_H= HAVE_TIMERFD_H= HAVE_TM_GMTOFF=1 HAVE_UNISTD_H=1 HAVE_XI_TOUCH_CLASS=1 WITH_ALSA=OFF WITH_CCACHE=ON WITH_CHANNELS=ON WITH_CLIENT=ON WITH_CLIENT_AVAILABLE=1 WITH_CLIENT_CHANNELS=ON WITH_CLIENT_CHANNELS_AVAILABLE=1 WITH_CLIENT_COMMON=ON WITH_CLIENT_INTERFACE=OFF WITH_CUPS=OFF WITH_DEBUG_ALL=OFF WITH_DEBUG_CAPABILITIES=OFF WITH_DEBUG_CERTIFICATE=OFF WITH_DEBUG_CHANNELS=OFF WITH_DEBUG_CLIPRDR=OFF WITH_DEBUG_DVC=OFF WITH_DEBUG_KBD=OFF WITH_DEBUG_LICENSE=OFF WITH_DEBUG_MUTEX=OFF WITH_DEBUG_NEGO=OFF WITH_DEBUG_NLA=OFF WITH_DEBUG_NTLM=OFF WITH_DEBUG_RAIL=OFF WITH_DEBUG_RDP=OFF WITH_DEBUG_RDPDR=OFF WITH_DEBUG_RDPEI=OFF WITH_DEBUG_REDIR=OFF WITH_DEBUG_RFX=OFF WITH_DEBUG_RINGBUFFER=OFF WITH_DEBUG_SCARD=OFF WITH_DEBUG_SND=OFF WITH_DEBUG_SVC=OFF WITH_DEBUG_SYMBOLS=OFF WITH_DEBUG_THREADS=OFF WITH_DEBUG_TIMEZONE=OFF WITH_DEBUG_TRANSPORT=OFF WITH_DEBUG_TSG=OFF WITH_DEBUG_TSMF=OFF WITH_DEBUG_WND=OFF WITH_DEBUG_X11=OFF WITH_DEBUG_X11_CLIPRDR=OFF WITH_DEBUG_X11_LOCAL_MOVESIZE=OFF WITH_DEBUG_XV=OFF WITH_FFMPEG=ON WITH_GFX_H264=ON WITH_GPROF=OFF WITH_GSM=OFF WITH_GSSAPI=OFF WITH_GSTREAMER_0_10=OFF WITH_GSTREAMER_1_0=OFF WITH_ICU=OFF WITH_JPEG=OFF WITH_LIBRARY_VERSIONING=ON WITH_LIBSYSTEMD=OFF WITH_MACAUDIO=ON WITH_MACAUDIO_AVAILABLE=1 WITH_MANPAGES=ON WITH_MBEDTLS=OFF WITH_OPENH264=OFF WITH_OPENSSL=ON WITH_PCSC=OFF WITH_PROFILER=OFF WITH_PULSE=OFF WITH_SAMPLE=OFF WITH_SANITIZE_ADDRESS=OFF WITH_SANITIZE_ADDRESS_AVAILABLE=1 WITH_SANITIZE_LEAK=OFF WITH_SANITIZE_LEAK_AVAILABLE=1 WITH_SERVER=OFF WITH_SERVER_INTERFACE=ON WITH_SMARTCARD_INSPECT=OFF WITH_SSE2=ON WITH_THIRD_PARTY=OFF WITH_VALGRIND_MEMCHECK=OFF WITH_VALGRIND_MEMCHECK_AVAILABLE=1 WITH_X11=ON WITH_X264=OFF WITH_XCURSOR=ON WITH_XEXT=ON WITH_XFIXES=ON WITH_XI=ON WITH_XINERAMA=ON WITH_XKBFILE=ON WITH_XRENDER=ON WITH_XSHM=ON WITH_XV=ON WITH_ZLIB=ON
Build type:          Release
CFLAGS:              -pipe -Os
Compiler:            AppleClang, 8.1.0.8020038
Target architecture: x64

xfreerdp /v:rdp.example.com -> WORKS
xfreerdp /v:rdp.example.com /size:1600x900 -> WORKS
xfreerdp /v:rdp.example.com /kbd:US -> WORKS
xfreerdp /v:rdp.example.com /kbd:US /rfx -> WORKS
xfreerdp /kbd:US /rfx /v:rdp.example.com -> WORKS
xfreerdp /v:rdp.example.com /kbd:US /size:1600x900 -> shows USAGE
xfreerdp /v:rdp.example.com /size:1600x900 /u:meta /sound /rfx /codec-cache:rfx +home-drive /client-hostname:foobar -> WORKS
xfreerdp /v:rdp.example.com /u:meta /sound /rfx /codec-cache:rfx +home-drive /client-hostname:foobar /kbd:US -> WORKS
xfreerdp /v:rdp.example.com /size:1600x900 /u:meta /sound /rfx /codec-cache:rfx +home-drive /client-hostname:foobar /kbd:US -> shows USAGE

When xfreerdp doesn't start, this usage is shown.

FreeRDP - A Free Remote Desktop Protocol Implementation
See www.freerdp.com for more information

Usage: xfreerdp [file] [options] [/v:<server>[:port]]

Syntax:
    /flag (enables flag)
    /option:<value> (specifies option with value)
    +toggle -toggle (enables or disables toggle, where '/' is a synonym of '+')

    /a:<addin>[,<options>]	Addin
    /action-script:<file-name>	Action script
    /admin               	Admin (or console) session
    +aero                	Enable desktop composition (default:off)
    /app:<path> or ||<alias>	Remote application program
    /app-cmd:<parameters>	Remote application command-line parameters
    /app-file:<file-name>	File to open with remote application
    /app-guid:<app-guid>	Remote application GUID
    /app-icon:<icon-path>	Remote application icon for user interface
    /app-name:<app-name>	Remote application name for user interface
    /assistance:<password>	Remote assistance password
    +async-channels      	Asynchronous channels (experimental) (default:off)
    +async-input         	Asynchronous input (default:off)
    +async-transport     	Asynchronous transport (experimental) (default:off)
    +async-update        	Asynchronous update (default:off)
    /audio-mode:<mode>	Audio output mode
    +auth-only           	Authenticate only (default:off)
    -authentication      	Authentication (expermiental) (default:on)
    +auto-reconnect      	Automatic reconnection (default:off)
    /auto-reconnect-max-retries:...	Automatic reconnection maximum retries, 0 for unlimited [0,1000]
    -bitmap-cache        	Enable bitmap cache (default:on)
    /bpp:<depth>	Session bpp (color depth)
    /buildconfig         	Print the build configuration
    /cert-ignore         	Ignore certificate
    /cert-name:<name>	Certificate name
    /cert-tofu           	Automatically accept certificate on first connect
    /client-hostname:<name>	Client Hostname to send to server
    -clipboard           	Redirect clipboard (default:on)
    /codec-cache:rfx|nsc|jpeg	Bitmap codec cache
    -compression         	Enable compression (default:on)
    /compression-level:<level>	Compression level (0,1,2)
    +credentials-delegation	Disable credentials delegation (default:off)
    /d:<domain>	Domain
    -decorations         	Window decorations (default:on)
    /disp                	Display control
    /drive:<name>,<path>	Redirect directory <path> as named share <name>
    +drives              	Redirect all mount points as shares (default:off)
    /dvc:<channel>[,<options>]	Dynamic virtual channel
    /echo                	Echo channel
    -encryption          	Encryption (experimental) (default:on)
    /encryption-methods:...	RDP standard security encryption methods
    /f                   	Fullscreen mode
    -fast-path           	Enable fast-path input/output (default:on)
    +fipsmode            	Enable FIPS mode (default:off)
    +fonts               	Enable smooth fonts (ClearType) (default:off)
    /frame-ack:<number>	Number of frame acknowledgement
    /from-stdin          	Read credentials from stdin, do not use defaults.
    /g:<gateway>[:<port>]	Gateway Hostname
    /gateway-usage-method:direct|detect	Gateway usage method
    /gd:<domain>	Gateway domain
    /gdi:sw|hw	GDI rendering
    +gestures            	Consume multitouch input locally (default:off)
    /gfx[:RFX|AVC420|AVC444]	RDP8 graphics pipeline (experimental)
    /gfx-h264[:AVC420|AVC444]	RDP8.1 graphics pipeline using H264 codec
    +gfx-progressive     	RDP8 graphics pipeline using progressive codec (default:off)
    +gfx-small-cache     	RDP8 graphics pipeline using small cache mode (default:off)
    +gfx-thin-client     	RDP8 graphics pipeline using thin client mode (default:off)
    +glyph-cache         	Glyph cache (experimental) (default:off)
    /gp:<password>	Gateway password
    -grab-keyboard       	Grab keyboard (default:on)
    /gt:rpc|http|auto	Gateway transport type
    /gu:...	Gateway username
    /h:<height>	Height
    +heartbeat           	Support heartbeat PDUs (default:off)
    /help                	Print help
    +home-drive          	Redirect user home as share (default:off)
    /kbd:0x<id> or <name>	Keyboard layout
    /kbd-fn-key:<value>	Function key value
    /kbd-list            	List keyboard layouts
    /kbd-subtype:<id>	Keyboard subtype
    /kbd-type:<id>	Keyboard type
    /load-balance-info:<info-string>	Load balance info
    /log-filters:...	Set logger filters, see wLog(7) for details
    /log-level:...	Set the default log level, see wLog(7) for details
    /max-fast-path-size:<size>	Specify maximum fast-path update size
    /max-loop-time:<time>	Specify maximum time in milliseconds spend treating packets
    +menu-anims          	Enable menu animations (default:off)
    /microphone[:...]	Audio input (microphone)
    /monitor-list        	List detected monitors
    /monitors:<id>[,<id>[,...]]	Select monitors to use
    -mouse-motion        	Send mouse motion (default:on)
    /multimedia[:...]	Redirect multimedia (video)
    /multimon[:force]	Use multiple monitors
    +multitouch          	Redirect multitouch input (default:off)
    +multitransport      	Support multitransport protocol (default:off)
    -nego                	Enable protocol security negotiation (default:on)
    /network:...	Network connection type
    /nsc                 	Enable NSCodec
    -offscreen-cache     	Enable offscreen bitmap cache (default:on)
    /orientation:0|90|180|270	Orientation of display in degrees
    /p:<password>	Password
    /parallel[:<name>[,<path>]]	Redirect parallel device
    /parent-window:<window-id>	Parent window id
    +password-is-pin     	Use smart card authentication with password as smart card PIN (default:off)
    /pcb:<blob>	Preconnection Blob
    /pcid:<id>	Preconnection Id
    /pheight:<height>	Physical height of display (in millimeters)
    /play-rfx:<pcap-file>	Replay rfx pcap file
    /port:<number>	Server port
    +print-reconnect-cookie	Print base64 reconnect cookie after connecting (default:off)
    /printer[:<name>[,<driver>]]	Redirect printer device
    /proxy:[<proto>://]<host>:<port>	Proxy (see also environment variable below)
    /pth:<password-hash>	Pass the hash (restricted admin mode)
    /pwidth:<width>	Physical width of display (in millimeters)
    /reconnect-cookie:<base64-cookie>	Pass base64 reconnect cookie to the connection
    /restricted-admin    	Restricted admin mode
    /rfx                 	RemoteFX
    /rfx-mode:image|video	RemoteFX mode
    /scale:100|140|180	Scaling factor of the display
    /scale-desktop:<percentage>	Scaling factor for desktop applications (value between 100 and 500)
    /scale-device:100|140|180	Scaling factor for app store applications
    /sec:rdp|tls|nla|ext	Force specific protocol security
    +sec-ext             	NLA extended protocol security (default:off)
    -sec-nla             	NLA protocol security (default:on)
    -sec-rdp             	RDP protocol security (default:on)
    -sec-tls             	TLS protocol security (default:on)
    /serial[:...]	Redirect serial device
    /shell:<shell>	Alternate shell
    /shell-dir:<dir>	Shell working directory
    /size:...	Screen size
    /smart-sizing[:<width>x<height>]	Scale remote desktop to window size
    /smartcard[:<name>[,<path>]]	Redirect smartcard device
    /sound[:...]	Audio output (sound)
    /span                	Span screen over multiple monitors
    /spn-class:<service-class>	SPN authentication service class
    /ssh-agent           	SSH Agent forwarding channel
    /t:<title>	Window title
    -themes              	Enable themes (default:on)
    /tls-ciphers:netmon|ma|ciphers	Allowed TLS ciphers
    -toggle-fullscreen   	Alt+Ctrl+Enter toggles fullscreen (default:on)
    /u:...	Username
    +unmap-buttons       	Let server see real physical pointer button (default:off)
    /usb:...	Redirect USB device
    /v:<server>[:port]	Server hostname
    /vc:<channel>[,<options>]	Static virtual channel
    /version             	Print version
    /vmconnect[:<vmid>]	Hyper-V console (use port 2179, disable negotiation)
    /w:<width>	Width
    -wallpaper           	Enable wallpaper (default:on)
    +window-drag         	Enable full window drag (default:off)
    /wm-class:<class-name>	Set the WM_CLASS hint for the window instance
    /workarea            	Use available work area

Examples:
    xfreerdp connection.rdp /p:Pwd123! /f
    xfreerdp /u:CONTOSO\JohnDoe /p:Pwd123! /v:rdp.contoso.com
    xfreerdp /u:JohnDoe /p:Pwd123! /w:1366 /h:768 /v:192.168.1.100:4489
    xfreerdp /u:JohnDoe /p:Pwd123! /vmconnect:C824F53E-95D2-46C6-9A18-23A5BB403532 /v:192.168.1.100

Clipboard Redirection: +clipboard

Drive Redirection: /drive:home,/home/user
Smartcard Redirection: /smartcard:<device>
Serial Port Redirection: /serial:<name>,<device>,[SerCx2|SerCx|Serial],[permissive]
Serial Port Redirection: /serial:COM1,/dev/ttyS0
Parallel Port Redirection: /parallel:<device>
Printer Redirection: /printer:<device>,<driver>

Audio Output Redirection: /sound:sys:oss,dev:1,format:1
Audio Output Redirection: /sound:sys:alsa
Audio Input Redirection: /microphone:sys:oss,dev:1,format:1
Audio Input Redirection: /microphone:sys:alsa

Multimedia Redirection: /multimedia:sys:oss,dev:/dev/dsp1,decoder:ffmpeg
Multimedia Redirection: /multimedia:sys:alsa
USB Device Redirection: /usb:id,dev:054c:0268

For Gateways, the https_proxy environment variable is respected:
    export https_proxy=http://proxy.contoso.com:3128/
    xfreerdp /g:rdp.contoso.com ...

More documentation is coming, in the meantime consult source files

@metalefty metalefty changed the title from xfreerdp: kbd and size cannot specified together to xfreerdp: kbd and size cannot be specified together Nov 21, 2017

@akallabeth

This comment has been minimized.

Member

akallabeth commented Nov 21, 2017

@metalefty Does this also happen with mFreeRDP? Strangely this works on my machine (ok, no mac, but the command line parser is the same)

@metalefty

This comment has been minimized.

metalefty commented Nov 21, 2017

Same with MacFreeRDP.

$  ./client/Mac/cli/MacFreeRDP.app/Contents/MacOS/MacFreeRDP /v:rdp.example.com /kbd:US /size:1600x900

(snip)

Multimedia Redirection: /multimedia:sys:alsa
USB Device Redirection: /usb:id,dev:054c:0268

For Gateways, the https_proxy environment variable is respected:
    export https_proxy=http://proxy.contoso.com:3128/
    xfreerdp /g:rdp.contoso.com ...

More documentation is coming, in the meantime consult source files

2017-11-21 16:24:40.605 MacFreeRDP[89880:7758844] Stopping...
2017-11-21 16:24:40.605 MacFreeRDP[89880:7758844] Stopped.
@akallabeth

This comment has been minimized.

Member

akallabeth commented Nov 21, 2017

Ok, got it. The syntax is wrong. /kbd requires an integer identifier, but fails to check that. /kbd-list will give you the options.

akallabeth added a commit to akallabeth/FreeRDP that referenced this issue Nov 21, 2017

@akallabeth akallabeth added this to the 2.0-rc1 milestone Nov 21, 2017

@metalefty

This comment has been minimized.

metalefty commented Nov 21, 2017

As you say /kbd-list shows the list of available keyboard list but US is certainly on the list. I applied your PR and I also tried Russian, Japanese, French but same result. It still shows usage.

I tried 0x00000409 instead of US, it is working.

@metalefty

This comment has been minimized.

metalefty commented Nov 21, 2017

Too bad! It became worse. The PR break the parser much more.

master b5d2578

👌 xfreerdp /v:rdp.example.com /kbd:Russian -> works and 0x00000419 sent to server
👌xfreerdp /v:rdp.example.com /kbd:French -> works and 0x0000040c sent to server
👌xfreerdp /v:rdp.example.com /kbd:Japanese -> works and 0x00000411 sent to server

🆖 xfreerdp /v:rdp.example.com /kbd:Russian /size:1600x900 -> shows usage
🆖 xfreerdp /v:rdp.example.com /kbd:French /size:1600x900 -> shows usage
🆖 xfreerdp /v:rdp.example.com /kbd:Japanese /size:1600x900 -> shows usage

👌 xfreerdp /v:rdp.example.com /kbd:0x00000419 /size:1600x900 -> works
👌 xfreerdp /v:rdp.example.com /kbd:0x0000040c /size:1600x900 -> works
👌xfreerdp /v:rdp.example.com /kbd:0x00000411 /size:1600x900 -> works

akallabeth's PR d169b44

🆖 xfreerdp /v:rdp.example.com /kbd:Russian -> [17:23:02:860] [93434:a8cca340] [ERROR][com.freerdp.client.common.cmdline] - Invalid option kbd:Russian
🆖 xfreerdp /v:rdp.example.com /kbd:French -> [17:24:29:440] [93465:a8cca340] [ERROR][com.freerdp.client.common.cmdline] - Invalid option kbd:French
🆖 xfreerdp /v:rdp.example.com /kbd:Japanese -> [17:24:53:915] [93486:a8cca340] [ERROR][com.freerdp.client.common.cmdline] - Invalid option kbd:Japanese

🆖 xfreerdp /v:rdp.example.com /kbd:Russian /size:1600x900 -> [17:27:37:446] [93576:a8cca340] [ERROR][com.freerdp.client.common.cmdline] - Invalid option kbd:Russian
🆖 xfreerdp /v:rdp.example.com /kbd:French /size:1600x900 -> [17:26:08:320] [93507:a8cca340] [ERROR][com.freerdp.client.common.cmdline] - Invalid option kbd:French
🆖 xfreerdp /v:rdp.example.com /kbd:Japanese /size:1600x900 -> [17:26:42:492] [93532:a8cca340] [ERROR][com.freerdp.client.common.cmdline] - Invalid option kbd:Japanese

👌 xfreerdp /v:rdp.example.com /kbd:0x00000419 /size:1600x900 -> works
👌 xfreerdp /v:rdp.example.com /kbd:0x0000040c /size:1600x900 -> works
👌 xfreerdp /v:rdp.example.com /kbd:0x00000411 /size:1600x900 -> works

@akallabeth

This comment has been minimized.

Member

akallabeth commented Nov 21, 2017

@metalefty Please read the help text! /kbd:0x1234 is the syntax, yours is broken.

@akallabeth

This comment has been minimized.

Member

akallabeth commented Nov 21, 2017

@metalefty Ok, sorry missed the or name part, need coffee :/

@metalefty

This comment has been minimized.

metalefty commented Nov 21, 2017

Yep. Please don't drop name support.

akallabeth added a commit to akallabeth/FreeRDP that referenced this issue Nov 21, 2017

akallabeth added a commit to akallabeth/FreeRDP that referenced this issue Nov 21, 2017

@akallabeth

This comment has been minimized.

Member

akallabeth commented Nov 21, 2017

@metalefty Ok, updated the pr, should work now.

akallabeth added a commit to akallabeth/FreeRDP that referenced this issue Nov 21, 2017

akallabeth added a commit to akallabeth/FreeRDP that referenced this issue Nov 21, 2017

@metalefty

This comment has been minimized.

metalefty commented Nov 22, 2017

@akallabeth works nice! thanks!

@mfleisz mfleisz closed this in 7183189 Nov 22, 2017

mfleisz added a commit that referenced this issue Nov 22, 2017

Merge pull request #4258 from akallabeth/kbd_parse_fix
Fix #4257: Proper error checks for /kbd argument

koolkhel added a commit to skywalk-cloud/FreeRDP that referenced this issue Nov 29, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment