From df99e4bb3751560eb74a4a923c4d7510926f5d71 Mon Sep 17 00:00:00 2001 From: Tim Potter Date: Fri, 24 Sep 2004 12:41:00 +0000 Subject: r2597: A small program that takes SID strings on stdin and produces a marshalled lsa_SidArray on stdout. (This used to be commit d7d8a7ffc66cf6f78f11e8aed975d746c7a520a3) --- source4/utils/setnttoken.c | 77 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 source4/utils/setnttoken.c (limited to 'source4/utils/setnttoken.c') diff --git a/source4/utils/setnttoken.c b/source4/utils/setnttoken.c new file mode 100644 index 0000000000..96adaf8286 --- /dev/null +++ b/source4/utils/setnttoken.c @@ -0,0 +1,77 @@ +/* + Unix SMB/CIFS implementation. + + Set NT ACLs on UNIX files. + + Copyright (C) Tim Potter 2004 + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +#include "includes.h" + +#ifdef HAVE_NO_ACLS + +int main(int argc, char **argv) +{ + printf("ACL support not compiled in."); + return 1; +} + +#else + +int main(int argc, char **argv) +{ + char line[255]; + struct ndr_push *ndr; + struct lsa_SidArray sidarray; + NTSTATUS status; + + setup_logging("setnttoken", DEBUG_STDOUT); + + ndr = ndr_push_init(); + + sidarray.num_sids = 0; + sidarray.sids = NULL; + + while(fgets(line, sizeof(line), stdin)) { + struct dom_sid *sid = dom_sid_parse_talloc(ndr, line); + + if (!sid) { + fprintf(stderr, "Invalid sid: %s", line); + continue; + } + + sidarray.sids = talloc_realloc( + sidarray.sids, + (sidarray.num_sids + 1) * sizeof(struct lsa_SidPtr)); + + sidarray.sids[sidarray.num_sids].sid = + dom_sid_dup(ndr, sid); + + sidarray.num_sids++; + } + +/* NDR_PRINT_DEBUG(lsa_SidArray, &sidarray); */ + + status = ndr_push_lsa_SidArray( + ndr, NDR_SCALARS|NDR_BUFFERS, &sidarray); + + fwrite(ndr->data, 1, ndr->offset, stdout); + + return 0; +} + +#endif /* HAVE_NO_ACLS */ -- cgit From 157dc5e7ea2e46fee8f57f8092371512b4e6e224 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Wed, 27 Oct 2004 15:40:19 +0000 Subject: r3291: fix the build, thx to pipitas for finding this metze (This used to be commit d331a83f08b492ea463fb8781b4c46a71f80bf42) --- source4/utils/setnttoken.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'source4/utils/setnttoken.c') diff --git a/source4/utils/setnttoken.c b/source4/utils/setnttoken.c index 96adaf8286..e3f699fce4 100644 --- a/source4/utils/setnttoken.c +++ b/source4/utils/setnttoken.c @@ -38,9 +38,12 @@ int main(int argc, char **argv) struct ndr_push *ndr; struct lsa_SidArray sidarray; NTSTATUS status; + TALLOC_CTX *mem_ctx; setup_logging("setnttoken", DEBUG_STDOUT); + mem_ctx = talloc_init("setnttoken"); + ndr = ndr_push_init(); sidarray.num_sids = 0; @@ -54,9 +57,8 @@ int main(int argc, char **argv) continue; } - sidarray.sids = talloc_realloc( - sidarray.sids, - (sidarray.num_sids + 1) * sizeof(struct lsa_SidPtr)); + sidarray.sids = talloc_realloc(mem_ctx, sidarray.sids, + (sidarray.num_sids + 1) * sizeof(struct lsa_SidPtr)); sidarray.sids[sidarray.num_sids].sid = dom_sid_dup(ndr, sid); -- cgit From e8010adffe44f1ad0d82c7b5c7d5fe2cf7d53afd Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 5 Nov 2004 07:23:06 +0000 Subject: r3543: fixed some #include lines to make them more consistent, and fixed conditional compilation of xattr client code (This used to be commit 321fb06a627f4deae649ab014bc881721d37b3dd) --- source4/utils/setnttoken.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/utils/setnttoken.c') diff --git a/source4/utils/setnttoken.c b/source4/utils/setnttoken.c index e3f699fce4..b3b11a78ca 100644 --- a/source4/utils/setnttoken.c +++ b/source4/utils/setnttoken.c @@ -22,7 +22,7 @@ #include "includes.h" -#ifdef HAVE_NO_ACLS +#if (!defined(HAVE_NO_ACLS) || !defined(HAVE_XATTR_SUPPORT)) int main(int argc, char **argv) { -- cgit From b875cdf5db045c26da503cde26ae5c3629e6014a Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 5 Nov 2004 12:06:36 +0000 Subject: r3551: these utils need system/filesys.h (This used to be commit 1b945f9f4bcbb6afb3e531e92cd2e904c92c334e) --- source4/utils/setnttoken.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source4/utils/setnttoken.c') diff --git a/source4/utils/setnttoken.c b/source4/utils/setnttoken.c index b3b11a78ca..c51c582b82 100644 --- a/source4/utils/setnttoken.c +++ b/source4/utils/setnttoken.c @@ -21,6 +21,7 @@ */ #include "includes.h" +#include "system/filesys.h" #if (!defined(HAVE_NO_ACLS) || !defined(HAVE_XATTR_SUPPORT)) -- cgit From 8a5c9c28410ae0320356fe1686ad0ee7d1ec0e7b Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 5 Nov 2004 12:10:28 +0000 Subject: r3552: fixed sense of ACL test (This used to be commit 630af28a0f812b5bafce3ffeb72ebd069b66adac) --- source4/utils/setnttoken.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/utils/setnttoken.c') diff --git a/source4/utils/setnttoken.c b/source4/utils/setnttoken.c index c51c582b82..06544d0bc7 100644 --- a/source4/utils/setnttoken.c +++ b/source4/utils/setnttoken.c @@ -23,7 +23,7 @@ #include "includes.h" #include "system/filesys.h" -#if (!defined(HAVE_NO_ACLS) || !defined(HAVE_XATTR_SUPPORT)) +#if (defined(HAVE_NO_ACLS) || !defined(HAVE_XATTR_SUPPORT)) int main(int argc, char **argv) { -- cgit From 71db46ea665606384f2be1be708c74c97c9adfb2 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sat, 6 Nov 2004 23:23:15 +0000 Subject: r3586: Fix some of the issues with the module init functions. Both subsystems and modules can now have init functions, which can be specified in .mk files (INIT_FUNCTION = ...) The build system will define : - SUBSYSTEM_init_static_modules that calls the init functions of all statically compiled modules. Failing to load will generate an error which is not fatal - BINARY_init_subsystems that calls the init functions (if defined) for the subsystems the binary depends on This removes the hack with the "static bool Initialised = " and the "lazy_init" functions (This used to be commit 7a8244761bfdfdfb48f8264d76951ebdfbf7bd8a) --- source4/utils/setnttoken.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source4/utils/setnttoken.c') diff --git a/source4/utils/setnttoken.c b/source4/utils/setnttoken.c index 06544d0bc7..ccdd7a5578 100644 --- a/source4/utils/setnttoken.c +++ b/source4/utils/setnttoken.c @@ -41,6 +41,8 @@ int main(int argc, char **argv) NTSTATUS status; TALLOC_CTX *mem_ctx; + static_init_setnttoken; + setup_logging("setnttoken", DEBUG_STDOUT); mem_ctx = talloc_init("setnttoken"); -- cgit From 4d7e4c80580f9902339680cecee457460fe85218 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 17 Jan 2005 04:07:33 +0000 Subject: r4794: - disabled the ntacl command line utilities until they are rewritten to use the same acl format as we use in pvfs (and hopefully use common code too) - removed a lot of old cruft from our autoconf tests. This may well break some builds, but then we can fix them properly instead of the "if solaris version 5.1.2" crap This was prompted by someone sending me solaris 10 patches that patched the configure script with if statements for several more versions of solaris to check for and do special stuff. That is just silly. (This used to be commit 1ea59d1146f041e9befbb435e901c6d7d497c52c) --- source4/utils/setnttoken.c | 54 +--------------------------------------------- 1 file changed, 1 insertion(+), 53 deletions(-) (limited to 'source4/utils/setnttoken.c') diff --git a/source4/utils/setnttoken.c b/source4/utils/setnttoken.c index ccdd7a5578..d7fe2f0a68 100644 --- a/source4/utils/setnttoken.c +++ b/source4/utils/setnttoken.c @@ -23,60 +23,8 @@ #include "includes.h" #include "system/filesys.h" -#if (defined(HAVE_NO_ACLS) || !defined(HAVE_XATTR_SUPPORT)) - int main(int argc, char **argv) { - printf("ACL support not compiled in."); + printf("This utility disabled until rewritten\n"); return 1; } - -#else - -int main(int argc, char **argv) -{ - char line[255]; - struct ndr_push *ndr; - struct lsa_SidArray sidarray; - NTSTATUS status; - TALLOC_CTX *mem_ctx; - - static_init_setnttoken; - - setup_logging("setnttoken", DEBUG_STDOUT); - - mem_ctx = talloc_init("setnttoken"); - - ndr = ndr_push_init(); - - sidarray.num_sids = 0; - sidarray.sids = NULL; - - while(fgets(line, sizeof(line), stdin)) { - struct dom_sid *sid = dom_sid_parse_talloc(ndr, line); - - if (!sid) { - fprintf(stderr, "Invalid sid: %s", line); - continue; - } - - sidarray.sids = talloc_realloc(mem_ctx, sidarray.sids, - (sidarray.num_sids + 1) * sizeof(struct lsa_SidPtr)); - - sidarray.sids[sidarray.num_sids].sid = - dom_sid_dup(ndr, sid); - - sidarray.num_sids++; - } - -/* NDR_PRINT_DEBUG(lsa_SidArray, &sidarray); */ - - status = ndr_push_lsa_SidArray( - ndr, NDR_SCALARS|NDR_BUFFERS, &sidarray); - - fwrite(ndr->data, 1, ndr->offset, stdout); - - return 0; -} - -#endif /* HAVE_NO_ACLS */ -- cgit From d4de4c2d210d2e8c9b5aedf70695594809ad6a0b Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Fri, 30 Dec 2005 13:16:54 +0000 Subject: r12608: Remove some unused #include lines. (This used to be commit 70e7449318aa0e9d2639c76730a7d1683b2f4981) --- source4/utils/setnttoken.c | 1 - 1 file changed, 1 deletion(-) (limited to 'source4/utils/setnttoken.c') diff --git a/source4/utils/setnttoken.c b/source4/utils/setnttoken.c index d7fe2f0a68..fd7cb31b6d 100644 --- a/source4/utils/setnttoken.c +++ b/source4/utils/setnttoken.c @@ -21,7 +21,6 @@ */ #include "includes.h" -#include "system/filesys.h" int main(int argc, char **argv) { -- cgit From 0479a2f1cbae51fcd8dbdc3c148c808421fb4d25 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 10 Jul 2007 02:07:03 +0000 Subject: r23792: convert Samba4 to GPLv3 There are still a few tidyups of old FSF addresses to come (in both s3 and s4). More commits soon. (This used to be commit fcf38a38ac691abd0fa51b89dc951a08e89fdafa) --- source4/utils/setnttoken.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'source4/utils/setnttoken.c') diff --git a/source4/utils/setnttoken.c b/source4/utils/setnttoken.c index fd7cb31b6d..3a008a4c37 100644 --- a/source4/utils/setnttoken.c +++ b/source4/utils/setnttoken.c @@ -7,7 +7,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or + the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, @@ -16,8 +16,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + along with this program. If not, see . */ #include "includes.h" -- cgit