diff --git a/.gitignore b/.gitignore index 6c24293..a00b5d6 100644 --- a/.gitignore +++ b/.gitignore @@ -10,6 +10,7 @@ bootable.iso testing_area *.dSYM tags +Session.vim serial-output diff --git a/Makefile b/Makefile index 5b8e741..b30a86d 100644 --- a/Makefile +++ b/Makefile @@ -10,7 +10,7 @@ GCCINC = $(PREFIX)/lib/gcc/i586-pc-exscapeos/4.9.2/include TOOLCHAININC = $(PREFIX)/i586-pc-exscapeos/include CC = ccache i586-pc-exscapeos-gcc -CFLAGS := -O0 -nostdlib -nostdinc -I./src/include -I$(GCCINC) -I$(TOOLCHAININC) -std=gnu99 -march=i586 $(WARNINGS) -ggdb3 -D__DYNAMIC_REENT__ -D_EXSCAPEOS_KERNEL -fdiagnostics-color=auto +CFLAGS := -O0 -nostdlib -nostdinc -I./src/include -I$(GCCINC) -I$(TOOLCHAININC) -std=gnu99 -march=i586 $(WARNINGS) -ggdb3 -D__DYNAMIC_REENT__ -D_EXSCAPEOS_KERNEL -fdiagnostics-color=always LD = i586-pc-exscapeos-ld NATIVECC = gcc # Compiler for the HOST OS, e.g. Linux, Mac OS X @@ -53,6 +53,7 @@ all: $(OBJFILES) fi @python2 misc/create_initrd.py > /dev/null # let stderr through! @mkisofs -quiet -R -b boot/grub/stage2_eltorito -no-emul-boot -boot-load-size 4 -boot-info-table -o bootable.iso isofiles 2>&1 | grep -vP 'GNU xorriso|^\s*$$' || true + -@rm -f serial-output clean: -$(RM) $(wildcard $(OBJFILES) $(DEPFILES) kernel.bin bootable.iso misc/initrd.img) @@ -61,6 +62,7 @@ clean: rm -f initrd/bin/`basename "$$prog"` initrd/bin/tests/`basename "$$prog"`; \ done @rm -f initrd/bin/sh + -@rm -f serial-output -include $(DEPFILES) @@ -75,26 +77,21 @@ todolist: @nasm -o $@ $< -f elf -F dwarf -g nofat: all - -@rm -f serial-output $(QEMU) -cdrom bootable.iso -monitor stdio -s -serial file:serial-output -m 64 #net: all - #-@rm -f serial-output #@bash net-scripts/prepare.sh #@sudo $(QEMU) -cdrom bootable.iso -hda hdd.img -hdb fat32.img -monitor stdio -s -serial file:serial-output -d cpu_reset -m 64 -net nic,vlan=0,macaddr=00:aa:00:18:6c:00,model=rtl8139 -net tap,ifname=tap2,script=net-scripts/ifup.sh,downscript=no $(KVM) #netdebug: all - #-@rm -f serial-output #@bash net-scripts/prepare.sh #@sudo $(QEMU) -cdrom bootable.iso -hda hdd.img -hdb fat32.img -monitor stdio -s -S -serial file:serial-output -d cpu_reset -m 64 -net nic,vlan=0,macaddr=00:aa:00:18:6c:00,model=rtl8139 -net tap,ifname=tap2,script=net-scripts/ifup.sh,downscript=no $(KVM) run: all - -@rm -f serial-output @sudo $(QEMU) -cdrom bootable.iso -hda ext2-1kb.img -monitor stdio -s -serial file:serial-output -d cpu_reset -m 64 -boot d $(KVM) bochs: all -@bochs -f exscapeos.bochs -q debug: all - -@rm -f serial-output @sudo $(QEMU) -cdrom bootable.iso -hda ext2-1kb.img -monitor stdio -s -S -serial file:serial-output -d cpu_reset -m 64 -boot d $(KVM) diff --git a/src/kernel/ext2.c b/src/kernel/ext2.c index f6bac3d..c0f2428 100644 --- a/src/kernel/ext2.c +++ b/src/kernel/ext2.c @@ -483,6 +483,8 @@ static struct inode_ret ext2_handle_symlink_in_path(ext2_partition_t *part, cons else strcpy(full_path, parent_dir); + // Resolve *all* possible symlinks in the path and check for symlink loops and + // overly nested links if (resolve_actual_path(full_path, PATH_MAX+1) == -ELOOP) { struct inode_ret ret; ret.value = -ELOOP;