-#!/usr/bin/env python
+#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# This is unit with tests for LDAP access checks
-#!/usr/bin/env python
+#!/usr/bin/env python3
#
# Sample run-on-target script
-#!/usr/bin/env python
+#!/usr/bin/env python3
"""
ntlogon.py written by Timothy (rhacer) Grant
-#!/usr/bin/env python
+#!/usr/bin/env python3
# script to test the dnsserver RPC protocol
-#!/usr/bin/env python
+#!/usr/bin/env python3
# Unix SMB/CIFS implementation.
# Copyright (C) Jelmer Vernooij <jelmer@samba.org> 2008
-#!/usr/bin/env python
+#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Unix SMB/CIFS implementation.
-#!/usr/bin/env python
+#!/usr/bin/env python3
#
# tool to manipulate a remote registry
# Copyright Andrew Tridgell 2005
-#!/usr/bin/env python
+#!/usr/bin/env python3
# Unix SMB/CIFS implementation.
# Copyright (C) Stefan Metzmacher 2014,2015
#
-#!/usr/bin/env python
+#!/usr/bin/env python3
# Simple subunit testrunner for python
-#!/usr/bin/env python
+#!/usr/bin/env python3
# Filter a subunit stream
# Copyright (C) 2009-2011 Jelmer Vernooij <jelmer@samba.org>
-#!/usr/bin/env python
+#!/usr/bin/env python3
# vim: expandtab
# Pretty-format subunit output
# Copyright (C) 2008-2010 Jelmer Vernooij <jelmer@samba.org>
-#!/usr/bin/env python
+#!/usr/bin/env python3
# Copyright (C) 2008-2010 Jelmer Vernooij <jelmer@samba.org>
# Copyright (C) 2016 Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
# Published under the GNU GPL, v3 or later
-#!/usr/bin/env python
+#!/usr/bin/env python3
from __future__ import print_function
import sys
import os
import subprocess
-from samba.compat import PY3
+from samba.compat import get_string
if len(sys.argv) != 3:
NOTE: subprocess api always return bytes, in both py2 and py3.
"""
output = subprocess.check_output(cmd).strip()
- return output.decode('utf-8') if PY3 else output
+ return get_string(output)
def flush_cache(sids=[], uids=[], gids=[]):
-#!/usr/bin/env python
+#!/usr/bin/env python3
# Unix SMB/CIFS implementation.
# A test for the ntlm_auth tool