public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
From: Holly Bostick <motub@planet.nl>
To: gentoo-user@lists.gentoo.org
Subject: Re: [gentoo-user] sudo echo cannot write to /etc/ files ?
Date: Wed, 06 Jul 2005 17:21:47 +0200	[thread overview]
Message-ID: <42CBF70B.4010703@planet.nl> (raw)
In-Reply-To: <200507061620.47943.gentoo@depardo.ch>

gentoo@depardo.ch schreef:
> Le Mercredi, 6 Juillet 2005 15.52, Holly Bostick a ecrit :
> 
>>Hey, ho--
>>
>>I've finally got around to setting up sudo. It works fine, except for
>>one thing.
>>
>>I made a Cmd_Alias group which includes a lot of utility apps. And, like
>>many of you, I included emerge in this group.
>>
>>But a lot of the time, I have to echo to one of the files in
>>/etc/portage.
>>
>>Echo is in the sudo-ed group, and echo isn't the problem-- the problem
>>is that permission is refused to write to the file itself
>>
>>As I see it, this error can mean only one of two things:
>>
>>sudo does not give me a login shell (so my UID is 'really' still my UID
>>and not root's, and I don't have permission to write to the file); or
>>
>>there is another, "invisible" cli utility responsible for actually
>>writing to the file, which is not sudo-ed.
>>
>>Or could it be something else?
>>
>>In any case, does anybody know how I could fix this? It's really
>>screwing up my useability, which was just starting to shape up nicely :-) .
>>
>>Thanks,
>>Holly
> 
> 
> I think the problem come from the fact that echo is sudo-ed but the shell 
> redirection isn't.
> 
> Compare this:
> su -c "echo foo > /etc/portage/whatever"
> and 
> su -c "echo foo" > /etc/portage/whatever
> 
> The first one will succeed, but not the second.
> 
> To solve your problem, I would just do:
> chgrp -R portage /etc/portage
> chmod -R g+w /etc/portage
> 

Well, it didn't work (this to all the respondents).

I did change the group and mod of /etc/portage, but even before I did:

"sudo echo 'media-video/xine-ui ~x86' >>/etc/portage/package.keywords"
-bash: sudo echo 'media-video/xine-ui ~x86'
>>/etc/portage/package.keywords: Onbekend bestand of map

("unknown file or folder", which is at least different, but not really
much of an improvement, and no, before someone asks, putting a space
before /etc doesn't help)

and even after chowning and chmodding:

 sudo echo 'media-video/xine-ui ~x86' >>/etc/portage/package.keywords
-bash: /etc/portage/package.keywords: Toegang geweigerd

(permission refused)

with the quotes, it's unknown file or folder.

la /etc/portage
totaal 51
drwxrwxr-x   5 root portage  384 jun 13 00:40 .
drwxr-xr-x  88 root root    7312 jul  6 16:15 ..
-rw-rw-r--   1 root portage 9757 jul  6 17:09 package.keywords
-rw-rw-r--   1 root portage 6164 mei 26 11:47 package.keywords~
-rw-rw-r--   1 root portage   64 jun 15 05:27 package.mask
-rw-rw-r--   1 root portage  100 mei 16 14:57 package.mask~
-rw-rw-r--   1 root portage  105 jun 15 05:27 package.unmask
-rw-rw-r--   1 root portage  103 mei 15 21:09 package.unmask~
-rw-rw-r--   1 root portage 2252 jun 30 12:32 package.use
-rw-rw-r--   1 root portage 1616 mei 12 15:46 package.use~
drwxrwxr-x   2 root portage   80 nov 26  2004 profile
drwxrwxr-x   2 root portage   72 jun  2 13:10 profiles
drwxrwsr-x   2 root portage   48 okt 27  2004 sets


Not really sure what good the portage group was supposed to do anyway,
since root is a member of that group, but then again root owns the whole
shebang anyway. The user is not a member of the portage group.

Should I chown the folder -R to users? (seems again quite not the
point)? It still seems that what I really want is a login shell that I'm
not getting.

I'm really lost. Where am I going wrong?

Oh, btw, just remembered-- this is bash 3. Does that make a difference?

Holly


-- 
gentoo-user@gentoo.org mailing list



  reply	other threads:[~2005-07-06 15:29 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-07-06 13:52 [gentoo-user] sudo echo cannot write to /etc/ files ? Holly Bostick
2005-07-06 14:02 ` A. Khattri
2005-07-06 14:25   ` Holly Bostick
2005-07-06 14:20 ` David Morgan
2005-07-06 14:20 ` gentoo
2005-07-06 15:21   ` Holly Bostick [this message]
2005-07-06 15:29     ` Christoph Gysin
2005-07-06 15:39     ` gentoo
2005-07-07  3:42     ` Boyd Stephen Smith Jr.
2005-07-07  5:31       ` Richard Fish
2005-07-06 14:22 ` Edward Catmur
2005-07-06 14:54   ` Holly Bostick
2005-07-06 15:12     ` David Morgan
2005-07-06 15:26       ` Neil Bothwick
2005-07-06 15:28       ` Christoph Gysin
2005-07-06 16:07         ` Holly Bostick
2005-07-06 16:47           ` Christoph Gysin
2005-07-06 18:22           ` Richard Fish
2005-07-06 18:36             ` Holly Bostick
2005-07-06 19:12               ` Richard Fish
2005-07-06 19:42                 ` Holly Bostick
2005-07-06 20:28                   ` John J. Foster
2005-07-06 20:52                   ` Manuel McLure
2005-07-06 19:13               ` Christoph Gysin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=42CBF70B.4010703@planet.nl \
    --to=motub@planet.nl \
    --cc=gentoo-user@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox