summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Matveev <makc@gmx.co.uk>2012-11-13 11:18:04 -0500
committerSteve Dickson <steved@redhat.com>2012-11-13 12:54:36 -0500
commit103947230def2d284a1388df833a3c11cfc7d961 (patch)
tree272f6b43d79f370c2dbe9b2063fd094b160000fc
parent5e8214c7698658da2a0f6651522a01af494afe52 (diff)
downloadti-rpc-103947230def2d284a1388df833a3c11cfc7d961.tar.gz
authnone - respect the locks
Don't try to unlock the lock which has not been locked. Signed-off-by: Max Matveev <makc@gmx.co.uk> Signed-off-by: Steve Dickson <steved@redhat.com>
-rw-r--r--src/auth_none.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/auth_none.c b/src/auth_none.c
index 008c589..affc92b 100644
--- a/src/auth_none.c
+++ b/src/auth_none.c
@@ -110,20 +110,19 @@ static bool_t
authnone_marshal(AUTH *client, XDR *xdrs)
{
struct authnone_private *ap;
- bool_t dummy;
+ bool_t rv = FALSE;
extern mutex_t authnone_lock;
assert(xdrs != NULL);
+ mutex_lock(&authnone_lock);
ap = authnone_private;
- if (ap == NULL) {
- mutex_unlock(&authnone_lock);
- return (FALSE);
+ if (ap) {
+ rv = (*xdrs->x_ops->x_putbytes)(xdrs, ap->marshalled_client,
+ ap->mcnt);
}
- dummy = (*xdrs->x_ops->x_putbytes)(xdrs,
- ap->marshalled_client, ap->mcnt);
mutex_unlock(&authnone_lock);
- return (dummy);
+ return (rv);
}
/* All these unused parameters are required to keep ANSI-C from grumbling */