Tiny Core Linux

Tiny Core Base => TCB Bugs => Topic started by: danielibarnes on October 14, 2009, 04:25:58 PM

Title: TC 2.4.1: Deprecated code in /root/.profile
Post by: danielibarnes on October 14, 2009, 04:25:58 PM
Since the autologin user for tty1 in /etc/inittab is now set to $USER by tc-config (line 198), the script code in /root/.profile causes incorrect operation. The symptom is that if other virtual terminals are enabled, logging in as root will immediately su as the tc user.

Removing lines 5-10 of /root/.profile will allow a user to log in as root.
Title: Re: TC 2.4.1: Deprecated code in /root/.profile
Post by: danielibarnes on October 14, 2009, 05:32:13 PM
It seems there is a race condition between the processing of the tty1 settings in /etc/inittab and its modification by /etc/init.d/tc-config (line 198). Booting with /root/.profile modified as above and no boot parameters results in an autologin which randomly logs in as either root or the tc user. The default /root/.profile hides this race condition because even a root login will result in su as the tc user.

Based on my observation, I'd say it is unsafe to modify /etc/inittab within /etc/init.d/tc-config.
Title: Re: TC 2.4.1: Deprecated code in /root/.profile
Post by: roberts on November 23, 2009, 10:40:26 AM
I see this is a message that I have somehow overlooked.
I agree with our statement, actually it is orphaned code in tc-config and will be removed.
Title: Re: TC 2.4.1: Deprecated code in /root/.profile
Post by: danielibarnes on November 28, 2009, 05:41:24 PM
The problem still exists in 2.6. If I specify "noautologin" and then login as root it will "sudo su" as tc user.
Title: Re: TC 2.4.1: Deprecated code in /root/.profile
Post by: roberts on November 29, 2009, 10:54:23 AM
Only the orphaned code in tc-config was deleted in 2.6.
I believe you mean subsquent root logins.
Will be addressed in 2.7
Title: Re: TC 2.4.1: Deprecated code in /root/.profile
Post by: jpeters on November 29, 2009, 01:09:19 PM
The problem still exists in 2.6. If I specify "noautologin" and then login as root it will "sudo su" as tc user.

..probably only safe if you remaster anyway.  There's a noautologin script.  
Title: Re: TC 2.4.1: Deprecated code in /root/.profile
Post by: roberts on November 29, 2009, 01:44:36 PM
Agreed.