~ubuntu-branches/ubuntu/vivid/samba/vivid

« back to all changes in this revision

Viewing changes to source4/dsdb/samdb/ldb_modules/simple_ldap_map.c

  • Committer: Package Import Robot
  • Author(s): Chuck Short
  • Date: 2011-12-21 13:18:04 UTC
  • mfrom: (0.39.21 sid)
  • Revision ID: package-import@ubuntu.com-20111221131804-xtlr39wx6njehxxr
Tags: 2:3.6.1-3ubuntu1
* Merge from Debian testing.  Remaining changes:
  + debian/patches/VERSION.patch:
    - set SAMBA_VERSION_SUFFIX to Ubuntu.
  + debian/patches/error-trans.fix-276472:
    - Add the translation of Unix Error code -ENOTSUP to NT Error Code
    - NT_STATUS_NOT_SUPPORTED to prevent the Permission denied error.
  + debian/smb.conf:
    - add "(Samba, Ubuntu)" to server string.
    - comment out the default [homes] share, and add a comment about
      "valid users = %S" to show users how to restrict access to
      \\server\username to only username.
    - Set 'usershare allow guests', so that usershare admins are 
      allowed to create public shares in addition to authenticated
      ones.
    - add map to guest = Bad user, maps bad username to guest access.
  + debian/samba-common.config:
    - Do not change priority to high if dhclient3 is installed.
    - Use priority medium instead of high for the workgroup question.
  + debian/control:
    - Don't build against or suggest ctdb.
    - Add dependency on samba-common-bin to samba.
  + Add ufw integration:
    - Created debian/samba.ufw.profile
    - debian/rules, debian/samba.dirs, debian/samba.files: install
      profile
    - debian/control: have samba suggest ufw
  + Add apport hook:
    - Created debian/source_samba.py.
    - debian/rules, debian/samba.dirs, debian/samba-common-bin.files: install
  + Switch to upstart:
    - Add debian/samba.{nmbd,smbd}.upstart.
  + debian/samba.logrotate, debian/samba-common.dhcp, debian/samba.if-up:
    - Make them upstart compatible
  + debian/samba.postinst: 
    - Avoid scary pdbedit warnings on first import.
  + debian/samba-common.postinst: Add more informative error message for
    the case where smb.conf was manually deleted
  + debian/patches/fix-debuglevel-name-conflict.patch: don't use 'debug_level'
    as a global variable name in an NSS module 
  + Dropped:
    - debian/patches/error-trans.fix-276472
    - debian/patches/fix-debuglevel-name-conflict.patch

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
*/
28
28
 
29
29
#include "includes.h"
30
 
#include "ldb/include/ldb_module.h"
 
30
#include <ldb_module.h>
31
31
#include "ldb/ldb_map/ldb_map.h"
32
32
 
33
33
#include "librpc/gen_ndr/ndr_misc.h"
34
34
#include "librpc/ndr/libndr.h"
35
35
#include "dsdb/samdb/samdb.h"
 
36
#include <ldb_handlers.h>
36
37
 
37
38
struct entryuuid_private {
38
39
        struct ldb_context *ldb;
43
44
{
44
45
        struct GUID guid;
45
46
        NTSTATUS status = GUID_from_data_blob(val, &guid);
46
 
        enum ndr_err_code ndr_err;
47
47
        struct ldb_val out = data_blob(NULL, 0);
48
48
 
49
49
        if (!NT_STATUS_IS_OK(status)) {
50
50
                return out;
51
51
        }
52
 
        ndr_err = ndr_push_struct_blob(&out, ctx, NULL, &guid,
53
 
                                       (ndr_push_flags_fn_t)ndr_push_GUID);
54
 
        if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
55
 
                return out;
 
52
        status = GUID_to_ndr_blob(&guid, ctx, &out);
 
53
        if (!NT_STATUS_IS_OK(status)) {
 
54
                return data_blob(NULL, 0);
56
55
        }
57
56
 
58
57
        return out;
73
72
{
74
73
        struct GUID guid;
75
74
        NTSTATUS status = NS_GUID_from_string((char *)val->data, &guid);
76
 
        enum ndr_err_code ndr_err;
77
75
        struct ldb_val out = data_blob(NULL, 0);
78
76
 
79
77
        if (!NT_STATUS_IS_OK(status)) {
80
78
                return out;
81
79
        }
82
 
        ndr_err = ndr_push_struct_blob(&out, ctx, NULL, &guid,
83
 
                                       (ndr_push_flags_fn_t)ndr_push_GUID);
84
 
        if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
85
 
                return out;
 
80
        status = GUID_to_ndr_blob(&guid, ctx, &out);
 
81
        if (!NT_STATUS_IS_OK(status)) {
 
82
                return data_blob(NULL, 0);
86
83
        }
87
84
 
88
85
        return out;
122
119
        return out;
123
120
}
124
121
 
 
122
/* Ensure we always convert sids into string, so the backend doesn't have to know about both forms */
 
123
static struct ldb_val sid_always_string(struct ldb_module *module, TALLOC_CTX *ctx, const struct ldb_val *val)
 
124
{
 
125
        struct ldb_context *ldb = ldb_module_get_ctx(module);
 
126
        struct ldb_val out = data_blob(NULL, 0);
 
127
 
 
128
        if (ldif_comparision_objectSid_isString(val)) {
 
129
                if (ldb_handler_copy(ldb, ctx, val, &out) != LDB_SUCCESS) {
 
130
                        return data_blob(NULL, 0);
 
131
                }
 
132
 
 
133
        } else {
 
134
                if (ldif_write_objectSid(ldb, ctx, val, &out) != LDB_SUCCESS) {
 
135
                        return data_blob(NULL, 0);
 
136
                }
 
137
        }
 
138
        return out;
 
139
}
 
140
 
125
141
/* Ensure we always convert objectCategory into a DN */
126
142
static struct ldb_val objectCategory_always_dn(struct ldb_module *module, TALLOC_CTX *ctx, const struct ldb_val *val)
127
143
{
131
147
        const struct ldb_schema_attribute *a = ldb_schema_attribute_by_name(ldb, "objectCategory");
132
148
 
133
149
        dn = ldb_dn_from_ldb_val(ctx, ldb, val);
134
 
        if (dn && ldb_dn_validate(dn)) {
 
150
        if (ldb_dn_validate(dn)) {
135
151
                talloc_free(dn);
136
152
                return val_copy(module, ctx, val);
137
153
        }
165
181
 
166
182
static unsigned long long entryCSN_to_usn_int(TALLOC_CTX *ctx, const struct ldb_val *val) 
167
183
{
168
 
        char *entryCSN = talloc_strdup(ctx, (const char *)val->data);
 
184
        char *entryCSN = talloc_strndup(ctx, (const char *)val->data, val->length);
169
185
        char *mod_per_sec;
170
186
        time_t t;
171
187
        unsigned long long usn;
216
232
static struct ldb_val timestamp_to_usn(struct ldb_module *module, TALLOC_CTX *ctx, const struct ldb_val *val)
217
233
{
218
234
        struct ldb_val out;
219
 
        time_t t;
 
235
        time_t t=0;
220
236
        unsigned long long usn;
221
237
 
222
 
        t = ldb_string_to_time((const char *)val->data);
 
238
        ldb_val_to_time(val, &t);
223
239
        
224
240
        usn = ((unsigned long long)t <<24);
225
241
 
233
249
        /* objectGUID */
234
250
        {
235
251
                .local_name = "objectGUID",
236
 
                .type = MAP_CONVERT,
 
252
                .type = LDB_MAP_CONVERT,
237
253
                .u = {
238
254
                        .convert = {
239
255
                                .remote_name = "entryUUID", 
245
261
        /* invocationId */
246
262
        {
247
263
                .local_name = "invocationId",
248
 
                .type = MAP_CONVERT,
 
264
                .type = LDB_MAP_CONVERT,
249
265
                .u = {
250
266
                        .convert = {
251
267
                                .remote_name = "invocationId", 
257
273
        /* objectSid */
258
274
        {
259
275
                .local_name = "objectSid",
260
 
                .type = MAP_CONVERT,
 
276
                .type = LDB_MAP_CONVERT,
261
277
                .u = {
262
278
                        .convert = {
263
279
                                .remote_name = "objectSid", 
266
282
                        },
267
283
                },
268
284
        },
 
285
        /* securityIdentifier */
 
286
        {
 
287
                .local_name = "securityIdentifier",
 
288
                .type = LDB_MAP_CONVERT,
 
289
                .u = {
 
290
                        .convert = {
 
291
                                .remote_name = "securityIdentifier",
 
292
                                .convert_local = sid_always_binary,
 
293
                                .convert_remote = val_copy,
 
294
                        },
 
295
                },
 
296
        },
269
297
        {
270
298
                .local_name = "name",
271
 
                .type = MAP_RENAME,
 
299
                .type = LDB_MAP_RENAME,
272
300
                .u = {
273
301
                        .rename = {
274
 
                                 .remote_name = "samba4RDN"
 
302
                                 .remote_name = "rdnValue"
275
303
                         }
276
304
                }
277
305
        },
278
306
        {
279
307
                .local_name = "whenCreated",
280
 
                .type = MAP_RENAME,
 
308
                .type = LDB_MAP_RENAME,
281
309
                .u = {
282
310
                        .rename = {
283
311
                                 .remote_name = "createTimestamp"
286
314
        },
287
315
        {
288
316
                .local_name = "whenChanged",
289
 
                .type = MAP_RENAME,
 
317
                .type = LDB_MAP_RENAME,
290
318
                .u = {
291
319
                        .rename = {
292
320
                                 .remote_name = "modifyTimestamp"
295
323
        },
296
324
        {
297
325
                .local_name = "objectClasses",
298
 
                .type = MAP_RENAME,
 
326
                .type = LDB_MAP_RENAME,
299
327
                .u = {
300
328
                        .rename = {
301
329
                                 .remote_name = "samba4ObjectClasses"
304
332
        },
305
333
        {
306
334
                .local_name = "dITContentRules",
307
 
                .type = MAP_RENAME,
 
335
                .type = LDB_MAP_RENAME,
308
336
                .u = {
309
337
                        .rename = {
310
338
                                 .remote_name = "samba4DITContentRules"
313
341
        },
314
342
        {
315
343
                .local_name = "attributeTypes",
316
 
                .type = MAP_RENAME,
 
344
                .type = LDB_MAP_RENAME,
317
345
                .u = {
318
346
                        .rename = {
319
347
                                 .remote_name = "samba4AttributeTypes"
322
350
        },
323
351
        {
324
352
                .local_name = "objectCategory",
325
 
                .type = MAP_CONVERT,
 
353
                .type = LDB_MAP_CONVERT,
326
354
                .u = {
327
355
                        .convert = {
328
356
                                .remote_name = "objectCategory", 
333
361
        },
334
362
        {
335
363
                .local_name = "distinguishedName",
336
 
                .type = MAP_RENAME,
 
364
                .type = LDB_MAP_RENAME,
337
365
                .u = {
338
366
                        .rename = {
339
367
                                 .remote_name = "entryDN"
342
370
        },
343
371
        {
344
372
                .local_name = "primaryGroupID",
345
 
                .type = MAP_CONVERT,
 
373
                .type = LDB_MAP_CONVERT,
346
374
                .u = {
347
375
                        .convert = {
348
376
                                 .remote_name = "primaryGroupID",
353
381
        },
354
382
        {
355
383
                .local_name = "groupType",
356
 
                .type = MAP_CONVERT,
 
384
                .type = LDB_MAP_CONVERT,
357
385
                .u = {
358
386
                        .convert = {
359
387
                                 .remote_name = "groupType",
364
392
        },
365
393
        {
366
394
                .local_name = "userAccountControl",
367
 
                .type = MAP_CONVERT,
 
395
                .type = LDB_MAP_CONVERT,
368
396
                .u = {
369
397
                        .convert = {
370
398
                                 .remote_name = "userAccountControl",
375
403
        },
376
404
        {
377
405
                .local_name = "sAMAccountType",
378
 
                .type = MAP_CONVERT,
 
406
                .type = LDB_MAP_CONVERT,
379
407
                .u = {
380
408
                        .convert = {
381
409
                                 .remote_name = "sAMAccountType",
386
414
        },
387
415
        {
388
416
                .local_name = "systemFlags",
389
 
                .type = MAP_CONVERT,
 
417
                .type = LDB_MAP_CONVERT,
390
418
                .u = {
391
419
                        .convert = {
392
420
                                 .remote_name = "systemFlags",
397
425
        },
398
426
        {
399
427
                .local_name = "usnChanged",
400
 
                .type = MAP_CONVERT,
 
428
                .type = LDB_MAP_CONVERT,
401
429
                .u = {
402
430
                        .convert = {
403
431
                                 .remote_name = "entryCSN",
408
436
        },
409
437
        {
410
438
                .local_name = "usnCreated",
411
 
                .type = MAP_CONVERT,
 
439
                .type = LDB_MAP_CONVERT,
412
440
                .u = {
413
441
                        .convert = {
414
442
                                 .remote_name = "createTimestamp",
419
447
        },
420
448
        {
421
449
                .local_name = "*",
422
 
                .type = MAP_KEEP,
 
450
                .type = LDB_MAP_KEEP,
423
451
        },
424
452
        {
425
453
                .local_name = NULL,
455
483
        /* objectGUID */
456
484
        {
457
485
                .local_name = "objectGUID",
458
 
                .type = MAP_CONVERT,
 
486
                .type = LDB_MAP_CONVERT,
459
487
                .u = {
460
488
                        .convert = {
461
489
                                .remote_name = "nsuniqueid", 
467
495
        /* objectSid */ 
468
496
        {
469
497
                .local_name = "objectSid",
470
 
                .type = MAP_CONVERT,
471
 
                .u = {
472
 
                        .convert = {
473
 
                                .remote_name = "objectSid", 
 
498
                .type = LDB_MAP_CONVERT,
 
499
                .u = {
 
500
                        .convert = {
 
501
                                .remote_name = "sambaSID", 
 
502
                                .convert_local = sid_always_string,
 
503
                                .convert_remote = sid_always_binary,
 
504
                        }
 
505
                }
 
506
        },
 
507
        /* securityIdentifier */
 
508
        {
 
509
                .local_name = "securityIdentifier",
 
510
                .type = LDB_MAP_CONVERT,
 
511
                .u = {
 
512
                        .convert = {
 
513
                                .remote_name = "securityIdentifier",
474
514
                                .convert_local = sid_always_binary,
475
515
                                .convert_remote = val_copy,
476
 
                        }
477
 
                }
 
516
                        },
 
517
                },
478
518
        },
479
519
        {
480
520
                .local_name = "whenCreated",
481
 
                .type = MAP_RENAME,
 
521
                .type = LDB_MAP_RENAME,
482
522
                .u = {
483
523
                        .rename = {
484
524
                                 .remote_name = "createTimestamp"
487
527
        },
488
528
        {
489
529
                .local_name = "whenChanged",
490
 
                .type = MAP_RENAME,
 
530
                .type = LDB_MAP_RENAME,
491
531
                .u = {
492
532
                        .rename = {
493
533
                                 .remote_name = "modifyTimestamp"
496
536
        },
497
537
        {
498
538
                .local_name = "objectCategory",
499
 
                .type = MAP_CONVERT,
 
539
                .type = LDB_MAP_CONVERT,
500
540
                .u = {
501
541
                        .convert = {
502
542
                                .remote_name = "objectCategory", 
507
547
        },
508
548
        {
509
549
                .local_name = "distinguishedName",
510
 
                .type = MAP_RENAME,
 
550
                .type = LDB_MAP_RENAME,
511
551
                .u = {
512
552
                        .rename = {
513
553
                                 .remote_name = "entryDN"
516
556
        },
517
557
        {
518
558
                .local_name = "primaryGroupID",
519
 
                .type = MAP_CONVERT,
 
559
                .type = LDB_MAP_CONVERT,
520
560
                .u = {
521
561
                        .convert = {
522
562
                                 .remote_name = "primaryGroupID",
527
567
        },
528
568
        {
529
569
                .local_name = "groupType",
530
 
                .type = MAP_CONVERT,
 
570
                .type = LDB_MAP_CONVERT,
531
571
                .u = {
532
572
                        .convert = {
533
 
                                 .remote_name = "groupType",
 
573
                                 .remote_name = "sambaGroupType",
534
574
                                 .convert_local = normalise_to_signed32,
535
575
                                 .convert_remote = val_copy,
536
576
                         }
538
578
        },
539
579
        {
540
580
                .local_name = "userAccountControl",
541
 
                .type = MAP_CONVERT,
 
581
                .type = LDB_MAP_CONVERT,
542
582
                .u = {
543
583
                        .convert = {
544
584
                                 .remote_name = "userAccountControl",
549
589
        },
550
590
        {
551
591
                .local_name = "sAMAccountType",
552
 
                .type = MAP_CONVERT,
 
592
                .type = LDB_MAP_CONVERT,
553
593
                .u = {
554
594
                        .convert = {
555
595
                                 .remote_name = "sAMAccountType",
560
600
        },
561
601
        {
562
602
                .local_name = "systemFlags",
563
 
                .type = MAP_CONVERT,
 
603
                .type = LDB_MAP_CONVERT,
564
604
                .u = {
565
605
                        .convert = {
566
606
                                 .remote_name = "systemFlags",
571
611
        },
572
612
        {
573
613
                .local_name = "usnChanged",
574
 
                .type = MAP_CONVERT,
 
614
                .type = LDB_MAP_CONVERT,
575
615
                .u = {
576
616
                        .convert = {
577
617
                                 .remote_name = "modifyTimestamp",
582
622
        },
583
623
        {
584
624
                .local_name = "usnCreated",
585
 
                .type = MAP_CONVERT,
 
625
                .type = LDB_MAP_CONVERT,
586
626
                .u = {
587
627
                        .convert = {
588
628
                                 .remote_name = "createTimestamp",
592
632
                }
593
633
        },
594
634
        {
 
635
                .local_name = "pwdLastSet",
 
636
                .type = LDB_MAP_RENAME,
 
637
                .u = {
 
638
                        .rename = {
 
639
                                 .remote_name = "sambaPwdLastSet"
 
640
                         }
 
641
                }
 
642
        },
 
643
        {
 
644
                .local_name = "lastLogon",
 
645
                .type = LDB_MAP_RENAME,
 
646
                .u = {
 
647
                        .rename = {
 
648
                                 .remote_name = "sambaLogonTime"
 
649
                         }
 
650
                }
 
651
        },
 
652
        {
 
653
                .local_name = "lastLogoff",
 
654
                .type = LDB_MAP_RENAME,
 
655
                .u = {
 
656
                        .rename = {
 
657
                                 .remote_name = "sambaLogoffTime"
 
658
                         }
 
659
                }
 
660
        },
 
661
        {
 
662
                .local_name = "badPwdCount",
 
663
                .type = LDB_MAP_RENAME,
 
664
                .u = {
 
665
                        .rename = {
 
666
                                 .remote_name = "sambaBadPasswordCount"
 
667
                         }
 
668
                }
 
669
        },
 
670
        {
 
671
                .local_name = "logonHours",
 
672
                .type = LDB_MAP_RENAME,
 
673
                .u = {
 
674
                        .rename = {
 
675
                                 .remote_name = "sambaLogonHours"
 
676
                         }
 
677
                }
 
678
        },
 
679
        {
 
680
                .local_name = "homeDrive",
 
681
                .type = LDB_MAP_RENAME,
 
682
                .u = {
 
683
                        .rename = {
 
684
                                 .remote_name = "sambaHomeDrive"
 
685
                         }
 
686
                }
 
687
        },
 
688
        {
 
689
                .local_name = "scriptPath",
 
690
                .type = LDB_MAP_RENAME,
 
691
                .u = {
 
692
                        .rename = {
 
693
                                 .remote_name = "sambaLogonScript"
 
694
                         }
 
695
                }
 
696
        },
 
697
        {
 
698
                .local_name = "profilePath",
 
699
                .type = LDB_MAP_RENAME,
 
700
                .u = {
 
701
                        .rename = {
 
702
                                 .remote_name = "sambaProfilePath"
 
703
                         }
 
704
                }
 
705
        },
 
706
        {
 
707
                .local_name = "userWorkstations",
 
708
                .type = LDB_MAP_RENAME,
 
709
                .u = {
 
710
                        .rename = {
 
711
                                 .remote_name = "sambaUserWorkstations"
 
712
                         }
 
713
                }
 
714
        },
 
715
        {
 
716
                .local_name = "homeDirectory",
 
717
                .type = LDB_MAP_RENAME,
 
718
                .u = {
 
719
                        .rename = {
 
720
                                 .remote_name = "sambaHomePath"
 
721
                         }
 
722
                }
 
723
        },
 
724
        {
 
725
                .local_name = "nextRid",
 
726
                .type = LDB_MAP_RENAME,
 
727
                .u = {
 
728
                        .rename = {
 
729
                                 .remote_name = "sambaNextRid"
 
730
                         }
 
731
                }
 
732
        },
 
733
        {
 
734
                .local_name = "privilegeDisplayName",
 
735
                .type = LDB_MAP_RENAME,
 
736
                .u = {
 
737
                        .rename = {
 
738
                                 .remote_name = "sambaPrivName"
 
739
                         }
 
740
                }
 
741
        },
 
742
        {
595
743
                .local_name = "*",
596
 
                .type = MAP_KEEP,
 
744
                .type = LDB_MAP_KEEP,
597
745
        },
598
746
        {
599
747
                .local_name = NULL,
600
748
        }
601
749
};
602
750
 
 
751
/* This objectClass conflicts with builtin classes on FDS */
 
752
const struct ldb_map_objectclass nsuniqueid_objectclasses[] =
 
753
{
 
754
        {
 
755
                .local_name = NULL
 
756
        }
 
757
};
 
758
 
603
759
/* These things do not show up in wildcard searches in OpenLDAP, but
604
760
 * we need them to show up in the AD-like view */
605
761
static const char * const nsuniqueid_wildcard_attributes[] = {
626
782
static int nsuniqueid_init(struct ldb_module *module)
627
783
{
628
784
        int ret;
629
 
        ret = ldb_map_init(module, nsuniqueid_attributes, NULL, nsuniqueid_wildcard_attributes, "extensibleObject", NULL);
 
785
        ret = ldb_map_init(module, nsuniqueid_attributes, nsuniqueid_objectclasses, nsuniqueid_wildcard_attributes, "extensibleObject", NULL);
630
786
        if (ret != LDB_SUCCESS)
631
787
                return ret;
632
788
 
692
848
        partition_ctrl = ldb_request_get_control(req, DSDB_CONTROL_CURRENT_PARTITION_OID);
693
849
        if (!partition_ctrl) {
694
850
                ldb_debug_set(ldb, LDB_DEBUG_FATAL,
695
 
                              "entryuuid_sequence_number: no current partition control found");
696
 
                return LDB_ERR_CONSTRAINT_VIOLATION;
 
851
                              "entryuuid_sequence_number: no current partition control found!");
 
852
                return LDB_ERR_PROTOCOL_ERROR;
697
853
        }
698
854
 
699
855
        partition = talloc_get_type(partition_ctrl->data,
700
856
                                    struct dsdb_control_current_partition);
701
 
        SMB_ASSERT(partition && partition->version == DSDB_CONTROL_CURRENT_PARTITION_VERSION);
 
857
        if ((partition == NULL) || (partition->version != DSDB_CONTROL_CURRENT_PARTITION_VERSION)) {
 
858
                ldb_debug_set(ldb, LDB_DEBUG_FATAL,
 
859
                              "entryuuid_sequence_number: current partition control with wrong data!");
 
860
                return LDB_ERR_PROTOCOL_ERROR;
 
861
        }
702
862
 
703
863
        ret = ldb_build_search_req(&search_req, ldb, req,
704
864
                                   partition->dn, LDB_SCOPE_BASE,
705
865
                                   NULL, contextCSN_attr, NULL,
706
866
                                   &seq_num, get_seq_callback,
707
867
                                   NULL);
 
868
        LDB_REQ_SET_LOCATION(search_req);
708
869
        if (ret != LDB_SUCCESS) {
709
870
                return ret;
710
871
        }
722
883
 
723
884
        ext = talloc_zero(req, struct ldb_extended);
724
885
        if (!ext) {
725
 
                return LDB_ERR_OPERATIONS_ERROR;
 
886
                return ldb_oom(ldb);
726
887
        }
727
888
        seqr = talloc_zero(req, struct ldb_seqnum_result);
728
889
        if (seqr == NULL) {
729
890
                talloc_free(ext);
730
 
                return LDB_ERR_OPERATIONS_ERROR;
 
891
                return ldb_oom(ldb);
731
892
        }
732
893
        ext->oid = LDB_EXTENDED_SEQUENCE_NUMBER;
733
894
        ext->data = seqr;
763
924
        return ldb_next_request(module, req);
764
925
}
765
926
 
766
 
_PUBLIC_ const struct ldb_module_ops ldb_entryuuid_module_ops = {
 
927
static const struct ldb_module_ops ldb_entryuuid_module_ops = {
767
928
        .name              = "entryuuid",
768
929
        .init_context      = entryuuid_init,
769
930
        .extended          = entryuuid_extended,
770
931
        LDB_MAP_OPS
771
932
};
772
933
 
773
 
_PUBLIC_ const struct ldb_module_ops ldb_nsuniqueid_module_ops = {
 
934
static const struct ldb_module_ops ldb_nsuniqueid_module_ops = {
774
935
        .name              = "nsuniqueid",
775
936
        .init_context      = nsuniqueid_init,
776
937
        .extended          = entryuuid_extended,
777
938
        LDB_MAP_OPS
778
939
};
 
940
 
 
941
/*
 
942
  initialise the module
 
943
 */
 
944
_PUBLIC_ int ldb_simple_ldap_map_module_init(const char *version)
 
945
{
 
946
        int ret;
 
947
        LDB_MODULE_CHECK_VERSION(version);
 
948
        ret = ldb_register_module(&ldb_entryuuid_module_ops);
 
949
        if (ret != LDB_SUCCESS) {
 
950
                return ret;
 
951
        }
 
952
        ret = ldb_register_module(&ldb_nsuniqueid_module_ops);
 
953
        if (ret != LDB_SUCCESS) {
 
954
                return ret;
 
955
        }
 
956
        return LDB_SUCCESS;
 
957
}