[SCM] Samba Shared Repository - branch master updated
Günther Deschner
gd at samba.org
Tue Nov 19 13:49:04 MST 2013
The branch, master has been updated
via 4503bdf netapi: Add support for info level 502 in NetShareAdd.
via ec9f4d5 svcctl: Fix IDL for svcctl_OpenServiceA().
from fa99f40 ctdb-tests: Coverity fixes
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit 4503bdf560f0e9461ac4eb1fe6220f6440c10fd3
Author: Hans Leidekker <hans at meelstraat.net>
Date: Mon Nov 18 18:32:41 2013 +0100
netapi: Add support for info level 502 in NetShareAdd.
Signed-off-by: Hans Leidekker <hans at meelstraat.net>
Reviewed-by: Guenther Deschner <gd at samba.org>
Autobuild-User(master): Günther Deschner <gd at samba.org>
Autobuild-Date(master): Tue Nov 19 21:48:17 CET 2013 on sn-devel-104
commit ec9f4d5c9b76b7b76dd0d5b3e9aa4a8eece8b659
Author: Hans Leidekker <hans at meelstraat.net>
Date: Mon Nov 18 18:39:57 2013 +0100
svcctl: Fix IDL for svcctl_OpenServiceA().
Signed-off-by: Hans Leidekker <hans at meelstraat.net>
Reviewed-by: Guenther Deschner <gd at samba.org>
-----------------------------------------------------------------------
Summary of changes:
librpc/idl/svcctl.idl | 3 ++-
source3/lib/netapi/netapi.h | 13 +++++++++++++
source3/lib/netapi/share.c | 28 +++++++++++++++++++++++++++-
source3/lib/netapi/tests/netshare.c | 18 ++++++++++++++++++
source3/librpc/idl/libnetapi.idl | 13 +++++++++++++
5 files changed, 73 insertions(+), 2 deletions(-)
Changeset truncated at 500 lines:
diff --git a/librpc/idl/svcctl.idl b/librpc/idl/svcctl.idl
index 52ebd44..671a1dc 100644
--- a/librpc/idl/svcctl.idl
+++ b/librpc/idl/svcctl.idl
@@ -484,7 +484,8 @@ import "misc.idl", "security.idl";
WERROR svcctl_OpenServiceA(
[in,ref] policy_handle *scmanager_handle,
[in,unique] [string,charset(UTF16)] uint16 *ServiceName,
- [in] uint32 access_mask
+ [in] uint32 access_mask,
+ [out,ref] policy_handle *handle
);
/*****************/
diff --git a/source3/lib/netapi/netapi.h b/source3/lib/netapi/netapi.h
index 457368e..c273ae0 100644
--- a/source3/lib/netapi/netapi.h
+++ b/source3/lib/netapi/netapi.h
@@ -1233,6 +1233,19 @@ struct SHARE_INFO_501 {
uint32_t shi501_flags;
};
+struct SHARE_INFO_502 {
+ const char * shi502_netname;
+ uint32_t shi502_type;
+ const char * shi502_remark;
+ uint32_t shi502_permissions;
+ uint32_t shi502_max_uses;
+ uint32_t shi502_current_uses;
+ const char * shi502_path;
+ const char * shi502_passwd;
+ uint32_t shi502_reserved;
+ struct security_descriptor * shi502_security_descriptor;
+};
+
struct SHARE_INFO_1004 {
const char * shi1004_remark;
};
diff --git a/source3/lib/netapi/share.c b/source3/lib/netapi/share.c
index 090e1a9..37b2322 100644
--- a/source3/lib/netapi/share.c
+++ b/source3/lib/netapi/share.c
@@ -24,6 +24,7 @@
#include "lib/netapi/netapi_private.h"
#include "lib/netapi/libnetapi.h"
#include "../librpc/gen_ndr/ndr_srvsvc_c.h"
+#include "librpc/gen_ndr/ndr_security.h"
/****************************************************************
****************************************************************/
@@ -129,8 +130,10 @@ static NTSTATUS map_SHARE_INFO_buffer_to_srvsvc_share_info(TALLOC_CTX *mem_ctx,
union srvsvc_NetShareInfo *info)
{
struct SHARE_INFO_2 *i2 = NULL;
+ struct SHARE_INFO_502 *i502 = NULL;
struct SHARE_INFO_1004 *i1004 = NULL;
struct srvsvc_NetShareInfo2 *s2 = NULL;
+ struct srvsvc_NetShareInfo502 *s502 = NULL;
struct srvsvc_NetShareInfo1004 *s1004 = NULL;
if (!buffer) {
@@ -156,6 +159,29 @@ static NTSTATUS map_SHARE_INFO_buffer_to_srvsvc_share_info(TALLOC_CTX *mem_ctx,
info->info2 = s2;
break;
+
+ case 502:
+ i502 = (struct SHARE_INFO_502 *)buffer;
+
+ s502 = talloc(mem_ctx, struct srvsvc_NetShareInfo502);
+ NT_STATUS_HAVE_NO_MEMORY(s502);
+
+ s502->name = i502->shi502_netname;
+ s502->type = i502->shi502_type;
+ s502->comment = i502->shi502_remark;
+ s502->permissions = i502->shi502_permissions;
+ s502->max_users = i502->shi502_max_uses;
+ s502->current_users = i502->shi502_current_uses;
+ s502->path = i502->shi502_path;
+ s502->password = i502->shi502_passwd;
+ s502->sd_buf.sd_size =
+ ndr_size_security_descriptor(i502->shi502_security_descriptor, 0);
+ s502->sd_buf.sd = i502->shi502_security_descriptor;
+
+ info->info502 = s502;
+
+ break;
+
case 1004:
i1004 = (struct SHARE_INFO_1004 *)buffer;
@@ -191,8 +217,8 @@ WERROR NetShareAdd_r(struct libnetapi_ctx *ctx,
switch (r->in.level) {
case 2:
- break;
case 502:
+ break;
case 503:
return WERR_NOT_SUPPORTED;
default:
diff --git a/source3/lib/netapi/tests/netshare.c b/source3/lib/netapi/tests/netshare.c
index 84af9e0..a518ce9 100644
--- a/source3/lib/netapi/tests/netshare.c
+++ b/source3/lib/netapi/tests/netshare.c
@@ -124,6 +124,7 @@ NET_API_STATUS netapitest_share(struct libnetapi_ctx *ctx,
const char *sharename, *comment;
uint8_t *buffer = NULL;
struct SHARE_INFO_2 i2;
+ struct SHARE_INFO_502 i502;
struct SHARE_INFO_1004 i1004;
struct SHARE_INFO_501 *i501 = NULL;
uint32_t parm_err = 0;
@@ -142,6 +143,23 @@ NET_API_STATUS netapitest_share(struct libnetapi_ctx *ctx,
printf("testing NetShareAdd\n");
+ ZERO_STRUCT(i502);
+
+ i502.shi502_netname = sharename;
+ i502.shi502_path = "c:\\";
+
+ status = NetShareAdd(hostname, 502, (uint8_t *)&i502, &parm_err);
+ if (status) {
+ NETAPI_STATUS(ctx, status, "NetShareAdd");
+ goto out;
+ };
+
+ status = NetShareDel(hostname, sharename, 0);
+ if (status) {
+ NETAPI_STATUS(ctx, status, "NetShareDel");
+ goto out;
+ };
+
ZERO_STRUCT(i2);
i2.shi2_netname = sharename;
diff --git a/source3/librpc/idl/libnetapi.idl b/source3/librpc/idl/libnetapi.idl
index 9018d76..f29e666 100644
--- a/source3/librpc/idl/libnetapi.idl
+++ b/source3/librpc/idl/libnetapi.idl
@@ -1779,6 +1779,19 @@ interface libnetapi
} SHARE_INFO_501;
typedef struct {
+ string shi502_netname;
+ uint32 shi502_type;
+ string shi502_remark;
+ uint32 shi502_permissions;
+ uint32 shi502_max_uses;
+ uint32 shi502_current_uses;
+ string shi502_path;
+ string shi502_passwd;
+ uint32 shi502_reserved;
+ security_descriptor *shi502_security_descriptor;
+ } SHARE_INFO_502;
+
+ typedef struct {
string shi1004_remark;
} SHARE_INFO_1004;
--
Samba Shared Repository
More information about the samba-cvs
mailing list