-
Notifications
You must be signed in to change notification settings - Fork 254
wtmp #1417
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
Open
alejandro-colomar
wants to merge
7
commits into
shadow-maint:master
Choose a base branch
from
alejandro-colomar:wtmp
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
wtmp #1417
+70
−51
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15f7b07 to
2160d48
Compare
9f3eb60 to
be6b6a9
Compare
be6b6a9 to
1753b65
Compare
Closes: <shadow-maint#1415> Cc: Serge Hallyn <serge@hallyn.com> Signed-off-by: Alejandro Colomar <alx@kernel.org>
What we really wanted to assert is that prepare_utmp() hasn't failed. This way, the intent is more readable, and it will allow us to do some refactoring. Signed-off-by: Alejandro Colomar <alx@kernel.org>
This separates wtmp(5) handling from utmp(5) handling, which itself allows removing comments. This results in obviously more readable code. Now, setutmp() resembles updwtmpx(3), so we could name it to updutmpx(). Before this change, we updated first utmp(5), then wtmp(5). This change reoders them, as the order does not matter (they are completely independent). This is because updwtmpx(3) cannot fail, while our updating of utmp(5) can fail. With this ordering, we'll be able to report errors, while at the same time we make sure to update wtmp(5) even if utmp(5) fails. Signed-off-by: Alejandro Colomar <alx@kernel.org>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
This is for consistency with updwtmpx(3), which is very similar to this function, with the following exceptions: - updutmpx() can fail, while updwtmpx(3) can't fail. - updutmpx() doesn't take a pathname. This is because utmp(5) APIs rely on utmpname(3) for specifying the path of the utmp(5) file (and use _PATH_UTMP if it is not called). Signed-off-by: Alejandro Colomar <alx@kernel.org>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
Minor cosmetic adjestments. Signed-off-by: Alejandro Colomar <alx@kernel.org>
1753b65 to
b92c8c4
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Some readability improvements around wtmp(5).
Closes: #1415
Revisions:
v1b
v1c