perl controlling samba permissions?

A

Anthony Boyd

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.
 
B

Ben Morrow

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
 
A

Anthony Boyd

Ben Morrow said:
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
 
B

Ben Morrow

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
 
A

Anthony Boyd

Ben Morrow said:
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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top