gdm_session_worker_create_cachedir (GdmSessionWorker *worker)
{
        struct stat statbuf;
        char       *cachedir;
        int         r;

        cachedir = g_build_filename (GDM_CACHE_DIR,
                                     worker->priv->username,
                                     NULL);

        /* Verify user cache directory exists, create if needed */
        r = g_stat (cachedir, &statbuf);
        if (r < 0) {
                g_debug ("Making user cache directory %s", cachedir);
                g_mkdir (cachedir,
                         S_IRWXU | S_IXGRP | S_IRGRP | S_IXOTH | S_IROTH);
                g_chmod (cachedir,
                         S_IRWXU | S_IXGRP | S_IRGRP | S_IXOTH | S_IROTH);
        }
        chown (cachedir, worker->priv->uid, worker->priv->gid);

        return cachedir;
}
gdm_session_worker_create_cachedir (GdmSessionWorker *worker)
{
        struct stat statbuf;
        char       *cachedir;
        int         r;

        cachedir = g_build_filename (GDM_CACHE_DIR,
                                     worker->priv->username,
                                     NULL);

         
        r = g_stat (cachedir, &statbuf);
        if (r < 0) {
                g_debug ("Making user cache directory %s", cachedir);
                g_mkdir (cachedir,
                         S_IRWXU | S_IXGRP | S_IRGRP | S_IXOTH | S_IROTH);
                g_chmod (cachedir,
                         S_IRWXU | S_IXGRP | S_IRGRP | S_IXOTH | S_IROTH);
        }
        chown (cachedir, worker->priv->uid, worker->priv->gid);

        return cachedir;
}