summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Potter <tpot@samba.org>2005-04-13 05:57:51 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:11:31 -0500
commit602be3fd493984bd85ddc6b2e1c98cd699bdd2a3 (patch)
tree84dccef11fcb6cbef94d8fa69ba909388d70454d
parent63ddff3d7b59fef8c8f2340803b85cde33a49402 (diff)
downloadsamba-602be3fd493984bd85ddc6b2e1c98cd699bdd2a3.tar.gz
samba-602be3fd493984bd85ddc6b2e1c98cd699bdd2a3.tar.bz2
samba-602be3fd493984bd85ddc6b2e1c98cd699bdd2a3.zip
r6324: Pass server name instead of binding string on command line (always use
ncacn_np for the moment). Fix rpcclient to work with struct cli_credentials. (This used to be commit 162d3609a1f46683151d201a5404d0456d76b726)
-rwxr-xr-xsource4/scripting/swig/rpcclient41
1 files changed, 19 insertions, 22 deletions
diff --git a/source4/scripting/swig/rpcclient b/source4/scripting/swig/rpcclient
index 8f33a6133b..faf5b3ec09 100755
--- a/source4/scripting/swig/rpcclient
+++ b/source4/scripting/swig/rpcclient
@@ -28,9 +28,9 @@ class rpcclient(Cmd):
prompt = 'rpcclient$ '
- def __init__(self, binding, domain, username, password):
+ def __init__(self, server, domain, username, password):
Cmd.__init__(self)
- self.binding = binding
+ self.server = server
self.domain = domain
self.username = username
self.password = password
@@ -83,9 +83,9 @@ class rpcclient(Cmd):
return
pipe = dcerpc.pipe_connect(
- self.binding,
+ 'ncacn_np:%s' % self.server,
dcerpc.DCERPC_SAMR_UUID, int(dcerpc.DCERPC_SAMR_VERSION),
- self.domain, self.username, self.password)
+ (self.domain, self.username, self.password))
connect_handle = samr.Connect(pipe)
@@ -105,9 +105,9 @@ class rpcclient(Cmd):
return
pipe = dcerpc.pipe_connect(
- self.binding,
+ 'ncacn_np:%s' % self.server,
dcerpc.DCERPC_SAMR_UUID, int(dcerpc.DCERPC_SAMR_VERSION),
- self.domain, self.username, self.password)
+ (self.domain, self.username, self.password))
connect_handle = samr.Connect(pipe)
@@ -126,9 +126,9 @@ class rpcclient(Cmd):
return
pipe = dcerpc.pipe_connect(
- self.binding,
+ 'ncacn_np:%s' % self.server,
dcerpc.DCERPC_SAMR_UUID, int(dcerpc.DCERPC_SAMR_VERSION),
- self.domain, self.username, self.password)
+ (self.domain, self.username, self.password))
connect_handle = samr.Connect(pipe)
domain_handle = connect_handle.OpenDomain(args[0])
@@ -153,9 +153,9 @@ class rpcclient(Cmd):
return
pipe = dcerpc.pipe_connect(
- self.binding,
+ 'ncacn_np:%s' % self.server,
dcerpc.DCERPC_SAMR_UUID, int(dcerpc.DCERPC_SAMR_VERSION),
- self.domain, self.username, self.password)
+ (self.domain, self.username, self.password))
connect_handle = samr.Connect(pipe)
domain_handle = connect_handle.OpenDomain(args[0])
@@ -180,9 +180,9 @@ class rpcclient(Cmd):
return
pipe = dcerpc.pipe_connect(
- self.binding,
+ 'ncacn_np:%s' % self.server,
dcerpc.DCERPC_SAMR_UUID, int(dcerpc.DCERPC_SAMR_VERSION),
- self.domain, self.username, self.password)
+ (self.domain, self.username, self.password))
connect_handle = samr.Connect(pipe)
domain_handle = connect_handle.OpenDomain(args[0])
@@ -205,9 +205,9 @@ class rpcclient(Cmd):
return
pipe = dcerpc.pipe_connect(
- self.binding,
+ 'ncacn_np:%s' % self.server,
dcerpc.DCERPC_SAMR_UUID, int(dcerpc.DCERPC_SAMR_VERSION),
- self.domain, self.username, self.password)
+ (self.domain, self.username, self.password))
connect_handle = samr.Connect(pipe)
domain_handle = connect_handle.OpenDomain(args[0])
@@ -229,9 +229,9 @@ class rpcclient(Cmd):
return
pipe = dcerpc.pipe_connect(
- self.binding,
+ 'ncacn_np:%s' % self.server,
dcerpc.DCERPC_SAMR_UUID, int(dcerpc.DCERPC_SAMR_VERSION),
- self.domain, self.username, self.password)
+ (self.domain, self.username, self.password))
connect_handle = samr.Connect(pipe)
domain_handle = connect_handle.OpenDomain(args[0])
@@ -247,18 +247,15 @@ if __name__ == '__main__':
# Parse command line
- usage = 'rpcclient BINDING [options]'
+ usage = 'rpcclient SERVER [options]'
if len(sys.argv) == 1:
print usage
sys.exit(1)
- binding = sys.argv[1]
+ server = sys.argv[1]
del(sys.argv[1])
- if string.find(binding, ':') == -1:
- binding = 'ncacn_np:' + binding
-
parser = OptionParser(usage)
parser.add_option('-U', '--username', action='store', type='string',
@@ -288,7 +285,7 @@ if __name__ == '__main__':
# Run command loop
- c = rpcclient(binding, domain, username, password)
+ c = rpcclient(server, domain, username, password)
if options.command:
c.onecmd(options.command)