Page 1 of 1

[Answered] 'Operation not permitted' message on login

Posted: Sun Oct 28, 2018 11:13 am
by AndrewZ
Just noticed a message which appears briefly right before the login banner:

Code: Select all

chmod: changing permissions of '/DietPi/dietpi/.network': Operation not permitted
Here is the file mentioned:

Code: Select all

$ ll /DietPi/dietpi/.network
-rw-rw-rw- 1 root root 51 Oct 28 13:00 /DietPi/dietpi/.network
I'm logging in over ssh as dietpi user.

Is this something to fix?

Re: 'Operation not permitted' message on login

Posted: Sun Oct 28, 2018 3:09 pm
by MichaIng
Ah jep makes sense: https://github.com/Fourdee/DietPi/blob/ ... tails#L115
- The script is called on login by the login user.
- We chmod /DietPi/dietpi/.network actually allow all users run the script and update+check network info.
- Since /DietPi/dietpi/.network is owned by root, chmod is only permitted for root.
- As the script is first called on early boot state by root user, afterwards the chmod permissions are already set properly and we can do a simply (( $UID )) (root user) check before calling chnod.

NB: This is an only visual issue, no can be just ignored, but you can try/apply the above fix on your system by:

Code: Select all

sudo sed -i 's/chmod 666 $FP_NETFILE/(( $UID )) || chmod 666 $FP_NETFILE/' /DietPi/dietpi/func/obtain_network_details
PR is up to resolve with v6.18: https://github.com/Fourdee/DietPi/pull/2191

Re: 'Operation not permitted' message on login

Posted: Sun Oct 28, 2018 5:22 pm
by AndrewZ
thank you, the error is gone

Re: [Answered] 'Operation not permitted' message on login

Posted: Sun Oct 28, 2018 6:47 pm
by MichaIng
Great, thanks for feedback! :)