| 1 | /*
|
|---|
| 2 | Unix SMB/CIFS implementation.
|
|---|
| 3 |
|
|---|
| 4 | Winbind daemon for ntdom nss module
|
|---|
| 5 |
|
|---|
| 6 | Copyright (C) Tim Potter 2000
|
|---|
| 7 | Copyright (C) Jeremy Allison 2001.
|
|---|
| 8 | Copyright (C) Gerald (Jerry) Carter 2003.
|
|---|
| 9 | Copyright (C) Volker Lendecke 2005
|
|---|
| 10 |
|
|---|
| 11 | This program is free software; you can redistribute it and/or modify
|
|---|
| 12 | it under the terms of the GNU General Public License as published by
|
|---|
| 13 | the Free Software Foundation; either version 3 of the License, or
|
|---|
| 14 | (at your option) any later version.
|
|---|
| 15 |
|
|---|
| 16 | This program is distributed in the hope that it will be useful,
|
|---|
| 17 | but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|---|
| 18 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|---|
| 19 | GNU General Public License for more details.
|
|---|
| 20 |
|
|---|
| 21 | You should have received a copy of the GNU General Public License
|
|---|
| 22 | along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|---|
| 23 | */
|
|---|
| 24 |
|
|---|
| 25 | #include "includes.h"
|
|---|
| 26 | #include "winbindd.h"
|
|---|
| 27 |
|
|---|
| 28 | #undef DBGC_CLASS
|
|---|
| 29 | #define DBGC_CLASS DBGC_WINBIND
|
|---|
| 30 |
|
|---|
| 31 | /* Fill a grent structure from various other information */
|
|---|
| 32 |
|
|---|
| 33 | bool fill_grent(TALLOC_CTX *mem_ctx, struct winbindd_gr *gr,
|
|---|
| 34 | const char *dom_name, const char *gr_name, gid_t unix_gid)
|
|---|
| 35 | {
|
|---|
| 36 | fstring full_group_name;
|
|---|
| 37 | char *mapped_name = NULL;
|
|---|
| 38 | struct winbindd_domain *domain;
|
|---|
| 39 | NTSTATUS nt_status = NT_STATUS_UNSUCCESSFUL;
|
|---|
| 40 |
|
|---|
| 41 | domain = find_domain_from_name_noinit(dom_name);
|
|---|
| 42 | if (domain == NULL) {
|
|---|
| 43 | DEBUG(0, ("Failed to find domain '%s'. "
|
|---|
| 44 | "Check connection to trusted domains!\n",
|
|---|
| 45 | dom_name));
|
|---|
| 46 | return false;
|
|---|
| 47 | }
|
|---|
| 48 |
|
|---|
|
|---|