Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 84605
b: refs/heads/master
c: aee16ce
h: refs/heads/master
i:
  84603: 0053797
v: v3
  • Loading branch information
Pavel Emelyanov authored and Linus Torvalds committed Feb 8, 2008
1 parent 58f8ad6 commit f7c3e35
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 25 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ae5e1b22f17983da929a0d0178896269e19da186
refs/heads/master: aee16ce73c71a241190cef3aaa265f6a3ab8e035
17 changes: 8 additions & 9 deletions trunk/init/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -214,15 +214,6 @@ config TASK_IO_ACCOUNTING

Say N if unsure.

config USER_NS
bool "User Namespaces (EXPERIMENTAL)"
default n
depends on EXPERIMENTAL
help
Support user namespaces. This allows containers, i.e.
vservers, to use user namespaces to provide different
user info for different servers. If unsure, say N.

config PID_NS
bool "PID Namespaces (EXPERIMENTAL)"
default n
Expand Down Expand Up @@ -443,6 +434,14 @@ config IPC_NS
In this namespace tasks work with IPC ids which correspond to
different IPC objects in different namespaces

config USER_NS
bool "User namespace (EXPERIMENTAL)"
depends on NAMESPACES && EXPERIMENTAL
help
This allows containers, i.e. vservers, to use user namespaces
to provide different user info for different servers.
If unsure, say N.

config BLK_DEV_INITRD
bool "Initial RAM filesystem and RAM disk (initramfs/initrd) support"
depends on BROKEN || !FRV
Expand Down
5 changes: 3 additions & 2 deletions trunk/kernel/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

obj-y = sched.o fork.o exec_domain.o panic.o printk.o profile.o \
exit.o itimer.o time.o softirq.o resource.o \
sysctl.o capability.o ptrace.o timer.o user.o user_namespace.o \
sysctl.o capability.o ptrace.o timer.o user.o \
signal.o sys.o kmod.o workqueue.o pid.o \
rcupdate.o extable.o params.o posix-timers.o \
kthread.o wait.o kfifo.o sys_ni.o posix-cpu-timers.o mutex.o \
Expand Down Expand Up @@ -33,7 +33,6 @@ obj-$(CONFIG_PROVE_LOCKING) += spinlock.o
obj-$(CONFIG_UID16) += uid16.o
obj-$(CONFIG_MODULES) += module.o
obj-$(CONFIG_KALLSYMS) += kallsyms.o
obj-$(CONFIG_UTS_NS) += utsname.o
obj-$(CONFIG_PM) += power/
obj-$(CONFIG_BSD_PROCESS_ACCT) += acct.o
obj-$(CONFIG_KEXEC) += kexec.o
Expand All @@ -43,6 +42,8 @@ obj-$(CONFIG_CGROUPS) += cgroup.o
obj-$(CONFIG_CGROUP_DEBUG) += cgroup_debug.o
obj-$(CONFIG_CPUSETS) += cpuset.o
obj-$(CONFIG_CGROUP_NS) += ns_cgroup.o
obj-$(CONFIG_UTS_NS) += utsname.o
obj-$(CONFIG_USER_NS) += user_namespace.o
obj-$(CONFIG_IKCONFIG) += configs.o
obj-$(CONFIG_RESOURCE_COUNTERS) += res_counter.o
obj-$(CONFIG_STOP_MACHINE) += stop_machine.o
Expand Down
10 changes: 10 additions & 0 deletions trunk/kernel/user.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,14 @@
#include <linux/module.h>
#include <linux/user_namespace.h>

struct user_namespace init_user_ns = {
.kref = {
.refcount = ATOMIC_INIT(2),
},
.root_user = &root_user,
};
EXPORT_SYMBOL_GPL(init_user_ns);

/*
* UID task count cache, to get fast user lookup in "alloc_uid"
* when changing user ID's (ie setuid() and friends).
Expand Down Expand Up @@ -427,6 +435,7 @@ void switch_uid(struct user_struct *new_user)
suid_keys(current);
}

#ifdef CONFIG_USER_NS
void release_uids(struct user_namespace *ns)
{
int i;
Expand All @@ -451,6 +460,7 @@ void release_uids(struct user_namespace *ns)

free_uid(ns->root_user);
}
#endif

static int __init uid_cache_init(void)
{
Expand Down
13 changes: 0 additions & 13 deletions trunk/kernel/user_namespace.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,6 @@
#include <linux/nsproxy.h>
#include <linux/user_namespace.h>

struct user_namespace init_user_ns = {
.kref = {
.refcount = ATOMIC_INIT(2),
},
.root_user = &root_user,
};

EXPORT_SYMBOL_GPL(init_user_ns);

#ifdef CONFIG_USER_NS

/*
* Clone a new ns copying an original user ns, setting refcount to 1
* @old_ns: namespace to clone
Expand Down Expand Up @@ -84,5 +73,3 @@ void free_user_ns(struct kref *kref)
release_uids(ns);
kfree(ns);
}

#endif /* CONFIG_USER_NS */

0 comments on commit f7c3e35

Please sign in to comment.