Using handle_size bytes gpfs_fsal_handle in GPFSFSAL_handlecmp and FSAL_Handle_to_RBTIndex/FSAL_Handle_to_HashIndex
Get rid of some dead code

test_idmapper.c is never invoked and tests a defunct hash function.

Signed-off-by: Frank Filz <ffilz@us.ibm.com>
FSAL_GPFS no longer uses FSAL_UP parms in config, ignore them

Signed-off-by: Frank Filz <ffilz@us.ibm.com>
Add strmaxcpy and strmaxcat inline functions

These functions check if the destination buffer has room, and
if so, copy or concatenate the string and return 0. The destination
will be null terminated (and these functions assume the source
strings are null terminated also).

If there isn't enough room, the destination is unchanged and
the functions return -1.

Signed-off-by: Frank Filz <ffilz@us.ibm.com>
Add space for null char in MAXNAMELEN/FSAL_MAX_NAME_LEN buffers

Signed-off-by: Frank Filz <ffilz@us.ibm.com>
Explicitly use NFS4_VERIFIER_SIZE instead of "8"

Signed-off-by: Frank Filz <ffilz@us.ibm.com>
Replace strncpy with memcpy for copying NFS4 open verifier

Signed-off-by: Frank Filz <ffilz@us.ibm.com>
Cleanup string length issues in log_functions.c

Also use gsh_malloc instead of malloc in normal path.

This patch does not touch get_debug_info().

Also remove unused GetNameFunction.

Also remove log_vnsprintf

Signed-off-by: Frank Filz <ffilz@us.ibm.com>
Make sure all strings properly handled in fsal_strings.c

Signed-off-by: Frank Filz <ffilz@us.ibm.com>
Pass in_str_maxlen=0 to FSAL_str2name/FSAL_str2path if str is null term

Signed-off-by: Frank Filz <ffilz@us.ibm.com>
Replace strncpy and strlcpy with strmaxcpy, check overflow and null terminate strings

Also check result of strmaxcpy and report error if overflow
would have occurred.

Signed-off-by: Frank Filz <ffilz@us.ibm.com>
Reuse p_pdirent[*p_nb_entries].name to get handle for dirent

Signed-off-by: Frank Filz <ffilz@us.ibm.com>
Replace gsh_malloc + strcpy with gsh_strdup

Signed-off-by: Frank Filz <ffilz@us.ibm.com>
Use memcpy instead of strncpy when we know string length

Signed-off-by: Frank Filz <ffilz@us.ibm.com>
Use strcpy(x, y) instead of memcpy(x, y, strlen(y) + 1)

Signed-off-by: Frank Filz <ffilz@us.ibm.com>
Use free_utf8 instead of gsh_free

Signed-off-by: Frank Filz <ffilz@us.ibm.com>
Fixup nfs_ParseConfLine to take the size of the buffers

And use strmaxcpy to fill buffers.

Signed-off-by: Frank Filz <ffilz@us.ibm.com>
Have stat exporter use parseAccessParam instead of having it's own version.

Signed-off-by: Frank Filz <ffilz@us.ibm.com>
Simplify nfs_ParseConfLine and have it's users handle buffer sizes

Instead of allocating memory all over the place, considering the
input string to nfs_ParseConfLine is modified to null terminate
every token, just return pointers to those sub-strings.

Also, length check each token if requested (some callers benefit
from this, other callers don't bother since they aren't copying
the tokens into another string buffer).

Signed-off-by: Frank Filz <ffilz@us.ibm.com>
Clean out some unused functions in common_utils

Signed-off-by: Frank Filz <ffilz@us.ibm.com>