Bugzilla – Attachment 55099 Details for
Bug 121061
unable to mount jfs
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
IDP Log In
|
Forgot Password
[patch]
Fix buffer overflow in jfs_fsck
buffer_overflow.patch (text/plain), 1.78 KB, created by
Dave Kleikamp
on 2005-10-21 17:40:59 UTC
(
hide
)
Description:
Fix buffer overflow in jfs_fsck
Filename:
MIME Type:
Creator:
Dave Kleikamp
Created:
2005-10-21 17:40:59 UTC
Size:
1.78 KB
patch
obsolete
>Fix buffer overflow in Is_Device_Mounted > >The stupid code assumed that it could fit the file system type of the >root filesystem in 7 bytes. Recode, so that the type doesn't need to >be copied at all. > >Signed-off-by: Dave Kleikamp <shaggy@austin.ibm.com> > >diff -urp jfsutils-1.1.8/libfs/fssubs.c jfsutils/libfs/fssubs.c >--- jfsutils-1.1.8/libfs/fssubs.c 2003-01-06 12:59:25.000000000 -0600 >+++ jfsutils/libfs/fssubs.c 2005-10-21 12:33:24.000000000 -0500 >@@ -97,7 +97,7 @@ int Is_Device_Mounted(char *Device_Name) > FILE *Mount_Records; /* Pointer for system's mount records */ > struct mntent *Mount_Data; /* Holds data for entry in mount list */ > int Mounted_RC = 0; /* Holds return code. */ >- char Root_FS_Type[] = "0000000"; >+ int root_not_jfs = 0; > > #define ROOT_DIR "/" > >@@ -113,9 +113,16 @@ int Is_Device_Mounted(char *Device_Name) > > /* Attempt to find specified device name in mount records */ > while ((Mount_Data = getmntent(Mount_Records)) != NULL) { >- /* save root file system type for later, if needed */ >- if (strcmp(ROOT_DIR, Mount_Data->mnt_dir) == 0) >- strcpy(Root_FS_Type, Mount_Data->mnt_type); >+ /* >+ * There may be more than one entry for /. Trust the >+ * latest one >+ */ >+ if (strcmp(ROOT_DIR, Mount_Data->mnt_dir) == 0) { >+ if (strcmp("jfs", Mount_Data->mnt_type) == 0) >+ root_not_jfs = 0; >+ else >+ root_not_jfs = 1; >+ } > if (strcmp(Device_Name, Mount_Data->mnt_fsname) == 0) > break; > } >@@ -141,8 +148,7 @@ int Is_Device_Mounted(char *Device_Name) > * Make a best effort to ensure that > * the root file system type is jfs > */ >- if ((strcmp(Root_FS_Type, "0000000") != '0') && >- (strcmp(Root_FS_Type, "jfs") != 0)) >+ if (root_not_jfs) > /* is mounted, found type, is not type jfs */ > Mounted_RC = MSG_JFS_NOT_JFS; > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
Actions:
View
|
Diff
Attachments on
bug 121061
: 55099 |
55979