Bug 102490 - Bash builtin enable command clashes with binary enable command
Bash builtin enable command clashes with binary enable command
Status: CLOSED RAWHIDE
Product: Red Hat Linux
Classification: Retired
Component: cups (Show other bugs)
9
All Linux
medium Severity medium
: ---
: ---
Assigned To: Tim Waugh
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2003-08-15 17:26 EDT by Nick Marsh
Modified: 2007-04-18 12:56 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2004-02-06 11:03:01 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
1st hunk is patch, 2nd shows all symlinks. (772 bytes, patch)
2004-05-26 14:30 EDT, Robert van den Aker
no flags Details | Diff
Patch including symlinks and manpages (15.89 KB, patch)
2004-06-02 16:12 EDT, Robert van den Aker
no flags Details | Diff

  None (edit)
Description Nick Marsh 2003-08-15 17:26:03 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4b)
Gecko/20030516 Mozilla Firebird/0.6

Description of problem:
The the bash builtin "enable" command clashes with the binary enable command
thus forcing you to call it by it's full path name /usr/bin/enable. It wouldn't
be such a big deal except that lpc doesn't support enable functions under cups.
So, the only way to enable a printer is to /usr/bin/enable (unless I am missing
some new fangled way to enable printers).

Version-Release number of selected component (if applicable):
cups-1.1.17-13

How reproducible:
Always

Steps to Reproduce:
1. disable prt0
2. enable prt0
    

Actual Results:  # enable prt0
-bash: enable: prt0: not a shell builtin

Expected Results:  enable should call /usr/bin/enable.

Additional info:

# /usr/bin/enable prt0

# lpq 
prt0 is ready
no entries
Comment 1 Michael Lee Yohe 2003-08-22 11:51:00 EDT
You can override bash builtin commands by simply creating an alias.

$ alias enable=/usr/bin/enable

You can add this to your local .bashrc or system-wide, if necessary.
Comment 2 Tim Waugh 2003-10-03 07:51:56 EDT
While it's unfortunate, it's not really something that can be fixed. :-(
Comment 3 Robert van den Aker 2004-02-06 09:59:21 EST
I believe Debian renamed the command cups-enable (and cups-disable).
Comment 4 Tim Waugh 2004-02-06 11:02:47 EST
That's not a bad idea.  Next build will pick this up.
Comment 5 Nick Marsh 2004-02-06 13:34:17 EST
Great job, great idea.Thanks!
Comment 6 Robert van den Aker 2004-02-08 06:23:17 EST
Correction: Debian didn´t rename the commands cups-enable and
cups-disable. What they did is symlink cupsaccept, cupsreject,
cupsdisable and cupsenable to /usr/sbin/accept (much like reject,
disable, and enable are already symlinks to accept), and patch
accept.c to strip the cups prefix from the commands. The advantage of
that solution is that it doesn´t break current behavior. Whatever
method is chosen, I think it would be a good idea to use Debian´s
names for the commands (i.e. without the hyphen) for better
consistency between distros. One area that needed some work in the
Debian patch that I looked at (the one for Woody) are the manpages.
Looks like they only added symlinks to the original manpages, which
means 'man cupsenable' displays usage instructions for the enable command.
Comment 7 Robert van den Aker 2004-05-26 14:30:03 EDT
Created attachment 100601 [details]
1st hunk is patch, 2nd shows all symlinks.

This was extracted from Debian Woody's cupsys_1.1.14-5.diff. As you can see,
accept determines what to do based on how it was called (argv[0]). The patch
strips the cups prefix and then lets accept continue as usual. Ideally, the
manpages for accept, reject, enable, disable should be patched to mention
cupsaccept, etc as well.
Comment 8 Robert van den Aker 2004-06-02 16:12:02 EDT
Created attachment 100804 [details]
Patch including symlinks and manpages

I've made a patch that includes hunks for symlinks and manpages. I hope it does
all that's required. Note that I've used cupsdisable and cupsenable without the
hyphens. This is for consistency with Debian systems and with other commands
provided by CUPS such as cupstestppd and cupsaddsmb.
Comment 9 Tim Waugh 2004-06-03 11:07:22 EDT
Thanks.  I've incorporated this into 1.1.21-0.rc1.1.

Note You need to log in before you can comment on or make changes to this bug.