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

port user to their /home directory by default + the implications #18

Closed Monarchz3ro closed 4 months ago

Monarchz3ro commented 4 months ago

afterward, change su and sudo so that they switch you into the changed user's home directory after that, implement -p into su so it retains the current directory

Monarchz3ro commented 4 months ago

partially fixed, i think

OcelotWalrus commented 4 months ago

partially fixed, i think

It should be fully fixed by my PR.

Monarchz3ro commented 4 months ago

image you've left out something, and i can't figure out what it is you're trying to do

OcelotWalrus commented 4 months ago

That's just me who did weird stuff. I don't know what happened lol. Should be like this:

if self.__groups == "root":
    self.__current_directory = os.path.join(self.__kernel,"root/root").replace("\\", "/")
else:
    self.__current_directory = os.path.join(self.__kernel,"root/home/{self.__user}").replace("\\", "/")
self.current_directory = self.__current_directory

It's a function to change the current folder, depending on the user. If the user is a root, the directory changes to the /root/ one, else, the directory is /home/<user>/. This function is ran when booting and when running the su command without the -p argument. I don't exactly remember why but there had to be a self.current_directory and a self.__current_directory variable.

OcelotWalrus commented 4 months ago

I just found out why:

the ls.py script needs the self.__current_directory variable but, it cannot access it. So I made a self.current_directory variable just so it can be accessed. Let me make a quick PR to fix that.

OcelotWalrus commented 4 months ago

Checkout #24