[SCM] Samba Shared Repository - branch v4-0-test updated -
release-4-0-0alpha3-1840-gda3094d
Jelmer Vernooij
jelmer at samba.org
Mon May 26 12:13:55 GMT 2008
The branch, v4-0-test has been updated
via da3094d1ba86a8f4967ca1993383b0767439f79f (commit)
via 657a87fecc2e79e3c3f66c551e392cc341bca8cf (commit)
via 4dd0d46e27696b6d29d4b6a63c56667ce5e03db6 (commit)
via 4016427b77b2bc202a8dc4064ddc7e13f36db06d (commit)
via 3923414849c5a3b14379e2cd3e61d862150800a6 (commit)
from a429dc730f97388f0b4478b44522b1fe53f8569a (commit)
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v4-0-test
- Log -----------------------------------------------------------------
commit da3094d1ba86a8f4967ca1993383b0767439f79f
Author: Jelmer Vernooij <jelmer at samba.org>
Date: Mon May 26 14:10:34 2008 +0200
Remove unused literal EJS bindings.
commit 657a87fecc2e79e3c3f66c551e392cc341bca8cf
Author: Jelmer Vernooij <jelmer at samba.org>
Date: Mon May 26 14:08:17 2008 +0200
Remove unused libjs functions.
commit 4dd0d46e27696b6d29d4b6a63c56667ce5e03db6
Author: Jelmer Vernooij <jelmer at samba.org>
Date: Mon May 26 14:03:55 2008 +0200
Remove unused param ejs bindings.
commit 4016427b77b2bc202a8dc4064ddc7e13f36db06d
Author: Jelmer Vernooij <jelmer at samba.org>
Date: Mon May 26 14:02:37 2008 +0200
Remove unused rand EJS bindings.
commit 3923414849c5a3b14379e2cd3e61d862150800a6
Author: Jelmer Vernooij <jelmer at samba.org>
Date: Mon May 26 14:00:28 2008 +0200
Remove unused EJS net bindings.
-----------------------------------------------------------------------
Summary of changes:
source/scripting/ejs/config.mk | 13 +-
source/scripting/ejs/ejsnet/config.mk | 13 -
source/scripting/ejs/ejsnet/mpr_host.c | 74 ---
source/scripting/ejs/ejsnet/mpr_user.c | 173 -------
source/scripting/ejs/ejsnet/net_ctx.c | 230 ---------
source/scripting/ejs/ejsnet/net_host.c | 124 -----
source/scripting/ejs/ejsnet/net_user.c | 359 --------------
source/scripting/ejs/literal.c | 797 --------------------------------
source/scripting/ejs/smbcalls.c | 2 -
source/scripting/ejs/smbcalls_param.c | 259 -----------
source/scripting/ejs/smbcalls_rand.c | 104 -----
source/scripting/libjs/base.js | 53 ---
source/scripting/libjs/encoder.js | 116 -----
source/scripting/libjs/server_call.js | 83 ----
source/selftest/samba4_tests.sh | 1 -
testprogs/ejs/ejsnet.js | 46 --
testprogs/ejs/ejsnet/nethost.js | 45 --
testprogs/ejs/ejsnet/netusr.js | 86 ----
18 files changed, 1 insertions(+), 2577 deletions(-)
delete mode 100644 source/scripting/ejs/ejsnet/config.mk
delete mode 100644 source/scripting/ejs/ejsnet/mpr_host.c
delete mode 100644 source/scripting/ejs/ejsnet/mpr_user.c
delete mode 100644 source/scripting/ejs/ejsnet/net_ctx.c
delete mode 100644 source/scripting/ejs/ejsnet/net_host.c
delete mode 100644 source/scripting/ejs/ejsnet/net_user.c
delete mode 100644 source/scripting/ejs/literal.c
delete mode 100644 source/scripting/ejs/smbcalls_param.c
delete mode 100644 source/scripting/ejs/smbcalls_rand.c
delete mode 100644 source/scripting/libjs/encoder.js
delete mode 100644 source/scripting/libjs/server_call.js
delete mode 100755 testprogs/ejs/ejsnet.js
delete mode 100644 testprogs/ejs/ejsnet/nethost.js
delete mode 100644 testprogs/ejs/ejsnet/netusr.js
Changeset truncated at 500 lines:
diff --git a/source/scripting/ejs/config.mk b/source/scripting/ejs/config.mk
index 540e55e..34c0a96 100644
--- a/source/scripting/ejs/config.mk
+++ b/source/scripting/ejs/config.mk
@@ -13,13 +13,6 @@ PRIVATE_DEPENDENCIES = LIBLDB SAMDB LIBNDR
smbcalls_ldb_OBJ_FILES = $(ejsscriptsrcdir)/smbcalls_ldb.o
-[MODULE::smbcalls_rand]
-SUBSYSTEM = smbcalls
-OUTPUT_TYPE = MERGED_OBJ
-INIT_FUNCTION = smb_setup_ejs_random
-
-smbcalls_rand_OBJ_FILES = $(ejsscriptsrcdir)/smbcalls_rand.o
-
[MODULE::smbcalls_auth]
OUTPUT_TYPE = MERGED_OBJ
SUBSYSTEM = smbcalls
@@ -44,8 +37,6 @@ INIT_FUNCTION = smb_setup_ejs_system
smbcalls_sys_OBJ_FILES = $(ejsscriptsrcdir)/smbcalls_sys.o
-mkinclude ejsnet/config.mk
-
[SUBSYSTEM::smbcalls]
PRIVATE_DEPENDENCIES = \
EJS LIBSAMBA-UTIL \
@@ -58,9 +49,7 @@ smbcalls_OBJ_FILES = $(addprefix $(ejsscriptsrcdir)/, \
smbcalls.o \
smbcalls_options.o \
smbcalls_creds.o \
- smbcalls_param.o \
- mprutil.o \
- literal.o)
+ mprutil.o)
$(eval $(call proto_header_template,$(ejsscriptsrcdir)/proto.h,$(smbcalls_OBJ_FILES:.o=.c)))
diff --git a/source/scripting/ejs/ejsnet/config.mk b/source/scripting/ejs/ejsnet/config.mk
deleted file mode 100644
index 710221e..0000000
--- a/source/scripting/ejs/ejsnet/config.mk
+++ /dev/null
@@ -1,13 +0,0 @@
-[MODULE::smbcalls_net]
-SUBSYSTEM = smbcalls
-INIT_FUNCTION = smb_setup_ejs_net
-PRIVATE_DEPENDENCIES = LIBSAMBA-NET LIBCLI_SMB CREDENTIALS
-
-smbcalls_net_OBJ_FILES = $(addprefix $(ejsscriptsrcdir)/ejsnet/, \
- net_ctx.o \
- net_user.o \
- mpr_user.o \
- net_host.o \
- mpr_host.o)
-
-$(eval $(call proto_header_template,$(ejsscriptsrcdir)/ejsnet/proto.h,$(smbcalls_net_OBJ_FILES:.o=.c)))
diff --git a/source/scripting/ejs/ejsnet/mpr_host.c b/source/scripting/ejs/ejsnet/mpr_host.c
deleted file mode 100644
index 8258ea5..0000000
--- a/source/scripting/ejs/ejsnet/mpr_host.c
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- Unix SMB/CIFS implementation.
-
- provides interfaces to libnet calls from ejs scripts
-
- Copyright (C) Rafal Szczesniak 2005-2007
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 3 of the License, or
- (at your option) any later version.
-
- This program 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 General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-
-#include "includes.h"
-#include "lib/appweb/ejs/ejs.h"
-#include "libnet/libnet.h"
-#include "scripting/ejs/smbcalls.h"
-#include "events/events.h"
-#include "auth/credentials/credentials.h"
-
-
-/*
- Properties:
- DomainsList.Domains[0]
- DomainsList.Status
-*/
-struct MprVar mprDomainsList(TALLOC_CTX *mem_ctx, struct libnet_DomainList *list, NTSTATUS result)
-{
- const char *name = "DomainsList";
- NTSTATUS status;
- struct MprVar mprDomainList, mprDomains;
- struct MprVar mprSid, mprDomainName;
- struct MprVar mprDomain;
- int i;
-
- if (list == NULL || mem_ctx == NULL) {
- mprDomainList = mprCreateNullVar();
- goto done;
- }
-
- mprDomains = mprArray("Domains");
- for (i = 0; i < list->out.count; i++) {
- struct domainlist d = list->out.domains[i];
-
- /* get domainlist fields */
- mprSid = mprString(d.sid);
- mprDomainName = mprString(d.name);
-
- mprDomain = mprObject("Domain");
- mprSetVar(&mprDomain, "Name", mprDomainName);
- mprSetVar(&mprDomain, "SID", mprSid);
-
- mprAddArray(&mprDomains, i, mprDomain);
- }
-
- mprDomainList = mprObject(name);
- status = mprSetVar(&mprDomainList, "Domains", mprDomains);
- if (!NT_STATUS_IS_OK(status)) goto done;
- status = mprSetVar(&mprDomainList, "Count", mprCreateIntegerVar(list->out.count));
- if (!NT_STATUS_IS_OK(status)) goto done;
- status = mprSetVar(&mprDomainList, "Status", mprNTSTATUS(result));
-
-done:
- return mprDomainList;
-}
diff --git a/source/scripting/ejs/ejsnet/mpr_user.c b/source/scripting/ejs/ejsnet/mpr_user.c
deleted file mode 100644
index 6691a0f..0000000
--- a/source/scripting/ejs/ejsnet/mpr_user.c
+++ /dev/null
@@ -1,173 +0,0 @@
-/*
- Unix SMB/CIFS implementation.
-
- provides interfaces to libnet calls from ejs scripts
-
- Copyright (C) Rafal Szczesniak 2005-2007
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 3 of the License, or
- (at your option) any later version.
-
- This program 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 General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#include "includes.h"
-#include "lib/appweb/ejs/ejs.h"
-#include "libnet/libnet.h"
-#include "scripting/ejs/smbcalls.h"
-#include "events/events.h"
-#include "auth/credentials/credentials.h"
-
-
-/*
- Properties:
- UserInfo.AccountName
- UserInfo.FullName
- UserInfo.Description
- UserInfo.HomeDirectory
- UserInfo.HomeDrive
- UserInfo.Comment
- UserInfo.LogonScript
- UserInfo.AcctExpiry
- UserInfo.AllowPasswordChange
- UserInfo.ForcePasswordChange
- */
-struct MprVar mprCreateUserInfo(TALLOC_CTX *mem_ctx, struct libnet_UserInfo *info)
-{
- const char *name = "UserInfo";
- NTSTATUS status;
- struct MprVar mprUserInfo;
- struct MprVar mprAccountName, mprFullName, mprDescription;
- struct MprVar mprHomeDir, mprHomeDrive, mprComment;
- struct MprVar mprLogonScript;
- struct MprVar mprAcctExpiry, mprAllowPassChange, mprForcePassChange;
-
- if (info == NULL || mem_ctx == NULL) {
- mprUserInfo = mprCreateNullVar();
- goto done;
- }
-
- mprUserInfo = mprObject(name);
-
- mprAccountName = mprString(info->out.account_name);
- mprFullName = mprString(info->out.full_name);
- mprDescription = mprString(info->out.description);
- mprHomeDir = mprString(info->out.home_directory);
- mprHomeDrive = mprString(info->out.home_drive);
- mprComment = mprString(info->out.comment);
- mprLogonScript = mprString(info->out.logon_script);
- mprAcctExpiry = mprString(timestring(mem_ctx, info->out.acct_expiry->tv_sec));
- mprAllowPassChange = mprString(timestring(mem_ctx, info->out.allow_password_change->tv_sec));
- mprForcePassChange = mprString(timestring(mem_ctx, info->out.force_password_change->tv_sec));
-
- status = mprSetVar(&mprUserInfo, "AccountName", mprAccountName);
- if (!NT_STATUS_IS_OK(status)) goto done;
- status = mprSetVar(&mprUserInfo, "FullName", mprFullName);
- if (!NT_STATUS_IS_OK(status)) goto done;
- status = mprSetVar(&mprUserInfo, "Description", mprDescription);
- if (!NT_STATUS_IS_OK(status)) goto done;
- status = mprSetVar(&mprUserInfo, "HomeDirectory", mprHomeDir);
- if (!NT_STATUS_IS_OK(status)) goto done;
- status = mprSetVar(&mprUserInfo, "HomeDrive", mprHomeDrive);
- if (!NT_STATUS_IS_OK(status)) goto done;
- status = mprSetVar(&mprUserInfo, "Comment", mprComment);
- if (!NT_STATUS_IS_OK(status)) goto done;
- status = mprSetVar(&mprUserInfo, "LogonScript", mprLogonScript);
- if (!NT_STATUS_IS_OK(status)) goto done;
- status = mprSetVar(&mprUserInfo, "AcctExpiry", mprAcctExpiry);
- if (!NT_STATUS_IS_OK(status)) goto done;
- status = mprSetVar(&mprUserInfo, "AllowPasswordChange", mprAllowPassChange);
- if (!NT_STATUS_IS_OK(status)) goto done;
- status = mprSetVar(&mprUserInfo, "ForcePasswordChange", mprForcePassChange);
- if (!NT_STATUS_IS_OK(status)) goto done;
-
-done:
- return mprUserInfo;
-}
-
-
-/*
- Properties:
- UserListCtx.Users[]
- UserListCtx.ResumeIndex
- UserListCtx.Count
- UserListCtx.EndOfList
- UserListCtx.Status
- */
-struct MprVar mprUserListCtx(TALLOC_CTX *mem_ctx, struct libnet_UserList *list, NTSTATUS result)
-{
- const char *name = "UserListCtx";
- NTSTATUS status;
- bool endOfList;
- struct MprVar mprListCtx, mprUserList;
- struct MprVar mprUser, mprSid, mprUsername;
- int i;
-
- if (list == NULL || mem_ctx == NULL) {
- mprListCtx = mprCreateNullVar();
- goto done;
- }
-
- endOfList = (NT_STATUS_EQUAL(result, NT_STATUS_NO_MORE_ENTRIES) ||
- NT_STATUS_IS_OK(result));
-
- mprUserList = mprArray("Users");
- for (i = 0; i < list->out.count; i++) {
- struct userlist u = list->out.users[i];
-
- /* get userlist fields */
- mprSid = mprString(u.sid);
- mprUsername = mprString(u.username);
-
- /* create userlist object */
- mprUser = mprObject("User");
- mprSetVar(&mprUser, "Username", mprUsername);
- mprSetVar(&mprUser, "SID", mprSid);
-
- /* add the object to the array being constructed */
- mprAddArray(&mprUserList, i, mprUser);
- }
-
- mprListCtx = mprObject(name);
- status = mprSetVar(&mprListCtx, "Users", mprUserList);
- if (!NT_STATUS_IS_OK(status)) goto done;
- status = mprSetVar(&mprListCtx, "Count", mprCreateIntegerVar(list->out.count));
- if (!NT_STATUS_IS_OK(status)) goto done;
- status = mprSetVar(&mprListCtx, "ResumeIndex", mprCreateIntegerVar((int)list->out.resume_index));
- if (!NT_STATUS_IS_OK(status)) goto done;
- status = mprSetVar(&mprListCtx, "EndOfList", mprCreateBoolVar(endOfList));
- if (!NT_STATUS_IS_OK(status)) goto done;
- status = mprSetVar(&mprListCtx, "Status", mprNTSTATUS(result));
-
-done:
- return mprListCtx;
-}
-
-
-/*
- Returns UserListCtx.ResumeIndex out of passed UserListCtx
- */
-unsigned int mprListGetResumeIndex(struct MprVar *listCtx)
-{
- NTSTATUS status;
- unsigned int resume = 0;
- struct MprVar *mprResumeIndex;
- if (listCtx == NULL) return 0;
-
- mprResumeIndex = listCtx;
- status = mprGetVar(&mprResumeIndex, "ResumeIndex");
- if (!NT_STATUS_IS_OK(status)) goto done;
-
- resume = (unsigned int) mprVarToInteger(mprResumeIndex);
-
-done:
- return resume;
-}
diff --git a/source/scripting/ejs/ejsnet/net_ctx.c b/source/scripting/ejs/ejsnet/net_ctx.c
deleted file mode 100644
index cbe1635..0000000
--- a/source/scripting/ejs/ejsnet/net_ctx.c
+++ /dev/null
@@ -1,230 +0,0 @@
-/*
- Unix SMB/CIFS implementation.
-
- provides interfaces to libnet calls from ejs scripts
-
- Copyright (C) Rafal Szczesniak 2005-2007
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 3 of the License, or
- (at your option) any later version.
-
- This program 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 General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#include "includes.h"
-#include "lib/appweb/ejs/ejs.h"
-#include "scripting/ejs/smbcalls.h"
-#include "libnet/libnet.h"
-#include "events/events.h"
-#include "auth/credentials/credentials.h"
-
-
-int ejs_net_userman(MprVarHandle eid, int argc, struct MprVar** argv);
-int ejs_net_hostman(MprVarHandle eid, int argc, struct MprVar** argv);
-
-static int ejs_net_join_domain(MprVarHandle eid, int argc, struct MprVar **argv);
-static int ejs_net_samsync_ldb(MprVarHandle eid, int argc, struct MprVar **argv);
-
-/*
- Usage:
- net = NetContext(credentials);
-*/
-
-static int ejs_net_context(MprVarHandle eid, int argc, struct MprVar **argv)
-{
- TALLOC_CTX *event_mem_ctx = talloc_new(mprMemCtx());
- struct cli_credentials *creds;
- struct libnet_context *ctx;
- struct MprVar obj, mprCreds;
- struct event_context *ev;
-
- if (!event_mem_ctx) {
- ejsSetErrorMsg(eid, "talloc_new() failed");
- return -1;
- }
- ev = mprEventCtx();
-
- ctx = libnet_context_init(ev, mprLpCtx());
- /* IF we generated a new event context, it will be under here,
- * and we need it to last as long as the libnet context, so
- * make it a child */
- talloc_steal(ctx, event_mem_ctx);
-
- if (argc == 0 || (argc == 1 && argv[0]->type == MPR_TYPE_NULL)) {
- /*
- create the default credentials
- */
- creds = cli_credentials_init(ctx);
- if (creds == NULL) {
- ejsSetErrorMsg(eid, "cli_credential_init() failed");
- talloc_free(ctx);
- return -1;
- }
- cli_credentials_set_conf(creds, mprLpCtx());
- cli_credentials_set_anonymous(creds);
-
- mprCreds = mprCredentials(creds);
-
- } else if (argc == 1 && argv[0]->type == MPR_TYPE_OBJECT) {
- /*
- get credential values from credentials object
- */
- mprCreds = *(argv[0]);
- creds = (struct cli_credentials *)mprGetPtr(&mprCreds, "creds");
- if (creds == NULL) {
- ejsSetErrorMsg(eid, "invalid credentials parameter");
- talloc_free(ctx);
- return -1;
- }
-
- } else {
- ejsSetErrorMsg(eid, "NetContext invalid arguments, this function requires an object.");
- talloc_free(ctx);
- return -1;
- }
-
- /* setup libnet_context credentials */
- ctx->cred = creds;
-
- /* create the NetContext object */
- obj = mprObject("NetContext");
-
- /* add internal libnet_context pointer to the NetContext object */
- mprSetPtrChild(&obj, "ctx", ctx);
-
- /* add properties publicly available from js code */
- mprCreateProperty(&obj, "credentials", &mprCreds);
-
- /* add methods to the object */
- mprSetCFunction(&obj, "UserMgr", ejs_net_userman);
- mprSetCFunction(&obj, "HostMgr", ejs_net_hostman);
- mprSetCFunction(&obj, "JoinDomain", ejs_net_join_domain);
- mprSetCFunction(&obj, "SamSyncLdb", ejs_net_samsync_ldb);
-
- /* return the object */
- mpr_Return(eid, obj);
-
- return 0;
-}
-
-
-static int ejs_net_join_domain(MprVarHandle eid, int argc, struct MprVar **argv)
-{
- TALLOC_CTX *mem_ctx;
- struct libnet_context *ctx;
- struct libnet_Join *join;
- NTSTATUS status;
- ctx = (struct libnet_context *)mprGetThisPtr(eid, "ctx");
- mem_ctx = talloc_new(mprMemCtx());
-
- join = talloc(mem_ctx, struct libnet_Join);
- if (!join) {
- talloc_free(mem_ctx);
- return -1;
- }
-
- /* prepare parameters for the join */
- join->in.netbios_name = NULL;
- join->in.join_type = SEC_CHAN_WKSTA;
- join->in.domain_name = cli_credentials_get_domain(ctx->cred);
- join->in.level = LIBNET_JOIN_AUTOMATIC;
- join->out.error_string = NULL;
-
- if (argc == 1 && argv[0]->type == MPR_TYPE_OBJECT) {
- MprVar *netbios_name = mprGetProperty(argv[0], "netbios_name", NULL);
- MprVar *domain_name = mprGetProperty(argv[0], "domain_name", NULL);
- MprVar *join_type = mprGetProperty(argv[0], "join_type", NULL);
- if (netbios_name) {
- join->in.netbios_name = mprToString(netbios_name);
- }
- if (domain_name) {
- join->in.domain_name = mprToString(domain_name);
- }
- if (join_type) {
- join->in.join_type = mprToInt(join_type);
- }
- }
-
- if (!join->in.domain_name) {
- ejsSetErrorMsg(eid, "a domain must be specified for to join");
- talloc_free(mem_ctx);
- return -1;
- }
-
- /* do the domain join */
- status = libnet_Join(ctx, join, join);
-
- if (!NT_STATUS_IS_OK(status)) {
- MprVar error_string = mprString(join->out.error_string);
-
- mprSetPropertyValue(argv[0], "error_string", error_string);
- mpr_Return(eid, mprCreateBoolVar(false));
- } else {
- mpr_Return(eid, mprCreateBoolVar(true));
- }
- talloc_free(mem_ctx);
- return 0;
-}
-
-
-static int ejs_net_samsync_ldb(MprVarHandle eid, int argc, struct MprVar **argv)
--
Samba Shared Repository
More information about the samba-cvs
mailing list