lib: Add lib/util_unixsids.h
authorVolker Lendecke <vl@samba.org>
Tue, 27 Dec 2016 12:52:00 +0000 (12:52 +0000)
committerUri Simchoni <uri@samba.org>
Wed, 28 Dec 2016 19:17:12 +0000 (20:17 +0100)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
source3/auth/auth_util.c
source3/auth/server_info.c
source3/auth/token_util.c
source3/include/proto.h
source3/lib/util_sid_passdb.c
source3/lib/util_unixsids.c
source3/lib/util_unixsids.h [new file with mode: 0644]
source3/passdb/lookup_sid.c
source3/winbindd/wb_lookupsids.c
source3/winbindd/winbindd_samr.c
source3/winbindd/winbindd_util.c

index 2da28961bbe6836b0dbd639145e92759ff91ae25..25f27e887d50a05b073c508220f25847078bfa54 100644 (file)
@@ -23,6 +23,7 @@
 
 #include "includes.h"
 #include "auth.h"
+#include "lib/util_unixsids.h"
 #include "../libcli/auth/libcli_auth.h"
 #include "../lib/crypto/arcfour.h"
 #include "rpc_client/init_lsa.h"
index d2b7823aa5438415427bd61616fe4bd141e22539..8461d2089f25ae5962f94f4037e1dc59630f753d 100644 (file)
@@ -19,6 +19,7 @@
 
 #include "includes.h"
 #include "auth.h"
+#include "lib/util_unixsids.h"
 #include "../lib/crypto/arcfour.h"
 #include "../librpc/gen_ndr/netlogon.h"
 #include "../libcli/security/security.h"
index 375905a38777fe39b4d71f5ded22b7cb410e9bab..77b63e4ba63893541bf0d12b14a1bd7a73416f00 100644 (file)
@@ -25,6 +25,7 @@
 /* functions moved from auth/auth_util.c to minimize linker deps */
 
 #include "includes.h"
+#include "lib/util_unixsids.h"
 #include "system/passwd.h"
 #include "auth.h"
 #include "secrets.h"
index 53a2d6aa3832148514d8559a36284ac90453b59e..4535a143a1502401a8f4518c36cc4592d71b4ec0 100644 (file)
@@ -1104,19 +1104,6 @@ bool lookup_wellknown_sid(TALLOC_CTX *mem_ctx, const struct dom_sid *sid,
 bool lookup_wellknown_name(TALLOC_CTX *mem_ctx, const char *name,
                           struct dom_sid *sid, const char **domain);
 
-/* The following definitions come from lib/util_unixsids.c  */
-
-bool sid_check_is_unix_users(const struct dom_sid *sid);
-bool sid_check_is_in_unix_users(const struct dom_sid *sid);
-void uid_to_unix_users_sid(uid_t uid, struct dom_sid *sid);
-void gid_to_unix_groups_sid(gid_t gid, struct dom_sid *sid);
-const char *unix_users_domain_name(void);
-bool lookup_unix_user_name(const char *name, struct dom_sid *sid);
-bool sid_check_is_unix_groups(const struct dom_sid *sid);
-bool sid_check_is_in_unix_groups(const struct dom_sid *sid);
-const char *unix_groups_domain_name(void);
-bool lookup_unix_group_name(const char *name, struct dom_sid *sid);
-
 /* The following definitions come from lib/util_specialsids.c  */
 bool sid_check_is_asserted_identity(const struct dom_sid *sid);
 bool sid_check_is_in_asserted_identity(const struct dom_sid *sid);
index 0ff64cccd82c8651756ab2f362b14e6c00ce8b2b..e67a27d37b2b11cd9fd2cb9e272d5d5e1e1fb89f 100644 (file)
@@ -20,6 +20,7 @@
 
 #include "includes.h"
 #include "lib/util_sid_passdb.h"
+#include "lib/util_unixsids.h"
 #include "passdb/machine_sid.h"
 #include "passdb.h"
 
index 4a38c5702539c7cdaba5d8203d3233a318e15450..4fd0db74db87d547fd8ba325154cb86e5736ef84 100644 (file)
@@ -19,6 +19,7 @@
 
 #include "includes.h"
 #include "system/passwd.h"
+#include "util_unixsids.h"
 #include "../libcli/security/security.h"
 #include "../lib/util/util_pw.h"
 
diff --git a/source3/lib/util_unixsids.h b/source3/lib/util_unixsids.h
new file mode 100644 (file)
index 0000000..664d50f
--- /dev/null
@@ -0,0 +1,38 @@
+/*
+   Unix SMB/CIFS implementation.
+   Translate unix-defined names to SIDs and vice versa
+   Copyright (C) Volker Lendecke 2005
+
+   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/>.
+*/
+
+#ifndef __UTIL_UNIXSIDS_H__
+#define __UTIL_UNIXSIDS_H__
+
+#include "replace.h"
+
+struct dom_sid;
+
+bool sid_check_is_unix_users(const struct dom_sid *sid);
+bool sid_check_is_in_unix_users(const struct dom_sid *sid);
+void uid_to_unix_users_sid(uid_t uid, struct dom_sid *sid);
+void gid_to_unix_groups_sid(gid_t gid, struct dom_sid *sid);
+const char *unix_users_domain_name(void);
+bool lookup_unix_user_name(const char *name, struct dom_sid *sid);
+bool sid_check_is_unix_groups(const struct dom_sid *sid);
+bool sid_check_is_in_unix_groups(const struct dom_sid *sid);
+const char *unix_groups_domain_name(void);
+bool lookup_unix_group_name(const char *name, struct dom_sid *sid);
+
+#endif
index 110bdd3e9b4be97e85b0d684cae8d5f41510ed7d..33302f1b36f05a29af7418a8beaca2cfe5a75c72 100644 (file)
@@ -21,6 +21,7 @@
 
 #include "includes.h"
 #include "passdb.h"
+#include "lib/util_unixsids.h"
 #include "../librpc/gen_ndr/ndr_security.h"
 #include "secrets.h"
 #include "../lib/util/memcache.h"
index 248054750ff61146185054fd35e94579bc686831..a4bcbaddd7b9d9e9187b94ddcd3f653c447737b5 100644 (file)
@@ -19,6 +19,7 @@
 
 #include "includes.h"
 #include "winbindd.h"
+#include "lib/util_unixsids.h"
 #include "librpc/gen_ndr/ndr_winbind_c.h"
 #include "../libcli/security/security.h"
 #include "passdb/machine_sid.h"
index 3d0914a3d7c7d0cc6bfdb4a48bbc3aa70580636d..dce26d2f5a0562180f893c567a7f06ecb66f06b1 100644 (file)
@@ -26,6 +26,7 @@
 #include "includes.h"
 #include "winbindd.h"
 #include "winbindd_rpc.h"
+#include "lib/util_unixsids.h"
 #include "rpc_client/rpc_client.h"
 #include "../librpc/gen_ndr/ndr_samr_c.h"
 #include "rpc_client/cli_samr.h"
index 38e4b8b8edb244e6235429db126c36c435088bf2..c98b3ef5584a1954555cbf5c608e681b80bd4cd2 100644 (file)
@@ -22,6 +22,7 @@
 
 #include "includes.h"
 #include "winbindd.h"
+#include "lib/util_unixsids.h"
 #include "secrets.h"
 #include "../libcli/security/security.h"
 #include "../libcli/auth/pam_errors.h"