l2tp: pass tunnel pointer to ->session_create()
[pandora-kernel.git] / net / core / scm.c
index 51b4d52..9adabed 100644 (file)
@@ -80,6 +80,7 @@ static int scm_fp_copy(struct cmsghdr *cmsg, struct scm_fp_list **fplp)
                *fplp = fpl;
                fpl->count = 0;
                fpl->max = SCM_MAX_FD;
+               fpl->user = NULL;
        }
        fpp = &fpl->fp[fpl->count];
 
@@ -100,6 +101,10 @@ static int scm_fp_copy(struct cmsghdr *cmsg, struct scm_fp_list **fplp)
                *fpp++ = file;
                fpl->count++;
        }
+
+       if (!fpl->user)
+               fpl->user = get_uid(current_user());
+
        return num;
 }
 
@@ -124,6 +129,7 @@ void __scm_destroy(struct scm_cookie *scm)
                                list_del(&fpl->list);
                                for (i=fpl->count-1; i>=0; i--)
                                        fput(fpl->fp[i]);
+                               free_uid(fpl->user);
                                kfree(fpl);
                        }
 
@@ -342,6 +348,7 @@ struct scm_fp_list *scm_fp_dup(struct scm_fp_list *fpl)
                for (i = 0; i < fpl->count; i++)
                        get_file(fpl->fp[i]);
                new_fpl->max = new_fpl->count;
+               new_fpl->user = get_uid(fpl->user);
        }
        return new_fpl;
 }