mirror of
https://github.com/samba-team/samba.git
synced 2025-11-06 08:23:50 +03:00
r25028: Fix more warnings.
This commit is contained in:
committed by
Gerald (Jerry) Carter
parent
5085c53fcf
commit
3aa7ee4a0d
@@ -149,16 +149,14 @@ struct cifs_handle
|
|||||||
|
|
||||||
#define IO_HANDLE_TO_SMB(h) ((struct cifs_handle *)(h))
|
#define IO_HANDLE_TO_SMB(h) ((struct cifs_handle *)(h))
|
||||||
|
|
||||||
BOOL smb_seek_func(void * handle, uint64_t offset)
|
static bool smb_seek_func(void * handle, uint64_t offset)
|
||||||
{
|
{
|
||||||
IO_HANDLE_TO_SMB(handle)->offset = offset;
|
IO_HANDLE_TO_SMB(handle)->offset = offset;
|
||||||
return(True);
|
return(True);
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL smb_read_func(void * handle,
|
static bool smb_read_func(void * handle, uint8_t * buf, uint64_t wanted,
|
||||||
uint8_t * buf,
|
uint64_t * actual)
|
||||||
uint64_t wanted,
|
|
||||||
uint64_t * actual)
|
|
||||||
{
|
{
|
||||||
NTSTATUS ret;
|
NTSTATUS ret;
|
||||||
union smb_read r;
|
union smb_read r;
|
||||||
@@ -193,10 +191,8 @@ BOOL smb_read_func(void * handle,
|
|||||||
return(True);
|
return(True);
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL smb_write_func(void * handle,
|
static bool smb_write_func(void * handle, uint8_t * buf, uint64_t wanted,
|
||||||
uint8_t * buf,
|
uint64_t * actual)
|
||||||
uint64_t wanted,
|
|
||||||
uint64_t * actual)
|
|
||||||
{
|
{
|
||||||
NTSTATUS ret;
|
NTSTATUS ret;
|
||||||
union smb_write w;
|
union smb_write w;
|
||||||
|
|||||||
@@ -232,7 +232,7 @@ const char *socket_wrapper_dir(void)
|
|||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
static unsigned int socket_wrapper_default_iface(void)
|
unsigned int socket_wrapper_default_iface(void)
|
||||||
{
|
{
|
||||||
const char *s = getenv("SOCKET_WRAPPER_DEFAULT_IFACE");
|
const char *s = getenv("SOCKET_WRAPPER_DEFAULT_IFACE");
|
||||||
if (s) {
|
if (s) {
|
||||||
|
|||||||
@@ -37,6 +37,7 @@
|
|||||||
#define __SOCKET_WRAPPER_H__
|
#define __SOCKET_WRAPPER_H__
|
||||||
|
|
||||||
const char *socket_wrapper_dir(void);
|
const char *socket_wrapper_dir(void);
|
||||||
|
unsigned int socket_wrapper_default_iface(void);
|
||||||
int swrap_socket(int family, int type, int protocol);
|
int swrap_socket(int family, int type, int protocol);
|
||||||
int swrap_accept(int s, struct sockaddr *addr, socklen_t *addrlen);
|
int swrap_accept(int s, struct sockaddr *addr, socklen_t *addrlen);
|
||||||
int swrap_connect(int s, const struct sockaddr *serv_addr, socklen_t addrlen);
|
int swrap_connect(int s, const struct sockaddr *serv_addr, socklen_t addrlen);
|
||||||
@@ -131,4 +132,5 @@ int swrap_close(int);
|
|||||||
#define close(s) swrap_close(s)
|
#define close(s) swrap_close(s)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#endif /* __SOCKET_WRAPPER_H__ */
|
#endif /* __SOCKET_WRAPPER_H__ */
|
||||||
|
|||||||
@@ -87,10 +87,10 @@ static char *stdin_load(TALLOC_CTX *mem_ctx, size_t *size)
|
|||||||
while((num_read = read(STDIN_FILENO, buf, 255)) > 0) {
|
while((num_read = read(STDIN_FILENO, buf, 255)) > 0) {
|
||||||
|
|
||||||
if (result) {
|
if (result) {
|
||||||
result = (char *) talloc_realloc(
|
result = talloc_realloc(
|
||||||
mem_ctx, result, char *, total_len + num_read);
|
mem_ctx, result, char, total_len + num_read);
|
||||||
} else {
|
} else {
|
||||||
result = talloc_size(mem_ctx, num_read);
|
result = talloc_array(mem_ctx, char, num_read);
|
||||||
}
|
}
|
||||||
|
|
||||||
memcpy(result + total_len, buf, num_read);
|
memcpy(result + total_len, buf, num_read);
|
||||||
@@ -104,7 +104,7 @@ static char *stdin_load(TALLOC_CTX *mem_ctx, size_t *size)
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
const struct ndr_interface_table *load_iface_from_plugin(const char *plugin, const char *pipe_name)
|
static const struct ndr_interface_table *load_iface_from_plugin(const char *plugin, const char *pipe_name)
|
||||||
{
|
{
|
||||||
const struct ndr_interface_table *p;
|
const struct ndr_interface_table *p;
|
||||||
void *handle;
|
void *handle;
|
||||||
@@ -117,7 +117,7 @@ const struct ndr_interface_table *load_iface_from_plugin(const char *plugin, con
|
|||||||
}
|
}
|
||||||
|
|
||||||
symbol = talloc_asprintf(NULL, "ndr_table_%s", pipe_name);
|
symbol = talloc_asprintf(NULL, "ndr_table_%s", pipe_name);
|
||||||
p = dlsym(handle, symbol);
|
p = (const struct ndr_interface_table *)dlsym(handle, symbol);
|
||||||
|
|
||||||
if (!p) {
|
if (!p) {
|
||||||
printf("%s: Unable to find DCE/RPC interface table for '%s': %s\n", plugin, pipe_name, dlerror());
|
printf("%s: Unable to find DCE/RPC interface table for '%s': %s\n", plugin, pipe_name, dlerror());
|
||||||
|
|||||||
@@ -46,6 +46,5 @@ PRIVATE_DEPENDENCIES = LIBLDB
|
|||||||
################################################
|
################################################
|
||||||
|
|
||||||
[SUBSYSTEM::SECRETS]
|
[SUBSYSTEM::SECRETS]
|
||||||
PRIVATE_PROTO_HEADER = secrets_proto.h
|
|
||||||
OBJ_FILES = secrets.o
|
OBJ_FILES = secrets.o
|
||||||
PRIVATE_DEPENDENCIES = DB_WRAP UTIL_TDB
|
PRIVATE_DEPENDENCIES = DB_WRAP UTIL_TDB
|
||||||
|
|||||||
@@ -34,6 +34,19 @@ struct machine_acct_pass {
|
|||||||
#define SECRETS_KRBTGT_SEARCH "(&((|(realm=%s)(flatname=%s))(samAccountName=krbtgt)))"
|
#define SECRETS_KRBTGT_SEARCH "(&((|(realm=%s)(flatname=%s))(samAccountName=krbtgt)))"
|
||||||
#define SECRETS_PRINCIPAL_SEARCH "(&(|(realm=%s)(flatname=%s))(servicePrincipalName=%s))"
|
#define SECRETS_PRINCIPAL_SEARCH "(&(|(realm=%s)(flatname=%s))(servicePrincipalName=%s))"
|
||||||
|
|
||||||
#include "param/secrets_proto.h"
|
/**
|
||||||
|
* Use a TDB to store an incrementing random seed.
|
||||||
|
*
|
||||||
|
* Initialised to the current pid, the very first time Samba starts,
|
||||||
|
* and incremented by one each time it is needed.
|
||||||
|
*
|
||||||
|
* @note Not called by systems with a working /dev/urandom.
|
||||||
|
*/
|
||||||
|
void secrets_shutdown(void);
|
||||||
|
bool secrets_init(void);
|
||||||
|
struct ldb_context *secrets_db_connect(TALLOC_CTX *mem_ctx);
|
||||||
|
struct dom_sid *secrets_get_domain_sid(TALLOC_CTX *mem_ctx,
|
||||||
|
const char *domain);
|
||||||
|
|
||||||
|
|
||||||
#endif /* _SECRETS_H */
|
#endif /* _SECRETS_H */
|
||||||
|
|||||||
@@ -216,7 +216,7 @@ static const struct stream_server_ops dcesrv_stream_ops = {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
NTSTATUS dcesrv_add_ep_unix(struct dcesrv_context *dce_ctx, struct dcesrv_endpoint *e,
|
static NTSTATUS dcesrv_add_ep_unix(struct dcesrv_context *dce_ctx, struct dcesrv_endpoint *e,
|
||||||
struct event_context *event_ctx, const struct model_ops *model_ops)
|
struct event_context *event_ctx, const struct model_ops *model_ops)
|
||||||
{
|
{
|
||||||
struct dcesrv_socket_context *dcesrv_sock;
|
struct dcesrv_socket_context *dcesrv_sock;
|
||||||
@@ -241,7 +241,7 @@ NTSTATUS dcesrv_add_ep_unix(struct dcesrv_context *dce_ctx, struct dcesrv_endpoi
|
|||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
NTSTATUS dcesrv_add_ep_ncalrpc(struct dcesrv_context *dce_ctx, struct dcesrv_endpoint *e,
|
static NTSTATUS dcesrv_add_ep_ncalrpc(struct dcesrv_context *dce_ctx, struct dcesrv_endpoint *e,
|
||||||
struct event_context *event_ctx, const struct model_ops *model_ops)
|
struct event_context *event_ctx, const struct model_ops *model_ops)
|
||||||
{
|
{
|
||||||
struct dcesrv_socket_context *dcesrv_sock;
|
struct dcesrv_socket_context *dcesrv_sock;
|
||||||
@@ -309,7 +309,7 @@ static NTSTATUS add_socket_rpc_pipe_iface(struct dcesrv_context *dce_ctx, struct
|
|||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
NTSTATUS dcesrv_add_ep_np(struct dcesrv_context *dce_ctx, struct dcesrv_endpoint *e,
|
static NTSTATUS dcesrv_add_ep_np(struct dcesrv_context *dce_ctx, struct dcesrv_endpoint *e,
|
||||||
struct event_context *event_ctx, const struct model_ops *model_ops)
|
struct event_context *event_ctx, const struct model_ops *model_ops)
|
||||||
{
|
{
|
||||||
NTSTATUS status;
|
NTSTATUS status;
|
||||||
@@ -356,7 +356,7 @@ static NTSTATUS add_socket_rpc_tcp_iface(struct dcesrv_context *dce_ctx, struct
|
|||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
NTSTATUS dcesrv_add_ep_tcp(struct dcesrv_context *dce_ctx, struct dcesrv_endpoint *e,
|
static NTSTATUS dcesrv_add_ep_tcp(struct dcesrv_context *dce_ctx, struct dcesrv_endpoint *e,
|
||||||
struct event_context *event_ctx, const struct model_ops *model_ops)
|
struct event_context *event_ctx, const struct model_ops *model_ops)
|
||||||
{
|
{
|
||||||
NTSTATUS status;
|
NTSTATUS status;
|
||||||
@@ -379,7 +379,7 @@ NTSTATUS dcesrv_add_ep_tcp(struct dcesrv_context *dce_ctx, struct dcesrv_endpoin
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
NTSTATUS dcesrv_add_ep(struct dcesrv_context *dce_ctx, struct dcesrv_endpoint *e,
|
static NTSTATUS dcesrv_add_ep(struct dcesrv_context *dce_ctx, struct dcesrv_endpoint *e,
|
||||||
struct event_context *event_ctx, const struct model_ops *model_ops)
|
struct event_context *event_ctx, const struct model_ops *model_ops)
|
||||||
{
|
{
|
||||||
switch (e->ep_description->transport) {
|
switch (e->ep_description->transport) {
|
||||||
|
|||||||
@@ -22,6 +22,7 @@
|
|||||||
#include "includes.h"
|
#include "includes.h"
|
||||||
#include "system/filesys.h"
|
#include "system/filesys.h"
|
||||||
#include "param/param.h"
|
#include "param/param.h"
|
||||||
|
#include "smbd/pidfile.h"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @file
|
* @file
|
||||||
|
|||||||
@@ -153,7 +153,7 @@ static void setup_signals(void)
|
|||||||
static void server_stdin_handler(struct event_context *event_ctx, struct fd_event *fde,
|
static void server_stdin_handler(struct event_context *event_ctx, struct fd_event *fde,
|
||||||
uint16_t flags, void *private)
|
uint16_t flags, void *private)
|
||||||
{
|
{
|
||||||
const char *binary_name = private;
|
const char *binary_name = (const char *)private;
|
||||||
uint8_t c;
|
uint8_t c;
|
||||||
if (read(0, &c, 1) == 0) {
|
if (read(0, &c, 1) == 0) {
|
||||||
DEBUG(0,("%s: EOF on stdin - terminating\n", binary_name));
|
DEBUG(0,("%s: EOF on stdin - terminating\n", binary_name));
|
||||||
@@ -169,10 +169,11 @@ static void server_stdin_handler(struct event_context *event_ctx, struct fd_even
|
|||||||
/*
|
/*
|
||||||
die if the user selected maximum runtime is exceeded
|
die if the user selected maximum runtime is exceeded
|
||||||
*/
|
*/
|
||||||
_NORETURN_ static void max_runtime_handler(struct event_context *ev, struct timed_event *te,
|
_NORETURN_ static void max_runtime_handler(struct event_context *ev,
|
||||||
struct timeval t, void *private)
|
struct timed_event *te,
|
||||||
|
struct timeval t, void *private)
|
||||||
{
|
{
|
||||||
const char *binary_name = private;
|
const char *binary_name = (const char *)private;
|
||||||
DEBUG(0,("%s: maximum runtime exceeded - terminating\n", binary_name));
|
DEBUG(0,("%s: maximum runtime exceeded - terminating\n", binary_name));
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user