Professional Web Applications Themes

Is there a module to manipulate NTFS permissions? - PERL Beginners

Hello All: I searched CPAN and parts of the Win32:: but could not find an answer. Is there a module, etc to add/remove permissions on an NTFS folder? Thanks Birl...

  1. #1

    Default Is there a module to manipulate NTFS permissions?

    Hello All:

    I searched CPAN and parts of the Win32:: but could not find an answer.
    Is there a module, etc to add/remove permissions on an NTFS folder?


    Thanks
    Birl
    S.A. Guest

  2. #2

    Default Re: Is there a module to manipulate NTFS permissions?

    If you can't find a module (I have never heard of one but it may exist),
    can you assemble a command line and call cacls or something?

    S.A. Birl wrote:
     

    John Guest

  3. #3

    Default Re: Is there a module to manipulate NTFS permissions?

    On Sep 27, John (com.ns) typed:

    John: S.A. Birl wrote:
    John:
    John: > Hello All:
    John: >
    John: > I searched CPAN and parts of the Win32:: but could not find an answer.
    John: > Is there a module, etc to add/remove permissions on an NTFS folder?
    John: >
    John: >
    John: > Thanks
    John: > Birl
    John:
    John:
    John:
    John: If you can't find a module (I have never heard of one but it may exist),
    John: can you assemble a command line and call cacls or something?


    I could use backticks `` to call cacls.exe inside of PERL
    But there's a problem using cacls.exe, I cannot wipe out all permissions
    on a given directory. I need to know the user/group.

    Is there another .exe? If so, email off-line as this goes outside of
    PERL and I dont want to fill up the PERL list with non-PERL stuff.

    Thanks.
    Birl
    S.A. Guest

  4. #4

    Default Re: Is there a module to manipulate NTFS permissions?

    On Mon, 27 Sep 2004, S.A. Birl wrote:
     

    Actually, it would be interesting to keep this on list, as long as it
    doesn't go *too* far astray. This is a problem that a lot of Windows
    users may want to address sooner or later, and if Perl can't do it then
    there might as well be a note in the archives saying what did work.

    I always thought it was weird that the chmod() / chown() etc functions
    didn't get rigged to Do The Right Thing on Windows. Really, you
    shouldn't have to learn a new permissions API when Perl already has a
    perfectly good one that works for *nix (Linux, Solaris, OSX, etc) and
    seems like it would correlate tolerably well onto Windows systems.

    Heck, if Cygwin can weld it on there, why not Perl? :-)


    --
    Chris Devers
    Chris Guest

  5. #5

    Default Re: Is there a module to manipulate NTFS permissions?

    On Sep 27, Chris Devers (com.ns) typed:

    Chris: On Mon, 27 Sep 2004, S.A. Birl wrote:
    Chris:
    Chris: > I could use backticks `` to call cacls.exe inside of Perl But there's
    Chris: > a problem using cacls.exe, I cannot wipe out all permissions on a
    Chris: > given directory. I need to know the user/group.
    Chris: >
    Chris: > Is there another .exe? If so, email off-line as this goes outside of
    Chris: > Perl and I dont want to fill up the PERL list with non-Perl stuff.
    Chris:
    Chris: Actually, it would be interesting to keep this on list, as long as it
    Chris: doesn't go *too* far astray. This is a problem that a lot of Windows
    Chris: users may want to address sooner or later, and if Perl can't do it then
    Chris: there might as well be a note in the archives saying what did work.
    Chris:
    Chris: I always thought it was weird that the chmod() / chown() etc functions
    Chris: didn't get rigged to Do The Right Thing on Windows. Really, you
    Chris: shouldn't have to learn a new permissions API when Perl already has a
    Chris: perfectly good one that works for *nix (Linux, Solaris, OSX, etc) and
    Chris: seems like it would correlate tolerably well onto Windows systems.
    Chris:
    Chris: Heck, if Cygwin can weld it on there, why not Perl? :-)



    Im not having much success with Cygwin either. In fact I tried those
    commands first.



    The overall problem is this:

    I have PERL calling owsadm.exe to setup websites. Each website then has a
    folder called AppDev created:

    testweb\AppDev

    I want to wipe out the default permissions on AppDev. The defaults are:

    OWS_abcdefghij_advauthor RWX group
    OWS_abcdefghij_admin RWXP group
    Administrators Full Control group
    SYSTEM Full Control user
    IUSR_computer RX user

    (Where OWS_abcdefghij is a random-digit hash that M$ SharePoint,
    owsadm.exe, creates)

    Now I can wipe out the IUSR_computer account from the permissions.
    But it's the OWS_abcdefghij groups that are a headache.

    I was hoping that it would be easier to drop all the permissions and then
    re-add Administrators and SYSTEM in PERL.
    S.A. Guest

  6. #6

    Default Re: Is there a module to manipulate NTFS permissions?

    Chris Devers wrote:
     
    >
    >Actually, it would be interesting to keep this on list, as long as it
    >doesn't go *too* far astray. This is a problem that a lot of Windows
    >users may want to address sooner or later, and if Perl can't do it then
    >there might as well be a note in the archives saying what did work.
    >
    >I always thought it was weird that the chmod() / chown() etc functions
    >didn't get rigged to Do The Right Thing on Windows. Really, you
    >shouldn't have to learn a new permissions API when Perl already has a
    >perfectly good one that works for *nix (Linux, Solaris, OSX, etc) and
    >seems like it would correlate tolerably well onto Windows systems.
    >
    >Heck, if Cygwin can weld it on there, why not Perl? :-)
    >
    >
    >
    >[/ref]
    Sorry, all I know of is cacls and maybe xcacls (Windows Resource Kit?)
    and some others.

    I don't think I understand your problem though - cacls can replace or
    augment permissions and I don't think you need to know current
    user/group. You don't want a file with no ACLs - can't you default to
    Administrator:F in this condition? If you can clarify exactly what
    permissions you want to apply, I might be able to give a syntax example.
    John Guest

  7. #7

    Default Re: Is there a module to manipulate NTFS permissions?

    S.A. Birl wrote:
     
    I must be missing something. There may be some ordering consideration,
    and/or ou may be able to specify multiple users and groups on one
    invocation of cacls.

    First, wipe out existing permissions, leaving yourself in full control:

    cacls /t /g <YOU>:f

    Then add the other users and groups:

    cacls /t /g SYSTEM:f
    cacls /t /g Administrator:f
    cacls /t /g Administrators:f

    John Guest

  8. #8

    Default Re: Is there a module to manipulate NTFS permissions?

    John wrote:
     

    err, cacls <dirname> /t /p SYSTEM:F

    First param to calcls is file/directory. Use /p instead of /g when you
    want to edit permissions instead of setting permissions - so use /g to
    wipe permissions and apply some default, then /g to add additional
    users/groups.

    Sorry about that.
    John Guest

  9. #9

    Default Re: Is there a module to manipulate NTFS permissions?

    On Sep 27, John (com.ns) typed:

    John: > Then add the other users and groups:
    John: >
    John: > cacls /t /g SYSTEM:f
    John: > cacls /t /g Administrator:f
    John: > cacls /t /g Administrators:f
    John:
    John: err, cacls <dirname> /t /p SYSTEM:F
    John:
    John: First param to calcls is file/directory. Use /p instead of /g when you
    John: want to edit permissions instead of setting permissions - so use /g to
    John: wipe permissions and apply some default, then /g to add additional
    John: users/groups.
    John:
    John: Sorry about that.



    Well I could use my Administrator account for some odd reason, but
    I was able to use the Administrators group.

    But thanks for your help; it worked.

    I'll have to make sure to use xcacls in the PERL script instead so that I
    can utilize the /Y
    S.A. Guest

  10. #10

    Default Re: Is there a module to manipulate NTFS permissions?

    From: "S.A. Birl" <sbirl+temple.edu> 

    Win32::Perms - http://www.roth.net/perl/

    Jenda
    ===== cz === http://Jenda.Krynicky.cz =====
    When it comes to wine, women and song, wizards are allowed
    to get drunk and croon as much as they like.
    -- Terry Pratchett in Sourcery

    Jenda Guest

  11. #11

    Default Re: Is there a module to manipulate NTFS permissions?



    ----- Original Message -----
    From: "S.A. Birl" <sbirl+temple.edu>
    Date: Tuesday, September 28, 2004 9:42 am
    Subject: Re: Is there a module to manipulate NTFS permissions?
     

    Is there a module coming ??
     

    mgoland@optonline.net Guest

Similar Threads

  1. manipulate csv module
    By onlineviewer in forum PERL Modules
    Replies: 3
    Last Post: June 22nd, 04:24 PM
  2. NTFS permissions
    By Sheldon in forum Windows Server
    Replies: 1
    Last Post: June 14th, 08:21 PM
  3. NTFS Permissions
    By Colin in forum Windows Setup, Administration & Security
    Replies: 1
    Last Post: July 29th, 08:29 AM
  4. PHP & NTFS Permissions
    By BingoHandJob in forum PHP Development
    Replies: 1
    Last Post: July 24th, 07:36 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139