summaryrefslogtreecommitdiff
path: root/source4/scripting/ejs
AgeCommit message (Collapse)AuthorFilesLines
2007-10-10r8489: neaten up the object handlingAndrew Tridgell2-4/+20
(This used to be commit ccf20b2b13b11ac07b59988809b6c5160388a616)
2007-10-10r8488: after discussions with simo, moved to a full OO interface, so you ↵Andrew Tridgell2-41/+44
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 (This used to be commit cf35818648b5b649d0cd25f115a04b7b5b5311aa)
2007-10-10r8486: switched to a separate connection operation in ldb interfaceAndrew Tridgell1-73/+101
(a suggestion from simo) (This used to be commit 98c9c4ecb87e1b140002390067892806464849da)
2007-10-10r8484: switched the sys_*() calls to the OO interfaceAndrew Tridgell1-8/+22
tim, do you want to do the cli_*() calls now? (This used to be commit 9991e924e9dacec663a5d040ccfc878927fc3afa)
2007-10-10r8483: switched our generated ejs rpc code over to the new OO interface. ThisAndrew Tridgell6-60/+6
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 (This used to be commit 57d7a585e8162d21c7152952aa0cc7471968784f)
2007-10-10r8481: switched ldb ejs called over to an OO interface, so you do:Andrew Tridgell3-5/+35
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). (This used to be commit 3093057d9735cbb62f57e7159264d5a28b85320f)
2007-10-10r8452: allow for the ugly hack:Andrew Tridgell1-9/+9
#!/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. (This used to be commit 778bcd3738e42d8adfd4529f790c898f0d904363)
2007-10-10r8411: we need to use mprVarToNumber() instead of var->integer now, to cope withAndrew Tridgell1-1/+1
the 64 bit integer support this fixes the exit status from smbscript (This used to be commit f476e7aeec56a921fd286d3fe2cb0a229e57a9e8)
2007-10-10r8406: make sure we give an error in ldbAdd() if any record failsAndrew Tridgell1-0/+1
(This used to be commit 632f99017ded607c80022f730b6ec7e37bd13642)
2007-10-10r8399: move the ejs and esp code closer to the directory layout used by theAndrew Tridgell16-16/+16
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 (This used to be commit 52db7a052baeb0f11361ed69b71cb790039e3cc9)
2007-10-10r8394: Make sure the argument to ctype is*(3) macros are unsigned char asLove Hörnquist Åstrand1-1/+1
required by ISO C99. (This used to be commit 56fd21c806e816cf4c3d23881f26474f858b45e2)
2007-10-10r8372: - split out provisioning logic into a separate ejs libraryAndrew Tridgell1-0/+15
- added a provisioning web page (This used to be commit 7476cb94132cf2849ec19360468904ca6fe8de2c)
2007-10-10r8358: Return an error message if js include path not set instead of silentlyTim Potter1-0/+1
failing. (This used to be commit 797d9cf0c72992b2d5b9912d0f41873b6acc3195)
2007-10-10r8357: Call lp_load() so we can access the various lp_functions().Tim Potter1-0/+2
(This used to be commit f76a7ec2a2ef5db7ca7dced519474495d7ea02dc)
2007-10-10r8355: - added a vsprintf() functionAndrew Tridgell1-0/+36
- removed the --outputdir option from provision, as its not used any more (as ejs knows the real paths) (This used to be commit abbf9c703c17c2edc2d978dade3619a96c38d0d9)
2007-10-10r8340: - added sys_gmtime()Andrew Tridgell10-234/+236
- 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! (This used to be commit 625628a3f6e78349d2240ebcc79081f350672070)
2007-10-10r8339: added ldbAdd(), ldbModify(), ldbDelete() and ldbRename() to ejs ldb ↵Andrew Tridgell1-0/+144
functions (This used to be commit 322c2137835ff2d76b3183901bf680780f164b5e)
2007-10-10r8337: - use 64 bit access functions in ejs callsAndrew Tridgell9-23/+230
- added access to smbd random functions - fixed ordering in join() - added sys_interfaces(), sys_hostname(), sys_nttime() and sys_ldaptime() (This used to be commit 28c1a1f3c0cd2f8228fd8c3c695ab6f45226fa3f)
2007-10-10r8333: merged with latest upstream ejs sourcesAndrew Tridgell4-12/+9
(This used to be commit b0f9ddafe95d4e8d846bc72a39e94d22da271348)
2007-10-10r8331: added split(), join() and FileLoad() functions to ejs.Andrew Tridgell1-0/+103
this gets me most of the way through a ejs provision script (This used to be commit 0ef8f0282e0490328bbcdc8c6daff3f8fac99087)
2007-10-10r8320: make sure all our returned objects are full objects, which means theyAndrew Tridgell7-16/+23
have the toString() and valueOf() default attributes this allows all our returned objects to be used in logical expressions (This used to be commit 570f071b1544b497d5f480b8ad50df097fe4c843)
2007-10-10r8318: added a bunch more ejs calls.Andrew Tridgell6-3/+249
getgr*() getpw*() strlower() strupper() IfaceList() (This used to be commit 1517ad490dd67302f38ab9dcd8a3b24b73b8d550)
2007-10-10r8316: give full access to the popt command line parsing in ejs scripts, ↵Andrew Tridgell5-27/+204
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 (This used to be commit 775fb56ac287b8d485b38f633b9480d7b7ab64e3)
2007-10-10r8297: add libinclude() function in ejs, which is like include() but ↵Andrew Tridgell1-0/+47
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 (This used to be commit ff60529ba2515df29a20b4a417327a3565ec8ee9)
2007-10-10r8296: - split out the ejs auth functions into a separate fileAndrew Tridgell4-121/+148
- got rid of the one line ejs_returnlist() (This used to be commit 6961fe29058cffd8e69d9ce7e7d3902f973411c0)
2007-10-10r8284: - fixed some uninitialised variables in the irpc codeAndrew Tridgell4-7/+99
- 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 (This used to be commit 061e20e509d95ffe16d7dd6fba7db39fc7a165ed)
2007-10-10r8281: pass the callnum and rpc interface table directly from the generatedAndrew Tridgell2-19/+26
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 (This used to be commit 1c6b1102e5c2529206b917e7c6b279c4f63d0e9a)
2007-10-10r8280: - added irpc_connect() for connecting to a irpc server by nameAndrew Tridgell3-3/+87
- make the dcerpc pipe in rpc_connect() a talloc child of the ejs connection variable. That means when the connection variable goes out of scope, the connection is automatically closed. That makes for a more natural interface for closing connections in a scripting language (tpot, you may wish to use mprSetPtrChild() in your smb glue code too) (This used to be commit 1c170138a8e82cb42958b88b94a1d567ffa88a92)
2007-10-10r8276: fixed the remaining memory leaks in smbscript. We can now loop doingAndrew Tridgell10-124/+138
lots of rpc calls without memory usage increasing. (This used to be commit 9c885a7edb771486793eb287288158157b34e8f3)
2007-10-10r8273: fixed some memory leaks in smbscript. This required convertingAndrew Tridgell4-29/+16
file_load() to use talloc, which impacted quite a few bits of code, including our smb.conf processing. took the opportunity to remove the gloabls in params.c while doing this (This used to be commit b220756cb4f1d201ba3e771ca67e4bfae5eae748)
2007-10-10r8262: - simplify the dependency handling for ejs modulesAndrew Tridgell3-106/+63
- added config.mk entries for some more pipes - simplify the handling of ejs variables in the pidl code (This used to be commit 595304708db69229495c5739b5cacab732afd55f)
2007-10-10r8260: added an init based registration system for the generated ejs rpc ↵Andrew Tridgell2-18/+47
code, so adding a new pipe only involves changes to librpc/config.mk (This used to be commit 0e54fa446665f380e9c46723a6e2be5a08b8d51c)
2007-10-10r8256: - allow rpc calls from non-command line ejs contexts by creating a setAndrew Tridgell4-2/+34
of null credentials to use if cmdline_credentials is not setup - hide the length and size elements of a lsa_String from js scripts, so you can use a lsa_String just as an ordinary string without knowing its a structure. We won't do this with all structures, just a few core ones that are used often enough to warrant it. - make sure returned ldb arrays have a length property (This used to be commit 12d2092dd8668de41776132ccbcd634790c371a9)
2007-10-10r8254: fixed a valgrind error in the unix auth codeAndrew Tridgell1-1/+1
(This used to be commit ad1a4802d0634960646a6efe039fe8b62ead63dd)
2007-10-10r8238: - fixed handling of NULL pointers from ejsAndrew Tridgell3-0/+26
- added automatic creation of all constants in IDL as ejs variables (This used to be commit 9398b02e4ba51145e447668e321ca927f44c0078)
2007-10-10r8236: fixed support for arrays of structuresAndrew Tridgell1-4/+4
(This used to be commit cbe5289ac9a8adfe68704dc16a2b32ecbd15a4eb)
2007-10-10r8233: - added support for more base types in pidl ejsAndrew Tridgell4-5/+143
- added auto generation of a header with prototypes for public ejs functions - make public functions non-static - fixed allocation of fixed sized arrays - added 'noejs' flag indicating that a typedef will be handled manually by ejs - added manual functions for sid and GUID, so they show up as nice strings in ejs scripts This allows ejs to bring in samr, security, lsa and misc IDL functions (This used to be commit a8cb2dbdcc2871090a26f580f67db8f0636d1e7e)
2007-10-10r8230: prevent authentication dying on a NULL domainAndrew Tridgell1-1/+1
(This used to be commit e1cfc6d03244e04d59a96ef2abb5b48fcb157b0a)
2007-10-10r8220: added auto-generation of ENUM constants in ejs wrapper. So we can now ↵Andrew Tridgell5-1/+41
use the enum name instead of a integer in ejs scripts making rpc calls (This used to be commit a61cdee384c3002860016c1740276529493d318d)
2007-10-10r8216: - handle union pull in ejs pidl generationAndrew Tridgell1-0/+9
- added debugging calls for missing structure/union elements (This used to be commit f3ff48204cb8edeb9f42afbbefe13f7d49305506)
2007-10-10r8215: switched the pull side of the ejs generator over to the recursive ↵Andrew Tridgell2-30/+14
LEVELS based approach. This allows for much more complex structure mappings to be generated. (This used to be commit 49fc14d13291b02f7b16ab0eefe7bfb26f51b1c8)
2007-10-10r8213: I've started to understand the LEVELS stuff in pidl much better now,Andrew Tridgell2-29/+13
and have re-coded the push side of the ejs generator to use it properly. It ends up being very neat and small, and should handle much more complex structures (like arrays of pointers to unions etc). Also added push side support for unions. This should get more of the echo pipe working via ejs. (This used to be commit 2e306be1d83f722c259c4a63233e77d8bb1d5a72)
2007-10-10r8200: - added stub functions for union pull/pushAndrew Tridgell1-0/+3
- kill the js interpreter with an exception on internal errors (This used to be commit 5f062d71481a0aa2d8c89099abb2d171b789879e)
2007-10-10r8198: - handled push/pull of simple strings in ejsAndrew Tridgell3-9/+56
- improved the error handling, so the ejs wrappers don't just ignore a type they don't handle, instead an exception is issued saying what isn't handled (This used to be commit a77c2aa8606ad668f6a513211a1d9e7d6193d741)
2007-10-10r8195: - fixed handling of simple arrays. To keep the logic simple, I moved ↵Andrew Tridgell2-17/+17
to making all push functions taking a constant pointer to the type rather than having a different calling convention for scalars and pointers - fixed the setting of the 'length' element in arrays (This used to be commit 431b4b6888434daa8d1306f0e98bae7b2fe0fddd)
2007-10-10r8194: delete the old hand-written ejs code for echo_AddOne. This is nowAndrew Tridgell1-45/+0
autogenerated by pidl (This used to be commit 697b67ed572a458494fbf9172a341f6b621c84a3)
2007-10-10r8192: updated the glue code for the generated ejs functions from pidlAndrew Tridgell5-30/+155
only handles a small subset of all IDL files so far (This used to be commit 14b6436cc51f599572932bef72c49e0da4888073)
2007-10-10r8114: fixed the build after tpots ejs commit ....Andrew Tridgell1-0/+11
(This used to be commit 8649945cf9932a169190727f99e352ad68b0589f)
2007-10-10r8105: Add ejsrpc push/pull functions for uint16 and uint8.Tim Potter2-12/+55
(This used to be commit ee27943e215126a2048d1082437ef2597d913371)
2007-10-10r8073: a successful rpc call from ejs!Andrew Tridgell6-13/+292
the ejs_echo.c code is the stuff that needs to be auto-generated by pidl. It only does echo_AddOne so far. We also need a table for registering these calls. The code is hard-wired for echo_AddOne for now. (This used to be commit b1ea58ddc482c373783d16331dd07378010ba39a)