public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: "Gerald S. Williams" <gsw@agere.com>
To: <cygwin@cygwin.com>
Subject: RE: Finding your SID (was Re: problem starting inetd as NT service)
Date: Thu, 09 May 2002 15:43:00 -0000	[thread overview]
Message-ID: <GBEGLOMMCLDACBPKDIHFIEDDCIAA.gsw@agere.com> (raw)
In-Reply-To: <20020509151548.GI1236@tishler.net>

Problem solved.

I thought that I was able to contact the domain controller,
since I was able to change my domain password successfully
and do other sorts of things that required me to login.
However, apparently this was something other than the PDC
or BDC. Or at least I was in a situation where I wasn't
"trusted" enough to contact them via mkpasswd. Thinking it
was the latter, I even tried hacking mkpasswd to use the
appropriate Active Directory calls, to no avail.

But today, after finding someone that could use mkpasswd,
I simply copied his WINS settings and now it works for
me, too. Doh!

Thanks for the help,

-Jerry Williams

P.S. I don't know if anyone's interested in this, but here's
my previous Python script updated to provide more correct
results:
-----
#!/usr/bin/echo THIS_IS_ONLY_FOR_WINDOWS_PYTHON

from _winreg import *
from os import environ

class User:
    def __init__(self,masterkey,sid):
        self.sid = sid
        userkey = OpenKey(masterkey,sid)
        self.data = {}
        for valueno in range(QueryInfoKey(userkey)[1]):
            (name,data,type) = EnumValue(userkey,valueno)
            self.data[name] = data
        userkey.Close()
        profilePath = self.data['ProfileImagePath'].split("%")
        for i in range(1,len(profilePath),2):
            profilePath[i] = environ[profilePath[i]]
        self.profilePath = "".join(profilePath)

users = []

masterkey = OpenKey(HKEY_LOCAL_MACHINE,"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\ProfileList")
for userno in range(QueryInfoKey(masterkey)[0]):
    users.append(User(masterkey,EnumKey(masterkey,userno)))
masterkey.Close()

profilePath = environ["USERPROFILE"]
userName = environ["USERNAME"]
userDomain = environ["USERDOMAIN"]

# Offset of 10000 is for domain users. Use 0 for local users.
offset = 10000

for user in users:
    if user.profilePath == profilePath:
        # Group 513/10513 is for all users.
        # This assumes you want your home directory in /home/userName
        print ":".join([userName, \
                        "unused_by_nt/2000/xp", \
                        str(int(user.sid.split("-")[-1])+offset),
                        str(513+offset), \
                        "U-" + userDomain + "\\" + userName + "," + user.sid, \
                        "/home/" + userName, \
                        "/bin/bash"])


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

  reply	other threads:[~2002-05-09 22:23 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-05-08  4:43 problem starting inetd as NT service Mellman Thomas
2002-05-08  7:37 ` Larry Hall (RFK Partners, Inc)
2002-05-08 13:25   ` Finding your SID (was Re: problem starting inetd as NT service) Jason Tishler
2002-05-09  4:29     ` Gerald S. Williams
2002-05-09  6:05       ` Jason Tishler
2002-05-09  7:51         ` Gerald S. Williams
2002-05-09  8:12           ` Jason Tishler
2002-05-09 15:43             ` Gerald S. Williams [this message]
2002-05-20  9:55               ` Jason Tishler
2002-05-30  9:10                 ` Jason Tishler

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=GBEGLOMMCLDACBPKDIHFIEDDCIAA.gsw@agere.com \
    --to=gsw@agere.com \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).