~veger/ubuntu/precise/samba/fix-for-902339

« back to all changes in this revision

Viewing changes to source4/nbt_server/dgram/netlogon.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:
23
23
#include "includes.h"
24
24
#include "nbt_server/nbt_server.h"
25
25
#include "lib/socket/socket.h"
26
 
#include "lib/ldb/include/ldb.h"
 
26
#include <ldb.h>
27
27
#include "dsdb/samdb/samdb.h"
28
28
#include "auth/auth.h"
29
 
#include "../lib/util/util_ldb.h"
30
29
#include "param/param.h"
31
30
#include "smbd/service_task.h"
32
31
#include "cldap_server/cldap_server.h"
55
54
 
56
55
        samctx = iface->nbtsrv->sam_ctx;
57
56
 
58
 
        if (lp_server_role(iface->nbtsrv->task->lp_ctx) != ROLE_DOMAIN_CONTROLLER
 
57
        if (lpcfg_server_role(iface->nbtsrv->task->lp_ctx) != ROLE_DOMAIN_CONTROLLER
59
58
            || !samdb_is_pdc(samctx)) {
60
59
                DEBUG(2, ("Not a PDC, so not processing LOGON_PRIMARY_QUERY\n"));
61
60
                return;         
62
61
        }
63
62
 
64
 
        if (strcasecmp_m(name->name, lp_workgroup(iface->nbtsrv->task->lp_ctx)) != 0) {
 
63
        if (strcasecmp_m(name->name, lpcfg_workgroup(iface->nbtsrv->task->lp_ctx)) != 0) {
65
64
                DEBUG(5,("GetDC requested for a domian %s that we don't host\n", name->name));
66
65
                return;
67
66
        }
72
71
        pdc = &netlogon_response.data.get_pdc;
73
72
 
74
73
        pdc->command = NETLOGON_RESPONSE_FROM_PDC;
75
 
        pdc->pdc_name         = lp_netbios_name(iface->nbtsrv->task->lp_ctx);
 
74
        pdc->pdc_name         = lpcfg_netbios_name(iface->nbtsrv->task->lp_ctx);
76
75
        pdc->unicode_pdc_name = pdc->pdc_name;
77
 
        pdc->domain_name      = lp_workgroup(iface->nbtsrv->task->lp_ctx);
 
76
        pdc->domain_name      = lpcfg_workgroup(iface->nbtsrv->task->lp_ctx);
78
77
        pdc->nt_version       = 1;
79
78
        pdc->lmnt_token       = 0xFFFF;
80
79
        pdc->lm20_token       = 0xFFFF;
81
80
 
82
81
        dgram_mailslot_netlogon_reply(reply_iface->dgmsock, 
83
82
                                      packet, 
84
 
                                      lp_netbios_name(iface->nbtsrv->task->lp_ctx),
 
83
                                      lpcfg_netbios_name(iface->nbtsrv->task->lp_ctx),
85
84
                                      netlogon->req.pdc.mailslot_name,
86
85
                                      &netlogon_response);
87
86
}
124
123
 
125
124
        status = fill_netlogon_samlogon_response(samctx, packet, NULL, name->name, sid, NULL, 
126
125
                                                 netlogon->req.logon.user_name, netlogon->req.logon.acct_control, src->addr, 
127
 
                                                 netlogon->req.logon.nt_version, iface->nbtsrv->task->lp_ctx, &netlogon_response.data.samlogon);
 
126
                                                 netlogon->req.logon.nt_version, iface->nbtsrv->task->lp_ctx, &netlogon_response.data.samlogon, false);
128
127
        if (!NT_STATUS_IS_OK(status)) {
129
128
                DEBUG(2,("NBT netlogon query failed domain=%s sid=%s version=%d - %s\n",
130
129
                         name->name, dom_sid_string(packet, sid), netlogon->req.logon.nt_version, nt_errstr(status)));
137
136
 
138
137
        dgram_mailslot_netlogon_reply(reply_iface->dgmsock, 
139
138
                                      packet, 
140
 
                                      lp_netbios_name(iface->nbtsrv->task->lp_ctx),
 
139
                                      lpcfg_netbios_name(iface->nbtsrv->task->lp_ctx),
141
140
                                      netlogon->req.logon.mailslot_name,
142
141
                                      &netlogon_response);
143
142
}