~ubuntu-branches/ubuntu/quantal/ceph/quantal

« back to all changes in this revision

Viewing changes to src/ceph_authtool.cc

  • Committer: Package Import Robot
  • Author(s): James Page
  • Date: 2012-07-16 09:56:24 UTC
  • mfrom: (0.3.11)
  • mto: This revision was merged to the branch mainline in revision 17.
  • Revision ID: package-import@ubuntu.com-20120716095624-azr2w4hbhei1rxmx
Tags: upstream-0.48
ImportĀ upstreamĀ versionĀ 0.48

Show diffs side-by-side

added added

removed removed

Lines of Context:
43
43
       << "  --add-key                     will add an encoded key to the keyring\n"
44
44
       << "  --cap subsystem capability    will set the capability for given subsystem\n"
45
45
       << "  --caps capsfile               will set all of capabilities associated with a\n"
46
 
       << "                                given key, for all subsystems\n"
47
 
       << "  -b, --bin                     will create a binary formatted keyring" << std::endl;
 
46
       << "                                given key, for all subsystems"
 
47
       << std::endl;
48
48
  exit(1);
49
49
}
50
50
 
65
65
  bool set_auid = false;
66
66
  uint64_t auid = CEPH_AUTH_UID_DEFAULT;
67
67
  map<string,bufferlist> caps;
68
 
  bool bin_keyring = false;
69
68
  std::string fn;
70
69
 
71
70
  global_init(NULL, args, CEPH_ENTITY_TYPE_CLIENT, CODE_ENVIRONMENT_UTILITY,
108
107
        exit(1);
109
108
      }
110
109
      set_auid = true;
111
 
    } else if (ceph_argparse_flag(args, i, "-b", "--bin", (char*)NULL)) {
112
 
      bin_keyring = true;
113
110
    } else if (fn.empty()) {
114
111
      fn = *i++;
115
112
    } else {
264
261
  // write result?
265
262
  if (modified) {
266
263
    bufferlist bl;
267
 
    if (bin_keyring) {
268
 
      ::encode(keyring, bl);
269
 
    } else {
270
 
      keyring.encode_plaintext(bl);
271
 
    }
 
264
    keyring.encode_plaintext(bl);
272
265
    r = bl.write_file(fn.c_str(), 0600);
273
266
    if (r < 0) {
274
267
      cerr << "could not write " << fn << std::endl;