Bug 102490 - Bash builtin enable command clashes with binary enable command
Summary: Bash builtin enable command clashes with binary enable command
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: cups   
(Show other bugs)
Version: 9
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Tim Waugh
QA Contact:
Depends On:
TreeView+ depends on / blocked
Reported: 2003-08-15 21:26 UTC by Nick Marsh
Modified: 2007-04-18 16:56 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2004-02-06 16:03:01 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
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 18:30 UTC, Robert van den Aker
no flags Details | Diff
Patch including symlinks and manpages (15.89 KB, patch)
2004-06-02 20:12 UTC, Robert van den Aker
no flags Details | Diff

Description Nick Marsh 2003-08-15 21:26:03 UTC
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):

How reproducible:

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 15:51:00 UTC
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 11:51:56 UTC
While it's unfortunate, it's not really something that can be fixed. :-(

Comment 3 Robert van den Aker 2004-02-06 14:59:21 UTC
I believe Debian renamed the command cups-enable (and cups-disable).

Comment 4 Tim Waugh 2004-02-06 16:02:47 UTC
That's not a bad idea.  Next build will pick this up.

Comment 5 Nick Marsh 2004-02-06 18:34:17 UTC
Great job, great idea.Thanks!

Comment 6 Robert van den Aker 2004-02-08 11:23:17 UTC
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 18:30:03 UTC
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 20:12:02 UTC
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 15:07:22 UTC
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.