You could try just creating an empty perms object:
$Perms = new Win32::Perms;
Add the names/permissions you want then export the security descriptor:
$Sd = $Perms->GetSD( SD_RELATIVE );
Then, when creating the share, pass in $Sd as the "security_descriptor" key.
dave
-----Original Message-----
From: Ron LEVER [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 16, 2001 5:55 AM
To: '[EMAIL PROTECTED]'
Subject: Share Permissions
Hi all
Can anyone help with this?
When I run this script
use strict;
use Win32::Lanman;
use Win32::Perms;
my $shareInfo;
my $path;
my $user;
$shareInfo = { 'path' => 'c:\users\mel',
'netname'
=> 'mel$',
'remark'
=> "Mels Home directory",
'permissions' =>
0,
'max_uses'
=> -1,
'type'
=> 0,
};
if(Win32::Lanman::NetShareAdd('51-imd-ops-g-03',
\%$shareInfo ))
{
print "Share created\n";
} else {
print "Share creation failed\n";
}
$path = '\\\\51-imd-ops-g-03\\mel$';
$user = '\\\\51-imd-ops-g-03\\mel';
foreach ( sort keys %$shareInfo )
{
print "$_: $shareInfo->{ $_ }\n";
}
applySharePerm( $user, $path );
sub applySharePerm
{
my( $group, $path ) = @_;
my( $perm );
$perm = new Win32::Perms("share:".$path ) || warn
"Can not create perm for $path: \n$!";
if( $perm->Add( $group, CHANGE ))
{
print "Assigned Share permissions\n";
} else {
print "Unable to assign Share
permissions\n";
}
$perm->Set();
$perm->Close();
}
I get
"Can not create perm for \\51-imd-ops-g-03\mel$:
Can't call method "Win32::Perms::Add" without a package or object reference
at v:\ansto\directorymanager\testshares.pl line 45."
Thanks everybody
_______________________________________________
Perl-Win32-Admin mailing list [EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-admin
_______________________________________________
Perl-Win32-Admin mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-admin