Enlightenment CVS committal

Author  : xcomputerman
Project : e17
Module  : apps/entrance

Dir     : e17/apps/entrance/src/client


Modified Files:
        entrance_auth.c entrance_ipc.c entrance_session.c main.c 


Log Message:
OK -- finally wrap this up:
- IPC functions added on both sides
- Xauth now fully functional
- Cleanup entranced shutdown (eliminate warnings)

Please report any bugs at http://xcomputerman.com/bugs/.


===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/entrance/src/client/entrance_auth.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -3 -r1.14 -r1.15
--- entrance_auth.c     10 Apr 2004 22:20:24 -0000      1.14
+++ entrance_auth.c     19 Apr 2004 05:15:50 -0000      1.15
@@ -312,10 +312,14 @@
    extern char **environ;
    int size;
    char *mail;
+   char buf[PATH_MAX];
+
+   snprintf(buf, PATH_MAX, "%s/.Xauthority", e->pw->pw_dir);
 
    if (!e || !e->pw)
       return;
    e->env = environ;
+   setenv("XAUTHORITY", buf, 1);
    setenv("TERM", "vt100", 0);  // TERM=linux?
    setenv("HOME", e->pw->pw_dir, 1);
    setenv("SHELL", e->pw->pw_shell, 1);
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/entrance/src/client/entrance_ipc.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -3 -r1.7 -r1.8
--- entrance_ipc.c      5 Apr 2004 21:28:35 -0000       1.7
+++ entrance_ipc.c      19 Apr 2004 05:15:50 -0000      1.8
@@ -129,40 +129,39 @@
 int
 entrance_ipc_init(pid_t server_pid)
 {
-   char buf[80];
+   char buf[PATH_MAX];
 
    /* we definitely fail if we can't connect to ecore_ipc */
    if (ecore_ipc_init() < 1)
       return FALSE;
 
    memset(buf, 0, sizeof(buf));
-   snprintf(buf, 80, "%s_%d", PACKAGE_STATE_DIR "/" IPC_TITLE, server_pid);
+   snprintf(buf, PATH_MAX, "%s_%d", PACKAGE_STATE_DIR"/"IPC_TITLE, server_pid);
    if (ipc_title)
       free(ipc_title);
    ipc_title = strdup(buf);
+   printf("Debug: ipc_title = %s\n", ipc_title);
+   ecore_event_handler_add(ECORE_IPC_EVENT_CLIENT_ADD,
+                           _entrance_ipc_client_add, NULL);
 
-   if ((server =
-        ecore_ipc_server_connect(ECORE_IPC_LOCAL_SYSTEM, IPC_TITLE, 0, NULL)))
-   {
-      ecore_event_handler_add(ECORE_IPC_EVENT_CLIENT_ADD,
-                              _entrance_ipc_client_add, NULL);
-
-      ecore_event_handler_add(ECORE_IPC_EVENT_CLIENT_DEL,
-                              _entrance_ipc_client_del, NULL);
-
-      ecore_event_handler_add(ECORE_IPC_EVENT_CLIENT_DATA,
-                              _entrance_ipc_client_data, NULL);
+   ecore_event_handler_add(ECORE_IPC_EVENT_CLIENT_DEL,
+                           _entrance_ipc_client_del, NULL);
 
-      ecore_event_handler_add(ECORE_IPC_EVENT_SERVER_DATA,
-                              _entrance_ipc_server_data, NULL);
+   ecore_event_handler_add(ECORE_IPC_EVENT_CLIENT_DATA,
+                           _entrance_ipc_client_data, NULL);
 
-      ecore_event_handler_add(ECORE_IPC_EVENT_SERVER_ADD,
-                              _entrance_ipc_server_add, NULL);
+   ecore_event_handler_add(ECORE_IPC_EVENT_SERVER_DATA,
+                           _entrance_ipc_server_data, NULL);
 
-      ecore_event_handler_add(ECORE_IPC_EVENT_SERVER_DEL,
-                              _entrance_ipc_server_del, NULL);
+   ecore_event_handler_add(ECORE_IPC_EVENT_SERVER_ADD,
+                           _entrance_ipc_server_add, NULL);
 
+   ecore_event_handler_add(ECORE_IPC_EVENT_SERVER_DEL,
+                           _entrance_ipc_server_del, NULL);
 
+   if ((server =
+        ecore_ipc_server_connect(ECORE_IPC_LOCAL_SYSTEM, ipc_title, 0, NULL)))
+   {
       fprintf(stderr, "entrance_ipc_init: Success\n");
    }
    else
@@ -196,8 +195,12 @@
 void
 entrance_ipc_request_xauth(char *homedir, uid_t uid, gid_t gid)
 {
-   ecore_ipc_server_send(server, E_XAUTH_REQ, E_UID, 0, 0, (int) uid, "", 0);
-   ecore_ipc_server_send(server, E_XAUTH_REQ, E_GID, 0, 0, (int) gid, "", 0);
-   ecore_ipc_server_send(server, E_XAUTH_REQ, E_HOMEDIR, 0, 0, 0, homedir,
-                         strlen(homedir));
+   int pid;
+   pid = (int) getpid();
+   ecore_ipc_server_send(server, E_XAUTH_REQ, E_UID, pid, 0, (int) uid, NULL, 0);
+   ecore_ipc_server_send(server, E_XAUTH_REQ, E_GID, pid, 0, (int) gid, NULL, 0);
+   ecore_ipc_server_send(server, E_XAUTH_REQ, E_HOMEDIR, pid, 0, 0, homedir,
+                         strlen(homedir) + 1);
+   fprintf(stderr, "entranced: Requesting auth for uid %d (%s)\n", uid, homedir);
 }
+
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/entrance/src/client/entrance_session.c,v
retrieving revision 1.49
retrieving revision 1.50
diff -u -3 -r1.49 -r1.50
--- entrance_session.c  10 Apr 2004 22:20:24 -0000      1.49
+++ entrance_session.c  19 Apr 2004 05:15:50 -0000      1.50
@@ -415,14 +415,13 @@
    }
    _entrance_session_user_list_fix(e);
    /* clear users's password out of memory */
-   entrance_auth_clear_pass(e->auth);
+   if(e->auth)
+      entrance_auth_clear_pass(e->auth);
    /* this bypasses a race condition where entrance loses its x connection */
    /* before the wm gets it and x goes and resets itself */
    sleep(10);
    /* replace this rpcoess with a clean small one that just waits for its */
    /* child to exit.. passed on the cmd-line */
-   /* atmos : Could we just free up all of our memory usage at this point
-      instead of exec'ing this other tiny program ? */
    snprintf(buf, sizeof(buf), "%s/entrance_login %i", PACKAGE_BIN_DIR,
             (int) pid);
    execl("/bin/sh", "/bin/sh", "-c", buf, NULL);
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/entrance/src/client/main.c,v
retrieving revision 1.48
retrieving revision 1.49
diff -u -3 -r1.48 -r1.49
--- main.c      28 Mar 2004 03:57:01 -0000      1.48
+++ main.c      19 Apr 2004 05:15:50 -0000      1.49
@@ -652,6 +652,7 @@
            config = strdup(optarg);
            break;
         case 'z':
+           printf("entrance: main: z optarg = %s\n", optarg);
            server_pid = (pid_t) atoi(optarg);
            break;
         default:
@@ -666,6 +667,8 @@
    if (config)
       free(config);
 
+   printf("entrance: main: XAUTHORITY = %s\n", getenv("XAUTHORITY"));
+
 #if 1
    if (!ecore_x_init(display))
    {




-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to