perl controlling samba permissions?

Discussion in 'Perl Misc' started by Anthony Boyd, Feb 19, 2004.

  1. Anthony Boyd

    Anthony Boyd Guest

    I have a Linux box that is going to share a directory via Samba.
    People will be authorized to use the share via LDAP. They may change
    the file permissions (on the Samba/Windows side, but the Linux
    permissions should remain unchanged).

    I wanted to have a PHP script read the Samba permissions set on each
    file, and display that via a Web page. PHP doesn't appear up to the
    task (but it can get/set Linux permissions OK).

    Can Perl handle this? I thought Filesys::SmbClient might work, but
    the docs imply Linux permissions can be changed, not the Windows side.
     
    Anthony Boyd, Feb 19, 2004
    #1
    1. Advertising

  2. Anthony Boyd

    Ben Morrow Guest

    (Anthony Boyd) wrote:
    > I have a Linux box that is going to share a directory via Samba.
    > People will be authorized to use the share via LDAP. They may change
    > the file permissions (on the Samba/Windows side, but the Linux
    > permissions should remain unchanged).
    >
    > I wanted to have a PHP script read the Samba permissions set on each
    > file, and display that via a Web page. PHP doesn't appear up to the
    > task (but it can get/set Linux permissions OK).
    >
    > Can Perl handle this? I thought Filesys::SmbClient might work, but
    > the docs imply Linux permissions can be changed, not the Windows side.


    I don't think the two sets of permissions are distinct...

    Ben

    --
    $.=1;*g=sub{print@_};sub r($$\$){my($w,$x,$y)=@_;for(keys%$x){/main/&&next;*p=$
    $x{$_};/(\w)::$/&&(r($w.$1,$x.$_,$y),next);$y eq\$p&&&g("$w$_")}};sub t{for(@_)
    {$f&&($_||&g(" "));$f=1;r"","::",$_;$_&&&g(chr(0012))}};t #
    $J::u::s::t, $a::n::eek:::t::h::e::r, $P::e::r::l, $h::a::c::k::e::r, $.
     
    Ben Morrow, Feb 19, 2004
    #2
    1. Advertising

  3. Anthony Boyd

    Anthony Boyd Guest

    Ben Morrow <> wrote:
    > (Anthony Boyd) wrote:
    > >
    > > I wanted to have a PHP script read the Samba permissions set on each
    > > file, and display that via a Web page. PHP doesn't appear up to the
    > > task (but it can get/set Linux permissions OK).
    > >
    > > Can Perl handle this?

    >
    > I don't think the two sets of permissions are distinct...


    Ben, thanks for the reply. I must be really confused, although it
    wouldn't be the first time. I've created a screenshot, here:

    http://www.outshine.com/permissions.jpg

    It shows a shared folder, and in that shared folder, I selected a file
    and clicked into the permissions for that file. Under Windows XP, I
    am able to assign multiple groups and people to that file, with
    various levels of access. I need Perl to read that list and display
    it via the Web. When I use Perl to get permissions thus far, all I'm
    getting is the Unix/Linux permissions, which has 1 owner and 1 group
    (usually me, since I shared out the directory in the first place).

    In other words, after I share out a directory, people on Windows might
    add files and set fairly unique and specific permissions file-by-file.
    How does my Linux box "see" that info, and can Perl get it? Or are
    you suggesting that Samba simply won't save/allow for the
    Windows-style permissions.

    -Anthony
     
    Anthony Boyd, Feb 20, 2004
    #3
  4. Anthony Boyd

    Ben Morrow Guest

    (Anthony Boyd) wrote:
    > Ben Morrow <> wrote:
    > > (Anthony Boyd) wrote:
    > > >
    > > > I wanted to have a PHP script read the Samba permissions set on each
    > > > file, and display that via a Web page. PHP doesn't appear up to the
    > > > task (but it can get/set Linux permissions OK).
    > > >
    > > > Can Perl handle this?

    > >
    > > I don't think the two sets of permissions are distinct...

    >

    <snip>
    > In other words, after I share out a directory, people on Windows might
    > add files and set fairly unique and specific permissions file-by-file.
    > How does my Linux box "see" that info, and can Perl get it? Or are
    > you suggesting that Samba simply won't save/allow for the
    > Windows-style permissions.


    The samba docs I have (for version 2.2.8a) clearly say that the only
    permissions you will in fact be able to set through that dialog are
    those corresponding to user, group and world Unix permissions. The
    relevant document is full_docs/htmldocs/NT_Security.html (wherever
    you've got the samba docs installed).

    Certainly, your screenshot seems to imply that more permissions can be
    set... maybe things have changed. Anyway, this belongs on a Samba list:
    you ask the Samba folks how you'd get the info in C, we'll tell you how
    to get it in Perl. :)

    Ben

    --
    For the last month, a large number of PSNs in the Arpa[Inter-]net have been
    reporting symptoms of congestion ... These reports have been accompanied by an
    increasing number of user complaints ... As of June,... the Arpanet contained
    47 nodes and 63 links. [ftp://rtfm.mit.edu/pub/arpaprob.txt] *
     
    Ben Morrow, Feb 20, 2004
    #4
  5. Anthony Boyd

    Anthony Boyd Guest

    Ben Morrow <> wrote:

    > The samba docs I have (for version 2.2.8a) clearly say that the only
    > permissions you will in fact be able to set through that dialog are
    > those corresponding to user, group and world Unix permissions. The
    > relevant document is full_docs/htmldocs/NT_Security.html (wherever
    > you've got the samba docs installed).


    Thanks for the link to the NT_Security.html file. I had tried google
    and man pages, but that file was really what I needed.

    -Anthony
     
    Anthony Boyd, Feb 20, 2004
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. jon wackley

    iis 5 virtual directory on samba share

    jon wackley, Dec 29, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    1,897
    jon wackley
    Dec 30, 2003
  2. Scott Allen
    Replies:
    0
    Views:
    455
    Scott Allen
    Jul 13, 2004
  3. Neil Zanella

    ASP.NET service providers using Samba+Unix

    Neil Zanella, Jan 5, 2005, in forum: ASP .Net
    Replies:
    3
    Views:
    392
    Brandon Potter
    Jan 6, 2005
  4. Curt K
    Replies:
    0
    Views:
    578
    Curt K
    Nov 3, 2006
  5. Alexandre Jaquet

    perl and samba

    Alexandre Jaquet, Feb 10, 2005, in forum: Perl Misc
    Replies:
    2
    Views:
    112
    Tore Aursand
    Feb 10, 2005
Loading...

Share This Page