user_namespace.c (7a9787e1eba95a166265e6a260cf30af04ef0a99) | user_namespace.c (76aac0e9a17742e60d408be1a706e9aaad370891) |
---|---|
1/* 2 * This program is free software; you can redistribute it and/or 3 * modify it under the terms of the GNU General Public License as 4 * published by the Free Software Foundation, version 2 of the 5 * License. 6 */ 7 8#include <linux/module.h> --- 24 unchanged lines hidden (view full) --- 33 /* Insert new root user. */ 34 ns->root_user = alloc_uid(ns, 0); 35 if (!ns->root_user) { 36 kfree(ns); 37 return ERR_PTR(-ENOMEM); 38 } 39 40 /* Reset current->user with a new one */ | 1/* 2 * This program is free software; you can redistribute it and/or 3 * modify it under the terms of the GNU General Public License as 4 * published by the Free Software Foundation, version 2 of the 5 * License. 6 */ 7 8#include <linux/module.h> --- 24 unchanged lines hidden (view full) --- 33 /* Insert new root user. */ 34 ns->root_user = alloc_uid(ns, 0); 35 if (!ns->root_user) { 36 kfree(ns); 37 return ERR_PTR(-ENOMEM); 38 } 39 40 /* Reset current->user with a new one */ |
41 new_user = alloc_uid(ns, current->uid); | 41 new_user = alloc_uid(ns, current_uid()); |
42 if (!new_user) { 43 free_uid(ns->root_user); 44 kfree(ns); 45 return ERR_PTR(-ENOMEM); 46 } 47 48 switch_uid(new_user); 49 return ns; --- 27 unchanged lines hidden --- | 42 if (!new_user) { 43 free_uid(ns->root_user); 44 kfree(ns); 45 return ERR_PTR(-ENOMEM); 46 } 47 48 switch_uid(new_user); 49 return ns; --- 27 unchanged lines hidden --- |