Branch: Tag:

1998-02-04

1998-02-04 16:10:52 by Per Hedbor <ph@opera.com>

Added profining, removed 4711 Privs, added call_out workaround

Rev: server/base_server/configuration.pike:1.92
Rev: server/base_server/disk_cache.pike:1.33
Rev: server/base_server/privs.pike:1.32
Rev: server/base_server/read_config.pike:1.18
Rev: server/base_server/roxen.pike:1.163
Rev: server/base_server/roxenloader.pike:1.55
Rev: server/config_actions/generate_rsa.pike:1.5
Rev: server/modules/filesystems/filesystem.pike:1.26
Rev: server/modules/filesystems/restrictedfs.pike:1.7
Rev: server/modules/filesystems/userfs.pike:1.17
Rev: server/modules/graphics/business_graphics/business.pike:1.63
Rev: server/modules/graphics/graphic_text.pike:1.99
Rev: server/modules/misc/ip-less_hosts.pike:1.8
Rev: server/modules/misc/mirrorserver.pike:1.13
Rev: server/modules/misc/userdb.pike:1.23
Rev: server/modules/scripting/cgi.pike:1.70
Rev: server/modules/scripting/pikescript.pike:1.20
Rev: server/modules/tags/htmlparse.pike:1.74
Rev: server/protocols/ftp.pike:1.77
Rev: server/protocols/http.pike:1.52
Rev: server/start:1.25

1: - constant cvs_version="$Id: graphic_text.pike,v 1.98 1998/02/02 09:40:43 jens Exp $"; + constant cvs_version="$Id: graphic_text.pike,v 1.99 1998/02/04 16:10:44 per Exp $";   constant thread_safe=1;      #include <module.h>
12:   # define Font font   #endif    - #if !efun(Privs) - constant Privs=((program)"privs"); - #endif /* !efun(Privs) */ -  +    #ifndef VAR_MORE   #define VAR_MORE 0   #endif /* VAR_MORE */
130:      void create()   { -  defvar("cache_dir", ".gtext_cache", "Cache directory for gtext images", +  defvar("cache_dir", "../gtext_cache", "Cache directory for gtext images",    TYPE_DIR,    "The gtext tag saves images when they are calculated in this "    "directory. We currently do not clean this directory.");
618:    if(conf)    {    mkdirhier( query( "cache_dir" )+".foo" ); + #if efun(chmod) +  chmod( query( "cache_dir" ), 0777 ); + #endif    mc = conf;    base_key = "gtext:"+(conf?conf->name:roxen->current_configuration->name);    }
676:      #define simplify_text( from ) replace(from,replace_from,replace_to)    + #define FNAME(a,b) (query("cache_dir")+sprintf("%x",hash(reverse(a[6..])))+sprintf("%x",hash(b))+sprintf("%x",hash(reverse(b-" ")))+sprintf("%x",hash(b[12..])))      array get_cache_file(string a, string b)   { -  object fd = open(query("cache_dir")+ -  sprintf("%x",hash(reverse(a)))+sprintf("%x",hash(b)), "r"); +  object fd = open(FNAME(a,b), "r");    if(!fd) return 0;    array r = decode_value(fd->read());    if(r[0]==a && r[1]==b) return r[2];
688:      void store_cache_file(string a, string b, array data)   { -  object fd = open(query("cache_dir")+ -  sprintf("%x",hash(reverse(a)))+sprintf("%x",hash(b)), "wct"); +  object fd = open(FNAME(a,b), "wct"); + #if efun(chmod) +  chmod( FNAME(a,b), 0666 ); + #endif    if(!fd) return;    fd->write(encode_value(({a,b,data})));    destruct(fd);   }       - array(int)|string write_text(int _args, string text, int size, -  object id) + array(int)|string write_text(int _args, string text, int size, object id)   {    string key = base_key+_args;    array err;
951:    return url_cache[in]=option;   }    + #define ARGHASH query("cache_dir")+"ARGS_"+hash(mc->name) +    int args_restored = 0;   void restore_cached_args()   {    args_restored = 1; -  object privs = Privs("Reading gtext argument list"); -  object o = open(".gtext_args_"+hash(mc->name), "r"); -  privs = 0; +  object o = open(ARGHASH, "r");    if(o)    {    string data = o->read();
984:    on = number;    restore_cached_args();    if(on > number) number=on; -  object privs = Privs("Saving gtext argument list"); -  object o = open(".gtext_args_"+hash(mc->name), "wct"); -  privs = 0; +  object o = open(ARGHASH, "wct"); + #if efun(chmod) +  chmod( ARGHASH, 0666 ); + #endif    string data=encode_value(cached_args);    catch {    object q;