~evarlast/ubuntu/utopic/mongodb/upstart-workaround-debian-bug-718702

« back to all changes in this revision

Viewing changes to src/mongo/db/commands/touch.cpp

  • Committer: Package Import Robot
  • Author(s): James Page, James Page, Robie Basak
  • Date: 2013-05-29 17:44:42 UTC
  • mfrom: (44.1.7 sid)
  • Revision ID: package-import@ubuntu.com-20130529174442-z0a4qmoww4y0t458
Tags: 1:2.4.3-1ubuntu1
[ James Page ]
* Merge from Debian unstable, remaining changes:
  - Enable SSL support:
    + d/control: Add libssl-dev to BD's.
    + d/rules: Enabled --ssl option.
    + d/mongodb.conf: Add example SSL configuration options.
  - d/mongodb-server.mongodb.upstart: Add upstart configuration.
  - d/rules: Don't strip binaries during scons build for Ubuntu.
  - d/control: Add armhf to target archs.
  - d/p/SConscript.client.patch: fixup install of client libraries.
  - d/p/0010-install-libs-to-usr-lib-not-usr-lib64-Closes-588557.patch:
    Install libraries to lib not lib64.
* Dropped changes:
  - d/p/arm-support.patch: Included in Debian.
  - d/p/double-alignment.patch: Included in Debian.
  - d/rules,control: Debian also builds with avaliable system libraries
    now.
* Fix FTBFS due to gcc and boost upgrades in saucy:
  - d/p/0008-ignore-unused-local-typedefs.patch: Add -Wno-unused-typedefs
    to unbreak building with g++-4.8.
  - d/p/0009-boost-1.53.patch: Fixup signed/unsigned casting issue.

[ Robie Basak ]
* d/p/0011-Use-a-signed-char-to-store-BSONType-enumerations.patch: Fixup
  build failure on ARM due to missing signed'ness of char cast.

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
 
21
21
#include "pch.h"
22
22
 
 
23
#include <string>
 
24
#include <vector>
 
25
 
 
26
#include "mongo/db/auth/action_set.h"
 
27
#include "mongo/db/auth/action_type.h"
 
28
#include "mongo/db/auth/authorization_manager.h"
 
29
#include "mongo/db/auth/privilege.h"
23
30
#include "mongo/db/commands.h"
24
31
#include "mongo/db/d_concurrency.h"
25
32
#include "mongo/db/curop-inl.h"
26
33
#include "mongo/db/index.h"
 
34
#include "mongo/db/jsobj.h"
27
35
#include "mongo/db/pdfile.h"
28
36
#include "mongo/util/timer.h"
29
37
#include "mongo/util/touch_pages.h"
44
52
                " at least one of data or index must be true; default is both are false\n";
45
53
        }
46
54
        virtual bool requiresAuth() { return true; }
 
55
        virtual void addRequiredPrivileges(const std::string& dbname,
 
56
                                           const BSONObj& cmdObj,
 
57
                                           std::vector<Privilege>* out) {
 
58
            ActionSet actions;
 
59
            actions.addAction(ActionType::touch);
 
60
            out->push_back(Privilege(AuthorizationManager::SERVER_RESOURCE_NAME, actions));
 
61
        }
47
62
        TouchCmd() : Command("touch") { }
48
63
 
49
64
        virtual bool run(const string& db, 
92
107
                std::vector< std::string > indexes;
93
108
                {
94
109
                    Client::ReadContext ctx(ns);
95
 
                    NamespaceDetails *nsd = nsdetails(ns.c_str());
 
110
                    NamespaceDetails *nsd = nsdetails(ns);
96
111
                    massert( 16153, "namespace does not exist", nsd );
97
112
                    
98
113
                    NamespaceDetails::IndexIterator ii = nsd->ii();