[Answered] 'Operation not permitted' message on login

Having issues with your DietPi installation, or, found a bug? Post it here.
Post Reply
AndrewZ
Posts: 19
Joined: Mon May 01, 2017 4:34 pm

[Answered] 'Operation not permitted' message on login

Post 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?
Last edited by AndrewZ on Sun Oct 28, 2018 5:23 pm, edited 1 time in total.
User avatar
MichaIng
Site Admin
Posts: 2262
Joined: Sat Nov 18, 2017 6:21 pm

Re: 'Operation not permitted' message on login

Post 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
AndrewZ
Posts: 19
Joined: Mon May 01, 2017 4:34 pm

Re: 'Operation not permitted' message on login

Post by AndrewZ »

thank you, the error is gone
User avatar
MichaIng
Site Admin
Posts: 2262
Joined: Sat Nov 18, 2017 6:21 pm

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

Post by MichaIng »

Great, thanks for feedback! :)
Post Reply