]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
libcli:security: outline for sddl_conditional_ace.c
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>
Wed, 12 Jul 2023 05:21:06 +0000 (17:21 +1200)
committerAndrew Bartlett <abartlet@samba.org>
Tue, 26 Sep 2023 23:45:35 +0000 (23:45 +0000)
This is to show where we're going to end up.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
libcli/security/conditional_ace.h
libcli/security/sddl_conditional_ace.c [new file with mode: 0644]

index 8deb527e5b426212949fe672065dff7d12b8269e..027d6c17de4b61078b03934438138614ff2509c0 100644 (file)
@@ -40,4 +40,15 @@ bool conditional_ace_encode_binary(TALLOC_CTX *mem_ctx,
                                   struct ace_condition_script *program,
                                   DATA_BLOB *dest);
 
+struct ace_condition_script * ace_conditions_compile_sddl(TALLOC_CTX *mem_ctx,
+                                                         const char *sddl,
+                                                         const char **message,
+                                                         size_t *message_offset,
+                                                         size_t *consumed_length);
+
+char *debug_conditional_ace(TALLOC_CTX *mem_ctx,
+                           struct ace_condition_script *program);
+
+char *sddl_from_conditional_ace(TALLOC_CTX *mem_ctx,
+                               struct ace_condition_script *program);
 #endif /*_CONDITIONAL_ACE_H_*/
diff --git a/libcli/security/sddl_conditional_ace.c b/libcli/security/sddl_conditional_ace.c
new file mode 100644 (file)
index 0000000..c829694
--- /dev/null
@@ -0,0 +1,71 @@
+/*
+ *  Unix SMB implementation.
+ *  Functions for understanding conditional ACEs
+ *
+ *  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 3 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, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "includes.h"
+#include "librpc/gen_ndr/ndr_security.h"
+#include "librpc/gen_ndr/conditional_ace.h"
+#include "libcli/security/security.h"
+#include "libcli/security/conditional_ace.h"
+
+
+
+/*
+ * This is a helper function to create a representation of a
+ * conditional ACE. This is not SDDL, more like a disassembly,
+ * but it uses some of the same tables.
+ */
+char *debug_conditional_ace(TALLOC_CTX *mem_ctx,
+                           struct ace_condition_script *program)
+{
+       return NULL;
+}
+
+
+/*
+ * Convert conditional ACE conditions into SDDL conditions.
+ *
+ * @param mem_ctx
+ * @param program
+ * @return a string or NULL on error.
+ */
+char *sddl_from_conditional_ace(TALLOC_CTX *mem_ctx,
+                               struct ace_condition_script *program)
+{
+       return NULL;
+}
+
+
+/*
+ * Compile SDDL conditional ACE conditions.
+ *
+ * @param mem_ctx
+ * @param sddl - the string to be parsed
+ * @param message - on error, a pointer to a compiler message
+ * @param message_offset - where the error occurred
+ * @param consumed_length - how much of the SDDL was used
+ * @return a struct ace_condition_script (or NULL).
+ */
+struct ace_condition_script * ace_conditions_compile_sddl(
+       TALLOC_CTX *mem_ctx,
+       const char *sddl,
+       const char **message,
+       size_t *message_offset,
+       size_t *consumed_length)
+{
+       return NULL;
+}