aboutsummaryrefslogtreecommitdiff
path: root/libdiskfs
diff options
context:
space:
mode:
Diffstat (limited to 'libdiskfs')
-rw-r--r--libdiskfs/boot-start.c8
-rw-r--r--libdiskfs/dir-rename.c5
2 files changed, 9 insertions, 4 deletions
diff --git a/libdiskfs/boot-start.c b/libdiskfs/boot-start.c
index ad3cf1a4..e73e4d37 100644
--- a/libdiskfs/boot-start.c
+++ b/libdiskfs/boot-start.c
@@ -1,5 +1,5 @@
/*
- Copyright (C) 1993,94,95,96,97,98,99,2000,01,02
+ Copyright (C) 1993,94,95,96,97,98,99,2000,01,02,10
Free Software Foundation, Inc.
This file is part of the GNU Hurd.
@@ -194,6 +194,9 @@ diskfs_start_bootstrap ()
diskfs_exec_ctl = MACH_PORT_NULL; /* Not used after this. */
}
+ /* Cache the exec server port for file_exec to use. */
+ _hurd_port_set (&_diskfs_exec_portcell, diskfs_exec);
+
if (_diskfs_boot_command)
{
/* We have a boot command line to run instead of init. */
@@ -276,9 +279,6 @@ diskfs_start_bootstrap ()
mach_port_deallocate (mach_task_self (), startup_pt);
mach_port_deallocate (mach_task_self (), bootpt);
assert_perror (err);
-
- /* Cache the exec server port for file_exec to use. */
- _hurd_port_set (&_diskfs_exec_portcell, diskfs_exec);
}
/* We look like an execserver to the execserver itself; it makes this
diff --git a/libdiskfs/dir-rename.c b/libdiskfs/dir-rename.c
index 747c6666..867e395d 100644
--- a/libdiskfs/dir-rename.c
+++ b/libdiskfs/dir-rename.c
@@ -19,6 +19,7 @@
#include "priv.h"
#include "fs_S.h"
+#include <string.h>
/* To avoid races in checkpath, and to prevent a directory from being
simultaneously renamed by two processes, we serialize all renames of
@@ -44,6 +45,10 @@ diskfs_S_dir_rename (struct protid *fromcred,
if (! tocred)
return EXDEV;
+ if (!strcmp (fromname, ".") || !strcmp (fromname, "..")
+ || !strcmp (toname, ".") || !strcmp (toname, ".."))
+ return EINVAL;
+
if (tocred->po->shadow_root != fromcred->po->shadow_root)
/* Same translator, but in different shadow trees. */
return EXDEV;