summaryrefslogtreecommitdiffstats
path: root/src/parti386.c
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2008-02-25 13:49:47 +0100
committerChristophe Grenier <grenier@cgsecurity.org>2008-02-25 13:49:47 +0100
commitc6a2f962d463125875e1cacdb01d2bb799cbc44d (patch)
treea5afad8f29bcfe427e0fe8dbe41590a3f84ff237 /src/parti386.c
parente390547a3f698560ec5bc03deca5956ed03b0e69 (diff)
Remove Mac and Sun partition signature when writing an Intel partition table
Diffstat (limited to 'src/parti386.c')
-rw-r--r--src/parti386.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/parti386.c b/src/parti386.c
index 775c198..0ee3090 100644
--- a/src/parti386.c
+++ b/src/parti386.c
@@ -2,7 +2,7 @@
File: parti386.c
- Copyright (C) 1998-2007 Christophe GRENIER <grenier@cgsecurity.org>
+ Copyright (C) 1998-2008 Christophe GRENIER <grenier@cgsecurity.org>
This software is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -655,6 +655,12 @@ static int write_mbr_i386(disk_t *disk_car, const list_part_t *list_part, const
log_info("Store new MBR code\n");
write_MBR_code_i386_aux(buffer);
}
+ /* Remove Mac signature */
+ if(buffer[0]==0x45 && buffer[1]==0x52)
+ buffer[0]=0;
+ /* Remove Sun signature */
+ if(buffer[0x1fc]==0xda && buffer[0x1fd]==0xbe)
+ buffer[0x1fc]=0;
for(element=list_part;element!=NULL;element=element->next)
{
switch(element->part->status)