[SCM] Samba Shared Repository - branch master updated

Matthieu Patou mat at samba.org
Sun Apr 17 05:13:01 MDT 2011


The branch, master has been updated
       via  7cc02cf samba-tool: fix machinepw command so that we use the full path to the secret database and raise an error if secret can't be found
      from  0bf7c96 s3: Use 

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 7cc02cf870aa6301c55a78cff630d46d86abf434
Author: Matthieu Patou <mat at matws.net>
Date:   Sun Apr 17 14:15:40 2011 +0400

    samba-tool: fix machinepw command so that we use the full path to the secret database and raise an error if secret can't be found
    
    Autobuild-User: Matthieu Patou <mat at samba.org>
    Autobuild-Date: Sun Apr 17 13:12:27 CEST 2011 on sn-devel-104

-----------------------------------------------------------------------

Summary of changes:
 source4/scripting/python/samba/netcmd/machinepw.py |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source4/scripting/python/samba/netcmd/machinepw.py b/source4/scripting/python/samba/netcmd/machinepw.py
index d822b22..75338d9 100644
--- a/source4/scripting/python/samba/netcmd/machinepw.py
+++ b/source4/scripting/python/samba/netcmd/machinepw.py
@@ -18,7 +18,7 @@
 #
 
 import samba.getopt as options
-
+import os
 from samba import Ldb
 from samba.auth import system_session
 from samba.netcmd import Command, CommandError
@@ -40,10 +40,13 @@ class cmd_machinepw(Command):
     def run(self, secret, sambaopts=None, credopts=None, versionopts=None):
         lp = sambaopts.get_loadparm()
         creds = credopts.get_credentials(lp, fallback_machine=True)
-        url = lp.get("secrets database")
+        name = lp.get("secrets database")
+        path = lp.get("private dir")
+        url = os.path.join(path, name)
+        if not os.path.exists(url):
+            raise CommandError("secret database not found at %s " % url)
         secretsdb = Ldb(url=url, session_info=system_session(),
             credentials=creds, lp=lp)
-        
         result = secretsdb.search(attrs=["secret"], 
             expression="(&(objectclass=primaryDomain)(samaccountname=%s))" % secret)
 


-- 
Samba Shared Repository


More information about the samba-cvs mailing list