~ubuntu-branches/debian/sid/openchange/sid

« back to all changes in this revision

Viewing changes to mapiproxy/servers/default/emsmdb/oxorule.c

  • Committer: Package Import Robot
  • Author(s): Jelmer Vernooij
  • Date: 2012-04-12 20:07:57 UTC
  • mfrom: (11 sid)
  • mto: This revision was merged to the branch mainline in revision 12.
  • Revision ID: package-import@ubuntu.com-20120412200757-k933d9trljmxj1l4
Tags: 1:1.0-4
* openchangeserver: Add dependency on openchangeproxy.
* Rebuild against newer version of Samba 4.
* Use dpkg-buildflags.
* Migrate to Git, update Vcs-Git header.
* Switch to debhelper 9.

Show diffs side-by-side

added added

removed removed

Lines of Context:
59
59
        void                    *data = NULL;
60
60
        uint32_t                handle;
61
61
 
62
 
        DEBUG(4, ("exchange_emsmdb: [OXORULE] GetRulesTable (0x3f)\n"));
 
62
        DEBUG(4, ("exchange_emsmdb: [OXORULE] GetRulesTable (0x3f) -- stub\n"));
63
63
 
64
64
        /* Sanity checks */
65
65
        OPENCHANGE_RETVAL_IF(!emsmdbp_ctx, MAPI_E_NOT_INITIALIZED, NULL);
68
68
        OPENCHANGE_RETVAL_IF(!handles, MAPI_E_INVALID_PARAMETER, NULL);
69
69
        OPENCHANGE_RETVAL_IF(!size, MAPI_E_INVALID_PARAMETER, NULL);
70
70
 
71
 
        /* Ensure parent handle references a folder object */
72
 
        handle = handles[mapi_req->handle_idx];
73
 
        retval = mapi_handles_search(emsmdbp_ctx->handles_ctx, handle, &parent);
74
 
        OPENCHANGE_RETVAL_IF(retval, retval, NULL);
75
 
 
76
71
        /* Initialize default GetRulesTable reply */
77
72
        mapi_repl->opnum = mapi_req->opnum;
78
73
        mapi_repl->handle_idx = mapi_req->u.mapi_GetRulesTable.handle_idx;
79
74
        mapi_repl->error_code = MAPI_E_SUCCESS;
80
75
 
81
 
        mapi_handles_get_private_data(parent, &data);
 
76
        /* Ensure parent handle references a folder object */
 
77
        handle = handles[mapi_req->handle_idx];
 
78
        retval = mapi_handles_search(emsmdbp_ctx->handles_ctx, handle, &parent);
 
79
        if (retval) {
 
80
                mapi_repl->error_code = MAPI_E_INVALID_OBJECT;
 
81
                DEBUG(5, ("  handle (%x) not found: %x\n", handle, mapi_req->handle_idx));
 
82
                goto end;
 
83
        }
 
84
 
 
85
        retval = mapi_handles_get_private_data(parent, &data);
 
86
        if (retval) {
 
87
                mapi_repl->error_code = MAPI_E_NOT_FOUND;
 
88
                DEBUG(5, ("  handle data not found, idx = %x\n", mapi_req->handle_idx));
 
89
                goto end;
 
90
        }
 
91
 
82
92
        object = (struct emsmdbp_object *) data;
83
 
        if (!object || object->type != EMSMDBP_OBJECT_FOLDER) {
84
 
                mapi_repl->error_code = MAPI_E_NOT_FOUND;
 
93
        if (object->type != EMSMDBP_OBJECT_FOLDER) {
 
94
                mapi_repl->error_code = MAPI_E_INVALID_OBJECT;
 
95
                DEBUG(5, ("  unhandled object type: %d\n", object->type));
85
96
                goto end;
86
97
        }
87
98
 
 
99
        /* Initialize Table object */
 
100
        handle = handles[mapi_req->handle_idx];
88
101
        retval = mapi_handles_add(emsmdbp_ctx->handles_ctx, handle, &rec);
89
102
        handles[mapi_repl->handle_idx] = rec->handle;
90
103
 
 
104
        object = emsmdbp_object_table_init((TALLOC_CTX *)rec, emsmdbp_ctx, object);
 
105
        if (object) {
 
106
                retval = mapi_handles_set_private_data(rec, object);
 
107
                /* rules tables are stub objects for now */
 
108
                object->object.table->denominator = 0;
 
109
                object->object.table->ulType = MAPISTORE_RULE_TABLE;
 
110
        }
91
111
end:
92
112
        *size += libmapiserver_RopGetRulesTable_size();
93
113