~ubuntu-branches/ubuntu/utopic/389-ds-base/utopic-proposed

« back to all changes in this revision

Viewing changes to ldap/servers/slapd/plugin.c

  • Committer: Package Import Robot
  • Author(s): Timo Aaltonen
  • Date: 2014-02-03 11:08:50 UTC
  • mfrom: (0.2.1)
  • Revision ID: package-import@ubuntu.com-20140203110850-tjzx85elnke9fiu3
Tags: 1.3.2.9-1
* New upstream release.
  - fixes CVE-2013-0336 (Closes: #704077)
  - fixes CVE-2013-1897 (Closes: #704421)
  - fixes CVE-2013-2219 (Closes: #718325)
  - fixes CVE-2013-4283 (Closes: #721222)
  - fixes CVE-2013-4485 (Closes: #730115)
* Drop fix-CVE-2013-0312.diff, upstream.
* rules: Add new scripts to rename.
* fix-sasl-path.diff: Use a triplet path to find libsasl2. (LP:
  #1088822)
* admin_scripts.diff: Add patch from upstream #47511 to fix bashisms.
* control: Add ldap-utils to -base depends.
* rules, rename-online-scripts.diff: Some scripts with .pl suffix are
  meant for an online server, so instead of overwriting the offline
  scripts use -online suffix.
* rules: Enable parallel build, but limit the jobs to 1 for
  dh_auto_install.
* control: Bump policy to 3.9.5, no changes.
* rules: Add get-orig-source target.
* lintian-overrides: Drop obsolete entries, add comments for the rest.

Show diffs side-by-side

added added

removed removed

Lines of Context:
586
586
        return( names_list );
587
587
}
588
588
 
 
589
int slapi_send_ldap_intermediate( Slapi_PBlock *pb, LDAPControl **ectrls,
 
590
        char *responseName, struct berval *responseValue)
 
591
{
 
592
        /* no SLAPI_PLUGIN_DB_INTERMEDIATE_FN defined
 
593
         * always directly call slapd_ function
 
594
         */
 
595
        return send_ldap_intermediate(pb, ectrls, responseName, responseValue);
 
596
}
 
597
 
589
598
int
590
599
slapi_send_ldap_search_entry( Slapi_PBlock *pb, Slapi_Entry *e, LDAPControl **ectrls,
591
600
        char **attrs, int attrsonly )
1453
1462
                        if (( rc = func (pb)) != 0 )
1454
1463
                        {
1455
1464
                                if (SLAPI_PLUGIN_PREOPERATION == list->plg_type ||
1456
 
                                        SLAPI_PLUGIN_INTERNAL_PREOPERATION == list->plg_type ||
1457
 
                                        SLAPI_PLUGIN_BETXNPREOPERATION == list->plg_type ||
1458
 
                    SLAPI_PLUGIN_START_FN == operation )
 
1465
                                    SLAPI_PLUGIN_INTERNAL_PREOPERATION == list->plg_type ||
 
1466
                                    SLAPI_PLUGIN_START_FN == operation )
1459
1467
                                {
1460
1468
                                        /*
1461
1469
                                         * We bail out of plugin processing for preop plugins
1465
1473
                                         */
1466
1474
                                        return_value = rc;
1467
1475
                                        break;
1468
 
                                } else if (SLAPI_PLUGIN_BEPREOPERATION == list->plg_type ||
1469
 
                                        SLAPI_PLUGIN_BEPOSTOPERATION == list->plg_type)
 
1476
                                }
 
1477
                                else if (SLAPI_PLUGIN_BEPREOPERATION == list->plg_type ||
 
1478
                                         SLAPI_PLUGIN_BETXNPREOPERATION == list->plg_type ||
 
1479
                                         SLAPI_PLUGIN_BEPOSTOPERATION == list->plg_type ||
 
1480
                                         SLAPI_PLUGIN_BETXNPOSTOPERATION == list->plg_type )
1470
1481
                                {
1471
 
                                        /* respect fatal error (-1); should not OR it */
1472
 
                                        if (-1 == rc) {
 
1482
                                        /* 
 
1483
                                         * respect fatal error SLAPI_PLUGIN_FAILURE (-1);
 
1484
                                         * should not OR it.
 
1485
                                         */
 
1486
                                        if (SLAPI_PLUGIN_FAILURE == rc) {
1473
1487
                                                return_value = rc;
1474
 
                                        } else if (-1 != return_value) {
 
1488
                                        } else if (SLAPI_PLUGIN_FAILURE != return_value) {
1475
1489
                                                /* OR the result into the return value 
1476
1490
                                                 * for be pre/postops */
1477
1491
                                                return_value |= rc;
1493
1507
slapi_berval_cmp (const struct berval* L, const struct berval* R) /* JCM - This does not belong here. But, where should it go? */
1494
1508
{
1495
1509
    int result = 0;
 
1510
 
 
1511
    if(L == NULL && R != NULL){
 
1512
        return 1;
 
1513
    } else if(L != NULL && R == NULL){
 
1514
        return -1;
 
1515
    } else if(L == NULL && R == NULL){
 
1516
        return 0;
 
1517
    }
1496
1518
    if (L->bv_len < R->bv_len) {
1497
 
        result = memcmp (L->bv_val, R->bv_val, L->bv_len);
1498
 
        if (result == 0)
1499
 
          result = -1;
 
1519
        result = memcmp (L->bv_val, R->bv_val, L->bv_len);
 
1520
        if (result == 0)
 
1521
            result = -1;
1500
1522
    } else {
1501
 
        result = memcmp (L->bv_val, R->bv_val, R->bv_len);
1502
 
        if (result == 0 && (L->bv_len > R->bv_len))
1503
 
          result = 1;
 
1523
        result = memcmp (L->bv_val, R->bv_val, R->bv_len);
 
1524
        if (result == 0 && (L->bv_len > R->bv_len))
 
1525
            result = 1;
1504
1526
    }
 
1527
 
1505
1528
    return result;
1506
1529
}
1507
1530
 
3214
3237
 
3215
3238
        ptd_set_special_data(&(config->plgc_bind_subtrees), PLGC_DATA_BIND_ROOT);
3216
3239
}
 
3240
 
 
3241
PRBool
 
3242
slapi_disordely_shutdown(PRBool set)
 
3243
{
 
3244
    static PRBool is_disordely_shutdown = PR_FALSE;
 
3245
    
 
3246
    if (set) {
 
3247
        is_disordely_shutdown = PR_TRUE;
 
3248
    }
 
3249
    return (is_disordely_shutdown);
 
3250
}