Skip to contentSkip to conversation

cleanup: removed last references to g_conf from auth

PATCH Applied Roald van Loon 2 participants 5 messages Aug 27, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cleanup: removed last references to g_conf from auth

Trivial cleanup. There were still 3 references to g_conf in CephxKeyServer. Replaced them in favor of cct->_conf.

---

src/auth/cephx/CephxKeyServer.cc +0 -1
index e0c8174..e57b557 100644
@@ -163,7 +163,7 @@ bool KeyServer::_check_rotating_secrets()
     ldout(cct, 10) << __func__ << " added " << added << dendl;
     data.rotating_ver++;
     //data.next_rotating_time = ceph_clock_now(cct);
-    //data.next_rotating_time += MIN(g_conf->auth_mon_ticket_ttl,

g_conf->auth_service_ticket_ttl);
+ //data.next_rotating_time += MIN(cct->_conf->auth_mon_ticket_ttl,

cct->_conf->auth_service_ticket_ttl);
     _dump_rotating_secrets();
     return true;

}
@@ -191,7 +191,7 @@ int KeyServer::_rotate_secret(uint32_t service_id)
RotatingSecrets& r = data.rotating_secrets[service_id]; int added = 0;
utime_t now = ceph_clock_now(cct);
- double ttl = service_id == CEPH_ENTITY_TYPE_AUTH ? g_conf->auth_mon_ticket_ttl : g_conf->auth_service_ticket_ttl;
+ double ttl = service_id == CEPH_ENTITY_TYPE_AUTH ? cct->_conf->auth_mon_ticket_ttl : cct->_conf->auth_service_ticket_ttl;

   while (r.need_new_secrets(now)) {
     ExpiringCryptoKey ek;

@@ -424,7 +424,7 @@ int KeyServer::_build_session_auth_info(uint32_t service_id, CephXServiceTicketI
{
info.service_id = service_id;
info.ticket = auth_ticket_info.ticket;
- info.ticket.init_timestamps(ceph_clock_now(cct), g_conf->auth_service_ticket_ttl);
+ info.ticket.init_timestamps(ceph_clock_now(cct), cct->_conf->auth_service_ticket_ttl);

   generate_secret(info.session_key);
#1 lore raw

PATCH 1/1 cleanup: removed last references to g_conf from auth

Trivial cleanup. There were still 3 references to g_conf in CephxKeyServer. Replaced them in favor of cct->_conf.

---
 src/auth/cephx/CephxKeyServer.cc | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
src/auth/cephx/CephxKeyServer.cc +3 -3
index e0c8174..e57b557 100644
@@ -163,7 +163,7 @@ bool KeyServer::_check_rotating_secrets()
     ldout(cct, 10) << __func__ << " added " << added << dendl;
     data.rotating_ver++;
     //data.next_rotating_time = ceph_clock_now(cct);
-    //data.next_rotating_time += MIN(g_conf->auth_mon_ticket_ttl, g_conf->auth_service_ticket_ttl);
+    //data.next_rotating_time += MIN(cct->_conf->auth_mon_ticket_ttl, cct->_conf->auth_service_ticket_ttl);
     _dump_rotating_secrets();
     return true;
   }
@@ -191,7 +191,7 @@ int KeyServer::_rotate_secret(uint32_t service_id)
   RotatingSecrets& r = data.rotating_secrets[service_id];
   int added = 0;
   utime_t now = ceph_clock_now(cct);
-  double ttl = service_id == CEPH_ENTITY_TYPE_AUTH ? g_conf->auth_mon_ticket_ttl : g_conf->auth_service_ticket_ttl;
+  double ttl = service_id == CEPH_ENTITY_TYPE_AUTH ? cct->_conf->auth_mon_ticket_ttl : cct->_conf->auth_service_ticket_ttl;
 
   while (r.need_new_secrets(now)) {
     ExpiringCryptoKey ek;
@@ -424,7 +424,7 @@ int KeyServer::_build_session_auth_info(uint32_t service_id, CephXServiceTicketI
 {
   info.service_id = service_id;
   info.ticket = auth_ticket_info.ticket;
-  info.ticket.init_timestamps(ceph_clock_now(cct), g_conf->auth_service_ticket_ttl);
+  info.ticket.init_timestamps(ceph_clock_now(cct), cct->_conf->auth_service_ticket_ttl);
 
   generate_secret(info.session_key);
 
Signature · 1 line
1.7.12.4
#2 lore raw

Sorry, the format-patch of the first email was screwed up (tried to copy/paste the email because git was compiled without perl and hence had no send-email support... should have known that would go haywire)

Roald

Quoted 42 lines · Roald J. van Loon

Trivial cleanup. There were still 3 references to g_conf in CephxKeyServer. Replaced them in favor of cct->_conf.

---
 src/auth/cephx/CephxKeyServer.cc | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
src/auth/cephx/CephxKeyServer.cc +3 -4
index e0c8174..e57b557 100644
@@ -163,7 +163,7 @@ bool KeyServer::_check_rotating_secrets()
     ldout(cct, 10) << __func__ << " added " << added << dendl;
     data.rotating_ver++;
     //data.next_rotating_time = ceph_clock_now(cct);
-    //data.next_rotating_time += MIN(g_conf->auth_mon_ticket_ttl, g_conf->auth_service_ticket_ttl);
+    //data.next_rotating_time += MIN(cct->_conf->auth_mon_ticket_ttl, cct->_conf->auth_service_ticket_ttl);
     _dump_rotating_secrets();
     return true;
   }
@@ -191,7 +191,7 @@ int KeyServer::_rotate_secret(uint32_t service_id)
   RotatingSecrets& r = data.rotating_secrets[service_id];
   int added = 0;
   utime_t now = ceph_clock_now(cct);
-  double ttl = service_id == CEPH_ENTITY_TYPE_AUTH ? g_conf->auth_mon_ticket_ttl : g_conf->auth_service_ticket_ttl;
+  double ttl = service_id == CEPH_ENTITY_TYPE_AUTH ? cct->_conf->auth_mon_ticket_ttl : cct->_conf->auth_service_ticket_ttl;
 
   while (r.need_new_secrets(now)) {
     ExpiringCryptoKey ek;
@@ -424,7 +424,7 @@ int KeyServer::_build_session_auth_info(uint32_t service_id, CephXServiceTicketI
 {
   info.service_id = service_id;
   info.ticket = auth_ticket_info.ticket;
-  info.ticket.init_timestamps(ceph_clock_now(cct), g_conf->auth_service_ticket_ttl);
+  info.ticket.init_timestamps(ceph_clock_now(cct), cct->_conf->auth_service_ticket_ttl);
 
   generate_secret(info.session_key);
 
--

1.7.12.4

#3 lore raw
Quoted 3 lines · Roald van Loon

Sorry, the format-patch of the first email was screwed up (tried to copy/paste the email because git was compiled without perl and hence had no send-email support... should have known that would go haywire)

Ha, no problem. Applied now, thanks!

sage

Quoted 53 lines

Roald

Quoted 40 lines · Roald J. van Loon

Trivial cleanup. There were still 3 references to g_conf in CephxKeyServer. Replaced them in favor of cct->_conf.

---
 src/auth/cephx/CephxKeyServer.cc | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
src/auth/cephx/CephxKeyServer.cc +3 -4
index e0c8174..e57b557 100644
@@ -163,7 +163,7 @@ bool KeyServer::_check_rotating_secrets()
     ldout(cct, 10) << __func__ << " added " << added << dendl;
     data.rotating_ver++;
     //data.next_rotating_time = ceph_clock_now(cct);
-    //data.next_rotating_time += MIN(g_conf->auth_mon_ticket_ttl, g_conf->auth_service_ticket_ttl);
+    //data.next_rotating_time += MIN(cct->_conf->auth_mon_ticket_ttl, cct->_conf->auth_service_ticket_ttl);
     _dump_rotating_secrets();
     return true;
   }
@@ -191,7 +191,7 @@ int KeyServer::_rotate_secret(uint32_t service_id)
   RotatingSecrets& r = data.rotating_secrets[service_id];
   int added = 0;
   utime_t now = ceph_clock_now(cct);
-  double ttl = service_id == CEPH_ENTITY_TYPE_AUTH ? g_conf->auth_mon_ticket_ttl : g_conf->auth_service_ticket_ttl;
+  double ttl = service_id == CEPH_ENTITY_TYPE_AUTH ? cct->_conf->auth_mon_ticket_ttl : cct->_conf->auth_service_ticket_ttl;
 
   while (r.need_new_secrets(now)) {
     ExpiringCryptoKey ek;
@@ -424,7 +424,7 @@ int KeyServer::_build_session_auth_info(uint32_t service_id, CephXServiceTicketI
 {
   info.service_id = service_id;
   info.ticket = auth_ticket_info.ticket;
-  info.ticket.init_timestamps(ceph_clock_now(cct), g_conf->auth_service_ticket_ttl);
+  info.ticket.init_timestamps(ceph_clock_now(cct), cct->_conf->auth_service_ticket_ttl);
 
   generate_secret(info.session_key);
 
--
Quoted 2 lines

1.7.12.4

--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

Applied
#4 lore raw
In reply to Roald van Loon

Applied, thanks!

BTW the patch whitespace was mangled; I had to tweak it to make it apply. Gmail is a common culprit here.

sage

Quoted 48 lines · Roald van Loon

Trivial cleanup. There were still 3 references to g_conf in CephxKeyServer. Replaced them in favor of cct->_conf.

---

src/auth/cephx/CephxKeyServer.cc +1 -1
index e0c8174..e57b557 100644
@@ -163,7 +163,7 @@ bool KeyServer::_check_rotating_secrets()
     ldout(cct, 10) << __func__ << " added " << added << dendl;
     data.rotating_ver++;
     //data.next_rotating_time = ceph_clock_now(cct);
-    //data.next_rotating_time += MIN(g_conf->auth_mon_ticket_ttl,
 g_conf->auth_service_ticket_ttl);
+    //data.next_rotating_time += MIN(cct->_conf->auth_mon_ticket_ttl,
 cct->_conf->auth_service_ticket_ttl);
     _dump_rotating_secrets();
     return true;

}

src/auth/cephx/CephxKeyServer.cc +1 -1
@@ -191,7 +191,7 @@ int KeyServer::_rotate_secret(uint32_t service_id)
   RotatingSecrets& r = data.rotating_secrets[service_id];
   int added = 0;
   utime_t now = ceph_clock_now(cct);
-  double ttl = service_id == CEPH_ENTITY_TYPE_AUTH ?
 g_conf->auth_mon_ticket_ttl : g_conf->auth_service_ticket_ttl;
+  double ttl = service_id == CEPH_ENTITY_TYPE_AUTH ?
 cct->_conf->auth_mon_ticket_ttl : cct->_conf->auth_service_ticket_ttl;
 
   while (r.need_new_secrets(now)) {
     ExpiringCryptoKey ek;
src/auth/cephx/CephxKeyServer.cc +0 -0
@@ -424,7 +424,7 @@ int KeyServer::_build_session_auth_info(uint32_t

service_id, CephXServiceTicketI

 {
   info.service_id = service_id;
   info.ticket = auth_ticket_info.ticket;

- info.ticket.init_timestamps(ceph_clock_now(cct), g_conf->auth_service_ticket_ttl);
+ info.ticket.init_timestamps(ceph_clock_now(cct), cct->_conf->auth_service_ticket_ttl);

   generate_secret(info.session_key);

--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html