All files tagged as "hidden system files"!!?

FTP Server, File Server, DDNS, SAMBA, AFP, NFS
iggibuh
Starting out
Posts: 19
Joined: Fri Dec 24, 2010 5:10 pm

Re: All files tagged as "hidden system files"!!?

Post by iggibuh » Tue Apr 12, 2011 9:54 pm

i couldent understand that some friends said they couldent get acces to some shares of mine but after trying to change file attribues and just seeing them frozen via filemanager im rather annoyd with qnap for not fixing this.

im not that all into computers for the advanced fix or what u might call it and disappointed that qnap dosent take fix the issue at hand, i for one wont buy any more qnap products due to this issue not being taken seriously

chullos
First post
Posts: 1
Joined: Wed Aug 10, 2011 4:24 am

Re: All files tagged as "hidden system files"!!?

Post by chullos » Wed Aug 10, 2011 4:30 am

Hi to all, I'm new here, but here I found the solution to the problem I had. I almost forgot the old fashion ATTRIB command. This worked for me.

Thanks!

Corsair
Know my way around
Posts: 210
Joined: Tue Dec 29, 2009 9:18 pm

Re: All files tagged as "hidden system files"!!?

Post by Corsair » Wed Aug 10, 2011 7:11 am

QNAPRobert wrote:Hi,all:
There's a system script that might come handy :

Code: Select all

/sbin/set_volume_mode <Share_Folder_name>


the share folder must be on root folder level,that is : on the share folder list in the Web administration GUI.

eg.
/sbin/set_volume_mode Public
would set all the folders mode and files mode back to QNAP default.

*Thanks Lee Buskey of U.S.A. informed me and all your efforts.


This just made me happy. Thanks heaps.

Just one question though since I'm a bit of a noob about these things:

What's the difference in having a file set to 766 or 666 and folder set to 777 or 755? Does it matter?
Model: TS-451+ Firmware: 4.3.4.0675 Build 20180810
HDDs: 2x 4.0 TB Western Digital WD40EFRX-68N32N0 in Bays 1 & 2 RAID: RAID 1
HDDs: 2x 1.0 TB Hitachi HDT721010SLA360 ST6O in Bays 3 & 4 RAID: RAID 1
Storage Pool & Volume: Both RAID 1 groups combined into one storage pool with one, thick, volume.
Services: Microsoft Networking, File Station,Web Server
Apps: PLEX Media Server 1.13.5.5291

chocmint
New here
Posts: 7
Joined: Tue Dec 20, 2011 4:30 am

Re: All files tagged as "hidden system files"!!?

Post by chocmint » Thu Jan 05, 2012 9:24 pm

I encountered this issue a week ago and it nearly drove me mad. I think I now understand what's going on though. As discussed elsewhere in this thread, the solution is to set the DOS attributes from a Windows machine - don't try and do it by fiddling with permissions on the QNAP box, it won't work.

I have a share assigned to a user, but I have also enabled read only guest access on the share to allow a couple of Windows clients and my XBMC box to access the share as *guest*. However, when I accessed the share with the Windows clients and the XBMC box, none of the files were visible. The reason was they were all 'hidden' (in the Windows sense). I could at least see the files from Windows if I set the folder options to display hidden files, though this wasn't quite what I wanted.

I read the Samba documentation here http://www.samba.org/samba/docs/using_samba/ch08.html and learned that you can set the hidden status by using the executable bits on the Linux filesystem permissions. However, playing with the permissions as described did not produce the results I was expecting. For example, changing the executable bits did not actually make the files unhidden on Windows. The only way I could make the files unhidden on Windows was to unset the 'world' readable bit (eg -rwxrwx-wx). When doing this, the file would instantly show up as unhidden in a folder I had open on a Windows box. However, now the file was unreadable by the Windows box accessing the share as guest! This was driving me mad as the behaviour seemed to be completely different to what was described in the Samba documentation.

I checked the Samba configuration on the QNAP (ie. /etc/smb.conf) and noticed that the 'map hidden' option was set to 'no'. Ie., the use of the executable bits to modify hidden status shouldn't be working anyway (which it isn't).

One other thing I noticed was that in Windows, I could unset the hidden status (file -> properties) and the file would then be unhidden and readable (just as I wanted it). Checking the permissions on the QNAP, I noticed that despite this change, none of the permissions were changed at all. In other words, there was more to it than just the file permissions on the QNAP.

After a little more Googling, I discovered Samba's 'store dos attributes = yes' option and noticed that this is indeed set to 'yes' on the QNAP. In order for this option to function, each of the 'map archive', 'map system' and 'map hidden' values in smb.conf must be set to 'no' (which is also the case on the QNAP).

Refer to the man page of smb.conf for a full explanation of the 'store dos attributes' option. In summary, if this option is enabled, the DOS attributes (SYSTEM, HIDDEN, ARCHIVE or READ-ONLY) are actually stored in an extended attribute of the underlying Linux filesystem. In other words, on the QNAP, these DOS attributes are not controlled by the file permissions (executable bits etc), they are stored separately as part of the ext4 filesystem that QNAP uses. You can view and set these attibutes using the getfattr and setfattr commands. For example:

Code: Select all

[/share/MD0_DATA/mp3s/blah] # ls -l
-rwxr-xr-x    1 c        everyone  3606141 May 13  2010 song1.mp3*
-rwxr-xr-x    1 c        everyone  4547807 May 13  2010 song2.mp3*

[/share/MD0_DATA/mp3s/blah] # getfattr -d -e text song1.mp3
# file: song1.mp3
user.DOSATTRIB="0x20

[/share/MD0_DATA/mp3s/blah] # getfattr -d -e text song2.mp3     
# file: song2.mp3
user.DOSATTRIB="0x22

On Windows, the first file has the archive box checked and the second has the hidden and archive boxes checked. Changes to these on Windows are reflected in changes to the user.DOSATTRIB value.

Unfortunately, although the QNAP has the getfattr command installed, it doesn't have the setfattr command. If it did, it would have been a simple one liner to set all of the file attributes for all of the files in the share. Unfortunately, the only way to do it is from Windows as described earlier in this thread. For me, this means I need to temporarily set all of the files to be world readable (from the QNAP shell) before I can make these changes from a Windows box. Note to QNAP devs: please include setfattr in future releases.

Read the smb.conf man page before changing the dos attributes option to 'no' - there seem to be valid reasons for the current settings (eg. copying files to/from NTFS filesystems will retain additional attributes).

I'm still puzzled, however, why the world read bit still sets/unsets the hidden status...

CL

User avatar
schumaku
Guru
Posts: 43673
Joined: Mon Jan 21, 2008 4:41 pm
Location: Kloten (Zurich), Switzerland -- Skype: schumaku
Contact:

Re: All files tagged as "hidden system files"!!?

Post by schumaku » Fri Jan 06, 2012 8:49 pm

Excellent information collection, thank you!
chocmint wrote:I'm still puzzled, however, why the world read bit still sets/unsets the hidden status...

Done some tests - here on a 3.60 Beta NAS, the world read bit does toggle the archive (w:r = archive, w: = no achive. Suspected before: Thee are still some QNAP hardcoded mods in the SAMBA deamon. Behaviour is certianly wrong - changing the U**x protection masks must not interfere with the attribute presentation to the Windows clients - making a consiten management impossible as you correctly stated.

chocmint
New here
Posts: 7
Joined: Tue Dec 20, 2011 4:30 am

Re: All files tagged as "hidden system files"!!?

Post by chocmint » Fri Jan 06, 2012 8:54 pm

BTW: if you don't have access to a Windows box, you can use smbclient from a Linux box to set/unset the DOS attributes. The following example removes the hidden flag:

Code: Select all

smbclient -N -c 'setmode "directory one/directory two/file name.mp3" -h' //server/sharename

In this example, 'directory one' is a directory at the base level of the share named sharename. To do this by guest access you would probably need to enable full access on the QNAP for guest as well as write access on the files themselves (eg. mode 777).

Smbclient doesn't seem to be able to do it recursively - you could use some bash magic to achieve it though. The following seems to work (assuming the share is mounted at /mountpoint:

Code: Select all

cd /mountpoint
find * -type f -exec smbclient -N -c 'setmode "{}" -h' //server/sharename \;

This is very slow and there are probably much better ways to achieve it.

CL

JM22681
New here
Posts: 4
Joined: Sat Jul 30, 2016 10:07 am

Re: All files tagged as "hidden system files"!!?

Post by JM22681 » Wed Aug 10, 2016 9:38 am

This is an awesome feature - fixed my issues as well.

I do have a question though. Are there security risks inherent with setting those file attributes as wide open as that script does? My NAS is relatively contained to just SMB and SSH access, but I wonder whether those attributes could be harmful with NFS or FTP.

User avatar
schumaku
Guru
Posts: 43673
Joined: Mon Jan 21, 2008 4:41 pm
Location: Kloten (Zurich), Switzerland -- Skype: schumaku
Contact:

Re: All files tagged as "hidden system files"!!?

Post by schumaku » Wed Aug 10, 2016 9:33 pm

JM22681 wrote:I do have a question though. Are there security risks inherent with setting those file attributes as wide open as that script does? My NAS is relatively contained to just SMB and SSH access, but I wonder whether those attributes could be harmful with NFS or FTP.
SAMBA made use of the U**x file protection mask to store additional attributes for decades. Needless to say, this makes the "classic" U**x permission scheme kind of obsolete. Today, the QNAP NAS can be operated in two modes: The default, which is shared folder based security only, and with using Advanced Folder Permissions (read: simple POSIX ACLs on folders and files). Only with the Advanced Folder Permissions, granular access control within shared folders and files are possible - and workable with AFP, FTP, SMB/CIFS, SSH*, and File Station. Said that, NFS is another awful story in general, requiring a lot of harmonized and customized set-up of NFS client and NFS server anyway. When it comes to SSH, QNAP does only support SSH (and SFTP) for admin - which is uid:0 anyway.

JM22681
New here
Posts: 4
Joined: Sat Jul 30, 2016 10:07 am

Re: All files tagged as "hidden system files"!!?

Post by JM22681 » Thu Aug 11, 2016 7:59 am

Thanks for that clarity, so I think you're saying don't worry about these blanket "classic" permissions that are open-ended on the UNIX layer? They seem foundational to enabling the use of the other protocols, so I guess "it is what it is"!

User avatar
schumaku
Guru
Posts: 43673
Joined: Mon Jan 21, 2008 4:41 pm
Location: Kloten (Zurich), Switzerland -- Skype: schumaku
Contact:

Re: All files tagged as "hidden system files"!!?

Post by schumaku » Sat Aug 13, 2016 4:57 am

JM22681 wrote:Thanks for that clarity, so I think you're saying don't worry about these blanket "classic" permissions that are open-ended on the UNIX layer? They seem foundational to enabling the use of the other protocols, so I guess "it is what it is"!
Well, that's how the NAS is built. Modern granular access control modes are not compatible the the U**X protection mask model from 1970 anyway. ACLs are the way to go - Advanced Folder Permissions on the NAS, and use ACL mounts. This does add another layer of complexity - on top of harmonizing IDSs and UIDs, group names, usernames, ....

BenlyHar
Starting out
Posts: 37
Joined: Thu Feb 16, 2017 10:19 pm

Re: All files tagged as "hidden system files"!!?

Post by BenlyHar » Mon Jul 03, 2017 10:00 pm

I copied almost 1500 pictures to my NAS and it is also marked as hidden system files. How can I recover them?

User avatar
schumaku
Guru
Posts: 43673
Joined: Mon Jan 21, 2008 4:41 pm
Location: Kloten (Zurich), Switzerland -- Skype: schumaku
Contact:

Re: All files tagged as "hidden system files"!!?

Post by schumaku » Tue Jul 04, 2017 3:12 am

BenlyHar wrote:I copied almost 1500 pictures to my NAS and it is also marked as hidden system files.
Almost no information.

Copied how? From what source? What NAS model, firmware version, build date? Plain shared folder permissions or Advanced Folder Permissions enabled?

BenlyHar
Starting out
Posts: 37
Joined: Thu Feb 16, 2017 10:19 pm

Re: All files tagged as "hidden system files"!!?

Post by BenlyHar » Tue Jul 04, 2017 4:00 pm

schumaku wrote:
BenlyHar wrote:I copied almost 1500 pictures to my NAS and it is also marked as hidden system files.
Almost no information.

Copied how? From what source? What NAS model, firmware version, build date? Plain shared folder permissions or Advanced Folder Permissions enabled?



I know you're a pro here. At least be a little courteous when it comes to new members. I am new to this NAS system and don't know much about it. My cousin actually owns this system and it's installed here in my home. It's Qnap turbo NAS Ts451 model.
4.3.3.0229 build 20170624 firmware.

Copied from external source, a USB.

User avatar
schumaku
Guru
Posts: 43673
Joined: Mon Jan 21, 2008 4:41 pm
Location: Kloten (Zurich), Switzerland -- Skype: schumaku
Contact:

Re: All files tagged as "hidden system files"!!?

Post by schumaku » Tue Jul 04, 2017 4:26 pm

OK, USB - what file system?

Copied how?

BenlyHar
Starting out
Posts: 37
Joined: Thu Feb 16, 2017 10:19 pm

Re: All files tagged as "hidden system files"!!?

Post by BenlyHar » Sun Jul 09, 2017 7:27 pm

schumaku wrote:OK, USB - what file system?

Copied how?


USB file system? NTFS

marked and sent to other disk

Post Reply

Return to “File Sharing”