From 34721ad233227300d9c2e8b5483ba2c6c798a7da Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 5 Sep 2005 20:36:07 +0000 Subject: r10042: Add in external LGPL library for accessing the share mode db. Allow others to examine & test. May not end up here eventually... Jeremy. (This used to be commit 7cc70ae63399eacd55bd0bf51ac2c7b004d761bf) --- source3/include/smb_share_modes.h | 103 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 103 insertions(+) create mode 100644 source3/include/smb_share_modes.h (limited to 'source3/include/smb_share_modes.h') diff --git a/source3/include/smb_share_modes.h b/source3/include/smb_share_modes.h new file mode 100644 index 0000000000..5a79e171d5 --- /dev/null +++ b/source3/include/smb_share_modes.h @@ -0,0 +1,103 @@ +/* + Samba share mode database library. + + Copyright (C) Jeremy Allison 2005. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#ifndef _SMB_SHARE_MODES_H_ +#define _SMB_STATE_MODES_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#include +#include "tdb.h" + +/* Database context handle. */ +struct smbdb_ctx { + TDB_CONTEXT *smb_tdb; +}; + +/* Share mode entry. */ +/* + We use 64 bit types for device and inode as + we don't know what size mode Samba has been + compiled in - dev/ino may be 32, may be 64 + bits. This interface copes with either. +*/ + +struct smb_share_mode_entry { + uint64_t dev; + uint64_t ino; + uint32_t share_access; + uint32_t access_mask; + struct timeval open_time; + uint32_t file_id; + pid_t pid; +}; + +/* + * open/close sharemode database. + */ + +struct smbdb_ctx *smb_share_mode_db_open(const char *db_path); +int smb_share_mode_db_close(struct smbdb_ctx *db_ctx); + +/* + * lock/unlock entry in sharemode database. + */ + +int smb_lock_share_mode_entry(struct smbdb_ctx *db_ctx, + uint64_t dev, + uint64_t ino); + +int smb_unlock_share_mode_entry(struct smbdb_ctx *db_ctx, + uint64_t dev, + uint64_t ino); + +/* + * Share mode database accessor functions. + */ + +int smb_get_share_mode_entries(struct smbdb_ctx *db_ctx, + uint64_t dev, + uint64_t ino, + struct smb_share_mode_entry **pp_list, + unsigned char *p_delete_on_close); + +int smb_create_share_mode_entry(struct smbdb_ctx *db_ctx, + uint64_t dev, + uint64_t ino, + const struct smb_share_mode_entry *set_entry, + const char *path); + +int smb_delete_share_mode_entry(struct smbdb_ctx *db_ctx, + uint64_t dev, + uint64_t ino, + const struct smb_share_mode_entry *set_entry); + +int smb_change_share_mode_entry(struct smbdb_ctx *db_ctx, + uint64_t dev, + uint64_t ino, + const struct smb_share_mode_entry *set_entry, + const struct smb_share_mode_entry *new_entry); + +#ifdef __cplusplus +} +#endif +#endif -- cgit From 74622a761243adc72ac955e33227a5801552ee99 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Sun, 11 Sep 2005 05:18:14 +0000 Subject: r10151: Fix includes correctly. Patch from Steve Williams . Jeremy. (This used to be commit 17598846e7ee2748f2dcb3821823108fa8410480) --- source3/include/smb_share_modes.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'source3/include/smb_share_modes.h') diff --git a/source3/include/smb_share_modes.h b/source3/include/smb_share_modes.h index 5a79e171d5..f61ba624c6 100644 --- a/source3/include/smb_share_modes.h +++ b/source3/include/smb_share_modes.h @@ -25,7 +25,14 @@ extern "C" { #endif -#include +#if HAVE_INTTYPES_H +# include +#else +# if HAVE_STDINT_H +# include +# endif +#endif + #include "tdb.h" /* Database context handle. */ -- cgit From 54abd2aa66069e6baf7769c496f46d9dba18db39 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Fri, 30 Sep 2005 17:13:37 +0000 Subject: r10656: BIG merge from trunk. Features not copied over * \PIPE\unixinfo * winbindd's {group,alias}membership new functions * winbindd's lookupsids() functionality * swat (trunk changes to be reverted as per discussion with Deryck) (This used to be commit 939c3cb5d78e3a2236209b296aa8aba8bdce32d3) --- source3/include/smb_share_modes.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include/smb_share_modes.h') diff --git a/source3/include/smb_share_modes.h b/source3/include/smb_share_modes.h index f61ba624c6..1e04ea496d 100644 --- a/source3/include/smb_share_modes.h +++ b/source3/include/smb_share_modes.h @@ -55,7 +55,7 @@ struct smb_share_mode_entry { uint32_t access_mask; struct timeval open_time; uint32_t file_id; - pid_t pid; + struct process_id pid; }; /* -- cgit From 4e0a6bd9a7a66989dc53d2682c06451afb32199e Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 10 Apr 2007 18:12:25 +0000 Subject: r22154: Make struct smbdb_ctx an opaque pointer so users of the API don't need to have tdb.h. Jeremy. (This used to be commit 512542c90a78006bda3470eed7fb6d3f6e708eed) --- source3/include/smb_share_modes.h | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'source3/include/smb_share_modes.h') diff --git a/source3/include/smb_share_modes.h b/source3/include/smb_share_modes.h index 1e04ea496d..5ed43bda33 100644 --- a/source3/include/smb_share_modes.h +++ b/source3/include/smb_share_modes.h @@ -33,12 +33,8 @@ extern "C" { # endif #endif -#include "tdb.h" - -/* Database context handle. */ -struct smbdb_ctx { - TDB_CONTEXT *smb_tdb; -}; +/* Opaque database context handle. */ +struct smbdb_ctx; /* Share mode entry. */ /* -- cgit From e6383f47629368d9dd4e803f17566a24e9d7359e Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Mon, 7 May 2007 09:35:35 +0000 Subject: r22736: Start to merge the low-hanging fruit from the now 7000-line cluster patch. This changes "struct process_id" to "struct server_id", keeping both is just too much hassle. No functional change (I hope ;-)) Volker (This used to be commit 0ad4b1226c9d91b72136310d3bbb640d2c5d67b8) --- source3/include/smb_share_modes.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include/smb_share_modes.h') diff --git a/source3/include/smb_share_modes.h b/source3/include/smb_share_modes.h index 5ed43bda33..937a39c97a 100644 --- a/source3/include/smb_share_modes.h +++ b/source3/include/smb_share_modes.h @@ -51,7 +51,7 @@ struct smb_share_mode_entry { uint32_t access_mask; struct timeval open_time; uint32_t file_id; - struct process_id pid; + struct server_id pid; }; /* -- cgit From 2c09988e46d4e917b1c53c9bda3f81a48bba4952 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 10 Jul 2007 01:44:42 +0000 Subject: r23790: LGPLv3+ conversion for our LGPLv2+ library code (This used to be commit 1b78cace504f60c0f525765fbf59d9cc6506cd4d) --- source3/include/smb_share_modes.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include/smb_share_modes.h') diff --git a/source3/include/smb_share_modes.h b/source3/include/smb_share_modes.h index 937a39c97a..645ca71a4e 100644 --- a/source3/include/smb_share_modes.h +++ b/source3/include/smb_share_modes.h @@ -6,7 +6,7 @@ This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. + version 3 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of -- cgit From 9fa1c63578733077c0aaaeeb2fc97c3b191089cc Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 10 Jul 2007 03:42:26 +0000 Subject: r23798: updated old Temple Place FSF addresses to new URL (This used to be commit c676a971142d7176fd5dbf21405fca14515a0a76) --- source3/include/smb_share_modes.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'source3/include/smb_share_modes.h') diff --git a/source3/include/smb_share_modes.h b/source3/include/smb_share_modes.h index 645ca71a4e..101bec8245 100644 --- a/source3/include/smb_share_modes.h +++ b/source3/include/smb_share_modes.h @@ -14,8 +14,7 @@ Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + License along with this library; if not, see . */ #ifndef _SMB_SHARE_MODES_H_ -- cgit