Change in openvpn[master]: misc.c: remove unused code
A message that is not in the archive (sent off-list or not yet received): gerrit.1711616186000.Ic440f2c8d46dfcb5ff41ba2f33bf28bb7286eec4@...2715...
Attention is currently required from: flichtenheld, plaisthos.
Hello plaisthos, flichtenheld,
I'd like you to do a code review.
Please visit
http://gerrit.openvpn.net/c/openvpn/+/550?usp=email
to review the following change.
Change subject: misc.c: remove unused code
......................................................................
misc.c: remove unused code
Commit
3a4fb1 "Ensure --auth-nocache is handled during renegotiation"
has changed the behavior of set_auth_token(), but left unused parameter
struct user_pass *up
Remove this parameter and amend comments accordingly. Also remove unused function definition from misc.h.
Change-Id: Ic440f2c8d46dfcb5ff41ba2f33bf28bb7286eec4
---
M src/openvpn/misc.c
M src/openvpn/misc.h
M src/openvpn/ssl.c
3 files changed, 5 insertions(+), 17 deletions(-)
git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/50/550/1
src/openvpn/misc.c +2 -6
@@ -491,19 +491,15 @@ }void -set_auth_token (struct user_pass *up,struct user_pass *tk,const char *token) +set_auth_token (struct user_pass *tk,const char *token) { -if (strlen (token)) {strncpynt (tk->password, token,USER_PASS_LEN ); tk->token_defined = true;/* -* --auth-token has no username, so it needs the username -* either already set or copied from up, or later set by -* --auth-token-user -* If already set, tk is fully defined. +* If username already set, tk is fully defined. */ if (strlen (tk->username)) {
src/openvpn/misc.h +2 -10
@@ -152,26 +152,18 @@return get_user_pass_cr (up, auth_file, prefix, flags,NULL ); } -void fail_user_pass (const char *prefix, -const unsigned int flags, -const char *reason); -void purge_user_pass (struct user_pass *up,const bool force);/** -* Sets the auth-token to token. If a username is available from -* either up or already present in tk that will be used as default -* username for the token. The method will also purge up if +* Sets the auth-token to token. The method will also purge up if * the auth-nocache option is active. * -* @param up (non Auth-token) Username/password * @param tk auth-token userpass to set * @param token token to use as password for the auth-token * * @note all parameters to this function must not be null. */ -void set_auth_token (struct user_pass *up,struct user_pass *tk, -const char *token); +void set_auth_token (struct user_pass *tk,const char *token);/** * Sets the auth-token username by base64 decoding the passed
src/openvpn/ssl.c +1 -1
@@ -340,7 +340,7 @@void ssl_set_auth_token (const char *token) { -set_auth_token (&auth_user_pass, &auth_token, token); +set_auth_token (&auth_token, token); }void
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/550?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ic440f2c8d46dfcb5ff41ba2f33bf28bb7286eec4
Gerrit-Change-Number: 550
Gerrit-PatchSet: 1
Gerrit-Owner: stipa <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Attention: flichtenheld <[email protected]...>
Gerrit-MessageType: newchange
Attention is currently required from: plaisthos, stipa.
flichtenheld has posted comments on this change. ( http://gerrit.openvpn.net/c/openvpn/+/550?usp=email )
Change subject: misc.c: remove unused code
......................................................................
Patch Set 1: Code-Review+2
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/550?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ic440f2c8d46dfcb5ff41ba2f33bf28bb7286eec4
Gerrit-Change-Number: 550
Gerrit-PatchSet: 1
Gerrit-Owner: stipa <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Attention: stipa <[email protected]...>
Gerrit-Comment-Date: Thu, 28 Mar 2024 11:04:12 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
PATCH 1/1 misc.c: remove unused code
In reply to a message not in the archiveFrom: Lev Stipakov <[email protected]...>
Commit
3a4fb1 "Ensure --auth-nocache is handled during renegotiation"
has changed the behavior of set_auth_token(), but left unused parameter
struct user_pass *up
Remove this parameter and amend comments accordingly. Also remove unused function definition from misc.h.
Change-Id: Ic440f2c8d46dfcb5ff41ba2f33bf28bb7286eec4
---
This change was reviewed on Gerrit and approved by at least one developer. I request to merge it to master.
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/550
This mail reflects revision 1 of this Change.
Acked-by according to Gerrit (reflected above):
Frank Lichtenheld <[email protected]...>
src/openvpn/misc.c +2 -6
@@ -491,19 +491,15 @@ }void -set_auth_token (struct user_pass *up,struct user_pass *tk,const char *token) +set_auth_token (struct user_pass *tk,const char *token) { -if (strlen (token)) {strncpynt (tk->password, token,USER_PASS_LEN ); tk->token_defined = true;/* -* --auth-token has no username, so it needs the username -* either already set or copied from up, or later set by -* --auth-token-user -* If already set, tk is fully defined. +* If username already set, tk is fully defined. */ if (strlen (tk->username)) {
src/openvpn/misc.h +2 -10
@@ -152,26 +152,18 @@return get_user_pass_cr (up, auth_file, prefix, flags,NULL ); } -void fail_user_pass (const char *prefix, -const unsigned int flags, -const char *reason); -void purge_user_pass (struct user_pass *up,const bool force);/** -* Sets the auth-token to token. If a username is available from -* either up or already present in tk that will be used as default -* username for the token. The method will also purge up if +* Sets the auth-token to token. The method will also purge up if * the auth-nocache option is active. * -* @param up (non Auth-token) Username/password * @param tk auth-token userpass to set * @param token token to use as password for the auth-token * * @note all parameters to this function must not be null. */ -void set_auth_token (struct user_pass *up,struct user_pass *tk, -const char *token); +void set_auth_token (struct user_pass *tk,const char *token);/** * Sets the auth-token username by base64 decoding the passed
src/openvpn/ssl.c +1 -1
@@ -340,7 +340,7 @@void ssl_set_auth_token (const char *token) { -set_auth_token (&auth_user_pass, &auth_token, token); +set_auth_token (&auth_token, token); }void
[Openvpn-devel] [PATCH applied] Re: misc.c: remove unused code
Your patch has been applied to the master and release/2.6 branch.
(Trivial and obvious removal of dead code, passes all tests, and having the code align can be helpful)
commit 4c71e816031f564f834df695b3fa717ea22720d2 (master) commit f50c67707ed033040c93a6b5d4efbbd2c0933459 (release/2.6)
Author: Lev Stipakov Date: Fri Mar 29 11:37:39 2024 +0100
misc.c: remove unused code
Signed-off-by: Lev Stipakov <[email protected]...>
Acked-by: Frank Lichtenheld <[email protected]...>
Message-Id: <[email protected]...>
URL: https://www.mail-archive.com/[email protected]/msg28503.html
Signed-off-by: Gert Doering <[email protected]...>--
kind regards,
Gert Doering
cron2 has uploaded a new patch set (#2) to the change originally created by stipa. ( http://gerrit.openvpn.net/c/openvpn/+/550?usp=email )
The following approvals got outdated and were removed:
Code-Review+2 by flichtenheld
Change subject: misc.c: remove unused code
......................................................................
misc.c: remove unused code
Commit
3a4fb1 "Ensure --auth-nocache is handled during renegotiation"
has changed the behavior of set_auth_token(), but left unused parameter
struct user_pass *up
Remove this parameter and amend comments accordingly. Also remove unused function definition from misc.h.
Change-Id: Ic440f2c8d46dfcb5ff41ba2f33bf28bb7286eec4
Message-Id: <[email protected]...>
URL: https://www.mail-archive.com/[email protected]/msg28503.html
---
M src/openvpn/misc.c
M src/openvpn/misc.h
M src/openvpn/ssl.c
3 files changed, 5 insertions(+), 17 deletions(-)
git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/50/550/2
src/openvpn/misc.c +2 -6
@@ -491,19 +491,15 @@ }void -set_auth_token (struct user_pass *up,struct user_pass *tk,const char *token) +set_auth_token (struct user_pass *tk,const char *token) { -if (strlen (token)) {strncpynt (tk->password, token,USER_PASS_LEN ); tk->token_defined = true;/* -* --auth-token has no username, so it needs the username -* either already set or copied from up, or later set by -* --auth-token-user -* If already set, tk is fully defined. +* If username already set, tk is fully defined. */ if (strlen (tk->username)) {
src/openvpn/misc.h +2 -10
@@ -152,26 +152,18 @@return get_user_pass_cr (up, auth_file, prefix, flags,NULL ); } -void fail_user_pass (const char *prefix, -const unsigned int flags, -const char *reason); -void purge_user_pass (struct user_pass *up,const bool force);/** -* Sets the auth-token to token. If a username is available from -* either up or already present in tk that will be used as default -* username for the token. The method will also purge up if +* Sets the auth-token to token. The method will also purge up if * the auth-nocache option is active. * -* @param up (non Auth-token) Username/password * @param tk auth-token userpass to set * @param token token to use as password for the auth-token * * @note all parameters to this function must not be null. */ -void set_auth_token (struct user_pass *up,struct user_pass *tk, -const char *token); +void set_auth_token (struct user_pass *tk,const char *token);/** * Sets the auth-token username by base64 decoding the passed
src/openvpn/ssl.c +1 -1
@@ -340,7 +340,7 @@void ssl_set_auth_token (const char *token) { -set_auth_token (&auth_user_pass, &auth_token, token); +set_auth_token (&auth_token, token); }void
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/550?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ic440f2c8d46dfcb5ff41ba2f33bf28bb7286eec4
Gerrit-Change-Number: 550
Gerrit-PatchSet: 2
Gerrit-Owner: stipa <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-MessageType: newpatchset
cron2 has submitted this change. ( http://gerrit.openvpn.net/c/openvpn/+/550?usp=email )
Change subject: misc.c: remove unused code
......................................................................
misc.c: remove unused code
Commit
3a4fb1 "Ensure --auth-nocache is handled during renegotiation"
has changed the behavior of set_auth_token(), but left unused parameter
struct user_pass *up
Remove this parameter and amend comments accordingly. Also remove unused function definition from misc.h.
Change-Id: Ic440f2c8d46dfcb5ff41ba2f33bf28bb7286eec4
Message-Id: <[email protected]...>
URL: https://www.mail-archive.com/[email protected]/msg28503.html
---
M src/openvpn/misc.c
M src/openvpn/misc.h
M src/openvpn/ssl.c
3 files changed, 5 insertions(+), 17 deletions(-)
src/openvpn/misc.c +2 -6
@@ -491,19 +491,15 @@ }void -set_auth_token (struct user_pass *up,struct user_pass *tk,const char *token) +set_auth_token (struct user_pass *tk,const char *token) { -if (strlen (token)) {strncpynt (tk->password, token,USER_PASS_LEN ); tk->token_defined = true;/* -* --auth-token has no username, so it needs the username -* either already set or copied from up, or later set by -* --auth-token-user -* If already set, tk is fully defined. +* If username already set, tk is fully defined. */ if (strlen (tk->username)) {
src/openvpn/misc.h +2 -10
@@ -152,26 +152,18 @@return get_user_pass_cr (up, auth_file, prefix, flags,NULL ); } -void fail_user_pass (const char *prefix, -const unsigned int flags, -const char *reason); -void purge_user_pass (struct user_pass *up,const bool force);/** -* Sets the auth-token to token. If a username is available from -* either up or already present in tk that will be used as default -* username for the token. The method will also purge up if +* Sets the auth-token to token. The method will also purge up if * the auth-nocache option is active. * -* @param up (non Auth-token) Username/password * @param tk auth-token userpass to set * @param token token to use as password for the auth-token * * @note all parameters to this function must not be null. */ -void set_auth_token (struct user_pass *up,struct user_pass *tk, -const char *token); +void set_auth_token (struct user_pass *tk,const char *token);/** * Sets the auth-token username by base64 decoding the passed
src/openvpn/ssl.c +1 -1
@@ -340,7 +340,7 @@void ssl_set_auth_token (const char *token) { -set_auth_token (&auth_user_pass, &auth_token, token); +set_auth_token (&auth_token, token); }void
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/550?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ic440f2c8d46dfcb5ff41ba2f33bf28bb7286eec4
Gerrit-Change-Number: 550
Gerrit-PatchSet: 2
Gerrit-Owner: stipa <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-MessageType: merged