improved dos attribute handling

Ola Lundqvist opal at
Fri Jan 31 11:41:46 GMT 2003

Hello again.

This is the next issue for which I have created a patch.

There is a problem with the current dos filemode option. The
problem is that you can only set read only but not remove it
again. You can of course not because you do no longer have
write permissions to the file. My fix change the behaviour to
check the directory and file for permissions.

If the user has write permission to the dir and
(is owner of file, or member of group or part of group) of
the file the read-only can be removed. The code is tested
but not for very long time. Right now just a week in a
production server. I have not checked if it is possible to
bypass something but I do not think so. I think I have catched
all cases, but checking is good.

For other information, see:

The patch is located at (against the debian version of 2.2.3a):

or just
if you want to look at the files directly. The patch includes
the changes to the smbd makefile and dosmode.c file.

I had to write some functions myself because the normal C-functions
did not really behave as windows functions... That did not surprise
me a lot though. :)

Best regards,

// Ola

 --------------------- Ola Lundqvist ---------------------------
/  opal at                     Annebergsslingan 37      \
|  opal at                 654 65 KARLSTAD          |
|  +46 (0)54-10 14 30                  +46 (0)70-332 1551       |
|             UIN/icq: 4912500         |
\  gpg/f.p.: 7090 A92B 18FE 7994 0C36  4FE4 18A1 B1CF 0FE5 3DD9 /

More information about the samba-technical mailing list