LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Wvdial failing on ioctl call as regular user (https://www.linuxquestions.org/questions/linux-software-2/wvdial-failing-on-ioctl-call-as-regular-user-386859/)

mugwump84 11-26-2005 09:46 PM

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.

jailbait 11-27-2005 11:33 AM

"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

mugwump84 11-27-2005 12:54 PM

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.

mugwump84 11-27-2005 01:01 PM

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


All times are GMT -5. The time now is 04:13 PM.