diff --git a/bin/login/main.c b/bin/login/main.c index 078b6a6..576dc01 100644 --- a/bin/login/main.c +++ b/bin/login/main.c @@ -117,6 +117,7 @@ if (0x0 == strcmp(userName,data[i].username)) { if (0x0 == strcmp(passWord,data[i].password)) { shellPid = fork(); + if (shellPid == 0x0) { if (setuid(data[i].uid) != 0x0) { printf("Set UID Failed\n"); diff --git a/lib/libc_old/sys/setuid.c b/lib/libc_old/sys/setuid.c index 6398ef0..2575b7b 100644 --- a/lib/libc_old/sys/setuid.c +++ b/lib/libc_old/sys/setuid.c @@ -37,6 +37,7 @@ "setuid:\n" "movl $23, %eax\n" "int $0x80\n" + "ret\n" ); /*** diff --git a/sys/Makefile.incl b/sys/Makefile.incl index 4191881..c3eb38f 100644 --- a/sys/Makefile.incl +++ b/sys/Makefile.incl @@ -8,5 +8,7 @@ KMAKE= ${MAKE} ${KERNEL_FLAGS} INCLUDE=${KERNEL_INC} KERNEL=${KERNEL_NAME} INCLUDES = -I${INCLUDE} -CFLAGS = ${KFLAGS} -Wall -nostdlib -nostdinc -fno-builtin -fno-exceptions -ffreestanding + +CFLAGS = ${KFLAGS} -O -Wall -nostdlib -nostdinc -fno-builtin -fno-exceptions -ffreestanding + ROOT=/ubixos diff --git a/sys/kernel/access.c b/sys/kernel/access.c index 2e5df39..8d36fd3 100644 --- a/sys/kernel/access.c +++ b/sys/kernel/access.c @@ -42,6 +42,7 @@ ************************************************************************/ int sys_setUID(struct thread *td, struct sys_setUID_args *args) { + kprintf("Here?\n"); if (_current->uid == 0x0) { _current->uid = args->uid; return (0); diff --git a/sys/kernel/kern_sysctl.c b/sys/kernel/kern_sysctl.c index e68d1ab..b4a698e 100644 --- a/sys/kernel/kern_sysctl.c +++ b/sys/kernel/kern_sysctl.c @@ -85,6 +85,18 @@ name[1] = 20; page_val = 0x4000; sysctl_add(name, name_len, "p1003_1b.pagesize", &page_val, sizeof(uint32_t)); + + /* 1, 1 */ + name[0] = 1; + name[1] = 1; + char s11[4] = "UBIX"; + sysctl_add(name, name_len, "kern.ostype", &s11, 4); + + /* 1, 10 */ + name[0] = 1; + name[1] = 1; + char s110[16] = "devel.ubixos.com"; + sysctl_add(name, name_len, "kern.hostname", &s110, 16); } int sysctl_init() {