~ubuntu-branches/ubuntu/precise/samba/precise

« back to all changes in this revision

Viewing changes to source3/winbindd/winbindd_misc.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:
22
22
 
23
23
#include "includes.h"
24
24
#include "winbindd.h"
25
 
#include "../librpc/gen_ndr/cli_netlogon.h"
26
25
 
27
26
#undef DBGC_CLASS
28
27
#define DBGC_CLASS DBGC_WINBIND
130
129
                        is_online ? "Online" : "Offline" );
131
130
        }
132
131
 
 
132
        state->response->data.num_entries = num_domains;
 
133
 
133
134
        extra_data_len = strlen(extra_data);
134
135
        if (extra_data_len > 0) {
135
136
 
207
208
        return WINBINDD_OK;
208
209
}
209
210
 
210
 
/* This is the child-only version of --sequence. It only allows for a single
211
 
 * domain (ie "our" one) to be displayed. */
212
 
 
213
 
enum winbindd_result winbindd_dual_show_sequence(struct winbindd_domain *domain,
214
 
                                                 struct winbindd_cli_state *state)
215
 
{
216
 
        DEBUG(3, ("[%5lu]: show sequence\n", (unsigned long)state->pid));
217
 
 
218
 
        /* Ensure null termination */
219
 
        state->request->domain_name[sizeof(state->request->domain_name)-1]='\0';
220
 
 
221
 
        domain->methods->sequence_number(domain, &domain->sequence_number);
222
 
 
223
 
        state->response->data.sequence_number =
224
 
                domain->sequence_number;
225
 
 
226
 
        return WINBINDD_OK;
227
 
}
228
 
 
229
211
struct domain_info_state {
230
212
        struct winbindd_domain *domain;
231
213
        struct winbindd_cli_state *cli;
332
314
        request_ok(state->cli);
333
315
}
334
316
 
 
317
void winbindd_dc_info(struct winbindd_cli_state *cli)
 
318
{
 
319
        struct winbindd_domain *domain;
 
320
        char *dc_name, *dc_ip;
 
321
 
 
322
        cli->request->domain_name[sizeof(cli->request->domain_name)-1] = '\0';
 
323
 
 
324
        DEBUG(3, ("[%5lu]: domain_info [%s]\n", (unsigned long)cli->pid,
 
325
                  cli->request->domain_name));
 
326
 
 
327
        if (cli->request->domain_name[0] != '\0') {
 
328
                domain = find_domain_from_name_noinit(
 
329
                        cli->request->domain_name);
 
330
                DEBUG(10, ("Could not find domain %s\n",
 
331
                           cli->request->domain_name));
 
332
                if (domain == NULL) {
 
333
                        request_error(cli);
 
334
                        return;
 
335
                }
 
336
        } else {
 
337
                domain = find_our_domain();
 
338
        }
 
339
 
 
340
        if (!fetch_current_dc_from_gencache(
 
341
                    talloc_tos(), domain->name, &dc_name, &dc_ip)) {
 
342
                DEBUG(10, ("fetch_current_dc_from_gencache(%s) failed\n",
 
343
                           domain->name));
 
344
                request_error(cli);
 
345
                return;
 
346
        }
 
347
 
 
348
        cli->response->data.num_entries = 1;
 
349
        cli->response->extra_data.data = talloc_asprintf(
 
350
                cli->mem_ctx, "%s\n%s\n", dc_name, dc_ip);
 
351
 
 
352
        TALLOC_FREE(dc_name);
 
353
        TALLOC_FREE(dc_ip);
 
354
 
 
355
        if (cli->response->extra_data.data == NULL) {
 
356
                request_error(cli);
 
357
                return;
 
358
        }
 
359
 
 
360
        /* must add one to length to copy the 0 for string termination */
 
361
        cli->response->length +=
 
362
                strlen((char *)cli->response->extra_data.data) + 1;
 
363
 
 
364
        request_ok(cli);
 
365
}
 
366
 
335
367
/* List various tidbits of information */
336
368
 
337
369
void winbindd_info(struct winbindd_cli_state *state)