summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/README4
-rw-r--r--examples/VFS/Makefile3
-rw-r--r--examples/VFS/block/Makefile2
-rw-r--r--examples/VFS/recycle.c20
-rw-r--r--examples/pdb/README42
-rw-r--r--examples/pdb/pdb_test.c60
-rw-r--r--examples/smb.conf.default12
7 files changed, 109 insertions, 34 deletions
diff --git a/examples/README b/examples/README
index ba47cf912f..2222606714 100644
--- a/examples/README
+++ b/examples/README
@@ -1,4 +1,4 @@
-Copyright(C) Samba-Team 1993-1997
+Copyright(C) Samba-Team 1993-2001
This directory contains example config files and related material for
Samba.
@@ -6,6 +6,6 @@ Samba.
At a minimum please refer to the smb.conf.default file for current
information regarding global and share parameter settings.
-Send additions to: samba-bugs@samba.org
+Send additions to: samba@samba.org
diff --git a/examples/VFS/Makefile b/examples/VFS/Makefile
index 716e48da88..f93cd0cb2d 100644
--- a/examples/VFS/Makefile
+++ b/examples/VFS/Makefile
@@ -10,10 +10,11 @@ LIBTOOL = libtool
SAMBA_SRC = ../../source
SAMBA_INCL = ../../source/include
+POPT_INCL = ../../source/popt
UBIQX_SRC = ../../source/ubiqx
SMBWR_SRC = ../../source/smbwrapper
KRB5_SRC = /usr/kerberos/include
-CFLAGS = -I$(SAMBA_SRC) -I$(SAMBA_INCL) -I$(UBIQX_SRC) -I$(SMBWR_SRC) -I$(KRB5_SRC) -Wall -g
+CFLAGS = -I$(SAMBA_SRC) -I$(SAMBA_INCL) -I$(POPT_INCL) -I$(UBIQX_SRC) -I$(SMBWR_SRC) -I$(KRB5_SRC) -Wall -g
VFS_OBJS = audit.so skel.so recycle.so
# Default target
diff --git a/examples/VFS/block/Makefile b/examples/VFS/block/Makefile
index dcc7c07793..44b08681d6 100644
--- a/examples/VFS/block/Makefile
+++ b/examples/VFS/block/Makefile
@@ -8,7 +8,7 @@
CC = gcc
LIBTOOL = libtool
-SAMBA_SRC = /usr/local/src/samba/samba-2.2.0-ron/source
+SAMBA_SRC = ../../../source
SAMBA_INCL = ${SAMBA_SRC}/include
UBIQX_SRC = ${SAMBA_SRC}/ubiqx
SMBWR_SRC = ${SAMBA_SRC}/smbwrapper
diff --git a/examples/VFS/recycle.c b/examples/VFS/recycle.c
index 74d3657895..6a1c98ce54 100644
--- a/examples/VFS/recycle.c
+++ b/examples/VFS/recycle.c
@@ -238,15 +238,18 @@ static int recycle_unlink(connection_struct *conn, const char *inname)
return default_vfs_ops.unlink(conn,fname);
}
- base = strrchr(fname, '/') + 1;
- if(base == (char*)1)
- ext = strrchr(fname, '.');
- else
- ext = strrchr(base, '.');
-
+ base = strrchr(fname, '/');
pstrcpy(bin, recycle_bin);
pstrcat(bin, "/");
- pstrcat(bin, base);
+
+ if(base == NULL) {
+ ext = strrchr(fname, '.');
+ pstrcat(bin, fname);
+ } else {
+ ext = strrchr(base, '.');
+ pstrcat(bin, base+1);
+ }
+ DEBUG(3, ("recycle bin: base %s, ext %s, fname %s, bin %s\n", base, ext, fname, bin));
if(strcmp(fname,bin) == 0) {
DEBUG(3, ("recycle bin: file %s exists, purging...\n", fname));
@@ -254,6 +257,9 @@ static int recycle_unlink(connection_struct *conn, const char *inname)
}
len = strlen(bin);
+ if ( ext != NULL)
+ len = len - strlen(ext);
+
addlen = sizeof(pstring)-len-1;
while(recycle_file_exist(conn,bin)) {
slprintf(bin+len, addlen, " (Copy #%d)", i++);
diff --git a/examples/pdb/README b/examples/pdb/README
index ccc39248aa..a212604792 100644
--- a/examples/pdb/README
+++ b/examples/pdb/README
@@ -1,5 +1,41 @@
README for Samba Password Database (PDB) examples
====================================================
+21-6-2002 Stefan (metze) Metzmacher <metze@metzemix.de>
+
+I have added an interface versioning.
+
+Every module MUST have a pdb_version() function.
+
+this is defined in include/passdb.h:
+#define PDB_MODULE_VERSIONING_MAGIC \
+int pdb_version(void)\
+{\
+ return PASSDB_INTERFACE_VERSION;\
+}
+
+You MUST add this line inside a module:
+PDB_MODULE_VERSIONING_MAGIC
+
+21-6-2002 Stefan (metze) Metzmacher <metze@metzemix.de>
+
+The pdb_interface was changed:
+
+this function are deleted:
+static BOOL testsam_getsampwrid (struct pdb_methods *methods, SAM_ACCOUNT *user, uint32 rid)
+
+this function are added:
+static BOOL testsam_getsampwsid (struct pdb_methods *methods, SAM_ACCOUNT *user, DOM_SID sid)
+
+In the SAM_ACCOUNT struct:
+
+this fields are deleted:
+uint32 user_rid;
+uint32 group_rid;
+
+this fields are added:
+DOM_SID user_sid;
+DOM_SID group_sid;
+
15-2-2002 Jelmer Vernooij <jelmer@nl.linux.org>
The pdb_test.c file in this directory contains a very basic example of
@@ -7,3 +43,9 @@ a pdb plugin. It just prints the name of the function that is executed using
DEBUG. Maybe it's nice to include some of the arguments to the function in the
future too..
+To debug passdb backends, try to run gdb on the 'pdbedit' executable. That's really much easier than restarting smbd constantly and attaching with your debugger.
+
+New passdb plugins should go into the samba lib directory, (/usr/lib/samba/ for
+most distributions) and should be prefixed with 'pdb_'. An example would be:
+/usr/lib/samba/pdb_test.so
+
diff --git a/examples/pdb/pdb_test.c b/examples/pdb/pdb_test.c
index 4b4189e9d5..d2722d2e03 100644
--- a/examples/pdb/pdb_test.c
+++ b/examples/pdb/pdb_test.c
@@ -17,11 +17,24 @@
* Mass Ave, Cambridge, MA 02139, USA.
*/
+
#include "includes.h"
-static BOOL testsam_setsampwent(struct pdb_context *context, BOOL update)
+static int testsam_debug_level = DBGC_ALL;
+
+#undef DBGC_CLASS
+#define DBGC_CLASS testsam_debug_level
+
+/* define the version of the passdb interface */
+PDB_MODULE_VERSIONING_MAGIC
+
+/***************************************************************
+ Start enumeration of the passwd list.
+****************************************************************/
+
+static BOOL testsam_setsampwent(struct pdb_methods *methods, BOOL update)
{
- DEBUG(0, ("testsam_setsampwent called\n"));
+ DEBUG(10, ("testsam_setsampwent called\n"));
return True;
}
@@ -29,18 +42,18 @@ static BOOL testsam_setsampwent(struct pdb_context *context, BOOL update)
End enumeration of the passwd list.
****************************************************************/
-static void testsam_endsampwent(struct pdb_context *context)
+static void testsam_endsampwent(struct pdb_methods *methods)
{
- DEBUG(0, ("testsam_endsampwent called\n"));
+ DEBUG(10, ("testsam_endsampwent called\n"));
}
/*****************************************************************
Get one SAM_ACCOUNT from the list (next in line)
*****************************************************************/
-static BOOL testsam_getsampwent(struct pdb_context *context, SAM_ACCOUNT *user)
+static BOOL testsam_getsampwent(struct pdb_methods *methods, SAM_ACCOUNT *user)
{
- DEBUG(0, ("testsam_getsampwent called\n"));
+ DEBUG(10, ("testsam_getsampwent called\n"));
return False;
}
@@ -48,19 +61,19 @@ static BOOL testsam_getsampwent(struct pdb_context *context, SAM_ACCOUNT *user)
Lookup a name in the SAM database
******************************************************************/
-static BOOL testsam_getsampwnam (struct pdb_context *context, SAM_ACCOUNT *user, const char *sname)
+static BOOL testsam_getsampwnam (struct pdb_methods *methods, SAM_ACCOUNT *user, const char *sname)
{
- DEBUG(0, ("testsam_getsampwnam called\n"));
+ DEBUG(10, ("testsam_getsampwnam called\n"));
return False;
}
/***************************************************************************
- Search by rid
+ Search by sid
**************************************************************************/
-static BOOL testsam_getsampwrid (struct pdb_context *context, SAM_ACCOUNT *user, uint32 rid)
+static BOOL testsam_getsampwsid (struct pdb_methods *methods, SAM_ACCOUNT *user, DOM_SID sid)
{
- DEBUG(0, ("testsam_getsampwrid called\n"));
+ DEBUG(10, ("testsam_getsampwsid called\n"));
return False;
}
@@ -68,9 +81,9 @@ static BOOL testsam_getsampwrid (struct pdb_context *context, SAM_ACCOUNT *user,
Delete a SAM_ACCOUNT
****************************************************************************/
-static BOOL testsam_delete_sam_account(struct pdb_context *context, const SAM_ACCOUNT *sam_pass)
+static BOOL testsam_delete_sam_account(struct pdb_methods *methods, const SAM_ACCOUNT *sam_pass)
{
- DEBUG(0, ("testsam_delete_sam_account called\n"));
+ DEBUG(10, ("testsam_delete_sam_account called\n"));
return False;
}
@@ -78,9 +91,9 @@ static BOOL testsam_delete_sam_account(struct pdb_context *context, const SAM_AC
Modifies an existing SAM_ACCOUNT
****************************************************************************/
-static BOOL testsam_update_sam_account (struct pdb_context *context, const SAM_ACCOUNT *newpwd)
+static BOOL testsam_update_sam_account (struct pdb_methods *methods, const SAM_ACCOUNT *newpwd)
{
- DEBUG(0, ("testsam_update_sam_account called\n"));
+ DEBUG(10, ("testsam_update_sam_account called\n"));
return False;
}
@@ -88,9 +101,9 @@ static BOOL testsam_update_sam_account (struct pdb_context *context, const SAM_A
Adds an existing SAM_ACCOUNT
****************************************************************************/
-static BOOL testsam_add_sam_account (struct pdb_context *context, const SAM_ACCOUNT *newpwd)
+static BOOL testsam_add_sam_account (struct pdb_methods *methods, const SAM_ACCOUNT *newpwd)
{
- DEBUG(0, ("testsam_add_sam_account called\n"));
+ DEBUG(10, ("testsam_add_sam_account called\n"));
return False;
}
@@ -104,18 +117,27 @@ NTSTATUS pdb_init(PDB_CONTEXT *pdb_context, PDB_METHODS **pdb_method, const char
(*pdb_method)->name = "testsam";
+ /* Functions your pdb module doesn't provide should be set
+ * to NULL */
+
(*pdb_method)->setsampwent = testsam_setsampwent;
(*pdb_method)->endsampwent = testsam_endsampwent;
(*pdb_method)->getsampwent = testsam_getsampwent;
(*pdb_method)->getsampwnam = testsam_getsampwnam;
- (*pdb_method)->getsampwrid = testsam_getsampwrid;
+ (*pdb_method)->getsampwsid = testsam_getsampwsid;
(*pdb_method)->add_sam_account = testsam_add_sam_account;
(*pdb_method)->update_sam_account = testsam_update_sam_account;
(*pdb_method)->delete_sam_account = testsam_delete_sam_account;
+
+ testsam_debug_level = debug_add_class("testsam");
+ if (testsam_debug_level == -1) {
+ testsam_debug_level = DBGC_ALL;
+ DEBUG(0, ("testsam: Couldn't register custom debugging class!\n"));
+ } else DEBUG(0, ("testsam: Debug class number of 'testsam': %d\n", testsam_debug_level));
DEBUG(0, ("Initializing testsam\n"));
if (location)
- DEBUG(0, ("Location: %s\n", location));
+ DEBUG(10, ("Location: %s\n", location));
return NT_STATUS_OK;
}
diff --git a/examples/smb.conf.default b/examples/smb.conf.default
index f0c86cc6ee..417417d256 100644
--- a/examples/smb.conf.default
+++ b/examples/smb.conf.default
@@ -58,9 +58,17 @@
# Security mode. Most people will want user level security. See
# security_level.txt for details.
security = user
+
# Use password server option only with security = server
+# The argument list may include:
+# password server = My_PDC_Name [My_BDC_Name] [My_Next_BDC_Name]
+# or to auto-locate the domain controller/s
+# password server = *
; password server = <NT-Server-Name>
+# Note: Do NOT use the now deprecated option of "domain controller"
+# This option is no longer implemented.
+
# You may wish to use password encryption. Please read
# ENCRYPTION.txt, Win95.txt and WinNT.txt in the Samba documentation.
# Do not enable this option unless you have read those documents
@@ -102,10 +110,6 @@
# and gives it a slightly higher chance of winning the election
; preferred master = yes
-# Use only if you have an NT server on your network that has been
-# configured at install time to be a primary domain controller.
-; domain controller = <NT-Domain-Controller-SMBName>
-
# Enable this if you want Samba to be a domain logon server for
# Windows95 workstations.
; domain logons = yes