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

« back to all changes in this revision

Viewing changes to source4/dsdb/repl/drepl_periodic.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:
24
24
#include "dsdb/samdb/samdb.h"
25
25
#include "auth/auth.h"
26
26
#include "smbd/service.h"
27
 
#include "lib/messaging/irpc.h"
28
27
#include "dsdb/repl/drepl_service.h"
29
 
#include "lib/ldb/include/ldb_errors.h"
 
28
#include <ldb_errors.h>
30
29
#include "../lib/util/dlinklist.h"
31
30
#include "librpc/gen_ndr/ndr_misc.h"
32
31
#include "librpc/gen_ndr/ndr_drsuapi.h"
81
80
        W_ERROR_HAVE_NO_MEMORY(new_te);
82
81
 
83
82
        tmp_mem = talloc_new(service);
84
 
        DEBUG(2,("dreplsrv_periodic_schedule(%u) %sscheduled for: %s\n",
 
83
        DEBUG(4,("dreplsrv_periodic_schedule(%u) %sscheduled for: %s\n",
85
84
                next_interval,
86
85
                (service->periodic.te?"re":""),
87
86
                nt_time_string(tmp_mem, timeval_to_nttime(&next_time))));
97
96
{
98
97
        TALLOC_CTX *mem_ctx;
99
98
 
100
 
        DEBUG(2,("dreplsrv_periodic_run(): schedule pull replication\n"));
 
99
        DEBUG(4,("dreplsrv_periodic_run(): schedule pull replication\n"));
 
100
 
 
101
        /*
 
102
         * KCC or some administrative tool
 
103
         * might have changed Topology graph
 
104
         * i.e. repsFrom/repsTo
 
105
         */
 
106
        dreplsrv_refresh_partitions(service);
101
107
 
102
108
        mem_ctx = talloc_new(service);
103
109
        dreplsrv_schedule_pull_replication(service, mem_ctx);
104
110
        talloc_free(mem_ctx);
105
111
 
106
 
        DEBUG(2,("dreplsrv_periodic_run(): run pending_ops memory=%u\n", 
 
112
        DEBUG(4,("dreplsrv_periodic_run(): run pending_ops memory=%u\n", 
107
113
                 (unsigned)talloc_total_blocks(service)));
108
114
 
109
 
        /* the KCC might have changed repsFrom */
110
 
        dreplsrv_refresh_partitions(service);
 
115
        dreplsrv_ridalloc_check_rid_pool(service);
111
116
 
112
117
        dreplsrv_run_pending_ops(service);
113
 
        dreplsrv_notify_run_ops(service);
 
118
}
 
119
 
 
120
/*
 
121
  run the next pending op, either a notify or a pull
 
122
 */
 
123
void dreplsrv_run_pending_ops(struct dreplsrv_service *s)
 
124
{
 
125
        if (!s->ops.notifies && !s->ops.pending) {
 
126
                return;
 
127
        }
 
128
        if (!s->ops.notifies ||
 
129
            (s->ops.pending &&
 
130
             s->ops.notifies->schedule_time > s->ops.pending->schedule_time)) {
 
131
                dreplsrv_run_pull_ops(s);
 
132
        } else {
 
133
                dreplsrv_notify_run_ops(s);
 
134
        }
114
135
}