Linux – Permission denied on files in a directory on a CIFS-mounted Windows share in Linux

linuxmountpermissionswindows-xp

I have two directories:

c:\work\directory1

and

c:\work\directory2

which are mounted under:

/mnt/c-drive/

When I try to read any file under directory1 I can, but when I try to read any file in directory2 I receive a "Permission Denied" error.

/mnt/c-drive/directory1
drwxrwxrwx 1 root root     0 2008-10-17 11:13 directory1
/mnt/c-drive/directory1/file1
-rwxrwSrwx 1 root root 257 2008-10-17 11:13 file1


/mnt/c-drive/directory2
drwxrwxrwx 1 root root     0 2009-07-20 10:42 directory2
/mnt/c-drive/directory2/file1
-rwxrwSrwx 1 root root   844 2009-07-20 10:42 file1

The Windows machine is running Windows XP Media Center Edition. The Linux is Fedora 10.

When I right click on either of the two files or their parent directories their attributes appear identical.
On files: Read Only -, Hidden -, file is ready for archiving +, for fast search +, compress -, encrypt –
On directories: Read Only +, Hidden -, file is ready for archiving -, for fast search +, compress -, encrypt –

If there's any other info I can give to help, let me know.

Any help would be appreciated, thanks.

Additional info:
Mounted via:
mount -t cifs //192.168.1.103/c /mnt/c-drive
with no username/password

CALCS Output:

Directory 1:

C:\work\directory1 BUILTIN\Users:F
BUILTIN\Users:(OI)(CI)(IO)F
Everyone:F
Everyone:(OI)(CI)(IO)(special access:)

                STANDARD_RIGHTS_ALL

                DELETE

                READ_CONTROL

                WRITE_DAC

                WRITE_OWNER

                SYNCHRONIZE

                STANDARD_RIGHTS_REQUIRED

                GENERIC_READ

                GENERIC_WRITE

                GENERIC_ALL

                FILE_GENERIC_READ

                FILE_GENERIC_WRITE

                FILE_GENERIC_EXECUTE

                FILE_READ_DATA

                FILE_WRITE_DATA

                FILE_APPEND_DATA

                FILE_READ_EA

                FILE_WRITE_EA

                FILE_EXECUTE

                FILE_DELETE_CHILD

                FILE_READ_ATTRIBUTES

                FILE_WRITE_ATTRIBUTES

BUILTIN\Administrators:F
BUILTIN\Administrators:(OI)(CI)(IO)F
NT AUTHORITY\SYSTEM:F
NT AUTHORITY\SYSTEM:(OI)(CI)(IO)F
E510\Rob:F
CREATOR OWNER:(OI)(CI)(IO)F
BUILTIN\Users:(OI)(CI)(IO)(special access:)

                     GENERIC_READ

                     GENERIC_EXECUTE

BUILTIN\Users:(CI)(IO)(special access:)

                 FILE_APPEND_DATA

BUILTIN\Users:(CI)(IO)(special access:)

                 FILE_WRITE_DATA

Directory 2:

        C:\work\direcory2 BUILTIN\Users:F
        BUILTIN\Users: (OI)(CI)(IO)F
        Everyone:F
        Everyone:(OI)(CI)(IO)(special access:)

               STANDARD_RIGHTS_ALL

               DELETE

               READ_CONTROL

               WRITE_DAC

               WRITE_OWNER

               SYNCHRONIZE

               STANDARD_RIGHTS_REQUIRED

               GENERIC_READ

               GENERIC_WRITE

               GENERIC_ALL

               FILE_GENERIC_READ

               FILE_GENERIC_WRITE

               FILE_GENERIC_EXECUTE

               FILE_READ_DATA

               FILE_WRITE_DATA

               FILE_APPEND_DATA

               FILE_READ_EA

               FILE_WRITE_EA

               FILE_EXECUTE

               FILE_DELETE_CHILD

               FILE_READ_ATTRIBUTES

               FILE_WRITE_ATTRIBUTES

        BUILTIN\Administrators:F
        BUILTIN\Administrators:(OI)(CI)(IO)F
NT AUTHORITY\SYSTEM:F
NT AUTHORITY\SYSTEM:(OI)(CI)(IO)F
E510\Rob:F
CREATOR OWNER:
        (OI)(CI)(IO)F
BUILTIN\Users:    (OI)(CI)(IO)(special access:)

                    GENERIC_READ

                    GENERIC_EXECUTE

BUILTIN\Users:    (CI)(IO)(special access:)

                FILE_APPEND_DATA

BUILTIN\Users:    (CI)(IO)(special access:)

                FILE_WRITE_DATA

Here are CACLS info for 2 individual files
directory1\file1

BUILTIN\Users:F
Everyone:F
BUILTIN\Administrators:F
NT AUTHORITY\SYSTEM:F
E510\Rob:F

directory2\file1

E510\Rob:F
NT AUTHORITY\SYSTEM:F
BUILTIN\Administrators:F

So now that I see the premission differences.

Best Answer

It sounds to me like you should go look at the NTFS permissions on those directories on the Windows XP computer. My guess is that the user account you're using to mount those from the Fedora box doesn't have rights.

Since it's XP Media Center the "Security" tab of the folder properties might be hidden. From a command-prompt, you can use the CACLS command (as below) to list the permissions:

CACLS C:\Directory1

The output of CACLS is somewhat easy to parse, but you can post the output here as an edit to your question if you're having trouble with it.

What Windows username are you specifying in the arguments to your mount on Linux?

Edit:

Okay-- so w/o a username and password specified you're connecting as "guest". The permission "Everyone:F" is allowing that to work.

The NTFS permissions on those directories are the same. If you create a new file in each directory from either the Windows or Linux machine you should see the same access. Try that and make sure it works.

I'm wondering if you have permissions set on individual files in "directory2". Since XP Media Center "hides" the "Security" tab by default (if I remember properly), try a CACLS referencing an individual file that's giving you problems in "directory2". I suspect you'll find that it has different permissions than "directory2" itself. Did you happen to move files into "directory2" from elsewhere on the hard disk drive of the computer?