FAQ

On 2013/04/17 16:50:09, snaury wrote:

..., if machine is part of a domain doesn't
really tell us anything: logged in user might be a local user on a
home network,
and the problem would be the same, trying to query domain controller when
there's none.

What about using NetGetJoinInformation
(http://play.golang.org/p/bFA02H1cwE)? The function will help us to
determine, if computer is part of a domain. And will tell us what the
domain name is, if PC is part of a domain.

Here is our logic:

if !PC_is_part_of_a_domain {
// PC is not part of domain
lookup_account_localy()
return
}
if PC_domain_name != USER_LOGIN_domain_name {
// PC is part of domain, but user is logged in locally
lookup_account_localy()
return
}
lookup_account_in_domain()
return

Perhaps, lookup_account_in_domain could still be slow, if user is logged
in without domain controller present. But, I believe, nothing we could
do about that - that case is undetectable. Also, since user is logged in
with some "cached credentials", perhaps our calls won't be slow after
all. Perhaps, they will use some "cached" information instead of looking
for domain controllers.

Alex

https://codereview.appspot.com/8541047/

--

---
You received this message because you are subscribed to the Google Groups "golang-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

  • Snaury at Apr 18, 2013 at 4:13 am

    On 2013/04/18 01:51:56, brainman wrote:
    What about using NetGetJoinInformation
    Oh! It's actually very interesting!
    if PC_domain_name != USER_LOGIN_domain_name {
    // PC is part of domain, but user is logged in locally
    lookup_account_localy()
    return
    }
    It is possible to have multiple domains on the network. Such a check
    would work for user.Current(), but would not return correct data for
    user.Lookup("OTHERDOMAIN\\username").

    Maybe we don't even have to compare any strings, but use a much simpler
    logic based on BufferType: always use lookup_account_in_domain first if
    BufferType==NetSetupDomainName, and never otherwise. What do you think?

    https://codereview.appspot.com/8541047/

    --

    ---
    You received this message because you are subscribed to the Google Groups "golang-dev" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-dev+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Lucio De Re at Apr 18, 2013 at 4:20 am
    Out of curiosity from somebody who seldom uses Windows, what goes
    wrong if one does an unconditional "local lookup" and the host is part
    of a domain?

    Lucio.
    On 4/18/13, snaury@gmail.com wrote:
    On 2013/04/18 01:51:56, brainman wrote:
    What about using NetGetJoinInformation
    Oh! It's actually very interesting!
    if PC_domain_name != USER_LOGIN_domain_name {
    // PC is part of domain, but user is logged in locally
    lookup_account_localy()
    return
    }
    It is possible to have multiple domains on the network. Such a check
    would work for user.Current(), but would not return correct data for
    user.Lookup("OTHERDOMAIN\\username").

    Maybe we don't even have to compare any strings, but use a much simpler
    logic based on BufferType: always use lookup_account_in_domain first if
    BufferType==NetSetupDomainName, and never otherwise. What do you think?

    https://codereview.appspot.com/8541047/

    --

    ---
    You received this message because you are subscribed to the Google Groups
    "golang-dev" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to golang-dev+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.

    --

    ---
    You received this message because you are subscribed to the Google Groups "golang-dev" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-dev+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Alex Brainman at Apr 18, 2013 at 4:43 am

    On 2013/04/18 04:13:41, snaury wrote:

    Maybe we don't even have to compare any strings, but use a much
    simpler logic
    based on BufferType: always use lookup_account_in_domain first if
    BufferType==NetSetupDomainName, and never otherwise. What do you
    think?

    SGTM. But, I think we'll be chasing our tail again year from now :-)

    Alex

    https://codereview.appspot.com/8541047/

    --

    ---
    You received this message because you are subscribed to the Google Groups "golang-dev" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-dev+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Alex Brainman at Apr 18, 2013 at 4:47 am

    On 2013/04/18 04:20:19, lucio wrote:
    ... what goes
    wrong if one does an unconditional "local lookup" and the host is part
    of a domain?
    The api fails. Please, do not ask me why, because I do not know? :-)

    Alex

    https://codereview.appspot.com/8541047/

    --

    ---
    You received this message because you are subscribed to the Google Groups "golang-dev" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-dev+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Lucio De Re at Apr 18, 2013 at 4:52 am

    On 4/18/13, alex.brainman@gmail.com wrote:
    On 2013/04/18 04:20:19, lucio wrote:
    ... what goes
    wrong if one does an unconditional "local lookup" and the host is part
    of a domain?
    The api fails. Please, do not ask me why, because I do not know? :-)
    If that is a quick response, is it not sufficient indication that a
    subsequent lookup in the domain is going to be quick? That would
    address the original problem, would it not?

    Or does everything fall apart instead?

    Lucio.

    --

    ---
    You received this message because you are subscribed to the Google Groups "golang-dev" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-dev+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Alex Brainman at Apr 18, 2013 at 5:05 am

    On 2013/04/18 04:52:18, lucio wrote:
    If that is a quick response, ...
    It is slow on my computer.

    Alex

    https://codereview.appspot.com/8541047/

    --

    ---
    You received this message because you are subscribed to the Google Groups "golang-dev" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-dev+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Lucio De Re at Apr 18, 2013 at 5:42 am
    The I guess it does precisely what snaury is trying to do and, in all
    likelyhood, there isn't a better way. But that's just speculation.

    Lucio.
    On 4/18/13, alex.brainman@gmail.com wrote:
    On 2013/04/18 04:52:18, lucio wrote:

    If that is a quick response, ...
    It is slow on my computer.

    Alex

    https://codereview.appspot.com/8541047/
    --

    ---
    You received this message because you are subscribed to the Google Groups "golang-dev" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-dev+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-dev @
categoriesgo
postedApr 18, '13 at 1:51a
activeApr 18, '13 at 5:42a
posts8
users3
websitegolang.org

People

Translate

site design / logo © 2022 Grokbase