LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 04-24-2010, 02:08 AM   #1
tomva
Member
 
Registered: May 2006
Distribution: Fedora
Posts: 45

Rep: Reputation: 15
cifs share not listing any files?


Hello all-

I've got a Fedora 10 server with a simple read-only samba share.

I'm able to mount and browse the share from a Fedora 12 client, but all directories appear as empty--and I can see on the server that they contain many files. This happens whether I browse using smbclient, or mount using mount.cifs.

I've got smb/nmb ports enabled on both the client and server. File permissions on the server look right.

The server smb.conf setup:
Code:
[global]
        security = user
        passdb backend = tdbsam

[media]
        comment = Media Library (read-only)
        path = /media
        public = yes
        read only = yes
I can mount the share from the client, and browse using smbclient. However, all directories are empty (most contain between 1 and 10 files).

Any ideas what this could be? I don't see any errors in the server logs, even running at maximum log level.

Thanks!

-Thomas
 
Old 04-26-2010, 06:01 PM   #2
irishbitte
Senior Member
 
Registered: Oct 2007
Location: Brighton, UK
Distribution: Ubuntu Hardy, Ubuntu Jaunty, Eeebuntu, Debian, SME-Server
Posts: 1,213
Blog Entries: 1

Rep: Reputation: 88
can you give an example of what you have the unix permissions on files in the share looking like? This command should help:
Code:
ls -al /path/to/share/in/linux
 
Old 04-26-2010, 11:36 PM   #3
tomva
Member
 
Registered: May 2006
Distribution: Fedora
Posts: 45

Original Poster
Rep: Reputation: 15
Hello-

Thanks for the response!

On the server, this is the /media directory, off the root. Here is how that looks:
Code:
% ls -al /media
total 20
drwxr-xr-x  4 media media 4096 2009-11-14 05:09 .
drwxr-xr-x 22 root  root  4096 2010-04-24 00:10 ..
drwxr-xr-x  6 media media 4096 2010-03-22 20:16 audio
drwxr-xr-x 13 media media 4096 2009-11-14 05:13 photos
(and obviously, the . entry describes the /media folder permissions as seen from the root directory)

On the client, it looks like this:
Code:
% mount /mnt/media
% ls -al /mnt/media
drwxr-xr-x.  4 tomva tomva    0 2009-11-14 05:09 .
drwxr-xr-x.  5 root  root  4096 2010-04-23 22:19 ..
drwxr-xr-x.  6 tomva tomva    0 2010-03-22 20:16 audio
drwxr-xr-x. 13 tomva tomva    0 2009-11-14 05:13 photos
And here is the client fstab entry for /mnt/media:
Code:
% cat /etc/fstab | grep media
//server/media          /mnt/media              cifs    ro,guest,noauto,uid=500,gid=500 0 0
 
Old 04-27-2010, 07:07 PM   #4
irishbitte
Senior Member
 
Registered: Oct 2007
Location: Brighton, UK
Distribution: Ubuntu Hardy, Ubuntu Jaunty, Eeebuntu, Debian, SME-Server
Posts: 1,213
Blog Entries: 1

Rep: Reputation: 88
Just curious, can you take mount entry out of your fstab, and try doing this using smbclient? It might shed a little light on your situation.
 
Old 04-27-2010, 09:20 PM   #5
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,937

Rep: Reputation: 3619Reputation: 3619Reputation: 3619Reputation: 3619Reputation: 3619Reputation: 3619Reputation: 3619Reputation: 3619Reputation: 3619Reputation: 3619Reputation: 3619
Just wondering out loud. Does the directories have to have samba users as part of group that can read?
 
Old 04-28-2010, 12:39 AM   #6
tomva
Member
 
Registered: May 2006
Distribution: Fedora
Posts: 45

Original Poster
Rep: Reputation: 15
Hello all-

I appreciate the help! This is a strange one: I've gotten cifs mounts to work before, but this is strange behavior.

I've commented out the fstab entry, and used smbclient instead. I got the same behavior: I could navigate the directories, but they all showed zero files (even when I can see on the server that there are many files there).

For instance, I also run mediatomb on the same directory tree on the server, and it is able to find and expose all of the media files. I'm guessing my samba share is set up funky on the server.

Are there particular ports I should watch out for on the firewall? I ran system-config-firewall-tue on the server, and opened the standard samba ports.

-Thomas
 
Old 04-28-2010, 04:26 AM   #7
irishbitte
Senior Member
 
Registered: Oct 2007
Location: Brighton, UK
Distribution: Ubuntu Hardy, Ubuntu Jaunty, Eeebuntu, Debian, SME-Server
Posts: 1,213
Blog Entries: 1

Rep: Reputation: 88
is tomva part of the group media on the server?
 
Old 04-28-2010, 11:29 PM   #8
tomva
Member
 
Registered: May 2006
Distribution: Fedora
Posts: 45

Original Poster
Rep: Reputation: 15
Hello-

No, tomva isn't in the media group on the server. Although in the samba logs on the server it looks like the client is authenticating as user 'nobody', which I think makes sense for an anonymous public share.

-Thomas
 
Old 04-28-2010, 11:39 PM   #9
tomva
Member
 
Registered: May 2006
Distribution: Fedora
Posts: 45

Original Poster
Rep: Reputation: 15
Doh! I was just looking at the server logs again. I thought I had checked them before, but apparently either I didn't, or I hadn't checked them since bumping up the log level.

If I go to a particular directory in my media share (audio/Artists/Yello) that only contains one file, the directory listing (as seen on the client) looks empty. This is what I saw in the server logs when I ran that command:

Code:
[2010/04/28 21:31:47,  5] smbd/trans2.c:get_lanman2_dir_entry(1382)
  get_lanman2_dir_entry:Couldn't lstat [audio/Artists/Yello/Yello - Stella - 07 - Domingo.mp3] (Permission denied)
It is apparently getting a permission denied to even read the file. Even if I give the file full permissions for everyone (chmod 777) I still can't see it in the directory--and I don't want to give the world write permissions anyway!

According to the lstat() man page,
Code:
No permissions are required on the file itself, but — in the case of stat() and lstat() — execute (search) permission is required on all of the directories in path that lead to the file.
I've just checked: the world has execute permissions on everything in the media tree on the server! Any ideas what could be wrong?
 
Old 04-30-2010, 06:57 AM   #10
irishbitte
Senior Member
 
Registered: Oct 2007
Location: Brighton, UK
Distribution: Ubuntu Hardy, Ubuntu Jaunty, Eeebuntu, Debian, SME-Server
Posts: 1,213
Blog Entries: 1

Rep: Reputation: 88
Still not sure, there is perhaps something on your settings in smb.conf. Can you post it here, without all the extra stuff? Just the active lines.
 
Old 05-10-2010, 12:05 AM   #11
tomva
Member
 
Registered: May 2006
Distribution: Fedora
Posts: 45

Original Poster
Rep: Reputation: 15
Sorry for the delay! Got caught up in other things.

Here is my smb.conf file, from /etc/samba:

Code:
[global]
        workgroup = LakeHaven
        server string = Samba Server Version %v
        netbios name = julius

        # logs split per machine
        log file = /var/log/samba/log.%m
        # max 50KB per log file, then rotate
        max log size = 50
        log level = 5

        security = user
        passdb backend = tdbsam

        load printers = yes
        cups options = raw

[homes]
        comment = Home Directories
        browseable = no
        writable = yes

[printers]
        comment = All Printers
        path = /var/spool/samba
        browseable = no
        guest ok = no
        writable = no
        printable = yes

[media]
        comment = Media Library (read-only)
        path = /media
        public = yes
        read only = yes

[media-rw]
        comment = Media Library (writeable)
        path = /media
        public = yes
        writeable = yes
        valid users = media
As you can see, I've also got a writeable share (media-rw), but right now I'm just trying to get the read-only share to work.
 
Old 05-10-2010, 02:37 AM   #12
Steveburner
LQ Newbie
 
Registered: May 2010
Posts: 4

Rep: Reputation: 0
Hi, i just want to know that tomva is part of the group media on the server
 
Old 05-10-2010, 10:21 PM   #13
tomva
Member
 
Registered: May 2006
Distribution: Fedora
Posts: 45

Original Poster
Rep: Reputation: 15
tomva is NOT a member of group media. Does that matter for the anonymous (read-only) share?

For the writeable share the client authenticates as user media.
 
Old 05-11-2010, 06:29 PM   #14
irishbitte
Senior Member
 
Registered: Oct 2007
Location: Brighton, UK
Distribution: Ubuntu Hardy, Ubuntu Jaunty, Eeebuntu, Debian, SME-Server
Posts: 1,213
Blog Entries: 1

Rep: Reputation: 88
well, are you trying to view both of these shares at the same time on one pc connected to the samba server? Because, it is only possible to pass one set of credentials to the server, not an individual set for each share. Does that make sense to you? So if you auth as user media, you will see the writeable share, but not the read only share, since both are mapped to the same backend directory: /media . If you auth as tomva, you should be able to see the read-only share. Does that help?
 
Old 05-12-2010, 12:08 AM   #15
tomva
Member
 
Registered: May 2006
Distribution: Fedora
Posts: 45

Original Poster
Rep: Reputation: 15
Quote:
So if you auth as user media, you will see the writeable share, but not the read only share, since both are mapped to the same backend directory: /media . If you auth as tomva, you should be able to see the read-only share.
I think that makes sense! However, I only connect to one share at a time, and for the read-only share my /etc/fstab is set up for me to authenticate as guest, not tomva.

From my /etc/fstab (on the client):
Code:
//julius/media          /mnt/media              cifs    ro,guest,noauto,uid=500,gid=500 0 0
(So I authenticate as a guest on the server, but the files are mapped to the local user tomva on the client). And I never set up user tomva for smb authentication on the server using smbpasswd, so I don't think I can authenticate as tomva.

On the server, it looks like I authenticate as user nobody (user ID 99) when I connect to the read-only share.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Can delete files in one smb share but not in another - using cifs.mount in active dir Lordandmaker Linux - Server 4 02-12-2009 05:34 AM
cifs remote share bobd72 Linux - Networking 2 06-04-2008 04:55 AM
Kerberos and CIFS network share MALDATA Linux - Server 4 04-10-2007 04:43 PM
Access CIFS Share from Linux johnnybhoy67 Linux - Networking 0 11-30-2005 09:30 AM
CIFS samba share ronanio Linux - Software 1 11-06-2005 11:22 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 05:45 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration