Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Viewing network shares

by Hyler (Sexton)
on Feb 28, 2003 at 09:10 UTC ( #239375=note: print w/replies, xml ) Need Help??


in reply to Viewing network shares

I've looked into viewing the permissions (for users and groups) on the shares somewhat, and it seems more daunting than I first believed.

The {'permissions'} hash key in Win32::NetResource::NetShareGetInfo is merely read, write, change, delete and so on. MSDN mentions the SECURITY_DESCRIPTOR in the SHARE_INFO_502 structure, but that's not available in W::NR::NetShareGetInfo.

One might work with Win32::FileSecurity, but it says in my version under Known issues/bugs:

  1. May not work on remote drives.

Replies are listed 'Best First'.
Re: Re: Viewing network shares
by Hyler (Sexton) on Mar 04, 2003 at 09:12 UTC

    Things are looking promising, I did some experimenting.

    Win32::FileSecurity::Get("\\\\computer\\share", \%sph); gives you a hash with the keys being users and/or groups and the values a bitmask. You can do the Get on a file, a directory or a share. For example, it could give the key DOMAIN\GROUP with the value 2032127, the bitmask being the permissions listed in CONSTANTS in the documentation for Win32::FileSecurity (DELETE, READ, FULL etc). Maybe it will only be a matter of using EnumerateRights and MakeMask.

    The testing done in ActivePerl 5.8.0 Build 805, Win32::FileSecurity version 1.03 ALPHA 97-12-14.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://239375]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (1)
As of 2021-10-17 04:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My first memorable Perl project was:







    Results (71 votes). Check out past polls.

    Notices?