Monarchz3ro / Silver

A unix inspired terminal mockup that is definitely not an emulator.
GNU General Public License v3.0
2 stars 2 forks source link

some bug report #20

Closed OcelotWalrus closed 4 months ago

OcelotWalrus commented 4 months ago

I tested the su command and here are the issues I've encountered:

Monarchz3ro commented 4 months ago

noticed this too, working on a fix

Monarchz3ro commented 4 months ago

also, su user by default always asks for the root pass, not the target user's pass edit: nvm, that came out wrong, idk what i was thinking

Monarchz3ro commented 4 months ago

i'm taking a break, it is boggling my mind with just how many bugs are in the code i really messed this up hard here are the following test cases i'd suggest you use if you are working on your own fix ill work on this myself in a few hours if this isnt fixed

sudo -i (asks for root, does nothing) sudo -i -s (asks for root, opens root shell) sudo -u Miriel -s whoami (asks for miriel, opens miriel shell, echoes miriel) sudo whoami (asks for monarch, echoes sysadmin) sudo -s (asks for monarch, opens root shell) sudo su - (asks for monarch, opens root shell) sudo su - -c whoami (asks for monarch, opens root shell, echoes sysadmin) sudo su (asks for monarch, changes to root without shell) sudo su Miriel (asks for monarch, changes to miriel without a shell) sudo su - Miriel (asks for monarch, opens miriel shell) su Miriel -c whoami (asks for miriel, changes to miriel without a shell, echoes miriel)

Monarchz3ro commented 4 months ago

im not sure why the comment above is boldened

Yajus114 commented 4 months ago

Using a "#" makes them big and bold

This msg has a '#' in the beginning and therefore is big

Monarchz3ro commented 4 months ago

nothing in my message has a hashtag though

Monarchz3ro commented 4 months ago

the way i'd go around fixing it is removing the su function entirely and rewriting it from scratch

OcelotWalrus commented 4 months ago

the way i'd go around fixing it is removing the su function entirely and rewriting it from scratch

Better idea. I could work on that if you want.

Monarchz3ro commented 4 months ago

If you want to. I'm going to work on it if you or Yajus don't

OcelotWalrus commented 4 months ago

If I do it it's going to be this week-end though. Or maybe on Thursday.

Monarchz3ro commented 4 months ago

I'll do it then, no worries

Monarchz3ro commented 4 months ago

EVERY issue has been mostly fixed, except an incredibly crucial combination sudo su sudo without the -s arg restores you back to the previous user once it has finished running, and that means it effectively drowns out the changes made by su

ideally, sudo su should ask for Monarch, switch to root without opening a shell look up test cases i threw if you're attempting to try and fix this behaviour

OcelotWalrus commented 4 months ago

ideally, sudo su should ask for Monarch, switch to root without opening a shell look up test cases i threw if you're attempting to try and fix this behaviour

yes.

Monarchz3ro commented 4 months ago

image EVERY SINGLE BUG WE HAD WITH SUDO AND SU IS FIXED

GO WILD IT PASSES EVERY SINGLE TEST CASE

OcelotWalrus commented 4 months ago

Nice!