Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
It can be switched off by setting the cpoption "W" flag (see http://www.vim.org/htmldoc/editing.html#write-quit), though why it's there in the first place beats me. Only the account owner of /home/foobar can take ownership of files in their own directories using wq!, thus considering that they can't give away ownership after taking it, I guess it's not as bad as it sounds...
root:/home/test# touch foobar.txt
root:/home/test# ls -lh
total 0
-rw-r--r-- 1 root root 0 2005-05-26 16:50 foobar.txt
root:/home/test# exit
exit
user@debian:~$ rm foobar.txt
rm: remove write-protected regular empty file `foobar.txt'? y
user@debian:~$ ls -lh
total 0
user@debian:~$
Which isn't too different from being able to write to a read-only file. Of course, outside the user's home directory, a 'permission denied' error is returned.
When saving a file, an editor (vi or pico or whatever) can do two things:
1. Write new data to the old file. Causes "permission denied" in this case. Apparently pico does this.
2. Alternatively, rename the oldfile to backup (or remove it alltogether) and create an entirely new file containing the new content. In order to do this, you need write permission for the directory the file is in, not for the file itself. Apparently, this is vi behaviour.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.