aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDag-Erling Smørgrav <des@FreeBSD.org>2003-02-08 20:18:25 +0000
committerDag-Erling Smørgrav <des@FreeBSD.org>2003-02-08 20:18:25 +0000
commit60f020541d35b0e5082dcacb7a9e423085e667c3 (patch)
tree71f9e8b9d2785e2325fc4485b9b1c55f53aaee16
parentb511bdf31cd5820d132f4ffc8f6a09f7a1804880 (diff)
downloadsrc-60f020541d35b0e5082dcacb7a9e423085e667c3.tar.gz
src-60f020541d35b0e5082dcacb7a9e423085e667c3.zip
MFP4: avoid side effects in macro arguments (#24823)
Notes
Notes: svn path=/vendor/openpam/dist/; revision=110556
-rw-r--r--contrib/openpam/lib/pam_acct_mgmt.c8
-rw-r--r--contrib/openpam/lib/pam_authenticate.c8
-rw-r--r--contrib/openpam/lib/pam_chauthtok.c12
-rw-r--r--contrib/openpam/lib/pam_close_session.c6
-rw-r--r--contrib/openpam/lib/pam_get_authtok.c5
-rw-r--r--contrib/openpam/lib/pam_get_user.c5
-rw-r--r--contrib/openpam/lib/pam_open_session.c6
-rw-r--r--contrib/openpam/lib/pam_setcred.c6
8 files changed, 32 insertions, 24 deletions
diff --git a/contrib/openpam/lib/pam_acct_mgmt.c b/contrib/openpam/lib/pam_acct_mgmt.c
index 4adfe53cbd8f..6dbd29a78711 100644
--- a/contrib/openpam/lib/pam_acct_mgmt.c
+++ b/contrib/openpam/lib/pam_acct_mgmt.c
@@ -31,7 +31,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $P4: //depot/projects/openpam/lib/pam_acct_mgmt.c#10 $
+ * $P4: //depot/projects/openpam/lib/pam_acct_mgmt.c#11 $
*/
#include <sys/param.h>
@@ -51,11 +51,11 @@ int
pam_acct_mgmt(pam_handle_t *pamh,
int flags)
{
- int pam_err;
+ int r;
ENTER();
- pam_err = openpam_dispatch(pamh, PAM_SM_ACCT_MGMT, flags);
- RETURNC(pam_err);
+ r = openpam_dispatch(pamh, PAM_SM_ACCT_MGMT, flags);
+ RETURNC(r);
}
/*
diff --git a/contrib/openpam/lib/pam_authenticate.c b/contrib/openpam/lib/pam_authenticate.c
index f2884f72ec4a..6d319b994521 100644
--- a/contrib/openpam/lib/pam_authenticate.c
+++ b/contrib/openpam/lib/pam_authenticate.c
@@ -31,7 +31,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $P4: //depot/projects/openpam/lib/pam_authenticate.c#12 $
+ * $P4: //depot/projects/openpam/lib/pam_authenticate.c#13 $
*/
#include <sys/param.h>
@@ -51,14 +51,14 @@ int
pam_authenticate(pam_handle_t *pamh,
int flags)
{
- int pam_err;
+ int r;
ENTER();
if (flags & ~(PAM_SILENT|PAM_DISALLOW_NULL_AUTHTOK))
RETURNC(PAM_SYMBOL_ERR);
- pam_err = openpam_dispatch(pamh, PAM_SM_AUTHENTICATE, flags);
+ r = openpam_dispatch(pamh, PAM_SM_AUTHENTICATE, flags);
pam_set_item(pamh, PAM_AUTHTOK, NULL);
- RETURNC(pam_err);
+ RETURNC(r);
}
/*
diff --git a/contrib/openpam/lib/pam_chauthtok.c b/contrib/openpam/lib/pam_chauthtok.c
index 68fa483e1a1a..74f2af3b1099 100644
--- a/contrib/openpam/lib/pam_chauthtok.c
+++ b/contrib/openpam/lib/pam_chauthtok.c
@@ -31,7 +31,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $P4: //depot/projects/openpam/lib/pam_chauthtok.c#13 $
+ * $P4: //depot/projects/openpam/lib/pam_chauthtok.c#14 $
*/
#include <sys/param.h>
@@ -51,19 +51,19 @@ int
pam_chauthtok(pam_handle_t *pamh,
int flags)
{
- int pam_err;
+ int r;
ENTER();
if (flags & ~(PAM_SILENT|PAM_CHANGE_EXPIRED_AUTHTOK))
RETURNC(PAM_SYMBOL_ERR);
- pam_err = openpam_dispatch(pamh, PAM_SM_CHAUTHTOK,
+ r = openpam_dispatch(pamh, PAM_SM_CHAUTHTOK,
flags | PAM_PRELIM_CHECK);
- if (pam_err == PAM_SUCCESS)
- pam_err = openpam_dispatch(pamh, PAM_SM_CHAUTHTOK,
+ if (r == PAM_SUCCESS)
+ r = openpam_dispatch(pamh, PAM_SM_CHAUTHTOK,
flags | PAM_UPDATE_AUTHTOK);
pam_set_item(pamh, PAM_OLDAUTHTOK, NULL);
pam_set_item(pamh, PAM_AUTHTOK, NULL);
- RETURNC(pam_err);
+ RETURNC(r);
}
/*
diff --git a/contrib/openpam/lib/pam_close_session.c b/contrib/openpam/lib/pam_close_session.c
index 9c6276ca2fd5..5fd14ad50f88 100644
--- a/contrib/openpam/lib/pam_close_session.c
+++ b/contrib/openpam/lib/pam_close_session.c
@@ -31,7 +31,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $P4: //depot/projects/openpam/lib/pam_close_session.c#10 $
+ * $P4: //depot/projects/openpam/lib/pam_close_session.c#11 $
*/
#include <sys/param.h>
@@ -51,11 +51,13 @@ int
pam_close_session(pam_handle_t *pamh,
int flags)
{
+ int r;
ENTER();
if (flags & ~(PAM_SILENT))
RETURNC(PAM_SYMBOL_ERR);
- RETURNC(openpam_dispatch(pamh, PAM_SM_CLOSE_SESSION, flags));
+ r = openpam_dispatch(pamh, PAM_SM_CLOSE_SESSION, flags);
+ RETURNC(r);
}
/*
diff --git a/contrib/openpam/lib/pam_get_authtok.c b/contrib/openpam/lib/pam_get_authtok.c
index 896f059ccad3..c1ecb3c26553 100644
--- a/contrib/openpam/lib/pam_get_authtok.c
+++ b/contrib/openpam/lib/pam_get_authtok.c
@@ -31,7 +31,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $P4: //depot/projects/openpam/lib/pam_get_authtok.c#20 $
+ * $P4: //depot/projects/openpam/lib/pam_get_authtok.c#21 $
*/
#include <sys/param.h>
@@ -124,7 +124,8 @@ pam_get_authtok(pam_handle_t *pamh,
free(resp);
if (r != PAM_SUCCESS)
RETURNC(r);
- RETURNC(pam_get_item(pamh, item, (const void **)authtok));
+ r = pam_get_item(pamh, item, (const void **)authtok);
+ RETURNC(r);
}
/*
diff --git a/contrib/openpam/lib/pam_get_user.c b/contrib/openpam/lib/pam_get_user.c
index f35a887fe71a..5681c53b688c 100644
--- a/contrib/openpam/lib/pam_get_user.c
+++ b/contrib/openpam/lib/pam_get_user.c
@@ -31,7 +31,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $P4: //depot/projects/openpam/lib/pam_get_user.c#13 $
+ * $P4: //depot/projects/openpam/lib/pam_get_user.c#14 $
*/
#include <sys/param.h>
@@ -78,7 +78,8 @@ pam_get_user(pam_handle_t *pamh,
free(resp);
if (r != PAM_SUCCESS)
RETURNC(r);
- RETURNC(pam_get_item(pamh, PAM_USER, (const void **)user));
+ r = pam_get_item(pamh, PAM_USER, (const void **)user);
+ RETURNC(r);
}
/*
diff --git a/contrib/openpam/lib/pam_open_session.c b/contrib/openpam/lib/pam_open_session.c
index 508ad5cb137e..02c94445d21b 100644
--- a/contrib/openpam/lib/pam_open_session.c
+++ b/contrib/openpam/lib/pam_open_session.c
@@ -31,7 +31,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $P4: //depot/projects/openpam/lib/pam_open_session.c#10 $
+ * $P4: //depot/projects/openpam/lib/pam_open_session.c#11 $
*/
#include <sys/param.h>
@@ -51,11 +51,13 @@ int
pam_open_session(pam_handle_t *pamh,
int flags)
{
+ int r;
ENTER();
if (flags & ~(PAM_SILENT))
RETURNC(PAM_SYMBOL_ERR);
- RETURNC(openpam_dispatch(pamh, PAM_SM_OPEN_SESSION, flags));
+ r = openpam_dispatch(pamh, PAM_SM_OPEN_SESSION, flags);
+ RETURNC(r);
}
/*
diff --git a/contrib/openpam/lib/pam_setcred.c b/contrib/openpam/lib/pam_setcred.c
index 16848802fbb9..b895e6ada2da 100644
--- a/contrib/openpam/lib/pam_setcred.c
+++ b/contrib/openpam/lib/pam_setcred.c
@@ -31,7 +31,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $P4: //depot/projects/openpam/lib/pam_setcred.c#11 $
+ * $P4: //depot/projects/openpam/lib/pam_setcred.c#12 $
*/
#include <sys/param.h>
@@ -51,13 +51,15 @@ int
pam_setcred(pam_handle_t *pamh,
int flags)
{
+ int r;
ENTER();
if (flags & ~(PAM_SILENT|PAM_ESTABLISH_CRED|PAM_DELETE_CRED|
PAM_REINITIALIZE_CRED|PAM_REFRESH_CRED))
RETURNC(PAM_SYMBOL_ERR);
/* XXX enforce exclusivity */
- RETURNC(openpam_dispatch(pamh, PAM_SM_SETCRED, flags));
+ r = openpam_dispatch(pamh, PAM_SM_SETCRED, flags);
+ RETURNC(r);
}
/*