LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-24-2019, 07:58 AM   #1
rodrick
LQ Newbie
 
Registered: Sep 2019
Posts: 11

Rep: Reputation: Disabled
editing policies.json in linux


Hi
I'm running Debian 10 with firefox snap and now need to edit the policies.json file in order to change the Disableappupdate to false. ls -l shows that I have rw as root. However when I edit this with vim and then attempt to save the change it returns an error 212: Can't open file for writing.
Can someone please tell me what I'm missing here?

Thanx
 
Old 09-24-2019, 08:20 AM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,636

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by rodrick View Post
Hi
I'm running Debian 10 with firefox snap and now need to edit the policies.json file in order to change the Disableappupdate to false. ls -l shows that I have rw as root. However when I edit this with vim and then attempt to save the change it returns an error 212: Can't open file for writing.
Can someone please tell me what I'm missing here?

Thanx
Yes; you're not editing the file with root permissions. Either run "sudo vim <filename>", or run "su", and enter your root password, then edit the file.
 
Old 09-24-2019, 08:32 AM   #3
Firerat
Senior Member
 
Registered: Oct 2008
Distribution: Debian sid
Posts: 2,683

Rep: Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783
Quote:
Originally Posted by rodrick View Post
Hi
Hi
Quote:
Originally Posted by rodrick View Post
I'm running Debian 10 with firefox snap
I assume you mean you have installed Firefox on Debian 10 via snap.
Quote:
Originally Posted by rodrick View Post
and now need to edit the policies.json file in order to change the Disableappupdate to false.
sounds technical
are you following some guide?
Quote:
Originally Posted by rodrick View Post
ls -l shows that I have rw as root.
ls -l lists the files/dirs in long format
without a dir/or file the current working dir.
I would like to know what dir you are in
Quote:
Originally Posted by rodrick View Post
However when I edit this with vim and then attempt to save the change it returns an error 212: Can't open file for writing.
what do you get from
Code:
lsattr ./policies.json
Quote:
Originally Posted by rodrick View Post
Can someone please tell me what I'm missing here?
Thanx
tbh, I would imagine there is some other way of managing the configuration options for that snappackage

I suspect the policies.json file is set immutable
Code:
A file with the 'i' attribute cannot be modified: it cannot be deleted or renamed, no link can be  created  to  this
       file, most of the file's metadata can not be modified, and the file can not be opened in write mode.  Only the supe‐
       ruser or a process possessing the CAP_LINUX_IMMUTABLE capability can set or clear this attribute.
that is a complete guess
 
Old 09-24-2019, 09:18 AM   #4
rodrick
LQ Newbie
 
Registered: Sep 2019
Posts: 11

Original Poster
Rep: Reputation: Disabled
Thanks for your prompt reply.
To answer your questions:
1) Yes I installed firefox snap on Debian.
2) No, I'm not following any guide
3) The directory I was in was home/username#. the command was: vim /snap/firefox/266/distribution/policies.json.
4) Executing lsattr ./policies.json elicits: No such file or directory while trying to stat ./policies.json

If there is some other way of managing the configuration options for that snappackage I haven't found it. I think the key to this may lie in the fact that .json is a standard java interchange format. I know this can be edited with jq as I have seen numerous examples of this but that's way over my head at this point. I can't understand why firefox snap would intentionally block updates. Of course I could simply delete the firefox snap and download a conventional firefox tar.gz. But then I would have learned nothing.

Thanks again
 
Old 09-24-2019, 09:41 AM   #5
Firerat
Senior Member
 
Registered: Oct 2008
Distribution: Debian sid
Posts: 2,683

Rep: Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783
Quote:
Originally Posted by rodrick View Post
Thanks for your prompt reply.
To answer your questions:
1) Yes I installed firefox snap on Debian.
2) No, I'm not following any guide
3) The directory I was in was home/username#. the command was: vim /snap/firefox/266/distribution/policies.json.
4) Executing lsattr ./policies.json elicits: No such file or directory while trying to stat ./policies.json
well, I based everything on the assumption you were in the same dir as the file you wanted to edit, since you only checked the permission of the dir you were in.

that looks like it may be a loopback device ( a file mounted like a block device )
It is probably readonly

confirm that with
Code:
mount | grep firefox
Quote:
Originally Posted by rodrick View Post
If there is some other way of managing the configuration options for that snappackage I haven't found it. I think the key to this may lie in the fact that .json is a standard java interchange format. I know this can be edited with jq as I have seen numerous examples of this but that's way over my head at this point. I can't understand why firefox snap would intentionally block updates. Of course I could simply delete the firefox snap and download a conventional firefox tar.gz. But then I would have learned nothing.

Thanks again
I have never used snap
but I would start here
https://snapcraft.io/install/snapd/debian

jq doesn't edit files, it can query and output json which can be put in a new file.

does Debian not have Firefox installed by default?
 
Old 09-24-2019, 10:32 AM   #6
rodrick
LQ Newbie
 
Registered: Sep 2019
Posts: 11

Original Poster
Rep: Reputation: Disabled
mount | grep firefox /var/lib/snapd/snaps/firefox_266.snap on /snap/firefox/266 type sqashfs (ro,nodev,relatime,x-gdu.hide)
What does this tell you?

Debian does ship with firefox but it's the ESR version. ESR is meant for deployments, doesn't receive all security patches, and will be a year behind the current technology before you get a major update.

Thanks for the link.I think I'll hit them with my question about the update block.
 
Old 09-24-2019, 10:36 AM   #7
Firerat
Senior Member
 
Registered: Oct 2008
Distribution: Debian sid
Posts: 2,683

Rep: Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783
Quote:
Originally Posted by rodrick View Post
mount | grep firefox /var/lib/snapd/snaps/firefox_266.snap on /snap/firefox/266 type sqashfs (ro,nodev,relatime,x-gdu.hide)
What does this tell you?

Debian does ship with firefox but it's the ESR version. ESR is meant for deployments, doesn't receive all security patches, and will be a year behind the current technology before you get a major update.

Thanks for the link.I think I'll hit them with my question about the update block.
what did rw tell you?


Edit, that was kind of evil

RO = Read Only

Last edited by Firerat; 09-24-2019 at 10:37 AM.
 
Old 09-24-2019, 12:34 PM   #8
rodrick
LQ Newbie
 
Registered: Sep 2019
Posts: 11

Original Poster
Rep: Reputation: Disabled
The ro part I got. It was the rest of it that I was hoping you'd elucidate. Not to be obtuse but does this mean that there is absolutely no way to unlock this file?
 
Old 09-24-2019, 01:31 PM   #9
Firerat
Senior Member
 
Registered: Oct 2008
Distribution: Debian sid
Posts: 2,683

Rep: Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783
you shoudl have said

so , the ro is read only.. what are the others?

one of the great things about Linux is the documentation that comes with it.

Code:
man mount
snippets
Quote:
nodev Do not interpret character or block special devices on the file system.

relatime
Update inode access times relative to modify or change time. Access time is only updated if the previous access time was ear‐lier than the current modify or change time. (Similar to noatime, but it doesn't break mutt or other applications that need to know if a file has been read since the last time it was modified.)

X-*
All options prefixed with "X-" are interpreted as comments or as userspace application-specific options. These options are not
stored in the user space (e.g. mtab file), nor sent to the mount.type helpers nor to the mount(2) system call. The suggested
format is X-appname.option.

x-*
The same as X-* options, but stored permanently in the user space. It means the options are also available for umount or another
operations. Note that maintain mount options in user space is tricky, because it's necessary use libmount based tools and there
is no guarantee that the options will be always available (for example after a move mount operation or in unshared namespace).

Note that before util-linux v2.30 the x-* options have not been maintained by libmount and stored in user space (functionality
was the same as have X-* now), but due to growing number of use-cases (in initrd, systemd etc.) the functionality have been ex‐
tended to keep existing fstab configurations usable without a change.
 
1 members found this post helpful.
Old 09-24-2019, 03:06 PM   #10
rodrick
LQ Newbie
 
Registered: Sep 2019
Posts: 11

Original Poster
Rep: Reputation: Disabled
Thank you for that.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: How to validate JSON from the command line on Linux LXer Syndicated Linux News 0 03-30-2016 12:14 AM
LXer: How to parse JSON string via command line on Linux LXer Syndicated Linux News 0 09-05-2013 06:32 PM
Parse JSON using Linux command Stefanus Linux - Newbie 2 11-19-2012 10:25 PM
Reading AJAX/JSON Responses in Linux (Bash/Perl/PHP) msf004 Programming 5 05-16-2012 03:35 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:43 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration