1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-25 23:21:54 +03:00
Commit Graph

116 Commits

Author SHA1 Message Date
Andrew Tridgell
f7b49ecd08 r8821: continue the trend to move to a more OO style of interface for our js
calls. This changes the generated RPC and IRPC calls to use the 'this'
object pointer instead of requiring the passing of the object on each
call. So typical usage is now:

var echo = echo_init();
var io = irpcObj();

status = echo.connect("ncacn_np:server");
assert(status.is_ok);

io.input.in_data = 7;
status = echo.AddOne(io);
assert(status.is_ok);
2007-10-10 13:30:08 -05:00
Andrew Tridgell
8086c37df6 r8742: fixed handling of zero length names in mprObject() 2007-10-10 13:30:00 -05:00
Andrew Bartlett
ecbd2235a3 r8700: Propmted by tridge's need to do plaintext auth in ejs, rework the
user_info strcture in auth/

This moves it to a pattern much like that found in ntvfs, with
functions to migrate between PAIN, HASH and RESPONSE passwords.

Instead of make_user_info*() functions, we simply fill in the control
block in the callers, per recent dicussions on the lists.  This
removed a lot of data copies as well as error paths, as we can grab
much of it with talloc.

Andrew Bartlett
2007-10-10 13:29:55 -05:00
Andrew Tridgell
acf8c8fd49 r8678: setup for gdb backtrace in 'make test' 2007-10-10 13:29:53 -05:00
Andrew Tridgell
a569fc8924 r8661: added strstr() ejs function in string lib 2007-10-10 13:29:51 -05:00
Andrew Tridgell
d2c29a5a51 r8659: return ldif formatted attributes in the ejs ldb search call, so sids show up as strings
not binary blobs
2007-10-10 13:29:50 -05:00
Andrew Tridgell
c2691ef712 r8643: - make lp_configfile() work again
- get rid of redundeny dyn_CONFIGFILE argument to lp_load()

- fixed provisioning to work with completely pristine install,
  creating an initial smb.conf is none is present

- added lp.set() and lp.reload() to loadparm ejs object interface
2007-10-10 13:29:48 -05:00
Andrew Tridgell
ed4fb68ef7 r8640: continue the trend by moving the ejs random calls into an object 2007-10-10 13:29:48 -05:00
Andrew Tridgell
2dc493eea6 r8639: moved loadparm calls into an ejs object 2007-10-10 13:29:48 -05:00
Andrew Tridgell
a978484738 r8638: continue the trend of maknig our C functions true ejs objects by making the string functions
into an object. To keep existing code working I have added:

  string_init(global);

into base.js. That brings the functions into the global scope for our
existing scripts
2007-10-10 13:29:48 -05:00
Andrew Tridgell
5dbdf4fb33 r8637: added sys.stat() and sys.lstat() calls 2007-10-10 13:29:48 -05:00
Andrew Tridgell
6a1ed328e2 r8635: make object inheritance with the builtin objects easy by allowing
callers to optionally supply an existing object to add the properties
to. So you can do:

 var rpc = samr_init();
 lsa_init(rpc);

and you end up with 'rpc' having both the samr and lsa functions and
constants available.
2007-10-10 13:29:47 -05:00
Andrew Tridgell
8e788ae309 r8633: check for valid input to ejs_userAuth() 2007-10-10 13:29:46 -05:00
Andrew Tridgell
9e07c08a71 r8629: - moved the getDomainList() call out of smbcalls_auth.c and into libjs/auth.js
- tried to make the ejs_userAuth() call work for the sam, not just for
  unix auth. I didn't get this working. Andrew, when you get a chance
  can you see what I'm doing wrong? I suspect its because we aren't
  supplying a challenge, but a challenge doesn't really make sense in a
  'is this username/password' correct call.
2007-10-10 13:29:46 -05:00
Andrew Tridgell
4c1d6a97c0 r8602: allow options in ldb connect calls 2007-10-10 13:29:44 -05:00
Andrew Tridgell
632f7bbe3e r8582: added sys.httptime() call, to display a NTTIME as a http time string 2007-10-10 13:29:41 -05:00
Andrew Tridgell
2ae6a33846 r8581: fixed handling of 64 bit integers in rpc calls from ejs 2007-10-10 13:29:41 -05:00
Andrew Tridgell
9af48b8fc2 r8569: delete is a js reserved word, so use del instead 2007-10-10 13:29:39 -05:00
Andrew Tridgell
a3f3292e66 r8561: as with the other ejs subsystems, make nss into a object 2007-10-10 13:29:38 -05:00
Andrew Tridgell
21ca972d06 r8557: expose ldb_errstring() in ldb ejs code 2007-10-10 13:29:37 -05:00
Andrew Tridgell
a58ea6b385 r8520: fixed a pile of warnings from the build farm gcc -Wall output on
S390. This is an attempt to avoid the panic we're seeing in the
automatic builds.

The main fixes are:

 - assumptions that sizeof(size_t) == sizeof(int), mostly in printf formats

 - use of NULL format statements to perform dn searches.

 - assumption that sizeof() returns an int
2007-10-10 13:29:34 -05:00
Simo Sorce
e709e37928 r8516: let us use all parameters of ldbsearch in ldb.search 2007-10-10 13:29:33 -05:00
Simo Sorce
5a6c2170ff r8499: clearer function name 2007-10-10 13:23:10 -05:00
Andrew Tridgell
ccf20b2b13 r8489: neaten up the object handling 2007-10-10 13:23:09 -05:00
Andrew Tridgell
cf35818648 r8488: after discussions with simo, moved to a full OO interface, so you don't need to keep
a 'db' variable around. The ldb object knows what it is connected to.

Added a simple ldb testsuite in testprogs/ldb.js
2007-10-10 13:23:08 -05:00
Andrew Tridgell
98c9c4ecb8 r8486: switched to a separate connection operation in ldb interface
(a suggestion from simo)
2007-10-10 13:23:08 -05:00
Andrew Tridgell
9991e924e9 r8484: switched the sys_*() calls to the OO interface
tim, do you want to do the cli_*() calls now?
2007-10-10 13:23:08 -05:00
Andrew Tridgell
57d7a585e8 r8483: switched our generated ejs rpc code over to the new OO interface. This
means we don't pollute the name space, and also makes for faster
startup times as we only create variables for the pipes that we use,
not all pipes
2007-10-10 13:23:08 -05:00
Andrew Tridgell
3093057d97 r8481: switched ldb ejs called over to an OO interface, so you do:
var ldb = ldb_init();

res = ldb.search(dbfile, "(objectClass=user)");

you can also do:

ldbSearch = ldb.search;
res = ldbSearch(dbfile, "(objectClass=user)");

if you want the old interface (ie. you can use this to import
functions into the global or local namespace).
2007-10-10 13:23:07 -05:00
Andrew Tridgell
778bcd3738 r8452: allow for the ugly hack:
#!/bin/sh
exec smbscript "$0" ${1+"$@"}

which is needed because bloody solaris puts 'env' in /bin instead of /usr/bin

also neaten up the #! handling code.
2007-10-10 13:23:05 -05:00
Andrew Tridgell
f476e7aeec r8411: we need to use mprVarToNumber() instead of var->integer now, to cope with
the 64 bit integer support

this fixes the exit status from smbscript
2007-10-10 13:22:59 -05:00
Andrew Tridgell
632f99017d r8406: make sure we give an error in ldbAdd() if any record fails 2007-10-10 13:22:58 -05:00
Andrew Tridgell
52db7a052b r8399: move the ejs and esp code closer to the directory layout used by the
upstream sources. This makes it much easier to keep it up to date.

I will separate out the mpr code into lib/appweb/mpr next
2007-10-10 13:22:39 -05:00
Love Hörnquist Åstrand
56fd21c806 r8394: Make sure the argument to ctype is*(3) macros are unsigned char as
required by ISO C99.
2007-10-10 13:20:14 -05:00
Andrew Tridgell
7476cb9413 r8372: - split out provisioning logic into a separate ejs library
- added a provisioning web page
2007-10-10 13:20:13 -05:00
Tim Potter
797d9cf0c7 r8358: Return an error message if js include path not set instead of silently
failing.
2007-10-10 13:20:11 -05:00
Tim Potter
f76a7ec2a2 r8357: Call lp_load() so we can access the various lp_functions(). 2007-10-10 13:20:11 -05:00
Andrew Tridgell
abbf9c703c r8355: - added a vsprintf() function
- removed the --outputdir option from provision, as its not used any
  more (as ejs knows the real paths)
2007-10-10 13:20:10 -05:00
Andrew Tridgell
625628a3f6 r8340: - added sys_gmtime()
- added sys_unlink()

- added sys_file_load() and sys_file_save()

- use mprString() instead of mprCreateStringVar() to cope with NULL strings

- removed smbcalls_irpc.c as its not needed any more

- allow ldbAdd() and ldbModify() to take multiple ldif records

- added a sprintf() function to ejs. Quite complex, but very useful!
2007-10-10 13:20:08 -05:00
Andrew Tridgell
322c213783 r8339: added ldbAdd(), ldbModify(), ldbDelete() and ldbRename() to ejs ldb functions 2007-10-10 13:20:08 -05:00
Andrew Tridgell
28c1a1f3c0 r8337: - use 64 bit access functions in ejs calls
- added access to smbd random functions

- fixed ordering in join()

- added sys_interfaces(), sys_hostname(), sys_nttime() and sys_ldaptime()
2007-10-10 13:20:07 -05:00
Andrew Tridgell
b0f9ddafe9 r8333: merged with latest upstream ejs sources 2007-10-10 13:20:07 -05:00
Andrew Tridgell
0ef8f0282e r8331: added split(), join() and FileLoad() functions to ejs.
this gets me most of the way through a ejs provision script
2007-10-10 13:20:06 -05:00
Andrew Tridgell
570f071b15 r8320: make sure all our returned objects are full objects, which means they
have the toString() and valueOf() default attributes

this allows all our returned objects to be used in logical expressions
2007-10-10 13:20:06 -05:00
Andrew Tridgell
1517ad490d r8318: added a bunch more ejs calls.
getgr*()
  getpw*()
  strlower()
  strupper()
  IfaceList()
2007-10-10 13:20:06 -05:00
Andrew Tridgell
775fb56ac2 r8316: give full access to the popt command line parsing in ejs scripts, including
access to the samba common options. For example:

ok = GetOptions(ARGV, options,
		"POPT_AUTOHELP",
		"POPT_COMMON_SAMBA",
		"myopt=s",
		"intopt=i",
		"noopt");

this allows scripts to support their own extended options properly
2007-10-10 13:20:05 -05:00
Andrew Tridgell
ff60529ba2 r8297: add libinclude() function in ejs, which is like include() but searches a js library
path set in "js include" in smb.conf.

This will allow us to start building up a library of common js code,
while avoiding the problem of hard-coding include paths in scripts
2007-10-10 13:19:32 -05:00
Andrew Tridgell
6961fe2905 r8296: - split out the ejs auth functions into a separate file
- got rid of the one line ejs_returnlist()
2007-10-10 13:19:32 -05:00
Andrew Tridgell
061e20e509 r8284: - fixed some uninitialised variables in the irpc code
- added code to send multiple irpc calls in parallel, to all servers
  that have registered the given name, with output going in
  io.results[i]. This allows you to make rpc calls to multiple servers
  at once, which is needed for clients like smbstatus
2007-10-10 13:19:31 -05:00
Andrew Tridgell
1c6b1102e5 r8281: pass the callnum and rpc interface table directly from the generated
code in pidl for ejs calls. This means that ejs_rpc_call() doesn't
need to scan the rpc tables for the right interface, and doesn't need
to scan for the call name
2007-10-10 13:19:31 -05:00