summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2000-11-20 13:29:21 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2000-11-20 13:29:21 +0000
commitbde7e18ea04d8cb458e2961193925c0063f04fd9 (patch)
tree16c5684fe6cb2d7a0f4af9be35a8a0a98a6aa082
parent2e3ce06b7ff9b3b15fc37ee6ad9fb4015e97045c (diff)
downloadrtems-bde7e18ea04d8cb458e2961193925c0063f04fd9.tar.bz2
2000-11-20 Dmitry Kargapolov <dk@gentex.ru>
* libc/mount.c: Make sure there is space allocated for a device name in the mount table entry.
-rw-r--r--c/src/exec/libcsupport/src/mount.c12
-rw-r--r--c/src/lib/ChangeLog16
-rw-r--r--c/src/lib/libc/mount.c12
-rw-r--r--cpukit/libcsupport/src/mount.c12
4 files changed, 43 insertions, 9 deletions
diff --git a/c/src/exec/libcsupport/src/mount.c b/c/src/exec/libcsupport/src/mount.c
index 6b5471422e..7e39357285 100644
--- a/c/src/exec/libcsupport/src/mount.c
+++ b/c/src/exec/libcsupport/src/mount.c
@@ -74,6 +74,7 @@ int mount(
rtems_filesystem_location_info_t loc;
rtems_filesystem_mount_table_entry_t *temp_mt_entry;
rtems_filesystem_location_info_t *loc_to_free = NULL;
+ size_t size;
/* XXX add code to check for required operations */
@@ -100,7 +101,10 @@ int mount(
* Allocate a mount table entry
*/
- temp_mt_entry = malloc( sizeof(rtems_filesystem_mount_table_entry_t) );
+ size = sizeof(rtems_filesystem_mount_table_entry_t);
+ if ( device )
+ size += strlen( device ) + 1;
+ temp_mt_entry = malloc( size );
if ( !temp_mt_entry ) {
errno = ENOMEM;
@@ -109,9 +113,11 @@ int mount(
temp_mt_entry->mt_fs_root.mt_entry = temp_mt_entry;
temp_mt_entry->options = options;
- if ( device )
+ if ( device ) {
+ temp_mt_entry->dev =
+ (char *)temp_mt_entry + sizeof( rtems_filesystem_mount_table_entry_t );
strcpy( temp_mt_entry->dev, device );
- else
+ } else
temp_mt_entry->dev = 0;
/*
diff --git a/c/src/lib/ChangeLog b/c/src/lib/ChangeLog
index 1125d4f349..2dc19feb7e 100644
--- a/c/src/lib/ChangeLog
+++ b/c/src/lib/ChangeLog
@@ -1,4 +1,20 @@
+2000-11-20 Dmitry Kargapolov <dk@gentex.ru>
+
+ * libc/mount.c: Make sure there is space allocated for a device name
+ in the mount table entry.
+
+2000-11-17 Jennifer Averret <jennifer@OARcorp.com>
+
+ * libc/mount.c (search_mt_for_mount_point): Deleted routine.
+ * libc/mount.c (Is_node_fs_root): Replacement for above that
+ accounts for the imaginary root node being returned by the
+ filesystem evaluation routine.
+ * libc/unmount.c (unmount): Account for imaginary root node
+ being returned and improved variable names to clarify code.
+ * libc/unmount.c (file_systems_below_this_mountpoint): Body of
+ routine replaced to account for imaginary root node being returned.
+
2000-11-10 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
* libc/libio.c: Special treatment of O_NDELAY for Cygwin.
diff --git a/c/src/lib/libc/mount.c b/c/src/lib/libc/mount.c
index 6b5471422e..7e39357285 100644
--- a/c/src/lib/libc/mount.c
+++ b/c/src/lib/libc/mount.c
@@ -74,6 +74,7 @@ int mount(
rtems_filesystem_location_info_t loc;
rtems_filesystem_mount_table_entry_t *temp_mt_entry;
rtems_filesystem_location_info_t *loc_to_free = NULL;
+ size_t size;
/* XXX add code to check for required operations */
@@ -100,7 +101,10 @@ int mount(
* Allocate a mount table entry
*/
- temp_mt_entry = malloc( sizeof(rtems_filesystem_mount_table_entry_t) );
+ size = sizeof(rtems_filesystem_mount_table_entry_t);
+ if ( device )
+ size += strlen( device ) + 1;
+ temp_mt_entry = malloc( size );
if ( !temp_mt_entry ) {
errno = ENOMEM;
@@ -109,9 +113,11 @@ int mount(
temp_mt_entry->mt_fs_root.mt_entry = temp_mt_entry;
temp_mt_entry->options = options;
- if ( device )
+ if ( device ) {
+ temp_mt_entry->dev =
+ (char *)temp_mt_entry + sizeof( rtems_filesystem_mount_table_entry_t );
strcpy( temp_mt_entry->dev, device );
- else
+ } else
temp_mt_entry->dev = 0;
/*
diff --git a/cpukit/libcsupport/src/mount.c b/cpukit/libcsupport/src/mount.c
index 6b5471422e..7e39357285 100644
--- a/cpukit/libcsupport/src/mount.c
+++ b/cpukit/libcsupport/src/mount.c
@@ -74,6 +74,7 @@ int mount(
rtems_filesystem_location_info_t loc;
rtems_filesystem_mount_table_entry_t *temp_mt_entry;
rtems_filesystem_location_info_t *loc_to_free = NULL;
+ size_t size;
/* XXX add code to check for required operations */
@@ -100,7 +101,10 @@ int mount(
* Allocate a mount table entry
*/
- temp_mt_entry = malloc( sizeof(rtems_filesystem_mount_table_entry_t) );
+ size = sizeof(rtems_filesystem_mount_table_entry_t);
+ if ( device )
+ size += strlen( device ) + 1;
+ temp_mt_entry = malloc( size );
if ( !temp_mt_entry ) {
errno = ENOMEM;
@@ -109,9 +113,11 @@ int mount(
temp_mt_entry->mt_fs_root.mt_entry = temp_mt_entry;
temp_mt_entry->options = options;
- if ( device )
+ if ( device ) {
+ temp_mt_entry->dev =
+ (char *)temp_mt_entry + sizeof( rtems_filesystem_mount_table_entry_t );
strcpy( temp_mt_entry->dev, device );
- else
+ } else
temp_mt_entry->dev = 0;
/*