summaryrefslogtreecommitdiff
path: root/source4/passdb/pdb_guest.c
diff options
context:
space:
mode:
Diffstat (limited to 'source4/passdb/pdb_guest.c')
-rw-r--r--source4/passdb/pdb_guest.c38
1 files changed, 37 insertions, 1 deletions
diff --git a/source4/passdb/pdb_guest.c b/source4/passdb/pdb_guest.c
index 3f0f06d18d..11da975501 100644
--- a/source4/passdb/pdb_guest.c
+++ b/source4/passdb/pdb_guest.c
@@ -100,7 +100,7 @@ static NTSTATUS guestsam_getsampwsid(struct pdb_methods *my_methods, SAM_ACCOUNT
return guestsam_getsampwrid(my_methods, user, rid);
}
-NTSTATUS pdb_init_guestsam(PDB_CONTEXT *pdb_context, PDB_METHODS **pdb_method, const char *location)
+static NTSTATUS pdb_init_guestsam(PDB_CONTEXT *pdb_context, PDB_METHODS **pdb_method, const char *location)
{
NTSTATUS nt_status;
@@ -121,3 +121,39 @@ NTSTATUS pdb_init_guestsam(PDB_CONTEXT *pdb_context, PDB_METHODS **pdb_method, c
/* There's not very much to initialise here */
return NT_STATUS_OK;
}
+
+NTSTATUS pdb_guest_init(void)
+{
+ NTSTATUS ret;
+ struct passdb_ops ops;
+
+ ZERO_STRUCT(ops);
+
+ /* fill in our name */
+ ops.name = "guestsam";
+ /* fill in all the operations */
+ ops.init = pdb_init_guestsam;
+
+ /* register ourselves with the PASSDB subsystem. */
+ ret = register_backend("passdb", &ops);
+ if (!NT_STATUS_IS_OK(ret)) {
+ DEBUG(0,("Failed to register '%s' PASSDB backend!\n",
+ ops.name));
+ return ret;
+ }
+
+ /* fill in our name */
+ ops.name = "guest";
+ /* fill in all the operations */
+ ops.init = pdb_init_guestsam;
+
+ /* register ourselves with the PASSDB subsystem. */
+ ret = register_backend("passdb", &ops);
+ if (!NT_STATUS_IS_OK(ret)) {
+ DEBUG(0,("Failed to register '%s' PASSDB backend!\n",
+ ops.name));
+ return ret;
+ }
+
+ return ret;
+}