Skip Menu |

This queue is for tickets about the Win32-IPConfig CPAN distribution.

Report information
The Basics
Id: 21613
Status: resolved
Priority: 0/
Queue: Win32-IPConfig

People
Owner: Nobody in particular
Requestors: santtu [...] iki.fi
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in:
  • 0.09
  • 0.03
  • 0.04
  • 0.05
  • 0.06
  • 0.07
  • 0.08
Fixed in: 0.10



Subject: Requirement of having WRITE access to HKLM is not needed?
Documentation says: "For this module to retrieve information from a host machine, you must have read and write access to the registry on that machine." However, if I change KEY_READ|KEY_WRITE from IPConfig::new to KEY_READ only I still get adapter information etc. read correctly. Using KEY_WRITE actually means that if you have a restricted account (domain user, for example) then Win32::IPConfig *will not work*. I used KEY_READ only and could retrieve adapter information using a domain account, whereas with the original KEY_READ|KEY_WRITE it doesn't work. So is there a particular reason to have KEY_WRITE? After all, IPConfig only reads the registry, and doesn't write to it.. Bug: Win32::IPConfig doesn't work for (a typical, restricted) domain user although HKLM is readable.
Show quoted text
> "For this module to retrieve information from a host machine, you must > have read and write access to the registry on that machine." > > However, if I change KEY_READ|KEY_WRITE from IPConfig::new to KEY_READ > only I still get adapter information etc. read correctly. > > Using KEY_WRITE actually means that if you have a restricted account > (domain user, for example) then Win32::IPConfig *will not work*. I used > KEY_READ only and could retrieve adapter information using a domain > account, whereas with the original KEY_READ|KEY_WRITE it doesn't work. > > So is there a particular reason to have KEY_WRITE? After all, IPConfig > only reads the registry, and doesn't write to it..
Actually, it has had needed to write to the registry since 0.03. The set_* methods require this. Show quoted text
> Bug: Win32::IPConfig doesn't work for (a typical, restricted) domain > user although HKLM is readable.
I agree this is a reasonable request and will look at incorporating this into the next release, after I've looked at how best to retain read/write functionality for the set_* methods.
From: alabamapaul [...] gmail.com
You could add an optional second parameter to new() that would be a "read_only" flag. For backward compatibility, you can default the flag to 0. The attached patches provide this read_only support.
Subject: Adapter.patch
609a610,612 > ## Error, if read only flag is set > croak "Marked as read only, settings cannot be changed" if $self->{"read_only"}; > 627a631,633 > > ## Error, if read only flag is set > croak "Marked as read only, settings cannot be changed" if $self->{"read_only"}; 649a656,658 > ## Error, if read only flag is set > croak "Marked as read only, settings cannot be changed" if $self->{"read_only"}; >
Subject: IPConfig.patch
18c18,21 < --- > > my $read_only = shift; > $read_only = 0 if (!defined($read_only)); > 20c23 < {Access => KEY_READ | KEY_WRITE}) --- > {Access => (($read_only) ? (KEY_READ) : (KEY_READ | KEY_WRITE))}) 29a33 > $self->{"read_only"} = $read_only; 370c374 < =item $ipconfig = Win32::IPConfig->new($host); --- > =item $ipconfig = Win32::IPConfig->new($host, $read_only); 373a378,379 > $read_only indicates the object will be used to examine current > settings and will not be allowed to make changes.