]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: fix critical cap parsing bugs and documentation.
authorGreg Farnum <gregf@hq.newdream.net>
Wed, 5 May 2010 20:55:49 +0000 (13:55 -0700)
committerGreg Farnum <gregf@hq.newdream.net>
Wed, 5 May 2010 21:04:30 +0000 (14:04 -0700)
man/cauthtool.8
src/osd/OSDCaps.cc

index 7415a1bc3f14a16d4edb5c2e11eb0518a4b5744f..3bf5c160a599e555571a1c4de2e1e01474320efd 100644 (file)
@@ -42,7 +42,7 @@ subsystem (osd, mds, mon).  The value is a comma separated list of allow, deny c
 specifier containing one or more of \fIrwx\fP, for read, write, and execute permission.  If you want to declare the key an administrator (with full privileges on everything), use the shorthand 'subsystem = "allow *"'. For
 example,
 .IP
-osd = "allow rwx [pool foo] [auid bar]"  # can read, write, and execute objects
+osd = "allow rwx [pool=foo[,bar]]|[uid=baz[,bay]]"  # can read, write, and execute objects
 .IP
 mds = "allow"      # can access mds server
 .IP
@@ -56,7 +56,7 @@ A client mounting the file system with minimal permissions would need caps like
 .IP
 mds = "allow"
 .IP
-osd = "allow rw pool data"
+osd = "allow rw; allow rw pool = data_pool_num"
 .IP
 mon = "allow r"
 .PP
index 9f80bf1aef5a6367996a74f190da8c228f0c0d3e..b88dbe4088234ba0f3425184f803c33920252d37 100644 (file)
@@ -125,9 +125,10 @@ do { \
         } else if (is_rwx(token, cap_val)) {
           ASSERT_STATE(op_allow || op_deny);
         } else if (token.compare(";") != 0) {
-          ASSERT_STATE(got_eq);
+         ASSERT_STATE(got_eq);
           if (token.compare(",") == 0) {
             ASSERT_STATE(!last_is_comma);
+           last_is_comma = true;
           } else {
             last_is_comma = false;
             int num = strtol(token.c_str(), NULL, 10);
@@ -139,10 +140,10 @@ do { \
           if (got_eq) {
             ASSERT_STATE(num_list.size() > 0);
             list<int>::iterator iter;
-           map<int, OSDCap>& working_map = pools_map;
-           if (cmd_uid) working_map = auid_map;
+           map<int, OSDCap> *working_map = &pools_map;
+           if (cmd_uid) working_map = &auid_map;
             for (iter = num_list.begin(); iter != num_list.end(); ++iter) {
-              OSDCap& cap = working_map[*iter];
+              OSDCap& cap = (*working_map)[*iter];
               if (op_allow) {
                 cap.allow |= cap_val;
               } else {