[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: pppd changes permission to /dev/ttyS1 (my modem)



Quoting Piotr Krukowiecki (piotr@pingu.ii.uj.edu.pl):
> On Mon, 04 Sep 2000, David Wright wrote:
> 
> > Quoting Mario Olimpio de Menezes (mario@curiango.ipen.br):
> > > On Mon, 4 Sep 2000, Piotr Krukowiecki wrote:
> > > > 
> > > > pppd removes g+w from /dev/ttyS1 after it is started. So next time I have
> > > > to be root to use my modem (and to connect to internet). How to make pppd
> > > > stop removing it ? 
> > > 
> > > 
> > > better: add users that need to use modem to dialout group; 
> > > # adduser user dialout
> > 
> > Wrong. That would allow all those users to snoop on each other's
> > ppp connections, since they get read-access to the modem port.
> 
> I'm the only user - it's my home computer so I don't care.
> 
> > The correct group is dip.
> 
> Wrong again ;)
> At least with wvdial.

Fair enough. Next time I'll read your mind. This time, I'll just
point out that you didn't mention wvdial in your posting.

> With pon/poff it's all ok. i don't have to
> be in group dialout nor have g+w permission on /dev/ttyS1. If
> /dev/ttyS1 is g+w while starting pppd, pppd removes it and puts
> back on exit.
> But if i use wvdial, /dev/ttyS1 has to be group writable:
> 
> SeLeR:/home/piotr# l /dev/ttyS1
> crw-r-----    1 root     dialout    4,  65 wrz  5 22:41 /dev/ttyS1
> piotr@SeLeR:~/download/5$ wvdial
> --> WvDial: Internet dialer version 1.41
> --> Cannot open /dev/ttyS1: Permission denied

Well that appears to be broken behaviour. Why should your being
entitled to run wvdial for PPP mean that you should have write-access 
to all the serial ports?

> If it has g+w, wvdial is working ok. It connects to my IP and then
> starts pppd, and pppd removes +w. But I think it's not ending pppd
> properly. This is from syslog:
> 
> pppd started by pon and ended by poff:
> Sep  5 23:00:24 SeLeR pppd[938]: Terminating on signal 15.
> Sep  5 23:00:24 SeLeR pppd[938]: sent [LCP TermReq id=0x2 "User request"]
> Sep  5 23:00:25 SeLeR pppd[938]: Script /etc/ppp/ip-up finished (pid 940),
> stat$Sep  5 23:00:25 SeLeR pppd[938]: Script /etc/ppp/ip-down started (pid
> 970)
> Sep  5 23:00:26 SeLeR pppd[938]: Script /etc/ppp/ip-down finished (pid
> 970), st$Sep  5 23:00:27 SeLeR pppd[938]: sent [LCP TermReq id=0x3 "User
> request"]
> Sep  5 23:00:30 SeLeR pppd[938]: sent [LCP TermReq id=0x4 "User request"]
> Sep  5 23:00:33 SeLeR pppd[938]: sent [LCP TermReq id=0x5 "User request"]
> Sep  5 23:00:36 SeLeR pppd[938]: sent [LCP TermReq id=0x6 "User request"]
> Sep  5 23:00:39 SeLeR pppd[938]: Hangup (SIGHUP)
> Sep  5 23:00:39 SeLeR pppd[938]: Modem hangup
> Sep  5 23:00:39 SeLeR pppd[938]: Connection terminated.
> Sep  5 23:00:39 SeLeR pppd[938]: Connect time 0.1 minutes.
> Sep  5 23:00:39 SeLeR pppd[938]: Sent 97 bytes, received 76 bytes.
> Sep  5 23:00:40 SeLeR pppd[938]: Exit.
> 
> pppd started by wvdial (and ended by ^c as said in README for wvdial):
> Sep  5 23:05:41 SeLeR pppd[994]: Terminating on signal 15.
> 
> And wvdial shows sth. like this:
> Caught signal #2!  Attempting to exit gracefully...
> --> Disconnecting at Tue Sep  5 23:05:43 2000
> 
> So is it bug in wvdial or in pppd ?
> wvdial has bug (#33590) - there is mentioned my problem but the bug 
> is in resolved (maybe it's because the main problem in #33590 was 
> different) 

Well, that may depend on how wvdial stops pppd. Killing pppd with
SIGTERM seems to restore the port permission, whereas there are/have
been bugs in pppd where exiting in some other manner (e.g. PAP
failure) has not restored them. If wvdial used -SIGKILL for example,
it would be difficult for pppd to do anything about it.

A workaround may be a sudo'd script that checks whether pppd is running
and restores the permission if it isn't.

I'd be very unhappy if pppd didn't g-w the serial port it uses. Oh, and
BTW, Debian has to be built for people who *do* care, so advice that
compromises security is not to be welcomed here and must certainly be
flagged in case it catches out other people who would then be exposed.

> PS. Don't CC me. I got everything twice.

Then why have you set Mail-Followup-To: to yourself as well as Debian?

Cheers,

-- 
Email:  d.wright@open.ac.uk   Tel: +44 1908 653 739  Fax: +44 1908 655 151
Snail:  David Wright, Earth Science Dept., Milton Keynes, England, MK7 6AA
Disclaimer:   These addresses are only for reaching me, and do not signify
official stationery. Views expressed here are either my own or plagiarised.



Reply to: