summaryrefslogtreecommitdiff
path: root/examples/pdb
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2002-09-25 15:05:17 +0000
committerGerald Carter <jerry@samba.org>2002-09-25 15:05:17 +0000
commitec0b8aa70454cab4a918ab09e8ed52d60b4b3256 (patch)
tree45bfb5176738f3888ff69d3ef8e07500cd07b34d /examples/pdb
parent3054ef8a6ec8a67937cc1bfc492722fd6eccc325 (diff)
downloadsamba-ec0b8aa70454cab4a918ab09e8ed52d60b4b3256.tar.gz
samba-ec0b8aa70454cab4a918ab09e8ed52d60b4b3256.tar.bz2
samba-ec0b8aa70454cab4a918ab09e8ed52d60b4b3256.zip
sync'ing up for 3.0alpha20 release
(This used to be commit 803715d96016767c55202362b17096fc80786c59)
Diffstat (limited to 'examples/pdb')
-rw-r--r--examples/pdb/mysql/Makefile.in2
-rw-r--r--examples/pdb/mysql/pdb_mysql.c57
-rw-r--r--examples/pdb/xml/Makefile.in2
-rw-r--r--examples/pdb/xml/pdb_xml.c24
4 files changed, 27 insertions, 58 deletions
diff --git a/examples/pdb/mysql/Makefile.in b/examples/pdb/mysql/Makefile.in
index 1da6ea789e..3ebecad762 100644
--- a/examples/pdb/mysql/Makefile.in
+++ b/examples/pdb/mysql/Makefile.in
@@ -2,8 +2,6 @@ PDB_OBJS = pdb_mysql.so
PDB_LDFLAGS = -lmysqlclient
MAKEFILE = Makefile.pdb
-include $(MAKEFILE)
-
CC = @CC@
LIBTOOL = libtool
CFLAGS = @CFLAGS@ $(PDB_CFLAGS)
diff --git a/examples/pdb/mysql/pdb_mysql.c b/examples/pdb/mysql/pdb_mysql.c
index c7e9e781c3..0cc1de6aaf 100644
--- a/examples/pdb/mysql/pdb_mysql.c
+++ b/examples/pdb/mysql/pdb_mysql.c
@@ -80,7 +80,6 @@ typedef struct pdb_mysql_query {
char *part1;
char *part2;
} pdb_mysql_query;
-
#define SET_DATA(data,methods) { \
if(!methods){ \
DEBUG(0, ("invalid methods!\n")); \
@@ -92,8 +91,8 @@ typedef struct pdb_mysql_query {
return False; \
} \
}
-void
-pdb_mysql_int_field(struct pdb_methods *m,
+
+void pdb_mysql_int_field(struct pdb_methods *m,
struct pdb_mysql_query *q, char *name, int value)
{
if (!name || strchr(name, '\''))
@@ -111,8 +110,7 @@ pdb_mysql_int_field(struct pdb_methods *m,
}
}
-static BOOL
-pdb_mysql_string_field(struct pdb_methods *methods,
+static BOOL pdb_mysql_string_field(struct pdb_methods *methods,
struct pdb_mysql_query *q,
char *name, const char *value)
{
@@ -145,8 +143,7 @@ pdb_mysql_string_field(struct pdb_methods *methods,
return True;
}
-static char *
-config_value(pdb_mysql_data * data, char *name, char *default_value)
+static char * config_value(pdb_mysql_data * data, char *name, char *default_value)
{
if (lp_parm_string(NULL, data->location, name))
return lp_parm_string(NULL, data->location, name);
@@ -154,9 +151,7 @@ config_value(pdb_mysql_data * data, char *name, char *default_value)
return default_value;
}
-static char *
-config_value_write(pdb_mysql_data * data, char *name, char *default_value)
-{
+static char * config_value_write(pdb_mysql_data * data, char *name, char *default_value) {
char *v = config_value(data, name, NULL);
char *write;
@@ -179,8 +174,7 @@ config_value_write(pdb_mysql_data * data, char *name, char *default_value)
return write;
}
-static const char *
-config_value_read(pdb_mysql_data * data, char *name, char *default_value)
+static const char * config_value_read(pdb_mysql_data * data, char *name, char *default_value)
{
char *v = config_value(data, name, NULL);
char *write;
@@ -206,8 +200,7 @@ config_value_read(pdb_mysql_data * data, char *name, char *default_value)
}
/* Wrapper for atol that returns 0 if 'a' points to NULL */
-static long
-xatol(char *a)
+static long xatol(char *a)
{
long ret = 0;
@@ -217,8 +210,7 @@ xatol(char *a)
return ret;
}
-static BOOL
-row_to_sam_account(MYSQL_RES * r, SAM_ACCOUNT * u)
+static BOOL row_to_sam_account(MYSQL_RES * r, SAM_ACCOUNT * u)
{
MYSQL_ROW row;
pstring temp;
@@ -280,8 +272,7 @@ row_to_sam_account(MYSQL_RES * r, SAM_ACCOUNT * u)
return True;
}
-static BOOL
-mysqlsam_setsampwent(struct pdb_methods *methods, BOOL update)
+static BOOL mysqlsam_setsampwent(struct pdb_methods *methods, BOOL update)
{
struct pdb_mysql_data *data =
(struct pdb_mysql_data *) methods->private_data;
@@ -386,8 +377,7 @@ mysqlsam_setsampwent(struct pdb_methods *methods, BOOL update)
End enumeration of the passwd list.
****************************************************************/
-static void
-mysqlsam_endsampwent(struct pdb_methods *methods)
+static void mysqlsam_endsampwent(struct pdb_methods *methods)
{
struct pdb_mysql_data *data =
(struct pdb_mysql_data *) methods->private_data;
@@ -409,8 +399,7 @@ mysqlsam_endsampwent(struct pdb_methods *methods)
Get one SAM_ACCOUNT from the list (next in line)
*****************************************************************/
-static BOOL
-mysqlsam_getsampwent(struct pdb_methods *methods, SAM_ACCOUNT * user)
+static BOOL mysqlsam_getsampwent(struct pdb_methods *methods, SAM_ACCOUNT * user)
{
struct pdb_mysql_data *data;
@@ -424,8 +413,7 @@ mysqlsam_getsampwent(struct pdb_methods *methods, SAM_ACCOUNT * user)
return row_to_sam_account(data->pwent, user);
}
-BOOL
-mysqlsam_select_by_field(struct pdb_methods * methods, SAM_ACCOUNT * user,
+BOOL mysqlsam_select_by_field(struct pdb_methods * methods, SAM_ACCOUNT * user,
const char *field, const char *sname)
{
char *esc_sname;
@@ -551,8 +539,7 @@ mysqlsam_select_by_field(struct pdb_methods * methods, SAM_ACCOUNT * user,
Lookup a name in the SAM database
******************************************************************/
-static BOOL
-mysqlsam_getsampwnam(struct pdb_methods *methods, SAM_ACCOUNT * user,
+static BOOL mysqlsam_getsampwnam(struct pdb_methods *methods, SAM_ACCOUNT * user,
const char *sname)
{
struct pdb_mysql_data *data;
@@ -573,8 +560,7 @@ mysqlsam_getsampwnam(struct pdb_methods *methods, SAM_ACCOUNT * user,
Search by sid
**************************************************************************/
-static BOOL
-mysqlsam_getsampwsid(struct pdb_methods *methods, SAM_ACCOUNT * user,
+static BOOL mysqlsam_getsampwsid(struct pdb_methods *methods, SAM_ACCOUNT * user,
const DOM_SID * sid)
{
BOOL ret = False;
@@ -597,8 +583,7 @@ mysqlsam_getsampwsid(struct pdb_methods *methods, SAM_ACCOUNT * user,
Delete a SAM_ACCOUNT
****************************************************************************/
-static BOOL
-mysqlsam_delete_sam_account(struct pdb_methods *methods,
+static BOOL mysqlsam_delete_sam_account(struct pdb_methods *methods,
SAM_ACCOUNT * sam_pass)
{
const char *sname = pdb_get_username(sam_pass);
@@ -656,8 +641,7 @@ mysqlsam_delete_sam_account(struct pdb_methods *methods,
return True;
}
-static BOOL
-mysqlsam_replace_sam_account(struct pdb_methods *methods,
+static BOOL mysqlsam_replace_sam_account(struct pdb_methods *methods,
const SAM_ACCOUNT * newpwd, char isupdate)
{
pstring temp;
@@ -889,21 +873,18 @@ mysqlsam_replace_sam_account(struct pdb_methods *methods,
return True;
}
-static BOOL
-mysqlsam_add_sam_account(struct pdb_methods *methods, SAM_ACCOUNT * newpwd)
+static BOOL mysqlsam_add_sam_account(struct pdb_methods *methods, SAM_ACCOUNT * newpwd)
{
return mysqlsam_replace_sam_account(methods, newpwd, 0);
}
-static BOOL
-mysqlsam_update_sam_account(struct pdb_methods *methods,
+static BOOL mysqlsam_update_sam_account(struct pdb_methods *methods,
SAM_ACCOUNT * newpwd)
{
return mysqlsam_replace_sam_account(methods, newpwd, 1);
}
-NTSTATUS
-pdb_init(PDB_CONTEXT * pdb_context, PDB_METHODS ** pdb_method,
+NTSTATUS pdb_init(PDB_CONTEXT * pdb_context, PDB_METHODS ** pdb_method,
char *location)
{
NTSTATUS nt_status;
diff --git a/examples/pdb/xml/Makefile.in b/examples/pdb/xml/Makefile.in
index 87d4546972..252641da6d 100644
--- a/examples/pdb/xml/Makefile.in
+++ b/examples/pdb/xml/Makefile.in
@@ -2,8 +2,6 @@ PDB_OBJS = pdb_xml.so
PDB_CFLAGS = `xml2-config --cflags`
PDB_LDFLAGS = `xml2-config --libs`
-include $(MAKEFILE)
-
CC = @CC@
LIBTOOL = libtool
CFLAGS = @CFLAGS@ $(PDB_CFLAGS)
diff --git a/examples/pdb/xml/pdb_xml.c b/examples/pdb/xml/pdb_xml.c
index f237a7da9d..17261873cd 100644
--- a/examples/pdb/xml/pdb_xml.c
+++ b/examples/pdb/xml/pdb_xml.c
@@ -42,8 +42,7 @@ static char * iota(int a) {
return tmp;
}
-BOOL
-parsePass(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, SAM_ACCOUNT * u)
+BOOL parsePass(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, SAM_ACCOUNT * u)
{
pstring temp;
@@ -72,8 +71,7 @@ parsePass(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, SAM_ACCOUNT * u)
return True;
}
-BOOL
-parseUser(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, SAM_ACCOUNT * u)
+BOOL parseUser(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, SAM_ACCOUNT * u)
{
char *tmp;
DOM_SID sid;
@@ -242,8 +240,7 @@ typedef struct pdb_xml {
xmlNsPtr ns;
} pdb_xml;
-xmlNodePtr
-parseSambaXMLFile(struct pdb_xml *data)
+xmlNodePtr parseSambaXMLFile(struct pdb_xml *data)
{
xmlNodePtr cur;
@@ -290,8 +287,7 @@ parseSambaXMLFile(struct pdb_xml *data)
return cur;
}
-static BOOL
-xmlsam_setsampwent(struct pdb_methods *methods, BOOL update)
+static BOOL xmlsam_setsampwent(struct pdb_methods *methods, BOOL update)
{
pdb_xml *data;
@@ -314,8 +310,7 @@ xmlsam_setsampwent(struct pdb_methods *methods, BOOL update)
End enumeration of the passwd list.
****************************************************************/
-static void
-xmlsam_endsampwent(struct pdb_methods *methods)
+static void xmlsam_endsampwent(struct pdb_methods *methods)
{
pdb_xml *data;
@@ -340,8 +335,7 @@ xmlsam_endsampwent(struct pdb_methods *methods)
Get one SAM_ACCOUNT from the list (next in line)
*****************************************************************/
-static BOOL
-xmlsam_getsampwent(struct pdb_methods *methods, SAM_ACCOUNT * user)
+static BOOL xmlsam_getsampwent(struct pdb_methods *methods, SAM_ACCOUNT * user)
{
pdb_xml *data;
@@ -373,8 +367,7 @@ xmlsam_getsampwent(struct pdb_methods *methods, SAM_ACCOUNT * user)
Adds an existing SAM_ACCOUNT
****************************************************************************/
-static BOOL
-xmlsam_add_sam_account(struct pdb_methods *methods, SAM_ACCOUNT * u)
+static BOOL xmlsam_add_sam_account(struct pdb_methods *methods, SAM_ACCOUNT * u)
{
pstring temp;
fstring sid_str;
@@ -514,8 +507,7 @@ xmlsam_add_sam_account(struct pdb_methods *methods, SAM_ACCOUNT * u)
return True;
}
-NTSTATUS
-pdb_init(PDB_CONTEXT * pdb_context, PDB_METHODS ** pdb_method,
+NTSTATUS pdb_init(PDB_CONTEXT * pdb_context, PDB_METHODS ** pdb_method,
const char *location)
{
NTSTATUS nt_status;