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

Explain return code in man page #28

Closed
didier13150 opened this issue Nov 2, 2017 · 6 comments
Closed

Explain return code in man page #28

didier13150 opened this issue Nov 2, 2017 · 6 comments

Comments

@didier13150
Copy link

Hi there,
I need some information about return code. I try to look into code, but it's very difficult to have a complete list. It will be very nice to add this in man page.
Thank in advance,
Didier.

@brc0x1
Copy link
Member

brc0x1 commented Nov 6, 2017

Hi Didier, I was surprised to realize the man pages don't document return codes. They absolutely should do this, and I'll fix this in the next release. Until then, here's a quick summary of how things are intended to work:

  • The twadmin, twprint, and siggen commands return 0 on success, and 1 on any error.

  • In tripwire integrity check mode, the return code is a set of bits OR'd together to indicate the check result:
    1: At least one file or directory was added.
    2: At least one file or directory was removed.
    4: At least one file or directory was modified.
    8: At least one error occurred during the check.
    So if an integrity check returns 0, it means the check ran successfully and no changes were observed.

  • Other tripwire modes return 0 on success, and 8 on error, for consistency with IC mode.

Right now there might be an exception or two to these rules; I see one spot in core/msystem.cpp that would exit with -1, but it's right below a comment saying "should never happen ...", and I doubt anyone will bump into it in practice. I think I'll change this and any other exceptions I run across at the same time I update the man pages.

@didier13150
Copy link
Author

thank you brian. Have you a date for the next release ?

@brc0x1
Copy link
Member

brc0x1 commented Nov 9, 2017

I don't have an exact date, but it will probably be sometime in December or January.

@brc0x1
Copy link
Member

brc0x1 commented Jan 19, 2018

I've added Exit Code sections to the man pages on this branch: https://github.com/Tripwire/tripwire-open-source/tree/dev/q1-2018 . I have some other documentation stuff to do there before it becomes a 2.4.3.7 release, but I hope to have that wrapped up in the near future.

@brc0x1
Copy link
Member

brc0x1 commented Mar 31, 2018

Resolved in 2.4.3.7

@brc0x1 brc0x1 closed this as completed Mar 31, 2018
@brc0x1 brc0x1 reopened this Mar 31, 2018
@brc0x1
Copy link
Member

brc0x1 commented Apr 4, 2018

Closing as resolved.

@brc0x1 brc0x1 closed this as completed Apr 4, 2018
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