mirror of
https://github.com/samba-team/samba.git
synced 2025-12-10 04:23:50 +03:00
Use SERVER_INFO_1005 in libnetapi.
Guenther
(This used to be commit 5f8793dd1d)
This commit is contained in:
@@ -48,10 +48,6 @@
|
|||||||
|
|
||||||
#define SAFE_FREE(x) do { if ((x) != NULL) {free(x); x=NULL;} } while(0)
|
#define SAFE_FREE(x) do { if ((x) != NULL) {free(x); x=NULL;} } while(0)
|
||||||
|
|
||||||
struct srvsvc_NetSrvInfo1005 {
|
|
||||||
const char *comment;/* [unique,charset(UTF16)] */
|
|
||||||
};
|
|
||||||
|
|
||||||
static gboolean verbose = FALSE;
|
static gboolean verbose = FALSE;
|
||||||
|
|
||||||
typedef struct join_state {
|
typedef struct join_state {
|
||||||
@@ -173,10 +169,10 @@ static void callback_apply_description_change(GtkWidget *widget,
|
|||||||
struct join_state *state = (struct join_state *)data;
|
struct join_state *state = (struct join_state *)data;
|
||||||
NET_API_STATUS status = 0;
|
NET_API_STATUS status = 0;
|
||||||
uint32_t parm_err = 0;
|
uint32_t parm_err = 0;
|
||||||
struct srvsvc_NetSrvInfo1005 info1005;
|
struct SERVER_INFO_1005 info1005;
|
||||||
GtkWidget *dialog;
|
GtkWidget *dialog;
|
||||||
|
|
||||||
info1005.comment = state->comment_new;
|
info1005.sv1005_comment = state->comment_new;
|
||||||
|
|
||||||
status = NetServerSetInfo(NULL, 1005, (uint8_t *)&info1005, &parm_err);
|
status = NetServerSetInfo(NULL, 1005, (uint8_t *)&info1005, &parm_err);
|
||||||
if (status) {
|
if (status) {
|
||||||
@@ -1556,7 +1552,7 @@ static int initialize_join_state(struct join_state *state,
|
|||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
struct srvsvc_NetSrvInfo1005 *info1005 = NULL;
|
struct SERVER_INFO_1005 *info1005 = NULL;
|
||||||
uint8_t *buffer = NULL;
|
uint8_t *buffer = NULL;
|
||||||
|
|
||||||
status = NetServerGetInfo(NULL, 1005, &buffer);
|
status = NetServerGetInfo(NULL, 1005, &buffer);
|
||||||
@@ -1566,9 +1562,9 @@ static int initialize_join_state(struct join_state *state,
|
|||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
info1005 = (struct srvsvc_NetSrvInfo1005 *)buffer;
|
info1005 = (struct SERVER_INFO_1005 *)buffer;
|
||||||
|
|
||||||
state->comment = strdup(info1005->comment);
|
state->comment = strdup(info1005->sv1005_comment);
|
||||||
if (!state->comment) {
|
if (!state->comment) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -58,6 +58,10 @@ struct DOMAIN_CONTROLLER_INFO {
|
|||||||
const char * client_site_name;
|
const char * client_site_name;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct SERVER_INFO_1005 {
|
||||||
|
const char * sv1005_comment;
|
||||||
|
};
|
||||||
|
|
||||||
struct USER_INFO_0 {
|
struct USER_INFO_0 {
|
||||||
const char * usri0_name;
|
const char * usri0_name;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -30,9 +30,9 @@
|
|||||||
static WERROR NetServerGetInfo_l_1005(struct libnetapi_ctx *ctx,
|
static WERROR NetServerGetInfo_l_1005(struct libnetapi_ctx *ctx,
|
||||||
uint8_t **buffer)
|
uint8_t **buffer)
|
||||||
{
|
{
|
||||||
struct srvsvc_NetSrvInfo1005 info1005;
|
struct SERVER_INFO_1005 info1005;
|
||||||
|
|
||||||
info1005.comment = lp_serverstring();
|
info1005.sv1005_comment = lp_serverstring();
|
||||||
*buffer = (uint8_t *)talloc_memdup(ctx, &info1005, sizeof(info1005));
|
*buffer = (uint8_t *)talloc_memdup(ctx, &info1005, sizeof(info1005));
|
||||||
if (!*buffer) {
|
if (!*buffer) {
|
||||||
return WERR_NOMEM;
|
return WERR_NOMEM;
|
||||||
|
|||||||
Reference in New Issue
Block a user