Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:markathomas
centerim
centerim-4.22.6-disable-actions.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File centerim-4.22.6-disable-actions.patch of Package centerim
This disables actions -- they're mostly useless anyways, and possess a security hazard (in past, configuation file with broken escaping was created, and we have to ignore it). Lubomir Rintel <lkundrak@v3.sk> Index: src/centerim.cc =================================================================== --- src/centerim.cc.orig +++ src/centerim.cc @@ -760,7 +760,7 @@ void centerim::checkmail() { void centerim::checkconfigs() { static const char *configs[] = { - "sounds", "colorscheme", "actions", "external", "keybindings", 0 + "sounds", "colorscheme", "external", "keybindings", 0 }; struct stat st; @@ -783,12 +783,9 @@ void centerim::checkconfigs() { face.redraw(); break; case 2: - conf->loadactions(); - break; - case 3: external.load(); break; - case 4: + case 3: conf->loadkeys(); break; } @@ -1153,8 +1150,13 @@ icqface::eventviewresult centerim::reade break; case icqface::open: - if(const imurl *m = static_cast<const imurl *>(&ev)) - conf->execaction("openurl", m->geturl()); + if(const imurl *m = static_cast<const imurl *>(&ev)) { + if (fork () == 0) { + face.log (m->geturl()); + execlp("xdg-open", "xdg-open", m->geturl().c_str(), NULL); + exit (-1); + } + } break; case icqface::accept: Index: src/icqconf.cc =================================================================== --- src/icqconf.cc.orig +++ src/icqconf.cc @@ -302,7 +302,6 @@ void icqconf::load() { loadmainconfig(); loadkeys(); loadcolors(); - loadactions(); loadcaptcha(); external.load(); } @@ -1273,74 +1272,6 @@ void icqconf::setcpconvert(protocolname cpconvert[pname] = fcpconvert; } -string icqconf::execaction(const string &name, const string ¶m) { - int inpipe[2], outpipe[2], pid, npos; - struct sigaction sact, osact; - string torun = actions[name], out; - fd_set rfds; - char ch; - - if(name == "openurl") - { - string url = param; - int pos = 0, fnd = -1; - - char enc[4]; - - while( ((fnd = url.find("'", pos)) != -1) || ((fnd = url.find("\"", pos)) != -1) ) { - snprintf(enc, 4, "%%%02X", url[fnd]); - url.replace(fnd, 1, enc); - pos = fnd+3; - } - - while((npos = torun.find("$url$")) != -1) - torun.replace(npos, 5, url); - } - - if(!pipe(inpipe) && !pipe(outpipe)) { - memset(&sact, 0, sizeof(sact)); - sigaction(SIGCHLD, &sact, &osact); - pid = fork(); - - if(!pid) { - dup2(inpipe[1], STDOUT_FILENO); - dup2(outpipe[0], STDIN_FILENO); - - close(inpipe[1]); - close(inpipe[0]); - close(outpipe[0]); - close(outpipe[1]); - - execl("/bin/sh", "/bin/sh", "-c", torun.c_str(), (char *)NULL ); - _exit(0); - } else { - close(outpipe[0]); - close(inpipe[1]); - - while(1) { - FD_ZERO(&rfds); - FD_SET(inpipe[0], &rfds); - - if(select(inpipe[0]+1, &rfds, 0, 0, 0) < 0) break; else { - if(FD_ISSET(inpipe[0], &rfds)) { - if(read(inpipe[0], &ch, 1) != 1) break; else { - out += ch; - } - } - } - } - - waitpid(pid, 0, 0); - close(inpipe[0]); - close(outpipe[1]); - } - - sigaction(SIGCHLD, &osact, 0); - } - face.log(_("+ launched the %s action command"), name.c_str()); - return out; -} - string icqconf::getprotocolname(protocolname pname) const { static const string ptextnames[protocolname_size] = { "icq", "yahoo", "msn", "aim", "irc", "jab", "rss", "lj", "gg", "infocard" Index: src/icqconf.h =================================================================== --- src/icqconf.h.orig +++ src/icqconf.h @@ -344,8 +344,6 @@ class icqconf { bool getshowopenedchats() const { return showopenedchats; } void setshowopenedchats(bool fsoc); - string execaction(const string &action, const string ¶m = ""); - imstatus getstatus(protocolname pname); void savestatus(protocolname pname, imstatus st); void setavatar(protocolname pname, const string &ava); Index: src/icqdialogs.cc =================================================================== --- src/icqdialogs.cc.orig +++ src/icqdialogs.cc @@ -1285,7 +1285,6 @@ bool icqface::updateconf(icqconf::regsou i = t.addnode(_(" Communications ")); t.addleaff(i, 0, 19, _(" SMTP server : %s "), smtp.c_str()); - t.addleaff(i, 0, 31, _(" HTTP browser : %s "), browser.c_str()); t.addleaff(i, 0, 24, _(" HTTP proxy server : %s "), httpproxy.c_str()); if(!httpproxy.empty()) @@ -1442,10 +1441,6 @@ bool icqface::updateconf(icqconf::regsou case 30: cm = (cm == icqconf::cmproto ? icqconf::cmstatus : icqconf::cmproto ); break; - case 31: - tmp = inputstr(_("HTTP browser to use: "), browser); - if(!tmp.empty()) browser = tmp; - break; case 32: conf->setleftpanelwidth(atol(inputstr(_("Left panel width: "), strint(conf->getleftpanelwidth())).c_str())); @@ -2088,7 +2083,6 @@ bool icqface::setljparams(imxmlevent *ev break; case 20: LJP_LIST("mood", moods, _("(none/custom)")); break; - case 21: LJP_STR("music", _("Currently playing: ")); break; case 22: LJP_LIST("picture", pictures, _("(default)")); break; case 23: LJP_STR("mood", _("Current mood: ")); break; case 25: LJP_STR("taglist", _("Tags for the entry: ")); break; @@ -2098,9 +2092,6 @@ bool icqface::setljparams(imxmlevent *ev case 33: LJP_BOOL("backdated"); break; } - } else if(b == 1) { - ev->setfield("music", conf->execaction("detectmusic")); - } else if(b == 2) { r = true; Index: src/icqface.cc =================================================================== --- src/icqface.cc.orig +++ src/icqface.cc @@ -2389,8 +2389,13 @@ void icqface::showextractedurls() { for(i = extractedurls.begin(); i != extractedurls.end(); ++i) m.additem(" " + *i); - if(n = m.open()) - conf->execaction("openurl", extractedurls[n-1]); + if(n = m.open()) { + if (fork () == 0) { + log (extractedurls[n-1]); + execlp("xdg-open", "xdg-open", extractedurls[n-1].c_str(), NULL); + exit (-1); + } + } restoreworkarea(); }
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor