mirror of
https://github.com/samba-team/samba.git
synced 2025-01-27 14:04:05 +03:00
s4-dns: added --no-credentials option to samba_dnsupdate
this is for a user who is doing DNS updates via key files rather than GSSAPI. This allows the update to go through without a kerberos error Autobuild-User: Andrew Tridgell <tridge@samba.org> Autobuild-Date: Tue Nov 22 06:34:59 CET 2011 on sn-devel-104
This commit is contained in:
parent
3e6e1aed94
commit
b16f539e0e
@ -63,6 +63,7 @@ parser.add_option("--all-interfaces", action="store_true")
|
|||||||
parser.add_option("--use-file", type="string", help="Use a file, rather than real DNS calls")
|
parser.add_option("--use-file", type="string", help="Use a file, rather than real DNS calls")
|
||||||
parser.add_option("--update-list", type="string", help="Add DNS names from the given file")
|
parser.add_option("--update-list", type="string", help="Add DNS names from the given file")
|
||||||
parser.add_option("--fail-immediately", action='store_true', help="Exit on first failure")
|
parser.add_option("--fail-immediately", action='store_true', help="Exit on first failure")
|
||||||
|
parser.add_option("--no-credentials", dest='nocreds', action='store_true', help="don't try and get credentials")
|
||||||
|
|
||||||
creds = None
|
creds = None
|
||||||
ccachename = None
|
ccachename = None
|
||||||
@ -308,11 +309,16 @@ def call_nsupdate(d):
|
|||||||
f.close()
|
f.close()
|
||||||
|
|
||||||
global error_count
|
global error_count
|
||||||
os.environ["KRB5CCNAME"] = ccachename
|
if ccachename:
|
||||||
|
os.environ["KRB5CCNAME"] = ccachename
|
||||||
try:
|
try:
|
||||||
cmd = nsupdate_cmd[:]
|
cmd = nsupdate_cmd[:]
|
||||||
cmd.append(tmpfile)
|
cmd.append(tmpfile)
|
||||||
ret = subprocess.call(cmd, shell=False, env={"KRB5CCNAME": ccachename})
|
if ccachename:
|
||||||
|
env = {"KRB5CCNAME": ccachename}
|
||||||
|
else:
|
||||||
|
env = {}
|
||||||
|
ret = subprocess.call(cmd, shell=False, env=env)
|
||||||
if ret != 0:
|
if ret != 0:
|
||||||
if opts.fail_immediately:
|
if opts.fail_immediately:
|
||||||
if opts.verbose:
|
if opts.verbose:
|
||||||
@ -471,7 +477,8 @@ if len(update_list) == 0:
|
|||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
|
|
||||||
# get our krb5 creds
|
# get our krb5 creds
|
||||||
get_credentials(lp)
|
if not opts.nocreds:
|
||||||
|
get_credentials(lp)
|
||||||
|
|
||||||
# ask nsupdate to add entries as needed
|
# ask nsupdate to add entries as needed
|
||||||
for d in update_list:
|
for d in update_list:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user