openSUSE 11.3 minicom permission denied with usb serial adapter

Hi,

I have a usb serial adapter and was happily using minicom with it under openSUSE 11.2. I’ve upgraded to openSUSE 11.3 and I can only use minicom with this serial adapter as root. I had previously had problems writing to /var/lock under openSUSE 11.2 which I worked around by changing the minicom config to use /tmp as its lock file location.

Unfortunately my laptop doesn’t have a built in serial port so I can’t tell if its a general problem or something specific to the /dev/ttyUSB0 device.

This is the output I get when I run minicom with my regular user account. I get the same output whether the lock file location is set to /tmp or /var/lock

~> minicom usb0                                      
Device /dev/ttyUSB0 lock failed: Permission denied.

Before I started tinkering my user belonged to the following groups

groups=16(dialout),33(video),100(users)

I’ve since added 5(tty),14(uucp),21(console) but still no joy.

Can anyone shed some light on this or point me in the right direction.

Thanks.

Just saw this: https://bugzilla.novell.com/show_bug.cgi?id=552095

I do not know what they mean by lockdev support…

I also know very little about lockdev but I do have it installed

~> zypper search lockdev
Loading repository data...
Reading installed packages...

S | Name          | Summary                                  | Type   
--+---------------+------------------------------------------+--------
i | liblockdev1   | The header files for the lockdev library | package
i | lockdev       | A library for locking devices            | package
  | lockdev-devel | A library for locking devices            | package

I also have the latest version of minicom installed

Repository: @System
Name: minicom
Version: 2.3-37.2
Arch: i586
Vendor: openSUSE
Installed: Yes
Status: up-to-date
Installed Size: 701.0 KiB

I have done so:


minicom -s

and I did setup “Serial Port Setup”

A- Serial device : /dev/ttyUSB0

and saved as default.

I added my user to the group dialout and then I rebooted my openSUSE 11.3.


myuser@mysuse:~> minicom
 
Welcome to minicom 2.3                                                                                                                                           
                                                                                                                                                                 
OPTIONS: I18n                                                                                                                                                    
Compiled on Jul  5 2010, 13:45:50.                                                                                                                               
Port /dev/ttyUSB0                                                                                                                                                
                                                                                                                                                                 
                 Press CTRL-A Z for help on special keys                                                                                                         

I hope it help. :slight_smile:

I was fairly sure I was a member of all the right groups but I restarted anyway, same issue.

I think I’ve got a solution now but I’m not 100% sure if its correct or what the correct solution should be. Earlier I mentioned that I had a problem with openSUSE 11.2 I mentioned I worked around not being able to write to /var/lock by configuring minicom to use /tmp. I think the lockdev integration in openSUSE 11.3 causes that setting to be ignored and lockdev or minicom always tires to create a file in /var/lock. In my system the permissions are set as follows

:~> ls -l /var/ | grep lock                                 
drwxrwxr-t   6 root root 4096 2010-07-21 16:18 lock

If I change the permissions such that /var/lock is writable by all then I can use minicom with a non-root user. According to this setting /var/lock to be world writable has security implications so I’m wondering what the proper fix is.

Answering my own question. After comparing notes with a friends fresh openSUSE 11.3 install the fix is

sudo chgrp lock /var/lock

Yes /var/lock by default is owned by the group lock… :slight_smile: But how did that fix the problem if it was the default permissions for /var/lock anyways ?

Because it wasn’t the default in openSUSE 11.2. In 11.2 /var/lock had the group set to “root”. I upgraded (instead of a fresh install) so I guess the update leaves file permissions alone whereas a fresh install would have created the directory with the group set to “lock”.