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

66 Commits

Author SHA1 Message Date
Andrew Tridgell
1c170138a8 r8280: - added irpc_connect() for connecting to a irpc server by name
- 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)
2007-10-10 13:19:30 -05:00
Andrew Tridgell
9c885a7edb r8276: fixed the remaining memory leaks in smbscript. We can now loop doing
lots of rpc calls without memory usage increasing.
2007-10-10 13:19:30 -05:00
Andrew Tridgell
b220756cb4 r8273: fixed some memory leaks in smbscript. This required converting
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
2007-10-10 13:19:29 -05:00
Andrew Tridgell
595304708d r8262: - simplify the dependency handling for ejs modules
- added config.mk entries for some more pipes

- simplify the handling of ejs variables in the pidl code
2007-10-10 13:19:27 -05:00
Andrew Tridgell
0e54fa4466 r8260: added an init based registration system for the generated ejs rpc code, so
adding a new pipe only involves changes to librpc/config.mk
2007-10-10 13:19:27 -05:00
Andrew Tridgell
12d2092dd8 r8256: - allow rpc calls from non-command line ejs contexts by creating a set
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
2007-10-10 13:19:26 -05:00
Andrew Tridgell
ad1a4802d0 r8254: fixed a valgrind error in the unix auth code 2007-10-10 13:19:26 -05:00
Andrew Tridgell
9398b02e4b r8238: - fixed handling of NULL pointers from ejs
- added automatic creation of all constants in IDL as ejs variables
2007-10-10 13:19:23 -05:00
Andrew Tridgell
cbe5289ac9 r8236: fixed support for arrays of structures 2007-10-10 13:19:23 -05:00
Andrew Tridgell
a8cb2dbdcc r8233: - added support for more base types in pidl ejs
- 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
2007-10-10 13:19:23 -05:00
Andrew Tridgell
e1cfc6d032 r8230: prevent authentication dying on a NULL domain 2007-10-10 13:19:22 -05:00
Andrew Tridgell
a61cdee384 r8220: added auto-generation of ENUM constants in ejs wrapper. So we can now use the enum name
instead of a integer in ejs scripts making rpc calls
2007-10-10 13:19:21 -05:00
Andrew Tridgell
f3ff48204c r8216: - handle union pull in ejs pidl generation
- added debugging calls for missing structure/union elements
2007-10-10 13:19:20 -05:00
Andrew Tridgell
49fc14d132 r8215: switched the pull side of the ejs generator over to the recursive LEVELS based approach.
This allows for much more complex structure mappings to be generated.
2007-10-10 13:19:20 -05:00
Andrew Tridgell
2e306be1d8 r8213: I've started to understand the LEVELS stuff in pidl much better now,
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.
2007-10-10 13:19:20 -05:00
Andrew Tridgell
5f062d7148 r8200: - added stub functions for union pull/push
- kill the js interpreter with an exception on internal errors
2007-10-10 13:19:19 -05:00
Andrew Tridgell
a77c2aa860 r8198: - handled push/pull of simple strings in ejs
- 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
2007-10-10 13:19:19 -05:00
Andrew Tridgell
431b4b6888 r8195: - fixed handling of simple arrays. To keep the logic simple, I moved 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
2007-10-10 13:19:18 -05:00
Andrew Tridgell
697b67ed57 r8194: delete the old hand-written ejs code for echo_AddOne. This is now
autogenerated by pidl
2007-10-10 13:19:18 -05:00
Andrew Tridgell
14b6436cc5 r8192: updated the glue code for the generated ejs functions from pidl
only handles a small subset of all IDL files so far
2007-10-10 13:19:18 -05:00
Andrew Tridgell
8649945cf9 r8114: fixed the build after tpots ejs commit .... 2007-10-10 13:19:10 -05:00
Tim Potter
ee27943e21 r8105: Add ejsrpc push/pull functions for uint16 and uint8. 2007-10-10 13:19:08 -05:00
Andrew Tridgell
b1ea58ddc4 r8073: a successful rpc call from ejs!
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.
2007-10-10 13:19:05 -05:00
Andrew Tridgell
a782541db3 r8069: the beginnings of code to allow rpc calls to be made from ejs
tpot, note that this shows how you can modify passed in MprVar
variables in C call
2007-10-10 13:19:04 -05:00
Tim Potter
696aa182d5 r7928: Add rename, unlink and list commands.
list() returns a list of strings, but maybe it should be a list of
objects with size, attrib, short name etc.
2007-10-10 13:18:51 -05:00
Tim Potter
043feb131f r7924: Add mkdir() and rmdir() functions.
Write a macro to check tree handle parameters.
2007-10-10 13:18:51 -05:00
Tim Potter
9ed763f7fa r7922: Comment out complicated connect/session/tree API for the moment. Replace
with tree_connect() and tree_disconnect() functions.
2007-10-10 13:18:50 -05:00
Andrew Tridgell
3a3025485b r7633: this patch started as an attempt to make the dcerpc code use a given
event_context for the socket_connect() call, so that when things that
use dcerpc are running alongside anything else it doesn't block the
whole process during a connect.

Then of course I needed to change any code that created a dcerpc
connection (such as the auth code) to also take an event context, and
anything that called that and so on .... thus the size of the patch.

There were 3 places where I punted:

  - abartlet wanted me to add a gensec_set_event_context() call
    instead of adding it to the gensec init calls. Andrew, my
    apologies for not doing this. I didn't do it as adding a new
    parameter allowed me to catch all the callers with the
    compiler. Now that its done, we could go back and use
    gensec_set_event_context()

  - the ejs code calls auth initialisation, which means it should pass
    in the event context from the web server. I punted on that. Needs fixing.

  - I used a NULL event context in dcom_get_pipe(). This is equivalent
    to what we did already, but should be fixed to use a callers event
    context. Jelmer, can you think of a clean way to do that?

I also cleaned up a couple of things:

 - libnet_context_destroy() makes no sense. I removed it.

 - removed some unused vars in various places
2007-10-10 13:18:15 -05:00
Tim Potter
63577628b0 r7570: Add tree, session and socket disconnect ejs functions. 2007-10-10 13:18:10 -05:00
Andrew Bartlett
990e061939 r7530: Simply calling convention of lp_load().
This always loads all the services, as we now don't have an easy way
to split out smbd.

Andrew Bartlett
2007-10-10 13:18:07 -05:00
Tim Potter
5b67f2c3d9 r7505: Add more argument forms for session_setup().
Throw an exception if tree connect fails.
2007-10-10 13:18:01 -05:00
Tim Potter
3b7df1037d r7501: Fix credential initialisation in ejs session setup. Implement four
arg and anonymous version of command.

Implement ejs tconx.
2007-10-10 13:18:01 -05:00
Tim Potter
564dfe14d0 r7500: Initialise module subsystems. 2007-10-10 13:18:01 -05:00
Tim Potter
8574f64ca2 r7477: Add MPR_TYPE_PTR to ejs_typeof(). 2007-10-10 13:17:57 -05:00
Andrew Tridgell
30e876e9c2 r7461: this is the start of some code for mapping IDL onto ejs. This is hand
written code, and it doesn't work or even compile yet. I am committing
it to make it easier to discuss the approach with jelmer and tpot.

The intention is that this code will eventually end up being mostly
auto-generated (with the utility functions split out, just like
librpc/ndr/*.c)
2007-10-10 13:17:55 -05:00
Tim Potter
832332de5d r7457: Return an ejs C pointer object from the ejs connect() function.
Add a session_setup() function that does an anonymous session setup.  Will
add credential passing later.
2007-10-10 13:17:55 -05:00
Tim Potter
a55e40651d r7422: Create a ejs object to wrap a smbcli_transport pointer. 2007-10-10 13:17:51 -05:00
Tim Potter
8062e808ef r7351: Start of ejs smb client library. I need to figure out a nice API here
that doesn't expose too much of the cifs protocol but still allows
people to do neat things.

Also, talloc lifetimes need to be thought about properly.
2007-10-10 13:17:45 -05:00
Tim Potter
ada0045957 r7350: Remove unused label. 2007-10-10 13:17:45 -05:00
Simo Sorce
ddd7454cb3 r7268: allocate the strings to avoid them disappearing under our feet 2007-10-10 13:17:34 -05:00
Simo Sorce
41bae267e2 r7267: REMOTE_HOST is a better choice 2007-10-10 13:17:34 -05:00
Tim Potter
b086768589 r7266: Split the different types of js function defines into separate files,
as there are going to be a lot more of them.
2007-10-10 13:17:34 -05:00
Tim Potter
c77a232b11 r7263: Exit smbscript with the intepreter return value (defaults to 0).
Change the exit value for an exception, usage error and other non-js
errors to 127 which is kinda like the return value for the system(3)
function.
2007-10-10 13:17:33 -05:00
Tim Potter
4b775c619b r7262: Add a length property to ARGV array. 2007-10-10 13:17:33 -05:00
Tim Potter
1a4a549317 r7261: Pass by reference is done in js via MPR_TYPE_OBJECT. Update argument
parsing and example for resolveName().
2007-10-10 13:17:33 -05:00
Tim Potter
aef99859f2 r7255: Change syntax of resolveName() js function to be more like the
resolve_name() C function.  I can't figure out how to return variables
by reference though.  Writing to argv[] doesn't seem to work.
2007-10-10 13:17:32 -05:00
Tim Potter
2fa6f7bb2b r7254: Add a mprWERROR() function with the same attributes as mprNTSTATUS. 2007-10-10 13:17:32 -05:00
Simo Sorce
8a98572a3b r7238: Add pam auth support in swat 2007-10-10 13:17:30 -05:00
Tim Potter
d81d5f8317 r7225: Create a MprVar object from a NTSTATUS, e.g:
res: {
  is_err: true,
  is_ok: false,
  errstr: "NT_STATUS_IO_TIMEOUT",
  v: -1073741643
}
2007-10-10 13:17:28 -05:00
Tim Potter
31b9fadbed r7223: Advance script past interpreter line. 2007-10-10 13:17:27 -05:00