LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   New Samba date modification problem (https://www.linuxquestions.org/questions/linux-networking-3/new-samba-date-modification-problem-132466/)

mdkelly069 01-07-2004 01:51 PM

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

nysethe 01-07-2004 02:18 PM

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

mdkelly069 01-07-2004 03:07 PM

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

t3___ 01-07-2004 03:12 PM

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.

dubman 01-07-2004 03:13 PM

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.

nysethe 01-07-2004 03:29 PM

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

mdkelly069 01-07-2004 04:18 PM

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

nysethe 01-07-2004 04:57 PM

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

mdkelly069 01-07-2004 05:09 PM

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

nysethe 01-07-2004 05:12 PM

FYI,

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

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

-Erik

mdkelly069 01-07-2004 06:13 PM

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

nysethe 01-09-2004 09:34 AM

Yes, that should be OK.

Sorry I'm late with that answer...

-Erik

nysethe 01-09-2004 09:39 AM

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

mdkelly069 01-10-2004 01:43 PM

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

mdkelly069 01-12-2004 11:42 AM

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


All times are GMT -5. The time now is 05:23 PM.