Incorrect argument processing #13

Closed
eirnym opened this Issue Jul 29, 2012 · 3 comments

Projects

None yet

2 participants

@eirnym
eirnym commented Jul 29, 2012
  1. if you run without arguments program runs correctly:
    ~>/opt/local/bin/reattach-to-user-namespace
    fatal: usage: /opt/local/bin/reattach-to-user-namespace [-l] [args...]
Reattach to the per-user bootstrap namespace in its "Background"
session then exec the program with args. If "-l" is given,
rewrite the program's argv[0] so that it starts with a '-'.
  1. wrong key for your command. Do you compare with strcmp, not processing args as usual?
    ~>/opt/local/bin/reattach-to-user-namespace -1
    fatal: execv failed: No such file or directory

  2. if you run with correct key but without program:
    ~>/opt/local/bin/reattach-to-user-namespace -l
    [1] 11465 segmentation fault /opt/local/bin/reattach-to-user-namespace -l

@ChrisJohnsen
Owner

Thank you for reporting these problems.

I have pushed some new commits to the pu branch that should resolve them. The tip of pu is currently at 8f86025.

The segfault is fixed, and it now warns about unknown options in the first argument position. Any option-like arguments after the first are for the child program, so they are not interpreted.

If these work for you I will promote them to master and drop a new tag.

@ChrisJohnsen
Owner

The commits (along with some other changes) are now on master, and are included in the new v2.0 tag.

Feel free to reopen this issue if the solution is not adequate.

@eirnym
eirnym commented Aug 18, 2012

Thank you ;)

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