mount.cifs - "Const" warnings patch

Jeff Layton jlayton at
Sat Nov 7 06:19:44 MST 2009

On Mon, 02 Nov 2009 21:36:19 +0100
Matthias Dieter Wallnöfer <mdw at> wrote:

> Hi Jeff,
> sorry, sorry - sometimes I forget the attachments.
> Now it should be okay.

No problem, I do the same thing sometimes.

The patch looks safe enough, but I wonder whether the problem is really
in addmntent. Looking at a recent glibc, it doesn't look like addmntent
ever changes any of the strings it gets passed. If any of them need to
be reencoded, it uses alloca to get a new buffer and reencodes the
string into that. Maybe the prototype for it should declare the struct
as const.

Fixing it there though may be problematic. Assuming that not stripping
off the const generates a warning, maybe it would be a little more
clear to just declare a non-const variable to hold a "cifs" string and
pass that in instead. Something like this maybe?

Jeff Layton <jlayton at>

More information about the samba-technical mailing list