2 Unix SMB/CIFS implementation.
4 Set NT ACLs on UNIX files.
6 Copyright (C) Tim Potter <tpot@samba.org> 2004
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2 of the License, or
11 (at your option) any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24 #include "system/filesys.h"
26 #if (defined(HAVE_NO_ACLS) || !defined(HAVE_XATTR_SUPPORT))
28 int main(int argc, char **argv)
30 printf("ACL support not compiled in.");
36 int main(int argc, char **argv)
40 struct lsa_SidArray sidarray;
44 static_init_setnttoken;
46 setup_logging("setnttoken", DEBUG_STDOUT);
48 mem_ctx = talloc_init("setnttoken");
50 ndr = ndr_push_init();
52 sidarray.num_sids = 0;
55 while(fgets(line, sizeof(line), stdin)) {
56 struct dom_sid *sid = dom_sid_parse_talloc(ndr, line);
59 fprintf(stderr, "Invalid sid: %s", line);
63 sidarray.sids = talloc_realloc(mem_ctx, sidarray.sids,
64 (sidarray.num_sids + 1) * sizeof(struct lsa_SidPtr));
66 sidarray.sids[sidarray.num_sids].sid =
67 dom_sid_dup(ndr, sid);
72 /* NDR_PRINT_DEBUG(lsa_SidArray, &sidarray); */
74 status = ndr_push_lsa_SidArray(
75 ndr, NDR_SCALARS|NDR_BUFFERS, &sidarray);
77 fwrite(ndr->data, 1, ndr->offset, stdout);
82 #endif /* HAVE_NO_ACLS */