/* Check permissions on unix socket directory */
if (lstat(dir, &st) == -1) {
+ errno = ENOENT;
return -1;
}
if (!S_ISDIR(st.st_mode) ||
(st.st_uid != 0 && st.st_uid != geteuid())) {
+ errno = ENOENT;
return -1;
}
the winbindd daemon is not running. */
if (lstat(path, &st) == -1) {
+ errno = ENOENT;
SAFE_FREE(path);
return -1;
}
if (!S_ISSOCK(st.st_mode) ||
(st.st_uid != 0 && st.st_uid != geteuid())) {
+ errno = ENOENT;
return -1;
}
restart:
if (winbind_open_pipe_sock(recursing, need_priv) == -1) {
+ errno = ENOENT;
return -1;
}
if (winbind_write_sock(request, sizeof(*request),
request->wb_flags & WBFLAG_RECURSE,
- need_priv) == -1) {
+ need_priv) == -1)
+ {
+ /* Set ENOENT for consistency. Required by some apps */
+ errno = ENOENT;
+
return NSS_STATUS_UNAVAIL;
}
(winbind_write_sock(request->extra_data.data,
request->extra_len,
request->wb_flags & WBFLAG_RECURSE,
- need_priv) == -1)) {
+ need_priv) == -1))
+ {
+ /* Set ENOENT for consistency. Required by some apps */
+ errno = ENOENT;
+
return NSS_STATUS_UNAVAIL;
}
/* Wait for reply */
if (winbindd_read_reply(response) == -1) {
+ /* Set ENOENT for consistency. Required by some apps */
+ errno = ENOENT;
+
return NSS_STATUS_UNAVAIL;
}