From 2da4877c8c9623ec36b64056878c82bd9a1540ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn?= Date: Tue, 28 Jun 2011 11:43:14 +0200 Subject: [PATCH] Feature #687: AuthRequest::add_auth extracts the object int id only if it is not a string template --- src/authm/AuthManager.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/authm/AuthManager.cc b/src/authm/AuthManager.cc index 2fde223c11..eb843fbdad 100644 --- a/src/authm/AuthManager.cc +++ b/src/authm/AuthManager.cc @@ -39,6 +39,8 @@ void AuthRequest::add_auth(Object ob, ostringstream oss; bool auth; + int ob_id_int = 0; + oss << Object_to_str(ob) << ":"; if (op == CREATE || op == INSTANTIATE) //encode the ob_id, it is a template @@ -58,6 +60,9 @@ void AuthRequest::add_auth(Object ob, else { oss << ob_id << ":"; + + istringstream iss(ob_id); + iss >> ob_id_int; } oss << Operation_to_str(op) << ":"; @@ -79,11 +84,6 @@ void AuthRequest::add_auth(Object ob, int ob_gid = 0; - istringstream iss(ob_id); - int ob_id_int; - - iss >> ob_id_int; - Nebula& nd = Nebula::instance(); AclManager* aclm = nd.get_aclm();