* Sets client->fcl_user on success, don't do anything on failure
* so that the client stays unauthenticated */
{
- /* [@PR #17] renamed (previously called 'true') to avoid conflict with
- stdbool */
- const int value = 1;
+ const int true_val = 1;
/* There is no ucred.h (or equivalent) on linux to define struct ucred (!!)
* so we do it here */
#if ! ( defined(HAVE_CRED_H) && defined(HAVE_UCRED_H) \
socklen_t cred_size = sizeof(cred);
struct passwd *p_entry = NULL;
- setsockopt(client->fcl_sock_fd, SOL_SOCKET, SO_PASSCRED, &value,
- sizeof(value));
+ setsockopt(client->fcl_sock_fd, SOL_SOCKET, SO_PASSCRED, &true_val,
+ sizeof(true_val));
if (getsockopt
(client->fcl_sock_fd, SOL_SOCKET, SO_PEERCRED, &cred,
&cred_size) != 0) {
}
-/* [@PR #17] renamed labels 'true' and 'false' to avoid conflict with
- stdbool */
char *
get_bool(char *ptr, int *i)
/* get a bool value : either true (1) or false (0)
* return NULL on error */
{
if (*ptr == '1')
- goto conf_true;
+ goto true_val;
else if (*ptr == '0')
- goto conf_false;
+ goto false_val;
else if (strncmp(ptr, "true", 4) == 0) {
ptr += 3;
- goto conf_true;
+ goto true_val;
}
else if (strncmp(ptr, "yes", 3) == 0) {
ptr += 2;
- goto conf_true;
+ goto true_val;
}
else if (strncmp(ptr, "false", 5) == 0) {
ptr += 4;
- goto conf_false;
+ goto false_val;
}
else if (strncmp(ptr, "no", 2) == 0) {
ptr += 1;
- goto conf_false;
+ goto false_val;
}
else
return NULL;
- conf_true:
+ true_val:
*i = true;
ptr++;
return ptr;
- conf_false:
+ false_val:
*i = false;
ptr++;
return ptr;