svn commit: samba r9210 - in
branches/SAMBA_4_0/source/scripting/ejs: .
tridge at samba.org
tridge at samba.org
Mon Aug 8 03:20:23 GMT 2005
Author: tridge
Date: 2005-08-08 03:20:17 +0000 (Mon, 08 Aug 2005)
New Revision: 9210
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=9210
Log:
fixed support for a credentials element in a rpc object in ejs to not
give lots of warnings of missing properties
Modified:
branches/SAMBA_4_0/source/scripting/ejs/mprutil.c
branches/SAMBA_4_0/source/scripting/ejs/smbcalls_rpc.c
Changeset:
Modified: branches/SAMBA_4_0/source/scripting/ejs/mprutil.c
===================================================================
--- branches/SAMBA_4_0/source/scripting/ejs/mprutil.c 2005-08-08 03:19:28 UTC (rev 9209)
+++ branches/SAMBA_4_0/source/scripting/ejs/mprutil.c 2005-08-08 03:20:17 UTC (rev 9210)
@@ -357,14 +357,15 @@
*/
void *mprGetPtr(struct MprVar *v, const char *propname)
{
- NTSTATUS status = mprGetVar(&v, propname);
- if (!NT_STATUS_IS_OK(status)) {
+ struct MprVar *val;
+ val = mprGetProperty(v, propname, NULL);
+ if (val == NULL) {
return NULL;
}
- if (v->type != MPR_TYPE_PTR) {
+ if (val->type != MPR_TYPE_PTR) {
return NULL;
}
- return v->ptr;
+ return val->ptr;
}
/*
Modified: branches/SAMBA_4_0/source/scripting/ejs/smbcalls_rpc.c
===================================================================
--- branches/SAMBA_4_0/source/scripting/ejs/smbcalls_rpc.c 2005-08-08 03:19:28 UTC (rev 9209)
+++ branches/SAMBA_4_0/source/scripting/ejs/smbcalls_rpc.c 2005-08-08 03:20:17 UTC (rev 9210)
@@ -112,6 +112,7 @@
struct cli_credentials *creds;
struct event_context *ev;
struct MprVar *this = mprGetProperty(ejsGetLocalObject(eid), "this", 0);
+ struct MprVar *credentials;
/* validate arguments */
if (argc < 1) {
@@ -137,8 +138,10 @@
goto done;
}
- creds = mprGetPtr(this, "credentials.creds");
- if (creds == NULL) {
+ credentials = mprGetProperty(this, "credentials", NULL);
+ if (credentials) {
+ creds = mprGetPtr(credentials, "creds");
+ } else {
creds = cmdline_credentials;
}
if (creds == NULL) {
More information about the samba-cvs
mailing list