Enlightenment CVS committal

Author  : xcomputerman
Project : e17
Module  : apps/entrance

Dir     : e17/apps/entrance/src/daemon


Modified Files:
        auth.c 


Log Message:
- Fix null pointer bug in auth_purge - destroy list nodes properly
- Disable code to write host access file, kinda defeats the point :)


===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/entrance/src/daemon/auth.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -3 -r1.8 -r1.9
--- auth.c      19 Apr 2004 05:15:50 -0000      1.8
+++ auth.c      24 Apr 2004 03:34:16 -0000      1.9
@@ -72,6 +72,7 @@
    fseek (auth_file, 0L, SEEK_SET);
    
    auth_keep = ecore_list_new();
+   ecore_list_set_free_cb(auth_keep, ECORE_FREE_CB(XauDisposeAuth));
 
    /* Read each auth entry and check if it matches one for this
     * display */
@@ -101,16 +102,15 @@
       return;
    }
    
-   while(auth_keep->nodes)
+   for(li = auth_keep->first; li; li = li->next)
    {
       Xauth *xa;
-      xa = (Xauth *) ecore_list_remove(auth_keep);
+      xa = (Xauth *) li->data;
       XauWriteAuth(auth_file, (Xauth *) xa);
-      XauDisposeAuth((Xauth *) xa);
    }
 
    ecore_list_destroy(auth_keep);
-      
+
 }
 
 /**
@@ -214,7 +214,10 @@
    }
 
    if (!d->auths)
+   {
       d->auths = ecore_list_new();
+      ecore_list_set_free_cb(d->auths, ECORE_FREE_CB(XauDisposeAuth));
+   }
 
    if (!ecore_list_append(d->auths, auth))
    {
@@ -229,7 +232,8 @@
 int
 entranced_auth_display_secure (Entranced_Display *d)
 {
-   FILE              *auth_file, *host_file;
+   FILE              *auth_file;
+/* FILE              *host_file; */
    char              buf[PATH_MAX];
    char              hostname[1024];
 
@@ -281,7 +285,7 @@
 
    fclose(auth_file);
    setenv("XAUTHORITY", d->authfile, TRUE);
-
+#if 0
    /* Write host access file */
    snprintf(buf, PATH_MAX, "/etc/X%d.hosts", d->dispnum);
    if (!(host_file = fopen(buf, "w")))
@@ -291,7 +295,7 @@
    }
    fprintf(host_file, "%s\n", d->hostname);
    fclose(host_file);
-   
+#endif
    entranced_debug("entranced_auth_display_secure: Successfully set up access for %s 
(localhost)\n", d->name);
 
    return TRUE;




-------------------------------------------------------
This SF.net email is sponsored by: The Robotic Monkeys at ThinkGeek
For a limited time only, get FREE Ground shipping on all orders of $35
or more. Hurry up and shop folks, this offer expires April 30th!
http://www.thinkgeek.com/freeshipping/?cpg=12297
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to