Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > perl controlling samba permissions?

Reply
Thread Tools

perl controlling samba permissions?

 
 
Anthony Boyd
Guest
Posts: n/a
 
      02-19-2004
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.
 
Reply With Quote
 
 
 
 
Ben Morrow
Guest
Posts: n/a
 
      02-19-2004

http://www.velocityreviews.com/forums/(E-Mail Removed) (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 # (E-Mail Removed)
$J::u::t, $a::n:::t::h::e::r, $P::e::r::l, $h::a::c::k::e::r, $.
 
Reply With Quote
 
 
 
 
Anthony Boyd
Guest
Posts: n/a
 
      02-20-2004
Ben Morrow <(E-Mail Removed)> wrote:
> (E-Mail Removed) (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
 
Reply With Quote
 
Ben Morrow
Guest
Posts: n/a
 
      02-20-2004

(E-Mail Removed) (Anthony Boyd) wrote:
> Ben Morrow <(E-Mail Removed)> wrote:
> > (E-Mail Removed) (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] * (E-Mail Removed)
 
Reply With Quote
 
Anthony Boyd
Guest
Posts: n/a
 
      02-20-2004
Ben Morrow <(E-Mail Removed)> 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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
map drive from window/2000 to Linux samba John Cisco 1 10-04-2005 06:11 AM
perl and samba Alexandre Jaquet Perl Misc 2 02-10-2005 05:26 PM
IPSec + rdesktop/samba problem. =?iso-8859-2?q?Micha=B3_Iwaszko?= Cisco 8 02-03-2005 08:38 AM
Samba PDC and PIX Firewall Mirek Cisco 0 02-19-2004 02:25 PM
Logging on a Samba PDC over Cisco Router Raffi Cisco 4 02-06-2004 07:35 PM



Advertisments