Tiny Core Linux

Tiny Core Base => TCB Bugs => Topic started by: adb014 on April 19, 2023, 07:18:01 AM

Title: Tinycore 14.0 : chown: warning: '.' should be ':': 'tc.staff'
Post by: adb014 on April 19, 2023, 07:18:01 AM
Great release, and I have no particular problems. But I did notice annoying warning messages like

Code: [Select]
chown: warning: '.' should be ':': 'tc.staff'

in a number of scripts. These appear to be due to a deprecation of 'chown user.group' in 6.x kernels. The most annoying happens at boot. Could tc-functions be modified with

Code: [Select]
sed -i -e 's/USER".staff/USER":staff/g' /etc/init.d/tc-functions

Other fixes needed are

Code: [Select]
sed -i -e 's/\(chown.*\)\.staff/\1:staff/g' /usr/bin/tce-setup
sed -i -e 's/\(chown.*\)\.staff/\1:staff/g' /usr/bin/tce-setdrive

But there are probably others as well
Title: Re: Tinycore 14.0 : chown: warning: '.' should be ':': 'tc.staff'
Post by: curaga on April 19, 2023, 09:32:52 AM
I don't see that? Are you using GNU chown?

edit: Pushed the change, as it doesn't hurt.
Title: Re: Tinycore 14.0 : chown: warning: '.' should be ':': 'tc.staff'
Post by: Rich on April 20, 2023, 08:46:50 AM
Hi curaga
I just noticed it today booting TC14 x86_64:
(https://forum.tinycorelinux.net/index.php?action=dlattach;topic=26210.0;attach=6426)
Title: Re: Tinycore 14.0 : chown: warning: '.' should be ':': 'tc.staff'
Post by: aus9 on April 20, 2023, 07:01:28 PM
I wonder if this is relevant to the tc:staff report by Rich?

Code: [Select]
root@box:/home/tc# ls -al /root
total 16
drwxrwxr-x    2 root     staff          120 Apr 21 01:55 .
drwxr-xr-x   17 tc       staff          400 Apr 21 01:21 ..
-rw-rw-r--    1 root     staff          248 Apr 12 15:38 .Xdefaults
-rw-------    1 root     root            16 Apr 21 01:56 .ash_history
-rw-r--r--    1 root     root            29 Dec 29 15:24 .bashrc
-rw-rw-r--    1 root     staff          278 Apr 12 15:38 .profile

and if that is true then maybe this is true for ONE of the  root:staff

Code: [Select]
ls -al /usr/local/tc.installed | less
drwxrwxr-x    2 root     staff         4200 Mar 25  2021 ./
drwxr-xr-x   10 1000     staff          200 Mar 25  2021 ../
SNIP

Title: Re: Tinycore 14.0 : chown: warning: '.' should be ':': 'tc.staff'
Post by: Rich on April 20, 2023, 07:33:19 PM
Hi aus9
I wonder if this is relevant to the tc:staff report by Rich? ...
A. No, it's about using a colon instead of a period between OWNER and GROUP
   as a field separator when executing chown.
Q. What's wrong with using a period?
A. A USER or GROUP name can contain a period.
Q. Can't a name contain a colon?
A. No. That would break /etc/passwd which uses a colon as the field separator.
Title: Re: Tinycore 14.0 : chown: warning: '.' should be ':': 'tc.staff'
Post by: aus9 on April 20, 2023, 07:50:13 PM
yes I should have spotted the period.

my bad
Title: Re: Tinycore 14.0 : chown: warning: '.' should be ':': 'tc.staff'
Post by: sloan on September 23, 2023, 09:20:12 PM
I have successfully cover this problem by change default tc-functions just like bellow when remaster "core.gz".

It is that add "&> /dev/null" to the line which has "chown -R "$USER".staff /home/"$USER/"" in it.
note.because restore mydata is after that script, so only change "/etc/init.d/tc-functions" and backup to mydata.tgz will not work. must remaster "core.gz" or "corepure64.gz".

Code: [Select]
/tmp/ezremaster/extract/etc/init.d/tc-functions
Code: [Select]
root@box:~$ cat/tmp/ezremaster/extract/etc/init.d/tc-functions | grep "chown -R"
      chown -R "$USER".staff /home/"$USER/" &> /dev/null
do chown -R "$USER".staff /home/"$USER"/"${ITEM%%/*}" &> /dev/null