Debian Bug report logs - #77828
[U-A] users should be able to use u-a (not only root)

version graph

Package: dpkg; Maintainer for dpkg is Dpkg Developers <debian-dpkg@lists.debian.org>; Source for dpkg is src:dpkg.

Reported by: Martin Quinson <mquinson@ens-lyon.fr>

Date: Thu, 23 Nov 2000 15:05:11 UTC

Severity: wishlist

Tags: wontfix

Merged with 79292, 79941

Found in versions 1.7.1, dpkg/1.14.29, 1.7.2

Reply or subscribe to this bug.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, Wichert Akkerman <wakkerma@debian.org>:
Bug#77828; Package dpkg. Full text and rfc822 format available.

Acknowledgement sent to Martin Quinson <mquinson@pixies.ens-lyon.fr>:
New Bug report received and forwarded. Copy sent to Wichert Akkerman <wakkerma@debian.org>. Full text and rfc822 format available.

Message #5 received at submit@bugs.debian.org (full text, mbox):

From: Martin Quinson <mquinson@pixies.ens-lyon.fr>
To: submit@bugs.debian.org
Subject: dpkg: [PATCH]: users should be able to use update-alternatives (not only root)
Date: Sat, 25 Nov 2000 15:59:11 +0100
Package: dpkg
Version: 1.7.1
Severity: wishlist

Hello,

Here is an (unified) patch against update-alternatives.pl as found today in
the CVS. Its purpose is to allow the users to manage an "alternative" system
on their account.

But, don't dream, anything is not possible for users. They can just call
update-alternatives for actions "--display", "--config" or "--install".
So, they can't add new alternative neither remove old ones. (Doing so, I
don't have to manage a DB for users)

Second problem, users who want to use it will have to add to their .bashrc
something like:
PATH=$HOME/etc/alternatives:$PATH
MANPATH=$HOME/etc/alternatives:$PATH
The problem is that anything (binaries and man pages) will be mixed up in
this directory (good news in the bad new: you can change the dir used).

Third problem: so far, the programm is located in /usr/sbin
So, you'll have to change that to give the users the ability to use it.

Enough with problems. How does it work ?
When you run the programm as user (uid != 0), /etc/alternatives is not
changed (sure, I do not have the right to do so). It's the ~/etc/altenatives
which changes.

When I (as user) put an alternative to "auto", it removes the corresponding
link from my subdir, putting the setting to the system-wide one by the same
occasion.

When I (as user) run display, I got information about my own personal
setting, and about the system-wide one.

When I (as user) run config, and if I got a personnal setting for this
alternative, this is the default one, and it is marked by a '@'. (so, we
have three column:
 '@' on first one for the user settings (not visible when root)
 '*' on second one for system-wide one
 '+' on third one for 'best' one

Ok, I've just read that I can't make attachements to bug repports because
the system dislikes MIME, so I dumbly copy/paste my patch here...
>>>>>>>>>>>>>>> BEGIN OF PATCH
--- DEBIAN/dpkg/scripts/update-alternatives.pl	Sat Nov 25 09:58:52 2000
+++ update-alternatives.pl	Sat Nov 25 15:49:00 2000
@@ -45,6 +45,7 @@
 
 Options:  --verbose|--quiet  --test  --help  --version
           --altdir <directory>  --admindir <directory>
+          --localaltdir <directory>
 END
         || &quit("failed to write usage: $!");
 }
@@ -103,6 +104,9 @@
     } elsif (m/^--altdir$/) {
         @ARGV || &badusage("--altdir needs a <directory> argument");
         $altdir= shift(@ARGV);
+    } elsif (m/^--localaltdir$/) {
+        @ARGV || &badusage("--localaltdir needs a <directory> argument");
+        $localaltdir= shift(@ARGV);
     } elsif (m/^--admindir$/) {
         @ARGV || &badusage("--admindir needs a <directory> argument");
         $admindir= shift(@ARGV);
@@ -115,6 +119,19 @@
 $aslavelinkcount{$alink} && &badusage("link $link is both primary and slave");
 
 $mode || &badusage("need --display, --config, --install, --remove or --auto");
+if (getpwnam(getpwuid($<))) { # check if user is root
+    $mode eq "auto" || $mode eq "config" || $mode eq "display"
+	|| &badusage("If you're not root, you're only allowed to run --config, --auto or --display"); 
+    $localaltdir=$ENV{"HOME"}.$altdir unless $localaltdir;
+    $localaltdir || &quit("Unable to determine localaltdir. Giving up");
+    &pr("Any changes will apply to $localaltdir.") 
+	if $verbosemode > 0;
+    -e $localaltdir || &quit("$localaltdir does not exist. Please create it.");
+    $rootaltdir=$altdir;$altdir=$localaltdir;
+} else {
+    $rootaltdir='';
+    $localaltdir && &badusage("You can't specify a localaltdir option when running as root");
+}
 $mode eq 'install' || !%slavelink || &badusage("--slave only allowed with --install");
 
 if (open(AF,"$admindir/$name")) {
@@ -159,10 +176,20 @@
 
 if ($mode eq 'display') {
     if (!$dataread) {
-        &pr("No alternatives for $name.");
+	 &pr("No alternatives for $name.");
     } else {
-        &pr("$name - status is $manual.");
-        if (defined($linkname= readlink("$altdir/$name"))) {
+	if (getpwnam(getpwuid($<))) {
+	    if (defined($linkname= readlink("$altdir/$name"))) {
+		&pr("$name - user alternative link currently points to $linkname");
+	    } elsif ($! == &ENOENT) {
+		&pr("$name - using system-wide settings");
+	    }
+	}
+	$tmp=getpwnam(getpwuid($<))? "\nSystem wide":"$name - ";
+	$tmp2=getpwnam(getpwuid($<))? " BUT DISCARDED in flavor of user settings":"";
+        &pr("$tmp status is $manual$tmp2.");
+        if ((getpwnam(getpwuid($<))&& defined($linkname = readlink("$rootaltdir/$name"))) 
+	    || defined($linkname= readlink("$altdir/$name"))) {
             &pr(" link currently points to $linkname");
         } elsif ($! == &ENOENT) {
             &pr(" link currently absent");
@@ -225,6 +252,22 @@
 # all independent
 
 if ($mode eq 'auto') {
+    if (getpwnam(getpwuid($<)) != 0) { # check if user is root
+	&pr("Setting up selection of $name to site setting.") 
+	    if $verbosemode > 0;
+	&quit("$name already set to site setting. Nothing done") 
+	    unless -e "$altdir/$name";
+	&pr("You are not root: I won't change the system wide settings, but only yours.\n");
+	unlink("$altdir/$name") || $! == &ENOENT ||
+	    &quit("unable to remove $altdir/$name");
+	for ($j=0; $j<=$#slavenames; $j++) {
+	    &pr("Discarding obsolete slave link $slavenames[$j] ($slavelinks[$j]).")
+		if $verbosemode > 0;
+	    unlink("$altdir/$slavenames[$j]") || $! == &ENOENT ||
+		&quit("unable to remove $slavenames[$j]: $!");
+	}
+	exit 0;
+    }
     &pr("Setting up automatic selection of $name.")
       if $verbosemode > 0;
     unlink("$altdir/$name.dpkg-tmp") || $! == &ENOENT ||
@@ -366,6 +409,7 @@
 # state=unexpected => manual=manual
 # manual=auto => state!=expected-inprogress && state!=unexpected
 
+exit 0 if (getpwnam(getpwuid($<))); # non-root don't save the DB
 open(AF,">$admindir/$name.dpkg-new") ||
     &quit("unable to open $admindir/$name.dpkg-new for write: $!");
 &paf($manual);
@@ -482,15 +526,32 @@
 	return;
     }
     printf(STDOUT "\nThere are %s programs which provide \`$name'.\n\n", $#versions+1);
-    printf(STDOUT "  Selection    Command\n");
+    printf(STDOUT "   Selection    Command\n");
     printf(STDOUT "-----------------------------------------------\n");
+    $userfixed=0;
     for ($i=0; $i<=$#versions; $i++) {
-	printf(STDOUT "%s%s    %s        %s\n", 
-	    (readlink("$altdir/$name") eq $versions[$i]) ? '*' : ' ',
+	$userfixed = $userfixed || 
+	    (-e "$altdir/$name" && (readlink("$altdir/$name") eq $versions[$i]));
+	printf(STDOUT "%s%s%s    %s        %s\n", 
+	    (getpwnam(getpwuid($<)) ? #non root
+	     (-e "$altdir/$name" && (readlink("$altdir/$name") eq $versions[$i]) ? '@' : ' ')
+	     : # root => no user specified
+	     ' '),
+	    (getpwnam(getpwuid($<)) ? #non root
+	     ((readlink("$rootaltdir/$name") eq $versions[$i]) ? '*' : ' ')
+	     : # root
+	    (readlink("$altdir/$name") eq $versions[$i]) ? '*' : ' '),
 	    ($best eq $versions[$i]) ? '+' : ' ',
 	    $i+1, $versions[$i]);
     }
-    printf(STDOUT "\nEnter to keep the default[*], or type selection number: ");
+    &pr("\n");
+
+    &pr("(You are not root: I won't change the system wide settings, but only yours)\n")
+	if (getpwnam(getpwuid($<)));
+
+    printf(STDOUT "Enter to keep the %sdefault[%s], or type selection number: ",
+	   (getpwnam(getpwuid($<)) ? ($userfixed ? "user-specified " : "system-wide ") : ""),
+	   (getpwnam(getpwuid($<)) ? ($userfixed ? "@" : "*") : "*"));
 }
 
 sub config_alternatives {
@@ -559,3 +620,8 @@
 exit(0);
 
 # vim: nowrap ts=8 sw=4
+
+
+
+
+
<<<<<<<<<<<<<< END OF PATCH

When this is the wrong way to give a patch, please say it, and I'll resend it.

Bye, Mt.

-- System Information
Debian Release: woody
Kernel Version: Linux pixies 2.2.17 #1 Thu Sep 21 17:08:01 CEST 2000 i686 unknown

Versions of the packages dpkg depends on:
ii  libc6          2.2-1          GNU C Library: Shared libraries and Timezone
ii  libncurses5    5.0-7          Shared libraries for terminal handling
ii  libstdc++2.10- 2.95.2-17      The GNU stdc++ library



Information forwarded to debian-bugs-dist@lists.debian.org, Wichert Akkerman <wakkerma@debian.org>:
Bug#77828; Package dpkg. Full text and rfc822 format available.

Acknowledgement sent to Martin Quinson <mquinson@ens-lyon.fr>:
Extra info received and forwarded to list. Copy sent to Wichert Akkerman <wakkerma@debian.org>. Full text and rfc822 format available.

Message #10 received at 77828@bugs.debian.org (full text, mbox):

From: Martin Quinson <mquinson@ens-lyon.fr>
To: 77828@bugs.debian.org
Subject: Correction of email adress
Date: Fri, 24 Nov 2000 15:54:35 +0100 (MET)
Well, sorry, I sent the report from a misconfigured machine.
My (valid) email is the one used in this mail.

Thanks, Mt.




Merged 77828 79292. Request was from Adam Heath <adam@doogie.org> to control@bugs.debian.org. Full text and rfc822 format available.

Tags added: patch Request was from Adam Heath <adam@doogie.org> to control@bugs.debian.org. Full text and rfc822 format available.

Merged 77828 79292. Request was from wichert@cistron.nl (Wichert Akkerman) to control@bugs.debian.org. Full text and rfc822 format available.

Merged 77828 79292 79941. Request was from Christian Marillat <marillat@debian.org> to control@bugs.debian.org. Full text and rfc822 format available.

Changed Bug title. Request was from Adam Heath <doogie@brainfood.com> to control@bugs.debian.org. Full text and rfc822 format available.

Changed Bug title. Request was from Martin Quinson <mquinson@ens-lyon.fr> to control@bugs.debian.org. Full text and rfc822 format available.

Blocking bugs added: 216606 Request was from Guillem Jover <guillem@debian.org> to control@bugs.debian.org. Full text and rfc822 format available.

Changed Bug submitter from Martin Quinson <mquinson@pixies.ens-lyon.fr> to Martin Quinson <mquinson@ens-lyon.fr>. Request was from Raphael Hertzog <hertzog@debian.org> to control@bugs.debian.org. (Sun, 01 Jun 2008 17:30:05 GMT) Full text and rfc822 format available.

Information forwarded to debian-bugs-dist@lists.debian.org, Dpkg Developers <debian-dpkg@lists.debian.org>:
Bug#77828; Package dpkg. Full text and rfc822 format available.

Acknowledgement sent to Raphael Hertzog <hertzog@debian.org>:
Extra info received and forwarded to list. Copy sent to Dpkg Developers <debian-dpkg@lists.debian.org>. Full text and rfc822 format available.

Message #31 received at 77828@bugs.debian.org (full text, mbox):

From: Raphael Hertzog <hertzog@debian.org>
To: Martin Quinson <mquinson@ens-lyon.fr>, 77828@bugs.debian.org
Subject: Re: Bug#77828: dpkg: [PATCH]: users should be able to use update-alternatives (not only root)
Date: Sun, 6 Jul 2008 17:49:25 +0200
tags 77828 - patch
tags 77828 + wontfix
thanks

On Sat, 25 Nov 2000, Martin Quinson wrote:
> Here is an (unified) patch against update-alternatives.pl as found today in
> the CVS. Its purpose is to allow the users to manage an "alternative" system
> on their account.

I'm not really inclined to support such a feature. I have yet to see a
valid use case.

When the user wants to override a system-wide setting, there are already
dozens of solutions going from using some environment variable to
changing the PATH so that ~/bin/ is looked first. And ~/bin/ can contain
symlinks corresponding to the various name of alternatives and have them
point to their program of choice.

Cheers,
-- 
Raphaël Hertzog

Le best-seller français mis à jour pour Debian Etch :
http://www.ouaza.com/livre/admin-debian/




Tags removed: patch Request was from Raphael Hertzog <hertzog@debian.org> to control@bugs.debian.org. (Sun, 06 Jul 2008 15:54:06 GMT) Full text and rfc822 format available.

Tags added: wontfix Request was from Raphael Hertzog <hertzog@debian.org> to control@bugs.debian.org. (Sun, 06 Jul 2008 15:54:07 GMT) Full text and rfc822 format available.

Information forwarded to debian-bugs-dist@lists.debian.org, Dpkg Developers <debian-dpkg@lists.debian.org>:
Bug#77828; Package dpkg. Full text and rfc822 format available.

Acknowledgement sent to Michelle Konzack <linux4michelle@tamay-dogan.net>:
Extra info received and forwarded to list. Copy sent to Dpkg Developers <debian-dpkg@lists.debian.org>. Full text and rfc822 format available.

Message #40 received at 77828@bugs.debian.org (full text, mbox):

From: Michelle Konzack <linux4michelle@tamay-dogan.net>
To: Raphael Hertzog <hertzog@debian.org>, 77828@bugs.debian.org
Subject: Re: Bug#77828: dpkg: [PATCH]: users should be able to use update-alternatives (not only root)
Date: Fri, 11 Jul 2008 14:36:45 +0200
[Message part 1 (text/plain, inline)]
Hallo Raphael and *,

Am 2008-07-06 17:49:25, schrieb Raphael Hertzog:
> tags 77828 - patch
> tags 77828 + wontfix
> thanks
> 
> On Sat, 25 Nov 2000, Martin Quinson wrote:
> > Here is an (unified) patch against update-alternatives.pl as found today in
> > the CVS. Its purpose is to allow the users to manage an "alternative" system
> > on their account.
> 
> I'm not really inclined to support such a feature. I have yet to see a
> valid use case.
> 
> When the user wants to override a system-wide setting, there are already
> dozens of solutions going from using some environment variable to
> changing the PATH so that ~/bin/ is looked first. And ~/bin/ can contain
> symlinks corresponding to the various name of alternatives and have them
> point to their program of choice.

I would support this whishlist bug since update-alternatives.pl  support
already an infrastructure and yes, ~/bin should be used.  I have written
for some time an tool which is based on "update-alternatives"

Not sure for now (no fsck Web-Access currently), but AFAIK I have it  as
Debian Package on my website and use (X)dialog  which  can  easyly  used
under the X-Window-System.

I have writen it, because there are "noobs" which are USER-ONLY and have
no clue about system configuration.  So my Xdialog Tool has helped  many
peoples already, even it is very simple coded.

Thanks, Greetings and nice Day/Evening
    Michelle Konzack
    Systemadministrator
    24V Electronic Engineer
    Tamay Dogan Network
    Debian GNU/Linux Consultant


-- 
Linux-User #280138 with the Linux Counter, http://counter.li.org/
##################### Debian GNU/Linux Consultant #####################
Michelle Konzack   Apt. 917                  ICQ #328449886
+49/177/9351947    50, rue de Soultz         MSN LinuxMichi
+33/6/61925193     67100 Strasbourg/France   IRC #Debian (irc.icq.com)
[signature.pgp (application/pgp-signature, inline)]

Information forwarded to debian-bugs-dist@lists.debian.org, Dpkg Developers <debian-dpkg@lists.debian.org>:
Bug#77828; Package dpkg. (Thu, 30 Sep 2010 01:18:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to jamesb <jagginess@videotron.ca>:
Extra info received and forwarded to list. Copy sent to Dpkg Developers <debian-dpkg@lists.debian.org>. (Thu, 30 Sep 2010 01:18:03 GMT) Full text and rfc822 format available.

Message #45 received at 77828@bugs.debian.org (full text, mbox):

From: jamesb <jagginess@videotron.ca>
To: Debian Bug Tracking System <77828@bugs.debian.org>
Subject: epiphany-browser
Date: Wed, 29 Sep 2010 21:15:06 -0400
Package: dpkg
Version: 1.14.29
Followup-For: Bug #77828

I quite  shocked to learn that this was filed 10 years ago
and realized that at least two people have offered solutions to this problem.


Apparently this is a very common problem I've had with debian for a longtime
and am sure many other people do to..

Thing is this-> 

By default ~/bin is not enabled for $PATH for normal users..

The epiphany browser cannot be changed graphically. <<< extremely irritating..as the
only place to change it is in console (did the ~/bin in $PATH for ~/.profile and made
a symlinkn ~/bin/epiphany-browser to point to my preferred browser)

Those apps that call the epiphany-browser symlink like gambas(from the help menu item)
ought to know better..so that's why i'm filing a bug to gambas package as well..

I'm sure gambas isn't the only package using the alternatives symlink and $PATH.. and
choosing 'Preferred Applications'(gnome-- to change the user's default webbrowser), has absolutely
no effect.. (perhaps X packages should be enforced not to use the alternatives symlinks)

The rest of the alternatives is console commands and pose no problems(obviously anyone who
uses console knows he can override /etc/alternatives with ~/bin symlinks), but something should definitely be
changed so that the epiphany-browser be globally changed from the GUI..

(I believe relying on /etc/alternatives and using ~/bin for GUI apps is not intuitive at all and very confusing providing
there's 'Preferred Applications' to look into)

Thanks for any feedback, greatly appreciate it.. again I understand the unnecessity of  ~/myalternatives,
but the epiphany-browser should at least be changeable from the user's GUI perspective much more easily..
(I occasionaly like to use the same webbrowser for bookmarking dochelp pages and can't live without thanks)



-- System Information:
Debian Release: 5.0.6
  APT prefers stable
  APT policy: (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.26-2-amd64 (SMP w/3 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages dpkg depends on:
ii  coreutils                   6.10-6       The GNU core utilities
ii  libc6                       2.7-18lenny4 GNU C Library: Shared libraries
ii  lzma                        4.43-14      Compression method of 7z format in

dpkg recommends no packages.

Versions of packages dpkg suggests:
ii  apt                      0.7.20.2+lenny2 Advanced front-end for dpkg

-- no debconf information




Information forwarded to debian-bugs-dist@lists.debian.org, Dpkg Developers <debian-dpkg@lists.debian.org>:
Bug#77828; Package dpkg. (Thu, 30 Sep 2010 03:09:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Jonathan Nieder <jrnieder@gmail.com>:
Extra info received and forwarded to list. Copy sent to Dpkg Developers <debian-dpkg@lists.debian.org>. (Thu, 30 Sep 2010 03:09:03 GMT) Full text and rfc822 format available.

Message #50 received at 77828@bugs.debian.org (full text, mbox):

From: Jonathan Nieder <jrnieder@gmail.com>
To: jamesb <jagginess@videotron.ca>, 77828@bugs.debian.org
Subject: Re: Bug#77828: epiphany-browser
Date: Wed, 29 Sep 2010 22:02:46 -0500
Hi,

jamesb wrote:

> The epiphany browser cannot be changed graphically. <<< extremely irritating

You've got the wrong bug report, I'm afraid.

You see, iiuc epiphany-browser is not even managed systemwide through
the alternatives system.  The default browser is rather managed
something like this:

 - GNOME apps look to the "preferred applications"

 - KDE apps look at their equivalent of the same

 - Traditional apps use the $BROWSER environment variable

 - Modern, desktop-agnostic apps use the xdg-open(1) utility,
   which detects the current browser and tries some of the above.

 - If none of the above is set, we start falling back to defaults.
   Old programs look for netscape, less old ones look for mozilla,
   less old for firefox.  But when packaging for Debian, these
   hard-coded defaults get replaced by x-www-browser, so the local
   sysadmin can decide to on a global site-default browser using
   the alternatives system.

The sensible-browser(1) script can be used to implement some of this.

Anyway, the moral is that if an app packaged for Debian is running
Epiphany despite something else being set as your default browser,
that is a bug.  Alternatives have nothing to do with fixing this.

> ..so that's why i'm filing a bug to gambas package as well..

Good. :)

Hope that helps,
Jonathan




Information forwarded to debian-bugs-dist@lists.debian.org, Dpkg Developers <debian-dpkg@lists.debian.org>:
Bug#77828; Package dpkg. (Thu, 30 Sep 2010 03:09:05 GMT) Full text and rfc822 format available.

Acknowledgement sent to Jonathan Nieder <jrnieder@gmail.com>:
Extra info received and forwarded to list. Copy sent to Dpkg Developers <debian-dpkg@lists.debian.org>. (Thu, 30 Sep 2010 03:09:05 GMT) Full text and rfc822 format available.

Message #55 received at 77828@bugs.debian.org (full text, mbox):

From: Jonathan Nieder <jrnieder@gmail.com>
To: jamesb <jagginess@videotron.ca>
Cc: 77828@bugs.debian.org
Subject: Re: Bug#77828: epiphany-browser
Date: Wed, 29 Sep 2010 22:04:44 -0500
Jonathan Nieder wrote:
> jamesb wrote:

>> The epiphany browser cannot be changed graphically. <<< extremely irritating
[...]
>  - Modern, desktop-agnostic apps use the xdg-open(1) utility,
>    which detects the current browser and tries some of the above.

... detects the current desktop environment ...

Sorry for the confusion.

Good night,
Jonathan




Did not alter fixed versions and reopened. Request was from Debbugs Internal Request <owner@bugs.debian.org> to internal_control@bugs.debian.org. (Sat, 12 Feb 2011 13:09:04 GMT) Full text and rfc822 format available.

Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Thu Apr 24 01:55:24 2014; Machine Name: beach.debian.org

Debian Bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.