The branch, master has been updated
via 2dffcde smbd: Remove "share_mode_entry->lease"
via 6ed119e smbstatus: Use share_mode_data->leases
via 3bff049 smbd: Pass "share_mode_data" to share_entry_forall callback
via a3b42db popt: popt 1.16 needs -liconv
via fa9e6a5 idmap: Make pointer initialization explicit
from 4e711d1 smbd: don't client->connections without checking client !=
NULL first in exit_server_common()
https://git.samba.org/?p=samba.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit 2dffcde408008d2bbac8e796ea7ce770c7e97f63
Author: Volker Lendecke <[email protected]>
Date: Wed Jul 25 17:05:34 2018 +0200
smbd: Remove "share_mode_entry->lease"
smbstatus was the only user, and this could be solved by adapting
share_entry_forall.
Signed-off-by: Volker Lendecke <[email protected]>
Reviewed-by: Jeremy Allison <[email protected]>
Autobuild-User(master): Jeremy Allison <[email protected]>
Autobuild-Date(master): Fri Jul 27 01:42:31 CEST 2018 on sn-devel-144
commit 6ed119eccf9356ba91c883b50a38adc1bf4deb00
Author: Volker Lendecke <[email protected]>
Date: Wed Jul 25 16:59:53 2018 +0200
smbstatus: Use share_mode_data->leases
This is the only user of share_mode_entry->lease
Signed-off-by: Volker Lendecke <[email protected]>
Reviewed-by: Jeremy Allison <[email protected]>
commit 3bff0494e1097a7f0aeade74b89361e3d319819f
Author: Volker Lendecke <[email protected]>
Date: Wed Jul 25 16:56:35 2018 +0200
smbd: Pass "share_mode_data" to share_entry_forall callback
Quite a bit of the contents have been passed explicitly anyway.
Signed-off-by: Volker Lendecke <[email protected]>
Reviewed-by: Jeremy Allison <[email protected]>
commit a3b42db982651c235fb9b9c2e01d384fa2f7b13e
Author: Volker Lendecke <[email protected]>
Date: Wed Jul 25 15:48:01 2018 +0200
popt: popt 1.16 needs -liconv
Signed-off-by: Volker Lendecke <[email protected]>
Reviewed-by: Jeremy Allison <[email protected]>
commit fa9e6a50da49bcab1da7533c72cee0687b4bb048
Author: Volker Lendecke <[email protected]>
Date: Wed Jul 25 12:05:58 2018 +0200
idmap: Make pointer initialization explicit
Took me a few seconds to find this NULL initializer
Signed-off-by: Volker Lendecke <[email protected]>
Reviewed-by: Jeremy Allison <[email protected]>
-----------------------------------------------------------------------
Summary of changes:
source3/librpc/idl/open_files.idl | 1 -
source3/locking/locking.c | 10 ++----
source3/locking/proto.h | 8 ++---
source3/locking/share_mode_lock.c | 42 +++++++---------------
source3/rpc_server/srvsvc/srv_srvsvc_nt.c | 58 +++++++++++++++----------------
source3/utils/status.c | 17 +++++----
source3/winbindd/idmap_tdb_common.c | 5 ++-
third_party/popt/wscript | 1 +
8 files changed, 58 insertions(+), 84 deletions(-)
Changeset truncated at 500 lines:
diff --git a/source3/librpc/idl/open_files.idl
b/source3/librpc/idl/open_files.idl
index 8d652a9..c07a903 100644
--- a/source3/librpc/idl/open_files.idl
+++ b/source3/librpc/idl/open_files.idl
@@ -61,7 +61,6 @@ interface open_files
* to store this share_mode_entry on disk.
*/
[skip] boolean8 stale;
- [ignore] share_mode_lease *lease;
} share_mode_entry;
typedef [public] struct {
diff --git a/source3/locking/locking.c b/source3/locking/locking.c
index e962fee..208f7e2 100644
--- a/source3/locking/locking.c
+++ b/source3/locking/locking.c
@@ -713,7 +713,6 @@ static void remove_share_mode_lease(struct share_mode_data
*d,
for (i=0; i<d->num_share_modes; i++) {
if (d->share_modes[i].lease_idx == d->num_leases) {
d->share_modes[i].lease_idx = lease_idx;
- d->share_modes[i].lease = &d->leases[lease_idx];
}
}
@@ -816,14 +815,10 @@ bool set_share_mode(struct share_mode_lock *lck, struct
files_struct *fsp,
{
struct share_mode_data *d = lck->data;
struct share_mode_entry *tmp, *e;
- struct share_mode_lease *lease = NULL;
- if (lease_idx == UINT32_MAX) {
- lease = NULL;
- } else if (lease_idx >= d->num_leases) {
+ if ((lease_idx != UINT32_MAX) &&
+ (lease_idx >= d->num_leases)) {
return false;
- } else {
- lease = &d->leases[lease_idx];
}
tmp = talloc_realloc(d, d->share_modes, struct share_mode_entry,
@@ -844,7 +839,6 @@ bool set_share_mode(struct share_mode_lock *lck, struct
files_struct *fsp,
e->op_mid = mid;
e->op_type = op_type;
e->lease_idx = lease_idx;
- e->lease = lease;
e->time.tv_sec = fsp->open_time.tv_sec;
e->time.tv_usec = fsp->open_time.tv_usec;
e->share_file_id = fsp->fh->gen_id;
diff --git a/source3/locking/proto.h b/source3/locking/proto.h
index 403729c..b615a4a 100644
--- a/source3/locking/proto.h
+++ b/source3/locking/proto.h
@@ -212,10 +212,10 @@ int share_mode_forall(int (*fn)(struct file_id fid,
const struct share_mode_data *data,
void *private_data),
void *private_data);
-int share_entry_forall(int (*fn)(const struct share_mode_entry *,
- const struct file_id *id,
- const char *, const char *,
- const char *, void *),
+int share_entry_forall(int (*fn)(struct file_id fid,
+ const struct share_mode_data *data,
+ const struct share_mode_entry *entry,
+ void *private_data),
void *private_data);
bool share_mode_cleanup_disconnected(struct file_id id,
uint64_t open_persistent_id);
diff --git a/source3/locking/share_mode_lock.c
b/source3/locking/share_mode_lock.c
index fce0c33..9314735 100644
--- a/source3/locking/share_mode_lock.c
+++ b/source3/locking/share_mode_lock.c
@@ -329,17 +329,7 @@ static struct share_mode_data
*parse_share_modes(TALLOC_CTX *mem_ctx,
*/
for (i=0; i<d->num_share_modes; i++) {
- struct share_mode_entry *e = &d->share_modes[i];
-
- e->stale = false;
- e->lease = NULL;
- if (e->op_type != LEASE_OPLOCK) {
- continue;
- }
- if (e->lease_idx >= d->num_leases) {
- continue;
- }
- e->lease = &d->leases[e->lease_idx];
+ d->share_modes[i].stale = false;
}
d->modified = false;
d->fresh = false;
@@ -836,9 +826,7 @@ static int share_mode_traverse_fn(struct db_record *rec,
void *_state)
}
for (i=0; i<d->num_share_modes; i++) {
- struct share_mode_entry *entry = &d->share_modes[i];
- entry->stale = false; /* [skip] in idl */
- entry->lease = &d->leases[entry->lease_idx];
+ d->share_modes[i].stale = false;
}
if (DEBUGLEVEL > 10) {
@@ -878,11 +866,9 @@ int share_mode_forall(int (*fn)(struct file_id fid,
}
struct share_entry_forall_state {
- int (*fn)(const struct share_mode_entry *e,
- const struct file_id *id,
- const char *service_path,
- const char *base_name,
- const char *stream_name,
+ int (*fn)(struct file_id fid,
+ const struct share_mode_data *data,
+ const struct share_mode_entry *entry,
void *private_data);
void *private_data;
};
@@ -897,11 +883,9 @@ static int share_entry_traverse_fn(struct file_id fid,
for (i=0; i<data->num_share_modes; i++) {
int ret;
- ret = state->fn(&data->share_modes[i],
- &data->id,
- data->servicepath,
- data->base_name,
- data->stream_name,
+ ret = state->fn(fid,
+ data,
+ &data->share_modes[i],
state->private_data);
if (ret != 0) {
return ret;
@@ -916,11 +900,11 @@ static int share_entry_traverse_fn(struct file_id fid,
share mode system.
********************************************************************/
-int share_entry_forall(int (*fn)(const struct share_mode_entry *,
- const struct file_id *id,
- const char *, const char *,
- const char *, void *),
- void *private_data)
+int share_entry_forall(int (*fn)(struct file_id fid,
+ const struct share_mode_data *data,
+ const struct share_mode_entry *entry,
+ void *private_data),
+ void *private_data)
{
struct share_entry_forall_state state = {
.fn = fn, .private_data = private_data };
diff --git a/source3/rpc_server/srvsvc/srv_srvsvc_nt.c
b/source3/rpc_server/srvsvc/srv_srvsvc_nt.c
index e1963a4..7138f12 100644
--- a/source3/rpc_server/srvsvc/srv_srvsvc_nt.c
+++ b/source3/rpc_server/srvsvc/srv_srvsvc_nt.c
@@ -81,11 +81,9 @@ struct share_conn_stat {
/*******************************************************************
********************************************************************/
-static int enum_file_fn(const struct share_mode_entry *e,
- const struct file_id *id,
- const char *sharepath,
- const char *fname,
- const char *sname,
+static int enum_file_fn(struct file_id id,
+ const struct share_mode_data *d,
+ const struct share_mode_entry *e,
void *private_data)
{
struct file_enum_count *fenum =
@@ -124,19 +122,25 @@ static int enum_file_fn(const struct share_mode_entry *e,
/* need to count the number of locks on a file */
ZERO_STRUCT( fsp );
- fsp.file_id = *id;
+ fsp.file_id = id;
if ( (brl = brl_get_locks(talloc_tos(), &fsp)) != NULL ) {
num_locks = brl_num_locks(brl);
TALLOC_FREE(brl);
}
- if ( strcmp( fname, "." ) == 0 ) {
- fullpath = talloc_asprintf(fenum->ctx, "C:%s", sharepath );
+ if ( strcmp(d->base_name, "." ) == 0 ) {
+ fullpath = talloc_asprintf(
+ fenum->ctx,
+ "C:%s",
+ d->servicepath);
} else {
- fullpath = talloc_asprintf(fenum->ctx, "C:%s/%s%s",
- sharepath, fname,
- sname ? sname : "");
+ fullpath = talloc_asprintf(
+ fenum->ctx,
+ "C:%s/%s%s",
+ d->servicepath,
+ d->base_name,
+ (d->stream_name != NULL) ? d->stream_name : "");
}
if (!fullpath) {
return 0;
@@ -841,11 +845,9 @@ static WERROR init_srv_sess_info_0(struct pipes_struct *p,
* find out the session on which this file is open and bump up its count
**********************************************************************/
-static int count_sess_files_fn(const struct share_mode_entry *e,
- const struct file_id *id,
- const char *sharepath,
- const char *fname,
- const char *sname,
+static int count_sess_files_fn(struct file_id fid,
+ const struct share_mode_data *d,
+ const struct share_mode_entry *e,
void *data)
{
struct sess_file_info *info = data;
@@ -969,18 +971,16 @@ static WERROR init_srv_sess_info_1(struct pipes_struct *p,
find the share connection on which this open exists.
********************************************************************/
-static int share_file_fn(const struct share_mode_entry *e,
- const struct file_id *id,
- const char *sharepath,
- const char *fname,
- const char *sname,
+static int share_file_fn(struct file_id fid,
+ const struct share_mode_data *d,
+ const struct share_mode_entry *e,
void *data)
{
struct share_file_stat *sfs = data;
uint32_t i;
uint32_t offset = sfs->total_entries - sfs->resp_entries;
- if (strequal(sharepath, sfs->in_sharepath)) {
+ if (strequal(d->servicepath, sfs->in_sharepath)) {
for (i=0; i < sfs->resp_entries; i++) {
if (serverid_equal(&e->pid, &sfs->svrid_arr[offset +
i])) {
sfs->netconn_arr[i].num_open ++;
@@ -2681,11 +2681,9 @@ struct enum_file_close_state {
struct messaging_context *msg_ctx;
};
-static int enum_file_close_fn(const struct share_mode_entry *e,
- const struct file_id *id,
- const char *sharepath,
- const char *fname,
- const char *sname,
+static int enum_file_close_fn(struct file_id id,
+ const struct share_mode_data *d,
+ const struct share_mode_entry *e,
void *private_data)
{
char msg[MSG_SMB_SHARE_MODE_ENTRY_SIZE];
@@ -2702,10 +2700,10 @@ static int enum_file_close_fn(const struct
share_mode_entry *e,
}
/* Ok - send the close message. */
- DBG_DEBUG("request to close file %s, %s\n", sharepath,
- share_mode_str(talloc_tos(), 0, id, e));
+ DBG_DEBUG("request to close file %s, %s\n", d->servicepath,
+ share_mode_str(talloc_tos(), 0, &id, e));
- share_mode_entry_to_message(msg, id, e);
+ share_mode_entry_to_message(msg, &id, e);
state->r->out.result = ntstatus_to_werror(
messaging_send_buf(state->msg_ctx,
diff --git a/source3/utils/status.c b/source3/utils/status.c
index d04efed..811eb7b 100644
--- a/source3/utils/status.c
+++ b/source3/utils/status.c
@@ -116,12 +116,10 @@ static bool Ucrit_addPid( struct server_id pid )
return True;
}
-static int print_share_mode(const struct share_mode_entry *e,
- const struct file_id *id,
- const char *sharepath,
- const char *fname,
- const char *sname,
- void *dummy)
+static int print_share_mode(struct file_id fid,
+ const struct share_mode_data *d,
+ const struct share_mode_entry *e,
+ void *private_data)
{
static int count;
@@ -182,7 +180,8 @@ static int print_share_mode(const struct share_mode_entry
*e,
} else if (e->op_type & LEVEL_II_OPLOCK) {
d_printf("LEVEL_II ");
} else if (e->op_type == LEASE_OPLOCK) {
- uint32_t lstate = e->lease->current_state;
+ struct share_mode_lease *l = &d->leases[e->lease_idx];
+ uint32_t lstate = l->current_state;
d_printf("LEASE(%s%s%s)%s%s%s ",
(lstate & SMB2_LEASE_READ)?"R":"",
(lstate & SMB2_LEASE_WRITE)?"W":"",
@@ -195,8 +194,8 @@ static int print_share_mode(const struct share_mode_entry
*e,
}
d_printf(" %s %s%s %s",
- sharepath, fname,
- sname ? sname : "",
+ d->servicepath, d->base_name,
+ (d->stream_name != NULL) ? d->stream_name : "",
time_to_asc((time_t)e->time.tv_sec));
}
diff --git a/source3/winbindd/idmap_tdb_common.c
b/source3/winbindd/idmap_tdb_common.c
index 48d87bb..ceb663c 100644
--- a/source3/winbindd/idmap_tdb_common.c
+++ b/source3/winbindd/idmap_tdb_common.c
@@ -221,14 +221,13 @@ NTSTATUS idmap_tdb_common_set_mapping(struct idmap_domain
* dom,
struct idmap_tdb_common_context *ctx;
struct idmap_tdb_common_set_mapping_context state;
NTSTATUS ret;
- char *ksidstr, *kidstr;
+ char *ksidstr = NULL;
+ char *kidstr = NULL;
if (!map || !map->sid) {
return NT_STATUS_INVALID_PARAMETER;
}
- ksidstr = kidstr = NULL;
-
/* TODO: should we filter a set_mapping using low/high filters ? */
ctx =
diff --git a/third_party/popt/wscript b/third_party/popt/wscript
index eae8602..135bae8 100644
--- a/third_party/popt/wscript
+++ b/third_party/popt/wscript
@@ -17,5 +17,6 @@ def build(bld):
bld.SAMBA_LIBRARY('popt',
source='popt.c poptconfig.c popthelp.c poptint.c
poptparse.c',
cflags=cflags,
+ deps='iconv',
allow_warnings=True,
private_library=True)
--
Samba Shared Repository