DSM-G600, DNS-3xx and NSA-220 Hack Forum

Unfortunately no one can be told what fun_plug is - you have to see it for yourself.

You are not logged in.

Announcement

#1 2007-09-10 21:27:22

tedlegrand
Member
Registered: 2007-03-07
Posts: 20

some files no longer accessible

I've been using the DNS-323 im my office for about six month now with about 15 users connected through windows XP with a mapped network drive to a shared folder on the device. Everything was working fine up until now.

some files are no longer accessible from one or many PC. When I try to copy one of these files, I get this message: Error copying Files or Folder: cannot copy "filename": Access is denied. When trying to view the file from say excel, I get a similar message like the document may be read-only or encrypted.

Although maybe not related, I just created some password protected folders via the network access option, so that some employees can keep confidential files in there. I created three users with passwords part of the employee group, then assigned these three users to three folders not accessible via the shared folder. In their windows xp machine, the password is set the same as the dns-323 password so they won't have to enter a password again to access their not shared mapped folder. And I started having this problem right after I did this.

I tried accessing the files via ftp, and same problem. I also tried to reboot the device with no luck.


Thanks,
Eric.

Offline

 

#2 2007-09-12 16:25:10

tedlegrand
Member
Registered: 2007-03-07
Posts: 20

Re: some files no longer accessible

Update:

The weird thing is I can move the non-accessible files around, I can rename them, but I can not delete them.

Anyone else encountered this?

Thanks

Eric.

Offline

 

#3 2007-09-18 17:12:11

tedlegrand
Member
Registered: 2007-03-07
Posts: 20

Re: some files no longer accessible

I can't believe no one here is using password protected folders.
I sent d-link an email of my problem, but still no answers.

Eric.

Offline

 

#4 2007-09-18 22:51:47

tedlegrand
Member
Registered: 2007-03-07
Posts: 20

Re: some files no longer accessible

I think I have made progress in finding what is my problem, but still, I have no solutions.

I have one shared folder that is accessible to anyone (user/group = ALL)
I also have three password protected folders that only three different users have access to one of them.
All three users are under the group "employee"

Now files (mostly office documents i.e. word, excel) modified by a regular user removes access to group and global.
When I say modified, I mean open, modify, then saved: note that a message on excel appears demanding me to either save a copy or overwrite because it is apparently already opened by another user which is fals, so I have to say overwrite.

Files created from scratch usually keeps permissions to everyone.

Now I can see the permissions from ftp, but I cannot change them. It tells me I am not allowed to do that.

anyone knows how I can reset permissions for all files?

Thanks,
Eric.

Offline

 

#5 2007-09-19 16:38:32

tedlegrand
Member
Registered: 2007-03-07
Posts: 20

Re: some files no longer accessible

More progress

I just added telnet to my device just to be able to change file permissions. It was easier than I thought and now I'm seeing all the potential of this device.

Back to my problem, it seams it has something to do with the group I created, so I deleted the group and put back my users without groups, and it seams to have somewhat helped for now.

since my files lost some permission, is there a way to give back all permissions to all of my files in one shot using telnet?

Will this work (I am new to linux command line):
chmod -R 777 /mnt/HD_a2/
chown -R nobody:501 /mnt/HD_a2/

do I need to set the owner and the group like I mentioned above?


here is an example of some files that lost permissions:

-rwx------    1 nobody   501         16384 Sep 19 08:15 Agenda.xls
-rwxrwxrwx    1 nobody   501         13824 Sep 19 08:06 LATESTTERRENCE.xls
-rwxrwxrwx    1 nobody   501         13824 Sep 18 14:34 LORRAINE.xls
-rwx------    1 nobody   501         13824 Sep 19 08:07 anotherone.xls
-rwxrwxrwx    1 nobody   501         13824 Sep 18 14:28 conf2003.xls
-rwxrwxrwx    1 nobody   501         13824 Sep 19 08:09 costsa.xls
drwxrwxrwx    2 nobody   501          4096 Sep 19 08:12 eric
drwxrwxrwx    2 lloyd    502          4096 Sep 19 08:13 eric new
-rwxrwxrwx    1 nobody   501         13824 Sep 18 14:47 eric save as.xls
-rwxrwxrwx    1 nobody   501         24064 Sep 18 14:21 eric.doc
-rwxrwxrwx    1 nobody   501             4 Sep 18 14:27 eric.txt
-rwxrwxrwx    1 nobody   501         13824 Sep 18 14:16 eric.xls
-rwxrwxrwx    1 nobody   501         13824 Sep 18 14:38 ericnew.xls
-rwxrwxrwx    1 505      502          9911 Sep 18 10:44 excel error.JPG
-rwxrwxrwx    1 505      502          6947 Sep 18 10:48 excel error2.JPG
-rwx------    1 nobody   501         13824 Sep 19 08:06 latest.xls

here are my users:
root:x:0:0:Linux User,,,:/home/root:/bin/sh
admin:x:500:500:Linux User,,,:/home/ftp:/bin/sh
nobody:x:501:501:Linux User,,,:/home/nobody:/bin/sh
ftp:*:95:95::/mnt/HD_a2/temp:/bin/sh
admintrip:x:506:506:Linux User,,,:/mnt:/bin/sh
lorraine:x:507:507:Linux User,,,:/home/ftp:/bin/sh
terrence:x:508:508:Linux User,,,:/home/ftp:/bin/sh
lloyd:x:509:509:Linux User,,,:/home/ftp:/bin/sh

Offline

 

#6 2007-09-27 22:26:06

greeners
New member
Registered: 2007-09-27
Posts: 1

Re: some files no longer accessible

I too have this problem.  I found after FTP'ing onto the DNS-323 that the offending files have lost their permissions.  I too will need to telnet onto the system and chmod the files.  Darned inconvenient.

Offline

 

#7 2007-09-28 01:17:13

tedlegrand
Member
Registered: 2007-03-07
Posts: 20

Re: some files no longer accessible

I'm "glad" to see it is not an isolated problem for me.

I have an open case with D-link support, they are working on it.

The more of you that report the problem to d-link, the quicker we should get a fix.

Eric.

Offline

 

#8 2007-10-12 22:46:25

tedlegrand
Member
Registered: 2007-03-07
Posts: 20

Re: some files no longer accessible

I just found a solution to my problem

It seams related to a samba issue in the version DNS-323 is using.
It's due to the way samba locks excel files.
I forced samba to not use oplocks

here are the steps:

telnet to the device

#vi /etc/samba/smb.conf

add the following line under [global]
oplocks = False

(alternately for just excel files: Veto oplock files = /*.xls/*.XLS/*.xlt/*.XLT/)

restart samba
#smb restart


reference
http://us4.samba.org/samba/docs/man/Sam … l#id378670
Eric.

Offline

 

#9 2007-11-14 07:49:35

djpark
New member
Registered: 2007-11-14
Posts: 3

Re: some files no longer accessible

The thread is 1 month old, but I am hitting the same problem everyday and managed to find here.

It is true that some files are having 0700 permission and owned by nobody.501 which makes it impossible for others to access with their id.

1) I use telnet using fun_plug and use this command to list such files:-

find /mnt/HD_a2 -perm 700 | grep -v "/\."

2) I use this script to fix them to 0777:-

find /mnt/HD_a2 -perm 700 | grep -v "/\." | sed -e 's/\ /\\ /g' | sed -e 's/\/mnt/chmod -c a=rwx \/mnt/' > /mnt/HD_a2/fun_plug.d/log/_chmod_

sh /mnt/HD_a2/fun_plug.d/log/_chmod_

rm -f /mnt/HD_a2/fun_plug.d/log/_chmod_

Very crude, but it works. "chmod a=rwx `find ....`" stuff can't work due to the command line length limitation.

3) I wish to find out if you have any problem of inserting a statement in the smb.conf file manually, especially from the web config interface.

When I made a small change on smb.conf file manually from telnet, the web interface displayed total nonsense. At one point, it screwed up the total config and I had to press the 'reset' button.

-- dj

Offline

 

#10 2007-11-14 15:20:25

HaydnH
Member
Registered: 2007-09-28
Posts: 187

Re: some files no longer accessible

You could probably use the -exec argument of find, {} denotes the found file, I haven't tried it on the dns-323 but it should work:

    find /mnt/HD_a2 -perm 700 -exec chmod 777 {} \;

btw, it's probably not a great idea to have all of the files executable, unless they are directories/binaries/scripts.

Haydn.

Offline

 

#11 2007-11-14 16:13:30

djpark
New member
Registered: 2007-11-14
Posts: 3

Re: some files no longer accessible

Thanks for the -exec option. It works asexpected on dns-323.

It is dns-323 which sets ALL shared files and directories 0777 by the smb.conf. For some reason some files are changed to 0700 and this keeps other users with different user id from accessing the file.

It happens a lot of times and I need to fix them to 0777 to allow users to access. I have yet to try the oplocks option suggested by tedlegrand, but I am concerned because my previous experiment with manual editing of smb.conf which bricked my dns-323.

I just managed to download the new 1.04b firmware and I hope this may help.

-- dj

Offline

 

#12 2007-11-14 16:43:06

HaydnH
Member
Registered: 2007-09-28
Posts: 187

Re: some files no longer accessible

"manual editing of smb.conf which bricked my dns-323."

I'm a bit unsure how you managed that - surely if you break samba your telnet was still working to fix it? Just `cp smb.conf smb.conf.safe` before editing the file and cp the .safe version back if you make a mistake.

Offline

 

#13 2007-11-14 17:51:45

tedlegrand
Member
Registered: 2007-03-07
Posts: 20

Re: some files no longer accessible

I'm running samba with the manually edited oplocks command for about one month now, and I have no problem with the admin interface.

Removing oplocks helped, as it is less frequent that files turn to 0700 permission, but I am still stuck having to give back permissions once in a while.

is it possible to have a script that runs every couple of hours to put all permissions to 0777?

does the firmware 1.4b still have this issue?

Offline

 

#14 2007-11-14 19:49:20

HaydnH
Member
Registered: 2007-09-28
Posts: 187

Re: some files no longer accessible

tedlegrand: I'm not sure if the dns-323 has cron installed - I would assume so but an entry similar to below would run the command every 2 hours:

(NOTE: haven't checked the below line so DON'T use it... it's probably missing a * or something)

02 * * * * root  find /mnt/HD_a2 -perm 700 -exec chmod 777 {} \;

Offline

 

#15 2007-11-15 04:18:36

djpark
New member
Registered: 2007-11-14
Posts: 3

Re: some files no longer accessible

HaydnH:
I was moving between web admin interface and telnet doing manual modification of smb.conf file. Since I was doing 1 line at a time, I didn't see the need to make a copy. When I add a line to the conf file manually, the web interface turned out meaningless configuration. I had a few share given to group, but they are all changed to the valid_users. There must be another file keeping web config which will be converted to smb.conf file. The reverse direction doesn't seem to be working. Adding a user to the valid_users list created havoc.

Along the way pulling in and out, the dns-323 suddenly stopped responding and I wasn't able to continue both web session and telnet. After resetting it, I couldn't find it in the network. I sniffed the network packet through the dns-323, but no activity at all. The only way to bring to life was pressing the reset button.

tedlegrand:
Mine (1.03) has crond is running but I became a paranoid after being bitten badly from the manual editing and not confident to do so again. If I need, I may just put a cron entry to a linux box nearby and do it via telnet session using nc.

-- dj

Offline

 

#16 2007-11-15 05:16:47

fordem
Member
Registered: 2007-01-26
Posts: 1938

Re: some files no longer accessible

Let me put it this way - at least under the general interpretation of "bricked" - if you had "bricked" the DNS-323 - bringing it back to life would have required a bit more than "pressing" the reset button.

Offline

 

#17 2008-01-24 17:32:54

tedlegrand
Member
Registered: 2007-03-07
Posts: 20

Re: some files no longer accessible

I just installed the firmware 1.4beta which has samba v3.0.24 (smbd -V), hoping it will solve my permission denied problem on excel files, but it didn't quite solve it.

First thing I noticed, is that i have over 200 files that are no longer accessible because I had some non english characters in the filenames.

Should I do something to reset the samba config, or reset the file permission?

Is there a way to fix the non english characters automatically instead of renaming the files one by one?

Offline

 

#18 2008-01-24 18:04:26

tedlegrand
Member
Registered: 2007-03-07
Posts: 20

Re: some files no longer accessible

with more testing, the permissions disappears only when a user connected as a guest (nobody) opens and saves the file twice in a row. Users that are registered within the dns323 do not seam to have this problem.

Code:

# # ls -l

-rwxrwxrwx    1 eric     510         13824 Jan 24 10:47 test.xls
# # ls -l

-rwxrwxrwx    1 eric     510         13824 Jan 24 10:47 test.xls
# # ls -l

-rwxrwxrwx    1 nobody   501         13824 Jan 24 10:47 test.xls
# # ls -l

-rwxrwxrwx    1 nobody   501         13824 Jan 24 10:47 test.xls
# # ls -l

-rwx------    1 nobody   501         13824 Jan 24 10:47 test.xls

edit: wheter oplocks is yes or no, it does not make a difference on the result above.

Last edited by tedlegrand (2008-01-24 18:05:26)

Offline

 

#19 2008-01-25 00:38:06

mig
Member
From: Seattle, WA
Registered: 2006-12-21
Posts: 532

Re: some files no longer accessible

Can you post the contents of your smb.conf?

Last edited by mig (2008-01-25 00:38:16)


DNS-323 • 2x Seagate Barracuda ES 7200.10 ST3250620NS 250GB SATAII (3.0Gb/s) 7200RPM 16MB • RAID1 • FW1.03 • ext2 
Fonz's v0.3 fun_plug http://www.inreto.de/dns323/fun-plug

Offline

 

#20 2008-01-26 12:43:43

Mistr
Member
From: Stockholm, Sweden
Registered: 2008-01-24
Posts: 11

Re: some files no longer accessible

Hi!

I noticed that I have the same problem but it΄s not only *.xls it΄s *. doc too. (I started in this thread http://dns323.kood.org/forum/viewtopic. … 9879#p9879).

Here are the file permissions:

-rwxrwxrwx   1 root root    13803967 Nov 17 2007 QTandQLPens265_266.exe
-rwx------      1 root root         24576 Jan 26  2008 Test.doc
-rwxrwxrwx   1 root root         34304 Jan 26  2008 Test.pub
-rwxrwxrwx   1 root root                6 Jan 26  2008 Test.txt
-rwx------      1 root root         13824 Jan 26  2008 Test.xls
-rwxrwxrwx   1 root root           8960 Sep 11 2007 jag.jpg

Kindly regards, Mikael

Offline

 

#21 2008-02-27 19:38:00

rtevans
New member
Registered: 2008-02-27
Posts: 1

Re: some files no longer accessible

I haven't upgraded to 1.04 so don't know if that fixes the problem or not, but I did the following and it fixed it for me.

From a WinXP machine I cut the affected files from the DNS-323 and pasted them to my XP machine.  Deleted the files from the DNS, then copied them from XP back to the DNS and now they are all accessable again.

Hope this helps.

Offline

 

#22 2008-03-25 15:42:26

tedlegrand
Member
Registered: 2007-03-07
Posts: 20

Re: some files no longer accessible

I have upgraded to firmware 1.4 and the file permission problem is still there.
I noticed that this problem only occurs when a "guest" user edit a Microsoft file (user nobody in group 50x).
So I created a user called "user" part of group "staff" and allowed access only to that group.
Then on every workstation, I mapped the network drive with the user "user". The only downside is that we are using windows XP home edition for the workstations, so it is impossible to save the password for the mapped connection.

It seams to work for now, but after upgrading to firmware 1.4, the non-english characters displays as squares, so I have to rename them one by one before using them. haven't found a way to massively rename all of those.

Eric.

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2010 PunBB