server: Remove ucred of wl_client 60/291760/5 accepted/tizen/unified/20230531.151929
authorChangyeon Lee <cyeon.lee@samsung.com>
Fri, 21 Apr 2023 02:38:55 +0000 (11:38 +0900)
committerChangyeon Lee <cyeon.lee@samsung.com>
Fri, 21 Apr 2023 06:24:05 +0000 (15:24 +0900)
ucred of wl_client is removed after below patch
and it is not initialized.

54b237a61257a41d35d018c5871331bdf1df77a6

Change-Id: I8b45fdab6bdc8e7d340ad301e1fed6ba53f5ac45

src/wayland-server.c

index 13753ab..2ffcd8c 100644 (file)
@@ -84,7 +84,6 @@ struct wl_client {
        pid_t pid;
        uid_t uid;
        gid_t gid;
-       struct ucred ucred;
        char proc_name[WL_CLIENT_NAME_MAX];
        int error;
        struct wl_priv_signal resource_created_signal;
@@ -382,7 +381,7 @@ wl_client_connection_data(int fd, uint32_t mask, void *data)
 
        if (mask & WL_EVENT_HANGUP) {
                wl_log("Mask has hangup flag set, client_proc(%s) PID(%d) mask[%x]\n",
-                          client->proc_name, client->ucred.pid, mask);
+                          client->proc_name, client->pid, mask);
                wl_client_destroy(client);
                return 1;
        }
@@ -396,7 +395,7 @@ wl_client_connection_data(int fd, uint32_t mask, void *data)
                len = wl_connection_flush(connection);
                if (len < 0)
                        wl_log("client_proc(%s) PID(%d) flush failed: len(%d) errno(%d)\n",
-                                  client->proc_name, client->ucred.pid, len, errno);
+                                  client->proc_name, client->pid, len, errno);
                if (len < 0 && errno != EAGAIN) {
                        destroy_client_with_error(
                            client, "failed to flush client connection");
@@ -412,7 +411,7 @@ wl_client_connection_data(int fd, uint32_t mask, void *data)
                len = wl_connection_read(connection);
                if (len <= 0)
                        wl_log("client_proc(%s) PID(%d) read failed: len(%d) errno(%d)\n",
-                                  client->proc_name, client->ucred.pid, len, errno);
+                                  client->proc_name, client->pid, len, errno);
                if (len == 0 || (len < 0 && errno != EAGAIN)) {
                        destroy_client_with_error(
                            client, "failed to read client connection");
@@ -553,10 +552,10 @@ wl_client_get_process_name(struct wl_client *client)
        if (!client->display->super_user)
                goto no_name;
 
-       if (client->ucred.pid <= 0)
+       if (client->pid <= 0)
                goto no_name;
 
-       snprintf(proc, WL_CLIENT_NAME_MAX, "/proc/%d/cmdline", client->ucred.pid);
+       snprintf(proc, WL_CLIENT_NAME_MAX, "/proc/%d/cmdline", client->pid);
        h = fopen(proc, "r");
        if (!h)
                goto no_name;
@@ -1555,7 +1554,7 @@ wl_display_flush_clients(struct wl_display *display)
                ret = wl_connection_flush(client->connection);
                if (ret < 0)
                        wl_log("client_proc(%s) PID(%d) flush failed: ret(%d) errno(%d)\n",
-                                  client->proc_name, client->ucred.pid, ret, errno);
+                                  client->proc_name, client->pid, ret, errno);
                if (ret < 0 && errno == EAGAIN) {
                        wl_event_source_fd_update(client->source,
                                                  WL_EVENT_WRITABLE |