Skip to content
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

tlsc: bug in command line processing #5

Open
GReagle opened this issue Jan 5, 2016 · 3 comments
Open

tlsc: bug in command line processing #5

GReagle opened this issue Jan 5, 2016 · 3 comments

Comments

@GReagle
Copy link

GReagle commented Jan 5, 2016

This causes an error:

~$ tcpclient jabber.org 5223 tlsc sj -d /home/greagle/sj -u taiga -s jabber.org
tlsc: invalid option -- 'd'
tlsc [-hCH] [-c cert_file] [-f ca_file] [-p ca_path] program [args...]

but this works:

tcpclient jabber.org 5223 tlsc sj -- -d /home/greagle/sj -u taiga -s jabber.org

This causes an error too:

~$ tcpclient jabber.org 5222 sj -d /home/greagle/sj -u taiga -s jabber.org
tlsc: invalid option -- 'd'
tlsc [-hCH] [-c cert_file] [-f ca_file] [-p ca_path] program [args...]

but adding '--' doesn't help:

~$ tcpclient jabber.org 5222 sj -- -d /home/greagle/sj -u taiga -s jabber.org
usage: sj OPTIONS
OPTIONS:
        -u <user>
        -s <server>
        -r <resource>
        -d <directory>
        -D

Using the SJ_ environment variables circumvents this problem, but tlsc should work properly.

@younix
Copy link
Owner

younix commented Jan 11, 2016

The problem seems to be a gnu-extension in getopt(3). Set the environment variable POSIXLY_CORRECT to force gnu-getopt to behave like POSIX-getopt. This should fix that issue.

@GReagle
Copy link
Author

GReagle commented Jan 12, 2016

Thank you younix. Setting POSIXLY_CORRECT does fix the problem. For reference, this GNU behavior is documented at https://www.gnu.org/software/libc/manual/html_node/Using-Getopt.html

@younix
Copy link
Owner

younix commented Jan 12, 2016

It's me, "Jan". You are welcome :-)

On Mon, Jan 11, 2016 at 06:39:26PM -0800, GReagle wrote:

Thank you younix. Setting POSIXLY_CORRECT does fix the problem. This is
documented at
https://www.gnu.org/software/libc/manual/html_node/Using-Getopt.html.

Reply to this email directly or view it on GitHub.

Link: #5 (comment)

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

No branches or pull requests

2 participants