New user's registration have been closed due to high spamming and low trafic on this forum. Please contact forum admins directly if you need an account. Thanks !

Can't delete files

Got problems with your B2 or B3? Share and get helped!
Post Reply
BadTicket
Posts: 72
Joined: 12 Jan 2012, 13:24

Can't delete files

Post by BadTicket »

Hello together

Everything was OK until I restart my Mac. Now it's not possible anymore to delete files on my B3. The files are located in "Public share - storage - video" and I can see them under "User share - storage - video" too (which is strange for me).

What can I do, that everybody in the network can do everything with the files on the B3? I really don't need any file-restriction, just a NAS that is usable for anybody in the net...

Thanks a lot and regards
Marcel
Gordon
Posts: 1464
Joined: 10 Aug 2011, 03:18

Re: Can't delete files

Post by Gordon »

It can get confusing indeed. Storage is it's own share but it is also a directory in the home share. The complicating factor here is that while you may use Samba's mechanism to force a particular group name on files that are written through the storage share, you will not want this for files that are written through the home share (which includes the storage directory). And then there is also the possibility that files get added through some other means than Samba, so this will definitely not follow the Samba rules.

In my experience the only sound-proof way to guarantee certain rights to a certain group or user (or plural) is to use ACL's.
Ubi
Posts: 1549
Joined: 17 Jul 2007, 09:01

Re: Can't delete files

Post by Ubi »

He's not using Samba, he's using AFP (as can be derived from the share names). THe fact that this error started after a reboot of the *client* suggests a communications error or a credentials error.

The interesting part here would be if you show the *actual* file permissions on the file you can no longer delete by logging onto the SSH terminal of the B3. Are you able to get this info?
BadTicket
Posts: 72
Joined: 12 Jan 2012, 13:24

Re: Can't delete files

Post by BadTicket »

Ubi wrote:Are you able to get this info?
Sorry, but I don't know how to do this? Is there no possibility to define all files that they are free for using?
Gordon
Posts: 1464
Joined: 10 Aug 2011, 03:18

Re: Can't delete files

Post by Gordon »

Ubi wrote:He's not using Samba, he's using AFP (as can be derived from the share names). THe fact that this error started after a reboot of the *client* suggests a communications error or a credentials error.

The interesting part here would be if you show the *actual* file permissions on the file you can no longer delete by logging onto the SSH terminal of the B3. Are you able to get this info?
I don't speak Mac :oops: It's a shortcoming in my upbringing I know - I blame my parents...

From the point of Linux, which I do understand and is on the B3: same difference. Either you enable ACL or you somehow arrange everything to be world accessible (which some mechanisms will plainly refuse to do).
BadTicket
Posts: 72
Joined: 12 Jan 2012, 13:24

Re: Can't delete files

Post by BadTicket »

Gordon wrote:Either you enable ACL or you somehow arrange everything to be world accessible (which some mechanisms will plainly refuse to do).
I don't find where I can enable ACL. Under "File sharing" I have enable "AFP" and "Windows file sharing" but there is no ACL. What does ACL mean?
Ubi
Posts: 1549
Joined: 17 Jul 2007, 09:01

Re: Can't delete files

Post by Ubi »

ACL means access control list, it's a more finegrained control over file permissions. ACL was not invented by UNIX developers and (in my opinion) is forced upon it. I think it brings more bad than good, specifically because linux admins tend to look only at the standard permissions and forget about the ACL. For windows-oriented admins I suppose ACLs have a benefit.

Anyway, it really is your choice, follow Gordons proposed fix and use ACLs, or use my method and solve it with UNIX permissions.
BadTicket
Posts: 72
Joined: 12 Jan 2012, 13:24

Re: Can't delete files

Post by BadTicket »

Thanks for the answer. I really don't know what I should do now, because both I don't understand. I'm just a computer user and like to use it as every technical system at home. But the computer industry is very complex and not user oriented :cry:

What I checked in the meantime was to delete the file with a windows vista system. There I don't need any login and can delete the file. But as I normally have no windows system this should only be a "last chance", not the normal way...
Gordon
Posts: 1464
Joined: 10 Aug 2011, 03:18

Re: Can't delete files

Post by Gordon »

Well the thing is that Unix rights are really very simple in design. You have an owner, a group and everyone else, so how difficult can it be you ask? The fun starts when you allow a user that is not the owner of the directory and also has a different primary group, to write in that directory. Since in most cases it is not custom to create files and directories that are world-writable, chances are high that no other user can touch that file because it belongs to a different owner and group. The original design is simply not fit to allow multiple users that belong to different primary groups to write in one single directory. So they invented the "sticky bits" that you may see on some of the directories by either a 't' or 's' that is supposed to make the owner or group a inherited property but somehow not always does (also I don't think the sticky bits themselves are also inherited if you create subdirectories - I should verify).

I like ACL because it allows me to do things that are otherwise practically impossible to achieve. Example: I have a faxmodem running on the old mgetty+sendfax service and that stores the faxes as tiff images on my server as user uucp and with access rights set to 600. By using ACL I can allow the apache webserver to access these files also and convert and view the faxes in a webpage.

A quickstart quide:

Code: Select all

# become the root user
su -

# Get the acl tools getfacl and setfacl
apt-get install acl

# Enable acl on the current mount instance of /home
mount -o remount,acl /home

# Recursively set the additional access rights for the storage dir
setfacl -R -m group:users:rwx  /home/storage

# Also set the rights that new files should receive
setfacl -R -d -m group:users:rwx  /home/storage
To make the ACL support be also active after a reboot, you need to edit the /etc/fstab file and add the acl option to the /home mount line.
BadTicket
Posts: 72
Joined: 12 Jan 2012, 13:24

Re: Can't delete files

Post by BadTicket »

Hello Gordon

Thanks for your help, but as written before: I'm a user, not a computer expert. So I really can't understand what I have to do. Isn't it not possible to run a program or so that gives my files free? I think this file belongs to me, so why the system is not accepting that?

Heavenicetrip! Fe/2
Gordon
Posts: 1464
Joined: 10 Aug 2011, 03:18

Re: Can't delete files

Post by Gordon »

There are not many other roads to take. If you can't delete it you are clearly not the owner (or somehow not considered to be) and the file also does not have the proper group rights (or possibly belongs to a different primary group - admin?). As far as I can see there is no mechanism provided that allows you to see the owner and group of a particular file, however you can see what rights have been assigned by using file manager (it says group "B3 users", but it also states that on root-owned files).

Unless you're willing to do some kind of brute-force investigating which user the file belongs to, I don't see any other option than to go into the console. There you have the option to fix it for now by using chown / chgrp / chmod or make sure it doesn't happen again.
RandomUsername
Posts: 904
Joined: 09 Oct 2009, 18:49

Re: Can't delete files

Post by RandomUsername »

I don't know anything about AFP but you can add an admin user to smb.conf that has abilities to do everything to all files. Is there anything similar for AFP?
Post Reply