From 477e1a8cee99fea4dc9d1ce2878569cc39a50db2 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sun, 23 Mar 2003 12:29:19 +0000 Subject: Don't duplicate the default group mapping functions - use the ones from passdb (This used to be commit 78e135cdb17dcf70d8a1259897fd44ecd7a4b3c6) --- source3/modules/mysql.c | 60 ------------------------------------------------- 1 file changed, 60 deletions(-) (limited to 'source3/modules') diff --git a/source3/modules/mysql.c b/source3/modules/mysql.c index 47883ca7f7..40694d6e7d 100644 --- a/source3/modules/mysql.c +++ b/source3/modules/mysql.c @@ -893,59 +893,6 @@ static NTSTATUS mysqlsam_update_sam_account(struct pdb_methods *methods, return mysqlsam_replace_sam_account(methods, newpwd, 1); } -static NTSTATUS mysqlsam_getgrsid(struct pdb_methods *methods, GROUP_MAP *map, - DOM_SID sid, BOOL with_priv) -{ - return get_group_map_from_sid(sid, map, with_priv) ? - NT_STATUS_OK : NT_STATUS_UNSUCCESSFUL; -} - -static NTSTATUS mysqlsam_getgrgid(struct pdb_methods *methods, GROUP_MAP *map, - gid_t gid, BOOL with_priv) -{ - return get_group_map_from_gid(gid, map, with_priv) ? - NT_STATUS_OK : NT_STATUS_UNSUCCESSFUL; -} - -static NTSTATUS mysqlsam_getgrnam(struct pdb_methods *methods, GROUP_MAP *map, - char *name, BOOL with_priv) -{ - return get_group_map_from_ntname(name, map, with_priv) ? - NT_STATUS_OK : NT_STATUS_UNSUCCESSFUL; -} - -static NTSTATUS mysqlsam_add_group_mapping_entry(struct pdb_methods *methods, - GROUP_MAP *map) -{ - return add_mapping_entry(map, TDB_INSERT) ? - NT_STATUS_OK : NT_STATUS_UNSUCCESSFUL; -} - -static NTSTATUS mysqlsam_update_group_mapping_entry(struct pdb_methods *methods, - GROUP_MAP *map) -{ - return add_mapping_entry(map, TDB_REPLACE) ? - NT_STATUS_OK : NT_STATUS_UNSUCCESSFUL; -} - -static NTSTATUS mysqlsam_delete_group_mapping_entry(struct pdb_methods *methods, - DOM_SID sid) -{ - return group_map_remove(sid) ? - NT_STATUS_OK : NT_STATUS_UNSUCCESSFUL; -} - -static NTSTATUS mysqlsam_enum_group_mapping(struct pdb_methods *methods, - enum SID_NAME_USE sid_name_use, - GROUP_MAP **rmap, int *num_entries, - BOOL unix_only, BOOL with_priv) -{ - return enum_group_mapping(sid_name_use, rmap, num_entries, unix_only, - with_priv) ? - NT_STATUS_OK : NT_STATUS_UNSUCCESSFUL; -} - - static NTSTATUS mysqlsam_init(struct pdb_context * pdb_context, struct pdb_methods ** pdb_method, const char *location) { @@ -979,13 +926,6 @@ static NTSTATUS mysqlsam_init(struct pdb_context * pdb_context, struct pdb_metho (*pdb_method)->add_sam_account = mysqlsam_add_sam_account; (*pdb_method)->update_sam_account = mysqlsam_update_sam_account; (*pdb_method)->delete_sam_account = mysqlsam_delete_sam_account; - (*pdb_method)->getgrsid = mysqlsam_getgrsid; - (*pdb_method)->getgrgid = mysqlsam_getgrgid; - (*pdb_method)->getgrnam = mysqlsam_getgrnam; - (*pdb_method)->add_group_mapping_entry = mysqlsam_add_group_mapping_entry; - (*pdb_method)->update_group_mapping_entry = mysqlsam_update_group_mapping_entry; - (*pdb_method)->delete_group_mapping_entry = mysqlsam_delete_group_mapping_entry; - (*pdb_method)->enum_group_mapping = mysqlsam_enum_group_mapping; data = talloc(pdb_context->mem_ctx, sizeof(struct pdb_mysql_data)); (*pdb_method)->private_data = data; -- cgit From f9e66df9c75ae60a3402967a057c0022a0449747 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Mon, 24 Mar 2003 11:31:01 +0000 Subject: Fix init function name and return value (This used to be commit 27f3fbac724847f2d0926d2231808871508a7dd9) --- source3/modules/developer.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source3/modules') diff --git a/source3/modules/developer.c b/source3/modules/developer.c index a697abcd22..7ffc3ff50d 100644 --- a/source3/modules/developer.c +++ b/source3/modules/developer.c @@ -125,8 +125,8 @@ static size_t weird_push(void *cd, char **inbuf, size_t *inbytesleft, struct charset_functions weird_functions = {"WEIRD", weird_pull, weird_push}; -int init_module(void) +int charset_weird_init(void) { smb_register_charset(&weird_functions); - return 1; + return True; } -- cgit From fc64b4c00077f5a6c307e14590adbda0f9a6bee8 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Tue, 25 Mar 2003 07:55:10 +0000 Subject: Make these functions static, keep them out of proto. (This used to be commit 34934d2edf0d575fae7d729fe4d8d3ab034a544f) --- source3/modules/vfs_recycle.c | 2 +- source3/modules/xml.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'source3/modules') diff --git a/source3/modules/vfs_recycle.c b/source3/modules/vfs_recycle.c index a99a593caf..ba453bad2c 100644 --- a/source3/modules/vfs_recycle.c +++ b/source3/modules/vfs_recycle.c @@ -610,7 +610,7 @@ static int recycle_unlink(connection_struct *conn, const char *file_name) final_name = NULL; asprintf(&final_name, "%s/%s", temp_name, base); ALLOC_CHECK(final_name, done); - DEBUG(10, ("recycle.bin: recycled file name%s\n", temp_name)); /* new filename with path */ + DEBUG(10, ("recycle.bin: recycled file name: %s\n", temp_name)); /* new filename with path */ /* check if we should delete file from recycle bin */ if (recycle_file_exist(conn, final_name)) { diff --git a/source3/modules/xml.c b/source3/modules/xml.c index 85b9e81b7f..1a4aeeeac0 100644 --- a/source3/modules/xml.c +++ b/source3/modules/xml.c @@ -47,7 +47,7 @@ static char * iota(int a) { return tmp; } -BOOL parsePass(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, SAM_ACCOUNT * u) +static BOOL parsePass(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, SAM_ACCOUNT * u) { pstring temp; @@ -76,7 +76,7 @@ BOOL parsePass(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, SAM_ACCOUNT * u) return True; } -BOOL parseUser(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, SAM_ACCOUNT * u) +static BOOL parseUser(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, SAM_ACCOUNT * u) { char *tmp; DOM_SID sid; @@ -245,7 +245,7 @@ typedef struct pdb_xml { xmlNsPtr ns; } pdb_xml; -xmlNodePtr parseSambaXMLFile(struct pdb_xml *data) +static xmlNodePtr parseSambaXMLFile(struct pdb_xml *data) { xmlNodePtr cur; -- cgit From 11db21cc1c00d63c6b23ec6b3a3bdb48728b2b64 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Thu, 27 Mar 2003 12:08:46 +0000 Subject: Use the new modules system in VFS. If a module can't be loaded with the new modules system, we still fall back to the old system. (This used to be commit cebe8d8b424f10006f2f791a8f086c6c8a7f5d57) --- source3/modules/vfs_audit.c | 14 ++++++-------- source3/modules/vfs_extd_audit.c | 15 ++++++--------- source3/modules/vfs_fake_perms.c | 8 +++----- source3/modules/vfs_netatalk.c | 8 +++----- source3/modules/vfs_recycle.c | 41 ++++++---------------------------------- 5 files changed, 24 insertions(+), 62 deletions(-) (limited to 'source3/modules') diff --git a/source3/modules/vfs_audit.c b/source3/modules/vfs_audit.c index 1944c98e53..fa9bf67a67 100644 --- a/source3/modules/vfs_audit.c +++ b/source3/modules/vfs_audit.c @@ -98,10 +98,9 @@ static vfs_op_tuple audit_ops[] = { /* VFS initialisation function. Return vfs_op_tuple array back to SAMBA. */ -vfs_op_tuple *vfs_init(int *vfs_version, struct vfs_ops *def_vfs_ops, +static vfs_op_tuple *audit_init(const struct vfs_ops *def_vfs_ops, struct smb_vfs_handle_struct *vfs_handle) { - *vfs_version = SMB_VFS_INTERFACE_VERSION; memcpy(&default_vfs_ops, def_vfs_ops, sizeof(struct vfs_ops)); audit_handle = vfs_handle; @@ -111,12 +110,6 @@ vfs_op_tuple *vfs_init(int *vfs_version, struct vfs_ops *def_vfs_ops, return audit_ops; } -/* VFS finalization function. */ -void vfs_done(connection_struct *conn) -{ - syslog(SYSLOG_PRIORITY, "VFS_DONE: vfs module unloaded\n"); -} - /* Implementation of vfs_ops. Pass everything on to the default operation but log event first. */ @@ -276,3 +269,8 @@ static int audit_fchmod_acl(struct files_struct *fsp, int fd, mode_t mode) return result; } + +int vfs_audit_init(void) +{ + return smb_register_vfs("audit", audit_init, SMB_VFS_INTERFACE_VERSION); +} diff --git a/source3/modules/vfs_extd_audit.c b/source3/modules/vfs_extd_audit.c index c75dc1d09c..f60acab36a 100644 --- a/source3/modules/vfs_extd_audit.c +++ b/source3/modules/vfs_extd_audit.c @@ -99,10 +99,9 @@ static vfs_op_tuple audit_ops[] = { /* VFS initialisation function. Return vfs_op_tuple array back to SAMBA. */ -vfs_op_tuple *vfs_init(int *vfs_version, struct vfs_ops *def_vfs_ops, +static vfs_op_tuple *audit_init(const struct vfs_ops *def_vfs_ops, struct smb_vfs_handle_struct *vfs_handle) { - *vfs_version = SMB_VFS_INTERFACE_VERSION; memcpy(&default_vfs_ops, def_vfs_ops, sizeof(struct vfs_ops)); audit_handle = vfs_handle; @@ -113,13 +112,6 @@ vfs_op_tuple *vfs_init(int *vfs_version, struct vfs_ops *def_vfs_ops, return audit_ops; } -/* VFS finalization function. */ - -void vfs_done(connection_struct *conn) -{ - syslog(SYSLOG_PRIORITY, "VFS_DONE: vfs module unloaded\n"); -} - /* Implementation of vfs_ops. Pass everything on to the default operation but log event first. */ @@ -317,3 +309,8 @@ static int audit_fchmod_acl(struct files_struct *fsp, int fd, mode_t mode) return result; } + +int vfs_extd_audit_init(void) +{ + return smb_register_vfs("extd_audit", audit_init, SMB_VFS_INTERFACE_VERSION); +} diff --git a/source3/modules/vfs_fake_perms.c b/source3/modules/vfs_fake_perms.c index 85515df21a..121a99a451 100644 --- a/source3/modules/vfs_fake_perms.c +++ b/source3/modules/vfs_fake_perms.c @@ -267,12 +267,11 @@ static vfs_op_tuple fake_perms_ops[] = { /* VFS initialisation - return initialized vfs_op_tuple array back to Samba */ -vfs_op_tuple *vfs_init(int *vfs_version, struct vfs_ops *def_vfs_ops, +static vfs_op_tuple *fake_perms_init(const struct vfs_ops *def_vfs_ops, struct smb_vfs_handle_struct *vfs_handle) { DEBUG(3, ("Initialising default vfs hooks\n")); - *vfs_version = SMB_VFS_INTERFACE_VERSION; memcpy(&default_vfs_ops, def_vfs_ops, sizeof(struct vfs_ops)); /* Remember vfs_handle for further allocation and referencing of private @@ -282,8 +281,7 @@ vfs_op_tuple *vfs_init(int *vfs_version, struct vfs_ops *def_vfs_ops, return fake_perms_ops; } -/* VFS finalization function */ -void vfs_done(connection_struct *conn) +int vfs_fake_perms_init(void) { - DEBUG(3, ("Finalizing default vfs hooks\n")); + return smb_register_vfs("fake_perms", fake_perms_init, SMB_VFS_INTERFACE_VERSION); } diff --git a/source3/modules/vfs_netatalk.c b/source3/modules/vfs_netatalk.c index b69a900e14..c9e3cde621 100644 --- a/source3/modules/vfs_netatalk.c +++ b/source3/modules/vfs_netatalk.c @@ -410,10 +410,9 @@ static vfs_op_tuple atalk_ops[] = { }; /* VFS initialisation function. Return vfs_op_tuple array back to SAMBA. */ -vfs_op_tuple *vfs_init(int *vfs_version, struct vfs_ops *def_vfs_ops, +static vfs_op_tuple *netatalk_init(const struct vfs_ops *def_vfs_ops, struct smb_vfs_handle_struct *vfs_handle) { - *vfs_version = SMB_VFS_INTERFACE_VERSION; memcpy(&default_vfs_ops, def_vfs_ops, sizeof(struct vfs_ops)); atalk_handle = vfs_handle; @@ -422,8 +421,7 @@ vfs_op_tuple *vfs_init(int *vfs_version, struct vfs_ops *def_vfs_ops, return atalk_ops; } -/* VFS finalization function. */ -void vfs_done(connection_struct *conn) +int vfs_netatalk_init(void) { - DEBUG(3, ("ATALK: vfs module unloaded\n")); + return smb_register_vfs("netatalk", netatalk_init, SMB_VFS_INTERFACE_VERSION); } diff --git a/source3/modules/vfs_recycle.c b/source3/modules/vfs_recycle.c index ba453bad2c..a669d864c6 100644 --- a/source3/modules/vfs_recycle.c +++ b/source3/modules/vfs_recycle.c @@ -87,13 +87,12 @@ static vfs_op_tuple recycle_ops[] = { * * @retval initialised vfs_op_tuple array **/ -vfs_op_tuple *vfs_init(int *vfs_version, struct vfs_ops *def_vfs_ops, +static vfs_op_tuple *recycle_init(const struct vfs_ops *def_vfs_ops, struct smb_vfs_handle_struct *vfs_handle) { TALLOC_CTX *mem_ctx = NULL; DEBUG(10, ("Initializing VFS module recycle\n")); - *vfs_version = SMB_VFS_INTERFACE_VERSION; memcpy(&default_vfs_ops, def_vfs_ops, sizeof(struct vfs_ops)); vfs_recycle_debug_level = debug_add_class("vfs_recycle_bin"); if (vfs_recycle_debug_level == -1) { @@ -120,39 +119,6 @@ vfs_op_tuple *vfs_init(int *vfs_version, struct vfs_ops *def_vfs_ops, return recycle_ops; } -/** - * VFS finalization function. - * - **/ -void vfs_done(void) -{ - recycle_bin_private_data *recdata; - recycle_bin_connections *recconn; - - DEBUG(10, ("Unloading/Cleaning VFS module recycle bin\n")); - - if (recycle_bin_private_handle) - recdata = (recycle_bin_private_data *)(recycle_bin_private_handle->data); - else { - DEBUG(0, ("Recycle bin not initialized!\n")); - return; - } - - if (recdata) { - if (recdata->conns) { - recconn = recdata->conns; - while (recconn) { - talloc_destroy(recconn->data->mem_ctx); - recconn = recconn->next; - } - } - if (recdata->mem_ctx) { - talloc_destroy(recdata->mem_ctx); - } - recdata = NULL; - } -} - static int recycle_connect(struct connection_struct *conn, const char *service, const char *user) { TALLOC_CTX *ctx = NULL; @@ -646,3 +612,8 @@ done: SAFE_FREE(final_name); return rc; } + +int vfs_recycle_init(void) +{ + return smb_register_vfs("recycle", recycle_init, SMB_VFS_INTERFACE_VERSION); +} -- cgit