Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 5 May 1997 10:22:36 +0200 (MET DST)
From:      Zahemszky Gabor <zgabor@CoDe.hu>
To:        freebsd-questions@freebsd.org (FreeBSD questions)
Cc:        un_x@anchorage.net
Subject:   Re: permissions
Message-ID:  <199705050822.KAA00506@CoDe.hu>
In-Reply-To: <Pine.BSF.3.95q.970504014022.21505A-100000@aak.anchorage.net> from Steve Howe at "May 4, 97 01:43:14 am"

next in thread | previous in thread | raw e-mail | index | archive | help
> > 
> > > > > why is it that i can open, modify, and save changes to a
> > > > > file with r--r--r-- perms (as root)?  shouldn't a file be
> > > > > read only under these conditions?
> > > > 
> > > > What do you mean, "as root"?
> 
> joe editor ...  i just checked with "pico" - it will NOT allow me to do
> as described above.  joe is the only one i can say for sure.
> -------------------------------------------------------------------------

With vi editor, if you're root (or any other user with UID 0), you CAN save
into a non-writeable file, with
:w! filename
or exit-with-save
:x! filename
format.


Gabor

---
#!/bin/ksh
trap 'rm -f /tmp/$$.$$' EXIT HUP INT QUIT TERM&&print '21N16I25C25E30, 40M30E33E25T15U!'>/tmp/$$.$$&&IFS=' ABCDEFGHIJKLMNOPQRSTUVWXYZ '&&set -A X $(</tmp/$$.$$)&&IFS=' 0123456789 '&&set -A Y $(</tmp/$$.$$);IFS=' '&&set -- "${X[@]}"&&for i do [[ $i = ? ]]&&print $i&&continue;[[ $i = ??? ]]&&j=$i&&i=${i%?};typeset -i40 i=8#$i&&print -n ${i#???}&&[[ "$j" = ??? ]]&&print -n "${j#??} "&&unset j;typeset +i i;done;set -- "${Y[@]}"&&set -A X&&for i do [[ $i = , ]]&&i=2;[[ $i = ?? ]]||typeset -l i;set -A X "${X[@]}" $i&&typeset +l i;done&&set -- ${X[@]}&&print $*



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199705050822.KAA00506>