Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

The world is coming to an end ... SAVE YOUR BUFFERS!!!


devel / comp.lang.python / Re: [Solved] Re: Windows registry PermissionError

SubjectAuthor
o Re: [Solved] Re: Windows registry PermissionErrorMike Dewhirst

1
Re: [Solved] Re: Windows registry PermissionError

<mailman.397.1652425219.20749.python-list@python.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=18258&group=comp.lang.python#18258

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!news.szaf.org!fu-berlin.de!uni-berlin.de!not-for-mail
From: mik...@dewhirst.com.au (Mike Dewhirst)
Newsgroups: comp.lang.python
Subject: Re: [Solved] Re: Windows registry PermissionError
Date: Fri, 13 May 2022 17:00:00 +1000
Lines: 77
Message-ID: <mailman.397.1652425219.20749.python-list@python.org>
References: <84e2a35c-3882-aaf5-a0a6-3efefc1ceb8d@dewhirst.com.au>
<CACL+1asQGepD+Lw7w9W-jiFUNYWLqRvZJ0uEufT5Ow1siJvJTg@mail.gmail.com>
<2e535898-3aaf-8904-017e-901acc88e8ad@dewhirst.com.au>
<CACL+1at=z_ni9CRqKi6CpHM7t9-zJ8Zgu=qTxt-wvbOU7W6sgQ@mail.gmail.com>
<678a8c64-4d6f-e96f-c890-5b429548d036@dewhirst.com.au>
<CACL+1au=bcMT0bVwjwNapZ4-ADL5-HgHAnd4qVeAu83vyxQYCw@mail.gmail.com>
<a183ed3b-e8bc-22e1-55a3-414263d25f41@dewhirst.com.au>
Mime-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha256;
protocol="application/pgp-signature";
boundary="------------uJk9y0bBZBWXIDAprow9R070"
X-Trace: news.uni-berlin.de LORMMsaAGfebW9NMFsf4mQIpuzqIS26essCuuqlsUFjg==
Return-Path: <miked@dewhirst.com.au>
X-Original-To: python-list@python.org
Delivered-To: python-list@mail.python.org
Authentication-Results: mail.python.org; dkim=none reason="no signature";
dkim-adsp=none (unprotected policy); dkim-atps=neutral
X-Spam-Status: OK 0.001
X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'looks': 0.02; 'absolute':
0.05; 'content-type:multipart/signed': 0.05; 'parameter': 0.05;
'demands': 0.07; 'string': 0.07; 'subject:Windows': 0.07; 'cc:addr
:python-list': 0.09; 'content-type:application/pgp-signature':
0.09; 'machines,': 0.09; 'subject:skip:P 10': 0.09; 'user.': 0.09;
'cc:no real name:2**0': 0.14; 'import': 0.15; 'that.': 0.15;
'"current': 0.16; 'accessed': 0.16; 'bulk': 0.16; 'decrypt': 0.16;
'domain.': 0.16; 'eryk': 0.16; 'from:addr:dewhirst.com.au': 0.16;
'from:addr:miked': 0.16; 'from:name:mike dewhirst': 0.16; 'key.':
0.16; 'logs': 0.16; 'machine.': 0.16; 'phishing.': 0.16;
'received:webmastery.com.au': 0.16; 'supported.': 0.16;
'targeting': 0.16; 'whichever': 0.16; 'wrote:': 0.16; 'api': 0.17;
'probably': 0.17; 'pm,': 0.19; 'cc:addr:python.org': 0.20; 'all,':
0.20; 'subject:: [': 0.21; 'subject:] ': 0.21; 'machine': 0.22;
'code': 0.23; 'lines': 0.23; 'cc:2**0': 0.25; "isn't": 0.27;
'done': 0.28; '>>>': 0.28; 'header:User-Agent:1': 0.30; 'assume':
0.32; 'execution': 0.32; 'unless': 0.32; "i'm": 0.33; "i'll":
0.33; 'received:192.168.0': 0.33; 'script': 0.33; 'skip:" 20':
0.34; 'header:In-Reply-To:1': 0.34; 'running': 0.34;
'received:au': 0.35; 'following': 0.35; 'using': 0.37; "it's":
0.37; 'received:192.168': 0.37; 'handle': 0.39; 'should': 0.40;
'reference': 0.60; 'services': 0.61; 'initial': 0.61; 'skip:h 10':
0.61; 'me.': 0.62; 'remote': 0.63; 'ever': 0.63; 'email': 0.63;
'send': 0.63; 'public': 0.63; 'key': 0.64; 'research': 0.64;
'skip:r 20': 0.64; 'service': 0.64; 'in.': 0.64; 'lock': 0.64;
'your': 0.64; 'came': 0.65; 'well': 0.65; 'content-
type:multipart/mixed': 0.68; 'items': 0.68; 'you.': 0.71;
'private': 0.73; 'bear': 0.76; 'documented': 0.76; 'signature':
0.76; '4:37': 0.84; 'literally': 0.84; 'received:103': 0.91
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.9.0
Content-Language: en-US
In-Reply-To: <CACL+1au=bcMT0bVwjwNapZ4-ADL5-HgHAnd4qVeAu83vyxQYCw@mail.gmail.com>
X-PPP-Message-ID: <20220513070009.4576.1753@plesk01.e1.webmastery.com.au>
X-PPP-Vhost: chemintro.com
X-Content-Filtered-By: Mailman/MimeDel 2.1.39
X-BeenThere: python-list@python.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: General discussion list for the Python programming language
<python-list.python.org>
List-Unsubscribe: <https://mail.python.org/mailman/options/python-list>,
<mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive: <https://mail.python.org/pipermail/python-list/>
List-Post: <mailto:python-list@python.org>
List-Help: <mailto:python-list-request@python.org?subject=help>
List-Subscribe: <https://mail.python.org/mailman/listinfo/python-list>,
<mailto:python-list-request@python.org?subject=subscribe>
X-Mailman-Original-Message-ID: <a183ed3b-e8bc-22e1-55a3-414263d25f41@dewhirst.com.au>
X-Mailman-Original-References: <84e2a35c-3882-aaf5-a0a6-3efefc1ceb8d@dewhirst.com.au>
<CACL+1asQGepD+Lw7w9W-jiFUNYWLqRvZJ0uEufT5Ow1siJvJTg@mail.gmail.com>
<2e535898-3aaf-8904-017e-901acc88e8ad@dewhirst.com.au>
<CACL+1at=z_ni9CRqKi6CpHM7t9-zJ8Zgu=qTxt-wvbOU7W6sgQ@mail.gmail.com>
<678a8c64-4d6f-e96f-c890-5b429548d036@dewhirst.com.au>
<CACL+1au=bcMT0bVwjwNapZ4-ADL5-HgHAnd4qVeAu83vyxQYCw@mail.gmail.com>
 by: Mike Dewhirst - Fri, 13 May 2022 07:00 UTC
Attachments: "OpenPGP_signature" (application/pgp-signature)

On 13/05/2022 4:37 pm, Eryk Sun wrote:
> On 5/13/22, Mike Dewhirst<miked@dewhirst.com.au> wrote:
>> On 13/05/2022 4:14 pm, Eryk Sun wrote:
>>> Since self.connect() is always called, you should document that the
>>> initial hkey parameter has to be one of the following predefined key
>>> handles:
>>>
>>> HKEY_LOCAL_MACHINE
>>> HKEY_USERS
>> I'm targeting HKEY_CURRENT_USER so I assume HK_USERS includes that.
> Using HKEY_CURRENT_USER with RegConnectRegistryW() to access a remote
> registry isn't well defined and not documented as supported. If it
> works at all, the API probably just opens a subkey of the remote
> HKEY_USERS based on the string SID (security identifier string) of the
> current user. That may fail as not found since user SIDs are unique to
> machines, unless it's on a domain.
>
> Bear in mind that the remote registry service is running on the remote
> machine as SYSTEM (S-1-5-18) in the non-interactive services session.
> If it literally accessed its "current user", then it would open
> "HKEY_USERS\S-1-5-18".
In that case, I'll remove 'computer' as a parameter and lock it in as
None. I'll document why and if I ever need to access a remote registry
I'll do some research along the lines you suggest.
My case demands execution of this code via login script for end-user
configuration after the IT department has done a bulk installation
rollout. One of key items is ComputerName which is in HKLM and needs to
be in HKCU for whichever user logs in. The application looks in HKCU for
a unique Device Reference and ComputerName suffices and is attractive
because it is also the asset number of the machine.

--
Signed email is an absolute defence against phishing. This email has
been signed with my private key. If you import my public key you can
automatically decrypt my signature and be sure it came from me. Just
ask and I'll send it to you. Your email software can handle signing.

Attachments: "OpenPGP_signature" (application/pgp-signature)
1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor