Project

General

Profile

Actions

Bug #23776

closed

ceph-authtool reports 0 caps for any keyring created

Added by Keith Schincke about 6 years ago. Updated over 3 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
-
Target version:
-
% Done:

0%

Source:
Tags:
Backport:
mimic,luminous
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Crash signature (v1):
Crash signature (v2):

Description

When creating a keyring with any number of capabilities, the ceph-authtool always reports "0 caps"

This has been tagged as impacting 10.2.10 but the impacted code has been in the source tree for at least 8 years.

Example:
  1. touch test.keyring
  2. ceph-authtool test.keyring --name client.test --cap osd 'allow rwx' --cap mon 'allow r' --add-key AQBw99VaAAAAABAAiOuv5Wl2Vnf29RvsJ9kUUA==
    added entity client.test auth auth(auid = 18446744073709551615 key=AQBw99VaAAAAABAAiOuv5Wl2Vnf29RvsJ9kUUA== with 0 caps)
  3. cat test.keyring
    [client.test]
    key = AQBw99VaAAAAABAAiOuv5Wl2Vnf29RvsJ9kUUA==
    caps mon = "allow r"
    caps osd = "allow rwx"
Software version:
  1. rpm -q ceph
    ceph-10.2.10-0.el7.x86_64

(1) below is where the output stream for the Eauth object is generated. the call to a.caps.size() returns 0.
However, the caps do not seem to be added to the Eauth object until lines 289 or 293 of (2).

Perhaps the following code changes be made:
1) update (1) to not print the size of the caps since it is empty at this point
2) update (3) to output the number of caps added to the key. Perhaps something like:
cout << "Added " << keys[name].caps.size{} << " caps to " << keys[name].auid << std::endl ;

1: https://github.com/ceph/ceph/blob/master/src/auth/Auth.h#L52
2: https://github.com/ceph/ceph/blob/master/src/tools/ceph_authtool.cc
3: https://github.com/ceph/ceph/blob/master/src/auth/KeyRing.h#L91


Related issues 2 (0 open2 closed)

Copied to Ceph - Backport #36520: mimic: ceph-authtool reports 0 caps for any keyring createdRejectedNathan CutlerActions
Copied to Ceph - Backport #36521: luminous: ceph-authtool reports 0 caps for any keyring createdRejectedNathan CutlerActions
Actions #1

Updated by Nathan Cutler about 6 years ago

  • Tracker changed from Tasks to Bug
  • Project changed from Stable releases to Ceph
  • Regression set to No
  • Severity set to 3 - minor
Actions #2

Updated by Nathan Cutler over 5 years ago

  • Status changed from New to Fix Under Review
  • Assignee set to Nathan Cutler
Actions #3

Updated by Nathan Cutler over 5 years ago

  • Backport set to mimic,luminous
Actions #4

Updated by Nathan Cutler over 5 years ago

  • Status changed from Fix Under Review to Pending Backport
Actions #5

Updated by Nathan Cutler over 5 years ago

  • Copied to Backport #36520: mimic: ceph-authtool reports 0 caps for any keyring created added
Actions #6

Updated by Nathan Cutler over 5 years ago

  • Copied to Backport #36521: luminous: ceph-authtool reports 0 caps for any keyring created added
Actions #7

Updated by Nathan Cutler over 4 years ago

  • Pull request ID set to 23304
Actions #8

Updated by Nathan Cutler over 3 years ago

  • Status changed from Pending Backport to Resolved
Actions

Also available in: Atom PDF