problem with recent change to glfs_realpath

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi all,

Anoop has brought to my attention that
recently glfs_realpath was changed in an incompatible way:

Previously, glfs_realpath returned an allocated string
that the caller would have to free with 'free'. Now  after
the change, free segfaults on the returned string, and
the caller needs to call glfs_free.

That change makes no sense, imho, because the result from
a realpath implementation may be used by the application
using libgfapi, outside of the scope of the actual libgfapi
using code. E.g. in samba, the gfapi calls are hidden behind
the vfs api in the gluster backend. But the realpath result
is used outside the vfs module. I think this should be quite
normal a use case, and hence glfs_realpath should behave
as one would expect from a realpath implementation
(and as described in the realpath(3) manpage): return a string
that needs to be freed with 'free'...

Now for samba, after thorough discussion with Anoop and Rajesh,
we have proposed a fix/workaround by using the variant of
glfs_realpath that hands in a pre-allocated result string.
This renders us independent of the allocation method used by
glfs_realpath. But we wanted to point this out to the list, since
it is a potential problem for other users, too.

Cheers - Michael

Attachment: signature.asc
Description: PGP signature

_______________________________________________
Gluster-devel mailing list
Gluster-devel@xxxxxxxxxxx
http://www.gluster.org/mailman/listinfo/gluster-devel

[Index of Archives]     [Gluster Users]     [Ceph Users]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux