tEnsure proper permissions on request/out - ratox - FIFO based tox client
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) README
 (DIR) LICENSE
       ---
 (DIR) commit 53688edc3d5b03fbee370c720072bd95bc6982a3
 (DIR) parent 07a2a6732b43465144ee35255e9590b98d377286
 (HTM) Author: sin <sin@2f30.org>
       Date:   Wed, 17 Sep 2014 17:16:43 +0100
       
       Ensure proper permissions on request/out
       
       Diffstat:
         M ratatox.c                           |       9 +++++----
       
       1 file changed, 5 insertions(+), 4 deletions(-)
       ---
 (DIR) diff --git a/ratatox.c b/ratatox.c
       t@@ -49,6 +49,7 @@ struct slot {
                const char *name;
                void (*cb)(void *);
                int outtype;
       +        int outmode;
                int fd[NR_GFILES];
        };
        
       t@@ -70,9 +71,9 @@ static void setstatusmsg(void *);
        static void sendfriendreq(void *);
        
        static struct slot gslots[] = {
       -        [NAME]    = { .name = "name",         .cb = setname,              .outtype = STATIC},
       -        [STATUS]  = { .name = "status",         .cb = setstatusmsg,  .outtype = STATIC},
       -        [REQUEST] = { .name = "request", .cb = sendfriendreq, .outtype = FOLDER}
       +        [NAME]    = { .name = "name",         .cb = setname,              .outtype = STATIC },
       +        [STATUS]  = { .name = "status",         .cb = setstatusmsg,  .outtype = STATIC },
       +        [REQUEST] = { .name = "request", .cb = sendfriendreq, .outtype = FOLDER, .outmode = 0755 },
        };
        
        static struct file gfiles[] = {
       t@@ -616,7 +617,7 @@ localinit(void)
                                                }
                                                gslots[i].fd[m] = r;
                                        } else if (gslots[i].outtype == FOLDER) {
       -                                        r = mkdir(gfiles[m].name, gfiles[m].mode);
       +                                        r = mkdir(gfiles[m].name, gslots[i].outmode);
                                                if (r < 0 && errno != EEXIST) {
                                                        perror("mkdir");
                                                        exit(EXIT_FAILURE);