Searched defs:fd (Results 1 - 25 of 49) sorted by relevance

12

/sssd/src/util/crypto/
H A Dsss_crypto.c29 int fd; local
31 fd = open("/dev/urandom", O_RDONLY);
32 if (fd == -1) return errno;
34 rsize = sss_atomic_read_s(fd, buf, size);
45 close(fd);
/sssd/src/util/
H A Datomic_io.c24 ssize_t sss_atomic_io_s(int fd, void *buf, size_t n, bool do_read) argument
31 pfd.fd = fd;
36 res = read(fd, b + pos, n - pos);
38 res = write(fd, b + pos, n - pos);
H A Dio.c40 int fd; local
49 fd = open(pathname, oflags);
50 if (fd == -1) {
60 v = fcntl(fd, F_GETFD, 0);
63 (void)fcntl(fd, F_SETFD, v | FD_CLOEXEC);
66 return fd;
71 int fd; local
80 fd = openat(dir_fd, pathname, oflags);
81 if (fd == -1) {
91 v = fcntl(fd, F_GETF
[all...]
H A Dutil_lock.c31 errno_t sss_br_lock_file(int fd, size_t start, size_t len, argument
49 ret = fcntl(fd, F_SETLK, &lock);
H A Dcheck_and_open.c64 errno_t check_fd(int fd, uid_t uid, gid_t gid, argument
78 ret = fstat(fd, stat_buf);
81 "fstat for [%d] failed: [%d][%s].\n", fd, errno,
127 errno_t check_and_open_readonly(const char *filename, int *fd, argument
134 *fd = open(filename, O_RDONLY);
135 if (*fd == -1) {
142 ret = check_fd(*fd, uid, gid, mode, mask, &stat_buf);
144 close(*fd);
145 *fd = -1;
H A Dfind_uid.c67 int fd; local
84 fd = open(path, O_RDONLY);
85 if (fd == -1) {
98 ret = fstat(fd, &stat_buf);
120 ret = sss_atomic_read_s(fd, buf, BUFSIZE);
131 ret = close(fd);
170 close(fd);
H A Dsss_sockets.c35 static errno_t set_fcntl_flags(int fd, int fd_flags, int fl_flags) argument
40 ret = fcntl(fd, F_GETFD, 0);
49 ret = fcntl(fd, F_SETFD, cur_flags | fd_flags);
57 ret = fcntl(fd, F_GETFL, 0);
66 ret = fcntl(fd, F_SETFL, cur_flags | fl_flags);
77 static errno_t set_fd_common_opts(int fd) argument
84 ret = setsockopt(fd, SOL_SOCKET, SO_KEEPALIVE, &dummy, sizeof(dummy));
92 ret = setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, &dummy, sizeof(dummy));
106 int fd; member in struct:sssd_async_connect_state
117 int fd,
115 sssd_async_connect_send(TALLOC_CTX *mem_ctx, struct tevent_context *ev, int fd, const struct sockaddr *addr, socklen_t addr_len) argument
[all...]
H A Ddebug.c49 errno_t set_debug_file_from_fd(const int fd) argument
55 dummy = fdopen(fd, "a");
64 fd, debug_prg_name, strerror(ret));
/sssd/src/sss_client/
H A Dnss_mc.h45 int fd; member in struct:sss_cli_mc_ctx
/sssd/src/providers/ldap/
H A Dsdap_fd_events.c36 int get_fd_from_ldap(LDAP *ldap, int *fd) argument
40 ret = ldap_get_option(ldap, LDAP_OPT_DESC, fd);
41 if (ret != LDAP_OPT_SUCCESS || *fd < 0) {
42 DEBUG(SSSDBG_CRIT_FAILURE, "Failed to get fd from ldap!!\n");
43 *fd = -1;
110 DEBUG(SSSDBG_TRACE_LIBS, "New LDAP connection to [%s] with fd [%d].\n",
129 fd_event_item->fd = ber_fd;
154 DEBUG(SSSDBG_TRACE_ALL, "Closing LDAP connection with fd [%d].\n", ber_fd);
157 if (fd_event_item->fd == ber_fd) {
162 DEBUG(SSSDBG_CRIT_FAILURE, "No event for fd [
177 int fd; local
285 sdap_call_conn_cb(const char *uri,int fd, struct sdap_handle *sh) argument
[all...]
H A Dsdap_child_helpers.c53 static void sdap_close_fd(int *fd) argument
57 if (*fd == -1) {
58 DEBUG(SSSDBG_TRACE_FUNC, "fd already closed\n");
62 ret = close(*fd);
65 DEBUG(SSSDBG_OP_FAILURE, "Closing fd %d, return error %d (%s)\n",
66 *fd, ret, strerror(ret));
69 *fd = -1;
/sssd/src/tests/
H A Dcheck_and_open-tests.c41 int fd; variable
60 fd = -1;
67 if (fd != -1) {
68 ret = close(fd);
82 ret = check_and_open_readonly("/bla/bla/bla", &fd,
86 fail_unless(fd == -1, "check_and_open_readonly file descriptor not -1");
148 ret = check_and_open_readonly("/dev/null", &fd, uid, gid, S_IFREG|mode, 0);
151 fail_unless(fd == -1, "check_and_open_readonly file descriptor not -1");
159 ret = check_and_open_readonly(filename, &fd, uid+1, gid, S_IFREG|mode, 0);
162 fail_unless(fd
[all...]
H A Dfiles-tests.c88 int fd; local
92 fd = open(name, O_WRONLY | O_CREAT | O_TRUNC, 0700);
93 fail_if(fd == -1, "Cannot create simple file\n");
95 size = write(fd, "abc", 3);
98 ret = fsync(fd);
101 ret = close(fd);
213 int fd = -1; local
251 ret = check_and_open_readonly(tmp, &fd, uid, gid, S_IFREG|S_IRWXU, 0);
253 close(fd);
265 int fd local
[all...]
H A Ddebug-tests.c128 int fd; local
137 fd = mkstemp(filename);
139 if (fd == -1) {
146 file = fdopen(fd, "r");
153 ret = set_debug_file_from_fd(fd);
267 int fd; local
277 fd = mkstemp(filename);
279 if (fd == -1) {
283 file = fdopen(fd, "r");
290 ret = set_debug_file_from_fd(fd);
[all...]
/sssd/src/tests/cwrap/
H A Dtest_server.c47 int fd; local
69 fd = open(pidfile, O_RDONLY);
70 assert_false(fd < 0);
72 ret = read(fd, buf, sizeof(buf));
73 close(fd);
H A Dtest_responder_common.c110 int fd; member in struct:create_pipe_ctx
120 ctx->fd = -1;
141 ret = getsockopt(ctx->fd, SOL_SOCKET, SO_DOMAIN, &optval, &optlen);
146 ret = getsockopt(ctx->fd, SOL_SOCKET, SO_TYPE, &optval, &optlen);
152 ret = getsockopt(ctx->fd, SOL_SOCKET, SO_ACCEPTCONN, &optval, &optlen);
158 ret = getsockopt(ctx->fd, SOL_SOCKET, SO_PROTOCOL, &optval, &optlen);
173 ret = create_pipe_fd(ctx->sock_name, &ctx->fd, 0111);
175 assert_int_not_equal(ctx->fd, -1);
179 ret = create_pipe_fd(ctx->sock_name, &ctx->fd, 0000);
181 assert_int_not_equal(ctx->fd,
[all...]
/sssd/src/sbus/
H A Dsssd_dbus_private.h84 int fd; member in struct:sbus_watch_ctx
H A Dsssd_dbus_common.c34 static struct sbus_watch_ctx *fd_to_watch(struct sbus_watch_ctx *list, int fd) argument
40 if (watch_iter->fd == fd) {
118 int fd; local
123 fd = dbus_watch_get_unix_fd(dbus_watch);
125 fd = dbus_watch_get_fd(dbus_watch);
128 watch = fd_to_watch(conn->watch_list, fd);
137 watch->fd = fd;
170 watch, fd, event_flag
201 int fd = -1; local
[all...]
/sssd/src/tests/cmocka/
H A Dtest_io.c168 int fd; local
175 fd = sss_open_cloexec(file_path, flags, &ret);
176 assert_int_not_equal(fd, -1);
178 ret_flag = fcntl(fd, F_GETFD, 0);
182 close(fd);
187 int fd; local
191 fd = sss_open_cloexec(NON_EX_PATH, flags, &ret);
193 assert_true(fd == -1);
199 int fd; local
206 fd
218 int fd; local
[all...]
/sssd/src/p11_child/
H A Dp11_child_nss.c452 static errno_t p11c_recv_data(TALLOC_CTX *mem_ctx, int fd, char **pin) argument
460 len = sss_atomic_read_s(fd, buf, IN_BUF_SIZE);
517 {"debug-fd", 0, POPT_ARG_INT, &debug_fd, 0,
/sssd/src/responder/common/
H A Dresponder_packet.c177 int sss_packet_recv(struct sss_packet *packet, int fd) argument
193 rb = recv(fd, buf, len, 0);
223 int sss_packet_send(struct sss_packet *packet, int fd) argument
238 rb = send(fd, buf, len, 0);
/sssd/src/responder/secrets/
H A Dsecsrv_cmd.c430 int sec_send_data(int fd, struct sec_data *data) argument
436 len = send(fd, data->data, data->length, 0);
483 int sec_recv_data(int fd, struct sec_data *data) argument
489 len = recv(fd, data->data, data->length, 0);
/sssd/src/krb5_plugin/
H A Dsssd_krb5_locator_plugin.c90 int fd = -1; local
125 fd = open(krb5info_name, O_RDONLY);
126 if (fd == -1) {
136 len = sss_atomic_read_s(fd, buf, BUFSIZE);
140 close(fd);
143 close(fd);
/sssd/src/tools/
H A Dtools_mc_util.c37 static errno_t sss_mc_set_recycled(int fd) argument
47 pos = lseek(fd, offset, SEEK_SET);
54 written = sss_atomic_write_s(fd, (uint8_t *)&w, sizeof(h.status));
H A Dtools_util.c437 int fd = -1; local
448 fd = open(spool_file, O_CREAT | O_WRONLY | O_EXCL, 0);
449 if (fd < 0) {
456 ret = fchmod(fd, 0600);
464 ret = fchown(fd, uid, gid);
472 ret = fsync(fd);
480 if (fd >= 0) {
481 ret = close(fd);

Completed in 406 milliseconds

12