أحمد المحمودي wrote:
> ----- Forwarded message from Maurizio Avogadro <[email protected]> -----
>
> sorry for my late but I'm very busy... after the first glance:
>
> 1. I noticed that some previous version left a
>
> - ---Sr--r-T root root data.(slamr|modem:)[0-9]
>
> file in /var/lib/slmodem: maybe the slmodemd daemon is unable to access
> that file after dropping the privileges. This didn't happen in my case.
>
> Can that user simply try to delete that file and restart the daemon (it
> will be created anew as
>
> - -rw------- 1 Slmodemd Slmodemd data.(slamr|modem:)[0-9]
>
> if not after the first slmodemd run, after the second)?
>
> 2. What are the permissions of /var/lib/slmodem?
/var/lib/slmodem didn't exist for me, apparently due to bug #421867. At
the time I filed this bug, I was using version 2.9.11~20080817-1, and
that bug was fixed in 2.9.11~20080817-2.
I just upgraded to 2.9.11~20080817-3, and /var/lib/slmodem was created:
$ ls -l /var/lib | grep slmodem
drwxr-xr-x 2 Slmodemd adm 48 2009-02-12 13:15:39 slmodem
When I run slmodemd, no files get created in /var/lib/slmodem, though.
The output looks like this:
----------------------------------------------------------------------
# slmodemd -a --debug
SmartLink Soft Modem: version 2.9.11 Feb 11 2009 17:18:39
<904.573094> SmartLink Soft Modem: version 2.9.11 Feb 11 2009 17:18:39
<904.573174> modem:1: startup modem...
<904.573351> modem:1: update termios...
symbolic link `/dev/ttySL0' -> `/dev/pts/2' created.
modem `modem:1' created. TTY is `/dev/pts/2'
<904.574521> open file: /var/lib/slmodem/data.modem:1...
<904.574610> cannot open '/var/lib/slmodem/data.modem:1': No such file
or directory
<904.589214> main: rt applyed: SCHED_FIFO, pri 99
<904.589650> main: dropped privileges to 114.105
Use `/dev/ttySL0' as modem device, Ctrl+C for termination.
----------------------------------------------------------------------
It appears that slmodemd isn't creating /var/lib/slmodem/data.modem:1
even though it should have permissions to create files in the directory
(isn't it still running as root at that point, anyway?). Actually, now
that I check the source, that makes sense:
modem/modem_datafile.c:70, function datafile_load_info()
----------------------------------------------------------------------
int fd;
DBG("open file: %s...\n",file_name);
fd = open(file_name, 0, 0);
if(fd < 0) {
DBG("cannot open '%s': %s\n",
file_name,strerror(errno));
return -errno;
}
----------------------------------------------------------------------
There aren't any flags on the open() system call; O_CREAT would be
needed. Anyway, I went ahead and created the file with the
permissions/ownership you listed above, and now the output looks like this:
----------------------------------------------------------------------
# slmodemd -a --debug
SmartLink Soft Modem: version 2.9.11 Feb 11 2009 17:18:39
<309.699510> SmartLink Soft Modem: version 2.9.11 Feb 11 2009 17:18:39
<309.699590> modem:1: startup modem...
<309.699755> modem:1: update termios...
symbolic link `/dev/ttySL0' -> `/dev/pts/1' created.
modem `modem:1' created. TTY is `/dev/pts/1'
<309.700894> open file: /var/lib/slmodem/data.modem:1...
<309.763599> main: rt applyed: SCHED_FIFO, pri 99
<309.764034> main: dropped privileges to 114.105
Use `/dev/ttySL0' as modem device, Ctrl+C for termination.
----------------------------------------------------------------------
I have some bad news, though. I had reported earlier that my problem
went away when I upgraded my kernel to 2.6.28. It appears I was
mistaken; I guess I had installed my modified Debian package and
completely forgotten about it; so, when I tested slmodemd under 2.6.28,
it simply wasn't dropping privileges because I had removed that
functionality.
So, please don't close this bug yet, since I spoke too soon.
Thanks,
Corey
--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]