Revision c7da5329 vncauthproxy/passwd.py

b/vncauthproxy/passwd.py
83 83
def write_wrapper(passwdfile, lines, dry_run):
84 84
    """ Dry-run wrapper for write. """
85 85
    if not dry_run:
86
        (fd, name) = tempfile.mkstemp()
86
        (fd, fpath) = tempfile.mkstemp(dir=os.path.dirname(passwdfile))
87 87
        with os.fdopen(fd, "w+") as f:
88 88
            f.write("".join(lines))
89
        os.rename(name, passwdfile)
89
        os.rename(fpath, passwdfile)
90 90
    else:
91 91
        sys.stderr.write("".join(lines))
92 92

  

Also available in: Unified diff