LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices

Reply
 
LinkBack Search this Thread
Old 01-07-2004, 01:51 PM   #1
mdkelly069
Member
 
Registered: Oct 2003
Posts: 43

Rep: Reputation: 15
New Samba date modification problem


Hi All,

I made post awhile ago regarding date modification when copying new files over from a Windows machine to a samba server. I have since resolved that problem by switching the samba share drive to the Linux ext3 file system. I tested things and they were working great so I thought my problems were over, until now.

I was advised my a fellow employee that when they open excel files, or a couple of other types of files that I have tried myself, and only view the file, when they attempt to close it the system asks if they want to save the changes they have made, and even after saying no, once the file is closed, the modification date, creation date, and access date have all been changed to the minute the file was opened.

A little shorter:

open file --> read file contents --> close file systems dates changed!

This does not happen with Word documents, jpgs, pdf files, ...

So far it does this only with excel files and canvas (graphics prog) files and I am still testing for more.

Has this happened to anyone before, and if so, how did you deal with it.

This is not a good thing to be happening as the actual file dates are critical to some of the work that we do, especially the modified date

Thanks for any help
mdkelly
 
Old 01-07-2004, 02:18 PM   #2
nysethe
Member
 
Registered: Jul 2003
Distribution: Fedora Core 1
Posts: 35

Rep: Reputation: 15
Not sure if this is the right answer or not, but I figured I would throw in my 2 cents...

Since the file dates are not being changed when you open standard pictures and other files, it *might* be safe to assume that MS Office has a hand in this problem. If this were a configuration issue on the Samba side, the dates would change when you view JPG's.

I would be willing to gamble that there is a setting somewhere in Excel that address this issue. Perhaps "auto save" is enabled even...

Hope this helps...

Regards,
Erik
 
Old 01-07-2004, 03:07 PM   #3
mdkelly069
Member
 
Registered: Oct 2003
Posts: 43

Original Poster
Rep: Reputation: 15
Erik,

Thank you for your reply. I had/have thought this way as well. However, if this was the case it should happen the same way on both the samba server and when working and saving to your local machine.

I did some more research on it and found that it is a file ownership issue.

All users of the file server belong to the same group, but each have unique login names. If I take a file and change ownership to my user-name the problem does not occur, if I change it back to the original owner the problem occurs again.

Is there anyway to avoid this. We have 15 people in our office who all collaborate on many documents. Other problem is that 90% of the files on our server are owned by root since they recently were moved from a FAT32 setup.

I cannot see this being correct, date modification that is, since the point of a file server is to share files, and if all the dates, modified, accessed, created are going to change every time someone reads a file that could lead to a lot of confusion. Hope I/we can solve this

Thanks again
mdkelly
 
Old 01-07-2004, 03:12 PM   #4
t3___
Member
 
Registered: Sep 2003
Posts: 240

Rep: Reputation: 30
on a related note, I dicovered that mcafee virusscan can modify the datestamp of MS office files (only - other file types were not affected)... one of our users was fooling around and created a mcafee job that scanned both local and network drives... much to our dismay, after it ran once, every MSOffice file on our network had the previous days datestamp.
 
Old 01-07-2004, 03:13 PM   #5
dubman
Member
 
Registered: Jan 2003
Distribution: Redhat 9, Fedora Core 1, Suse 8
Posts: 188

Rep: Reputation: 30
You could have them map to the samba drive using a different user name, root if you wish. That way everyone will be logged into the network drive with the same user name, hence no ownership issues.
 
Old 01-07-2004, 03:29 PM   #6
nysethe
Member
 
Registered: Jul 2003
Distribution: Fedora Core 1
Posts: 35

Rep: Reputation: 15
You can also put these lines on in your smb.conf file. These entries need to be part of each shared folder that you would like to see affected:

create mask = 0777 (NOTE: This would give full permission to everyone)
force user = joebob


Doing this will make it so that the files always end up being owned by "joebob." This will allow everyone to edit/delete anything in the shared folder.

Let me know if this wasn't what you were looking for...

Regards,
Erik
 
Old 01-07-2004, 04:18 PM   #7
mdkelly069
Member
 
Registered: Oct 2003
Posts: 43

Original Poster
Rep: Reputation: 15
t3___ : Thanks for that info. I will have to check all of our workstations to ensure the virus scanners are only scanning locally.

dubman: thanks for the reply. Having everyone as the same user is the system we moved away from. When I started here all employees were logging into a Win2000 shared folder under the "guest" account.

Erik: sounds interesting.

questions:

is it really necessary to have create mask set to 0777. currently I have it set to 0770 as all users, and the guest account I created, are part of the same group. If it is possible I would prefer to not give the world rwx permission on all the files.

if I put "force user=joebob" into the configuration and an employee, say joeblow, opens a file, would it not present the same situation as I currently have, joeblow open a file owned by joesmith and it changes the date when he closes it

Thanks again for the info
mdkelly
 
Old 01-07-2004, 04:57 PM   #8
nysethe
Member
 
Registered: Jul 2003
Distribution: Fedora Core 1
Posts: 35

Rep: Reputation: 15
Mdkelly,

-0770 should be fine. I wasn't sure if you cared about security on the network or not.

-If "joeblow" opens a file that that is owned/created by "joesmith", the file date should not change since the file is actually not owned by either of the two. When you force a user on a share, it tells UNIX that "joebob" is editing the file when "joeblow" or "joesmith" are the ones actually editing it.

I ran into a situation at home where I wanted to share out a folder to my wife and I, and give us both write access. When either of us created a file or folder, the other user was unable to change it since it was owned by the other person. Adding the force user line in the smb.conf made it so that no matter who touched the file, it would always end up being owned by the same UNIX account.

I am pretty certain that if you try this, your time issue would go away. Then again, all files would end up being owned by the same person. This is almost like having a guest account, but users still have to authenticate individually.

I hope I havn't confused you even more...
Erik
 
Old 01-07-2004, 05:09 PM   #9
mdkelly069
Member
 
Registered: Oct 2003
Posts: 43

Original Poster
Rep: Reputation: 15
Erik,

thanks for the info. Not confusing at all, actually cleared up a few things. Not to worried about having all files owned by the same user as, as you stated, anyone else must still be able to authenticate themselves onto the Samba server before they can touch any of the files.

I will give your suggestions a shot, hopefully tonight as I cannot restart the server right now as the office is open, and let you know how it goes.

Thanks again
mdkelly
 
Old 01-07-2004, 05:12 PM   #10
nysethe
Member
 
Registered: Jul 2003
Distribution: Fedora Core 1
Posts: 35

Rep: Reputation: 15
FYI,

At the command prompt you can put in:
service smb reload

This will reload the smb.conf file without disrupting active users.

-Erik
 
Old 01-07-2004, 06:13 PM   #11
mdkelly069
Member
 
Registered: Oct 2003
Posts: 43

Original Poster
Rep: Reputation: 15
Thanks for the extra tip.

I start both smbd and nmbd using the -D flag from rc.local.

would your tip still work?

Thanks
mdkelly
 
Old 01-09-2004, 09:34 AM   #12
nysethe
Member
 
Registered: Jul 2003
Distribution: Fedora Core 1
Posts: 35

Rep: Reputation: 15
Yes, that should be OK.

Sorry I'm late with that answer...

-Erik
 
Old 01-09-2004, 09:39 AM   #13
nysethe
Member
 
Registered: Jul 2003
Distribution: Fedora Core 1
Posts: 35

Rep: Reputation: 15
One extra note:

You can save a few extra keystrokes by starting Samba this way:
service smb start

This will start both smbd & nmbd.

-Erik
 
Old 01-10-2004, 01:43 PM   #14
mdkelly069
Member
 
Registered: Oct 2003
Posts: 43

Original Poster
Rep: Reputation: 15
Thanks again for the info.

I will give this a shot today at work. The office is closed so I can re-configure the server without worry of disruption.

I will let you know how it all works out

Cheers
mdkelly
 
Old 01-12-2004, 11:42 AM   #15
mdkelly069
Member
 
Registered: Oct 2003
Posts: 43

Original Poster
Rep: Reputation: 15
nysethe: made the changes over the weekend and all appears to be working great. Ran a bunch of tests with the suspect file types and they now retain the correct time/date information.

I also tried the commands for restarting samba and they did not work. I installed Samba from source on the machine in question so maybe that has something to do with it. Not really a big issue

Thanks for all your help
mdkelly
 
  


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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Get file modification date/time in Bash script cmfarley19 Programming 12 01-19-2013 09:37 AM
Samba - Modify File Date Azhrarn Linux - Software 1 09-06-2005 01:51 PM
Heeelp! How to preserve file date modification attribute Slackovado Slackware 1 03-30-2005 09:36 AM
File Modification Date Comparison MadTurki Programming 7 03-08-2004 04:02 PM
Help with Samba and date modification mdkelly069 Linux - Networking 6 11-28-2003 06:26 PM


All times are GMT -5. The time now is 06:35 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration