RE: Re: Help with permissions and sophie
"David Rueter" <[email protected]> Tue, 16 Mar 2004 07:32:36 -0800
| Newsgroups | gmane.comp.security.virus.vtools |
|---|---|
| Message-ID | <[email protected]> |
Matt, It sounds like both of your options could be made to work. Thanks for the suggestions. (I had tried something like your first suggestion and had problems talking with the socket after setuid.) I opted for a third approach that seems to work for my purposes: I needed to scan e-mail messages that were already in a maildir. (Infected messages were either present on the system before virus scanning was installed, or were copied to the server by the user via imapd.) The problem is that the messages have MIME-encoded attachments, and Sweep (as far as I can tell) doesn't have built-in support to munpack messages before scanning. So, my script (running as root) takes a message to be scanned, creates a temporary directory in /var/tmp, copies the file there, munpack's the message there, and has Sophie scan the directory (a al check_dir.pl). If Sophie returns a result indicating a virus, the script then quarantines the original message. Finally, the script removes the temp directory. (Sophie is running as the email user -- qmailq in this case.) I call this script from the ff (For each File) Bash script, which recurses through the entire directory structure. Seems to work well--but if anyone sees any problems with this approach, I'd appreciate hearing about them. David Rueter [email protected] -----Original Message----- From: [email protected] [mailto:[email protected]]On Behalf Of Matthew Trout Sent: Tuesday, March 16, 2004 4:08 AM To: [email protected] Subject: [vtools] Re: Help with permissions and sophie I would have thought your best bet would be to start the script as root, open the socket and then setuid to the user whose files you want to scan. Alternatively add group-read/write permissions to the socket, create a special group for it and run the script as the user you're scanning for bu make the script setgid so it can access the socket ... -- Matt S Trout Network Programmer Business Serve plc _______________________________________________ vtools mailing list [email protected] http://www.vanja.com/list/listinfo.cgi/vtools