Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 57978
b: refs/heads/master
c: 4e71e47
h: refs/heads/master
v: v3
  • Loading branch information
Cedric Le Goater authored and Linus Torvalds committed Jun 24, 2007
1 parent f5751e4 commit 8951fcf
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 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: 6d79af701d334777541136e914a9c0969b2ad307
refs/heads/master: 4e71e474c784dc274f28ec8bb22a5dbabc6dc7c5
10 changes: 2 additions & 8 deletions trunk/kernel/nsproxy.c
Original file line number Diff line number Diff line change
Expand Up @@ -145,13 +145,11 @@ void free_nsproxy(struct nsproxy *ns)

/*
* Called from unshare. Unshare all the namespaces part of nsproxy.
* On sucess, returns the new nsproxy and a reference to old nsproxy
* to make sure it stays around.
* On success, returns the new nsproxy.
*/
int unshare_nsproxy_namespaces(unsigned long unshare_flags,
struct nsproxy **new_nsp, struct fs_struct *new_fs)
{
struct nsproxy *old_ns = current->nsproxy;
int err = 0;

if (!(unshare_flags & (CLONE_NEWNS | CLONE_NEWUTS | CLONE_NEWIPC)))
Expand All @@ -170,13 +168,9 @@ int unshare_nsproxy_namespaces(unsigned long unshare_flags,
if (!capable(CAP_SYS_ADMIN))
return -EPERM;

get_nsproxy(old_ns);

*new_nsp = create_new_namespaces(unshare_flags, current,
new_fs ? new_fs : current->fs);
if (IS_ERR(*new_nsp)) {
if (IS_ERR(*new_nsp))
err = PTR_ERR(*new_nsp);
put_nsproxy(old_ns);
}
return err;
}

0 comments on commit 8951fcf

Please sign in to comment.