[Samba] can't copy files into one's own read-only directory

Dragan Krnic dkrnic at lycos.com
Mon Apr 19 18:38:11 GMT 2004


Windows know a special kind of folder links which look very
much like real folders but they're really a set of a small 
write-protected directory containing just 2 files: one is 
named "target.lnk", a usual link file with details about the 
target directory to which it points, and the other is a hidden 
system file (attributes "SH"), called "desktop.ini", with an 
id of a shellClass. You see this delicate structure only in a 
DOS box because Windows always displays the set as though it 
were a real directory.

You can create one by simply dragging a directory from an
Explorer window and dropping it onto the "Start" button. It
then becomes an additional menu item just like "Progs",
"Favourites" or "Settings" - it opens onto a view of the 
said drag-dropped directory. If your profile server is a
Windows server, this drag-dropped thing will be saved in 
your profile and correctly restored on next login, be it
on the same workstation or on another. But not if your
server is Samba.

Two years ago I had the problem that this kind of setup
did not survive across logins because samba didn't copy the
read-only attribute of such folders. A comment in source
file "smbd/dosmode.c" said "We never make directories read 
only for the owner as under DOS a user can always create a 
file in a read-only directory". However by changing the next 
line so that it doesn't force the writeability for the owner 
I could build smbd that copied these contradictory objects 
(from the point of view of POSIX) correctly across logins.

I moved my users yesterday from a Samba 2.2.8a to a 3.0.2a,
rebuilt smbd with that little kludge and - nothing. It doesn't
fix the problem anymore. If you've extended your profile with
such a folder link, there'll always be an error message on 
logout saying it can't copy the file "target.lnk". When you
login again that folder will be an empty folder.

Is there a way around this problem short of ignoring it or,
shudders, using a Windows server for profiles.


More information about the samba mailing list