LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 11-26-2005, 09:46 PM   #1
mugwump84
Member
 
Registered: Mar 2005
Distribution: Arch Linux
Posts: 61

Rep: Reputation: 15
Wvdial failing on ioctl call as regular user


I followed the non-root dialout howto and now I can dial out as a regular user with wvdial - almost. the first time I use the computer, I have to dial out as root, otherwise it fails on an ioctl (I used strace to find out where it was failing) call with a permission denied error ( I think, It might be something different) - Anyway, checking the permissions on /dev/ttyS1 (my modem) results in:
Code:
crw-rw----  1 root dialout 4, 65 2005-11-26 19:35 /dev/ttyS1
which is correct (I hope).

I am a member of the dialout group, so what the heck is wrong?

PS: If you want, I can post the output of strace.
 
Old 11-27-2005, 11:33 AM   #2
jailbait
Guru
 
Registered: Feb 2003
Location: Blue Ridge Mountain
Distribution: Debian Wheezy, Debian Jessie
Posts: 7,535

Rep: Reputation: 178Reputation: 178
"I followed the non-root dialout howto and now I can dial out as a regular user with wvdial - almost. the first time I use the computer, I have to dial out as root, otherwise it fails on an ioctl (I used strace to find out where it was failing) call with a permission denied error ( I think, It might be something different) - Anyway, checking the permissions on /dev/ttyS1 (my modem) results in:"

Different systems have different methods of enforcing dialout security. Here is a list of commands that unblock every wvdial security block that I have ever heard of. One of these might be the problem you have encountered.

chown root:dialout /dev/ttyS1
chmod 660 /dev/ttyS1
chown root:dialout /dev/modem
chown root:dialout /etc/wvdial.conf
chmod 660 /etc/wvdial.conf
chown root:dialout /etc/ppp/chap-secrets
chmod 660 /etc/chap-secrets
chown root:dialout /etc/ppp/pap-secrets
chmod 660 /etc/pap-secrets
chown root:dialout /etc/ppp/peers/wvdial
chmod 660 /etc/ppp/peer/wvdial
chmod u+s /usr/sbin/pppd
chmod u+s /usr/bin/wvdial


----------------------------
Steve Stites
 
Old 11-27-2005, 12:54 PM   #3
mugwump84
Member
 
Registered: Mar 2005
Distribution: Arch Linux
Posts: 61

Original Poster
Rep: Reputation: 15
Well, I did most of those to enable non-root dialout (not the suid stuff), and it works, except the first time if I didn't run it as root first, it fails on an ioctl call:
Code:
open("/var/lock/LCK..ttyS1", O_RDWR|O_NONBLOCK|O_CREAT|O_EXCL|O_LARGEFILE, 0644) = 4
fcntl64(4, F_SETFD, FD_CLOEXEC)         = 0
write(4, "      2656\n", 11)            = 11
close(4)                                = 0
open("/dev/ttyS1", O_RDWR|O_NONBLOCK|O_NOCTTY|O_LARGEFILE) = 4
fcntl64(4, F_SETFD, FD_CLOEXEC)         = 0
ioctl(4, SNDCTL_TMR_TIMEBASE or TCGETS, {B9600 opost isig icanon echo ...}) = 0
ioctl(4, SNDCTL_TMR_TIMEBASE or TCGETS, {B9600 opost isig icanon echo ...}) = 0
select(5, [4], [], [], {0, 0})          = 0 (Timeout)
ioctl(4, TIOCGSERIAL, 0xbfffe580)       = 0
ioctl(4, TIOCSSERIAL, 0xbfffe540)       = -1 EPERM (Operation not permitted)
ioctl(4, TCFLSH, 0x2)                   = 0
ioctl(4, SNDCTL_TMR_START or TCSETS, {B9600 opost isig icanon echo ...}) = 0
close(4)                                = 0
write(3, "--> ", 4--> )                     = 4
write(3, "Cannot open /dev/ttyS1: Cannot s"..., 63Cannot open /dev/ttyS1: Cannot set information for serial port.) = 63
write(3, "\n", 1
)                       = 1
unlink("/var/lock/LCK..ttyS1")          = 0
close(3)                                = 0
exit_group(1)                           = ?
Of course, I may be on the wrong track completely. I'll check my permissions on my other files as well.
 
Old 11-27-2005, 01:01 PM   #4
mugwump84
Member
 
Registered: Mar 2005
Distribution: Arch Linux
Posts: 61

Original Poster
Rep: Reputation: 15
I checked my permissions, and they are all right, except /usr/bin/wvdial isn't +s, which I want to avoid.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Cannot run call of duty as regular user aeruzcar Linux - Software 1 06-03-2005 07:23 AM
dm driver ioctl call tantrix Programming 0 05-16-2005 06:50 PM
Write sys call failing ppy Programming 1 11-05-2004 08:57 AM
Ioctl() call fails Custer Linux - Wireless Networking 0 02-16-2004 12:47 PM
wvdial for user Zander Linux - Software 1 09-06-2003 07:47 PM


All times are GMT -5. The time now is 09:40 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration