Bug 195573 - Ckermit 8.0.211 breaks LCK.. location
Ckermit 8.0.211 breaks LCK.. location
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: ckermit (Show other bugs)
5
All Linux
medium Severity high
: ---
: ---
Assigned To: Peter Vrabec
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2006-06-15 15:56 EDT by Philip Prindeville
Modified: 2007-11-30 17:11 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2006-06-18 16:13:16 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Philip Prindeville 2006-06-15 15:56:27 EDT
Description of problem:

I tried to run ckermit on an FC5 system (updated via yum) as a regular user, and
it failed.  The failing line was "set line /dev/ttyS0":

Sorry, write access to UUCP lockfile directory denied.

Doing a strings on /usr/bin/kermit revealed:

$ strings /usr/bin/kermit | grep /lock
/usr/sbin/lockdev
/etc/locks/LCK..

Doing a "yum provides /etc/locks" showed that this wasn't a directory that any
package built, however.  Looking at the strings of FC3's ckermit showed that
"$@/var/locks" was the destination of serial device locks.


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


How reproducible:

Try to run kermit as a non-privileged user.

Steps to Reproduce:
1. fire up kermit
2. do a "set line /dev/ttyS0"
3.
  
Actual results:

Sorry, write access to UUCP lockfile directory denied.

Expected results:

It should just work.

Additional info:

Looking through the sources, I find:

* The .spec file does a "make redhat9 ..."

* The target for redhat9 builds with -DLINUXFSSTND

* The define for LOCK_DIR should be set as:

/* in ckutio.c: */

#ifdef LINUXFSSTND
#ifndef HDBUUCP
#define HDBUUCP
#endif /* HDBUUCP */
#endif /* LINUXFSSTND */
...
#ifdef HDBUUCP
#warn got here... HDBUUCP is defined
#ifdef M_SYS5
#define LOCK_DIR "/usr/spool/uucp"
#else
#ifdef M_UNIX
#define LOCK_DIR "/usr/spool/uucp"
#else
#ifdef SVR4
#define LOCK_DIR "/var/spool/locks"
#else
#ifdef SUNOS4
#define LOCK_DIR "/var/spool/locks"
#else
#ifdef LINUXFSSTND
#define LOCK_DIR "/var/lock";
#else
#define LOCK_DIR "/usr/spool/locks"
#endif /* LINUXFSSTND */
...

So, two things...  There should never be a semi-colon on a #define (ok, almost
never)...  And if this #define was actually ever being substituted, it would
cause all sorts of issues because of the semi.  But it doesn't.  Which means
that LOCK_DIR is being define'd somewhere else.
Comment 1 Peter Vrabec 2006-06-18 16:13:16 EDT
You must be in uucp group to do "set line /dev/ttyS0"
see #166155
Comment 2 Philip Prindeville 2006-06-18 16:17:24 EDT
Yeah... you're talking about FC4, and I'm talking about FC5.
Comment 3 Philip Prindeville 2006-06-18 16:25:19 EDT
# uname -r
2.6.16-1.2122_FC5
# ls -l /usr/bin/kermit
-rwxr-xr-x 1 root root 2534712 Feb 10 23:28 /usr/bin/kermit
# rpm -q ckermit
ckermit-8.0.211-4.2.1
#
Comment 4 Philip Prindeville 2006-06-18 16:30:32 EDT
Hmmm...  I note that "show communications" returns the wrong result, as well:

(/home/philipp/) C-Kermit>show commun

Communications Parameters:
 Line: /dev/ttyS0, speed: 9600, mode: local, modem: none
 Parity: none, stop-bits: 1 (8N1)
 Duplex: full, flow: xon/xoff, handshake: none
 Carrier-watch: off, close-on-disconnect: off
 Lockfile: /etc/locks/LCK..ttyS0
 Terminal bytesize: 8, escape character: 28 (^\)

 Carrier Detect      (CD):  Off
 Dataset Ready       (DSR): Off
 Clear To Send       (CTS): Off
 Ring Indicator      (RI):  Off
 Data Terminal Ready (DTR): On
 Request To Send     (RTS): On

Type SHOW DIAL to see DIAL-related items.
Type SHOW MODEM to see modem-related items.

(/home/philipp/) C-Kermit>
Comment 5 Peter Vrabec 2006-06-18 16:39:28 EDT
Does the problem persist even if you are in uucp group?
Because it works for me:
# usermod -G uucp -a someuser
# su - someuser
$ ckermit
C-Kermit> set line /dev/ttyS0

There is same ckermit in FC-{4,5} and devel.
%changelog
* Fri Feb 10 2006 Jesse Keating <jkeating@redhat.com> - 8.0.211-4.2.1
- bump again for double-long bug on ppc(64)

* Tue Feb 07 2006 Jesse Keating <jkeating@redhat.com> - 8.0.211-4.2
- rebuilt for new gcc4.1 snapshot and glibc changes

* Fri Dec 09 2005 Jesse Keating <jkeating@redhat.com>
- rebuilt

* Tue Nov  8 2005 Tomas Mraz <tmraz@redhat.com> 8.0.211-4
- rebuilt with new openssl

* Wed Aug 31 2005 Peter Vrabec <pvrabec@redhat.com> 8.0.211-3
- use baudboy.h to create per-device lock(s) in /var/lock (#166155)
Comment 6 Philip Prindeville 2006-06-18 17:38:13 EDT
Well, in FC5 the group ownership of kermit is root, not uucp.  So I changed
that, and made the binary setgid().

That fixed not being able to do the "set line ...".

Arguably, these modes should be the default in the FC5 install.

In any case, it still remains that "show comm" displays the wrong lock path.
Comment 7 Curtis Doty 2006-07-02 16:16:01 EDT
This is a bug and should be re-opened. Reproducable as root. I even added uucp
group membership just for giggles.

root@localhost~# gpasswd -a root uucp
root@localhost~# kermit
C-Kermit 8.0.211, 10 Apr 2004, for Red Hat Linux 9.0
 Copyright (C) 1985, 2004,
  Trustees of Columbia University in the City of New York.
Type ? or HELP for help.
(/root/) C-Kermit>show comm

Communications Parameters:
 Line: /dev/tty, speed: unknown, mode: remote, modem: generic
 Parity: none, duplex: full, flow: none, handshake: none
 Carrier-watch: auto, close-on-disconnect: off
 Lockfile directory: (none)
 Typical port device name: /dev/ttyS0

Modem signals unavailable

Type SHOW DIAL to see DIAL-related items.
Type SHOW MODEM to see modem-related items.

(/root/) C-Kermit>set line /dev/ttyS0
Sorry, write access to UUCP lockfile directory denied.

Peter, the "ckermit" that you ran in your example above does not exist in FC5.
Comment 8 Curtis Doty 2006-07-02 16:58:55 EDT
I have identified the true source of this bug. The ckermit package has a missing
dep on the lockdev package.

root@localhost~# kermit
C-Kermit 8.0.211, 10 Apr 2004, for Red Hat Linux 9.0
 Copyright (C) 1985, 2004,
  Trustees of Columbia University in the City of New York.
Type ? or HELP for help.
(/root/) C-Kermit>set line /dev/ttyS0
Sorry, write access to UUCP lockfile directory denied.

(/root/) C-Kermit>exit     
root@localhost~# yum -d0 -y install lockdev
root@localhost~# kermit
C-Kermit 8.0.211, 10 Apr 2004, for Red Hat Linux 9.0
 Copyright (C) 1985, 2004,
  Trustees of Columbia University in the City of New York.
Type ? or HELP for help.
(/root/) C-Kermit>set line /dev/ttyS0
(/root/) C-Kermit>!ls /var/lock
dmraid  iptraf  LCK.004.064  LCK...31877  LCK..ttyS0  lvm  subsys
(/root/) C-Kermit>quit 
Closing /dev/ttyS0...OK

So I suppose the best solution is to add this to ckermit.spec:

Requires: lockdev >= 1.0.1-8

Why this wasn't caught by the rpm dep checker is a mystery left to the @redhat
experts.
Comment 9 Peter Vrabec 2006-07-03 10:04:01 EDT
Requires: lockdev is fixed in ckermit-8.0.211-5.fc{5,6}

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