diff options
author | Stefan Bellon <[email protected]> | 2002-04-22 15:49:31 +0000 |
---|---|---|
committer | Stefan Bellon <[email protected]> | 2002-04-22 15:49:31 +0000 |
commit | 70618e51758d04374f6013c462df8465124460aa (patch) | |
tree | c6bcf2e778ada5dd5bf45479323feb5d6a5af2b2 | |
parent | * samplekeys.asc: Added 0x5B0358A2 (diff) | |
download | gnupg-70618e51758d04374f6013c462df8465124460aa.tar.gz gnupg-70618e51758d04374f6013c462df8465124460aa.zip |
RISC OS specific changes
-rw-r--r-- | cipher/ChangeLog | 5 | ||||
-rw-r--r-- | cipher/rndriscos.c | 31 | ||||
-rw-r--r-- | g10/ChangeLog | 8 | ||||
-rw-r--r-- | g10/exec.c | 3 | ||||
-rw-r--r-- | g10/keyid.c | 4 | ||||
-rw-r--r-- | include/ChangeLog | 5 | ||||
-rw-r--r-- | include/util.h | 6 | ||||
-rw-r--r-- | scripts/ChangeLog | 8 | ||||
-rw-r--r-- | scripts/conf-riscos/Makefile | 15 | ||||
-rw-r--r-- | scripts/conf-riscos/include/config.h | 1 | ||||
-rw-r--r-- | util/ChangeLog | 8 | ||||
-rw-r--r-- | util/iobuf.c | 13 | ||||
-rw-r--r-- | util/riscos.c | 130 |
13 files changed, 81 insertions, 156 deletions
diff --git a/cipher/ChangeLog b/cipher/ChangeLog index 86f61020f..e12853cd7 100644 --- a/cipher/ChangeLog +++ b/cipher/ChangeLog @@ -1,3 +1,8 @@ +2002-04-22 Stefan Bellon <[email protected]> + + * rndriscos.c (func_table): Made func a function pointer. + (init_device): Improved loading of CryptRandom module. + 2002-04-18 Werner Koch <[email protected]> * rndlinux.c, rndegd.c, rndunix.c (func_table): Made func a diff --git a/cipher/rndriscos.c b/cipher/rndriscos.c index bffe8df42..47144517a 100644 --- a/cipher/rndriscos.c +++ b/cipher/rndriscos.c @@ -42,15 +42,26 @@ init_device(void) { _kernel_swi_regs r; + /* Is CryptRandom already loaded? */ r.r[0] = 18; r.r[1] = (int) "CryptRandom"; - if (_kernel_swi(OS_Module, &r, &r)) { - r.r[0] = 1; - r.r[1] = (int) "GnuPG:CryptRand"; - if (_kernel_swi(OS_Module, &r, &r)) - g10_log_fatal("Can't load module CryptRandom.\n"); - } - return 1; + if (!_kernel_swi(OS_Module, &r, &r)) + return 1; + + /* Is it named CryptRand and inside GnuPG$Path? */ + r.r[0] = 1; + r.r[1] = (int) "GnuPG:CryptRand"; + if (!_kernel_swi(OS_Module, &r, &r)) + return 1; + + /* Is it named CryptRandom and inside GnuPG$Path? */ + r.r[0] = 1; + r.r[1] = (int) "GnuPG:CryptRandom"; + if (!_kernel_swi(OS_Module, &r, &r)) + return 1; + + /* Can't find CryptRandom in the default locations */ + g10_log_fatal("Can't load module CryptRandom.\n"); } @@ -96,9 +107,9 @@ const char * const gnupgext_version = "RNDRISCOS ($Revision$)"; static struct { int class; int version; - void *func; + int (*func)(void); } func_table[] = { - { 40, 1, (void *) gather_random }, + { 40, 1, (int (*)(void))gather_random }, }; @@ -117,7 +128,7 @@ gnupgext_enum_func( int what, int *sequence, int *class, int *vers ) } *class = func_table[i].class; *vers = func_table[i].version; - ret = func_table[i].func; + ret = (void*) func_table[i].func; i++; } while ( what && what != *class ); diff --git a/g10/ChangeLog b/g10/ChangeLog index a428e5b03..0327d1628 100644 --- a/g10/ChangeLog +++ b/g10/ChangeLog @@ -1,3 +1,11 @@ +2002-04-22 Stefan Bellon <[email protected]> + + * keyid.c (expirestr_from_sk, expirestr_from_sig): Added _() to + string constant. + + * exec.c (make_tempdir) [__riscos__]: Better placement of + temporary file. + 2002-04-20 David Shaw <[email protected]> * keygen.c (generate_subkeypair): 2440bis04 adds that creating diff --git a/g10/exec.c b/g10/exec.c index 3be81e947..8bd549dcf 100644 --- a/g10/exec.c +++ b/g10/exec.c @@ -60,7 +60,8 @@ static int make_tempdir(struct exec_info *info) if(tmp==NULL) { #ifdef __riscos__ - tmp="<Wimp$ScrapDir>"; + tmp="<Wimp$ScrapDir>.GnuPG"; + mkdir(tmp,0700); /* Error checks occur later on */ #elif defined (__MINGW32__) || defined (__CYGWIN32__) tmp=m_alloc(256); if(GetTempPath(256,tmp)==0) diff --git a/g10/keyid.c b/g10/keyid.c index 608a1039c..43e531e3e 100644 --- a/g10/keyid.c +++ b/g10/keyid.c @@ -325,7 +325,7 @@ expirestr_from_sk( PKT_secret_key *sk ) time_t atime; if( !sk->expiredate ) - return "never "; + return _("never "); atime = sk->expiredate; return mk_datestr (buffer, atime); } @@ -337,7 +337,7 @@ expirestr_from_sig( PKT_signature *sig ) time_t atime; if(!sig->expiredate) - return "never "; + return _("never "); atime=sig->expiredate; return mk_datestr (buffer, atime); } diff --git a/include/ChangeLog b/include/ChangeLog index 9751fa64f..76b585d1a 100644 --- a/include/ChangeLog +++ b/include/ChangeLog @@ -1,3 +1,8 @@ +2002-04-22 Stefan Bellon <[email protected]> + + * util.h [__riscos__]: Removed riscos_open, riscos_fopen and + riscos_fstat as those special versions aren't needed anymore. + 2002-02-19 David Shaw <[email protected]> * keyserver.h: Add KEYSERVER_NOT_SUPPORTED for unsupported actions diff --git a/include/util.h b/include/util.h index 94827107e..ab94cf697 100644 --- a/include/util.h +++ b/include/util.h @@ -257,9 +257,6 @@ int vasprintf ( char **result, const char *format, va_list args); #ifdef __riscos__ pid_t riscos_getpid(void); int riscos_kill(pid_t pid, int sig); -FILE *riscos_fopen(const char *filename, const char *mode); -int riscos_open(const char *filename, int oflag, ...); -int riscos_fstat(int fildes, struct stat *buf); int riscos_access(const char *path, int amode); int fdopenfile(const char *filename, const int allow_write); void close_fds(void); @@ -273,9 +270,6 @@ void list_openfiles(void); #ifndef __RISCOS__C__ #define getpid riscos_getpid #define kill(a,b) riscos_kill((a),(b)) - #define fopen(a,b) riscos_fopen((a),(b)) - #define fstat(a,b) riscos_fstat((a),(b)) - #define open riscos_open #define access(a,b) riscos_access((a),(b)) #endif /* !__RISCOS__C__ */ #endif /* __riscos__ */ diff --git a/scripts/ChangeLog b/scripts/ChangeLog index 94968bcac..199283e59 100644 --- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -1,3 +1,11 @@ +2002-04-22 Stefan Bellon <[email protected]> + + * conf-riscos/include/config.h [__riscos__]: Development + versions automatically define DEBUG from now on. + + * conf-riscos/Makefile [__riscos__]: Updated for LDAP keyserver + code. + 2002-04-19 David Shaw <[email protected]> * gnupg.spec.in: Removed pubring.asc and OPTIONS. Added diff --git a/scripts/conf-riscos/Makefile b/scripts/conf-riscos/Makefile index 7a582f21b..27cd1bd07 100644 --- a/scripts/conf-riscos/Makefile +++ b/scripts/conf-riscos/Makefile @@ -4,11 +4,10 @@ LINK=link AS=objasm MAKE=amu DEPEND=-depend !Depend -DEBUG= -CC_FLAGS=-Wp -apcs 3/26bit -throwback -Otime -IUnix:,include.,mpi.,intl.,zlib. -JUnix: -D__riscos__ -DHAVE_CONFIG_H -DNO_ASM -UIS_MODULE -DVERSION="\"$(GnuPG$Version)\"" $(GnuPG$DevDefine) +LIBLDAP=^.^.openldap-2/0/18 +CC_FLAGS=-Wp -apcs 3/26bit -throwback -Otime -IUnix:,include,mpi,intl,zlib,$(LIBLDAP).include -JUnix: -D__riscos__ -DHAVE_CONFIG_H -DNO_ASM -UIS_MODULE -DVERSION="\"$(GnuPG$Version)\"" $(GnuPG$DevDefine) AS_FLAGS=-apcs 3/26bit -throwback -predefine "ARMv4 SETA 0" LD_FLAGS=Unix:o.unixlib -LIBLDAP=^.^.openldap-2/0/18.libraries.libldap.libldap CIPHER_OBJS=cipher.blowfish.o \ cipher.cast5.o \ cipher.cipher.o \ @@ -188,7 +187,7 @@ GPGV_OBJS=g10.armor.o \ .SUFFIXES: .c .o .s .c.o: - $(CC) $(CC_FLAGS) $(DEPEND) $(DEBUG) -c -o $@ $< + $(CC) $(CC_FLAGS) $(DEPEND) -c -o $@ $< .s.o: $(AS) $(AS_FLAGS) $(DEPEND) $< $@ @@ -215,8 +214,8 @@ tools.gpgsplit: tools.o.gpgsplit util.util intl.gettext zlib.zlib -squeeze tools.gpgsplit -copy tools.gpgsplit ADFS::A5.$.tmp.!GnuPG.gpgsplit ~CF~V -keyserver.gpgkeys_ldap: keyserver.o.gpgkeys_ldap $(LIBLDAP) - $(LINK) $(LD_FLAGS) keyserver.o.gpgkeys_ldap $(LIBLDAP) -o keyserver.gpgkeys_ldap +keyserver.gpgkeys_ldap: keyserver.o.gpgkeys_ldap $(LIBLDAP).libraries.libldap.libldap + $(LINK) $(LD_FLAGS) keyserver.o.gpgkeys_ldap $(LIBLDAP).libraries.libldap.libldap -o keyserver.gpgkeys_ldap -squeeze keyserver.gpgkeys_ldap -copy keyserver.gpgkeys_ldap ADFS::A5.$.tmp.!GnuPG.gpgkeys_ldap ~CF~V @@ -372,9 +371,11 @@ clean-g10: clean-keyserver: -ifthere keyserver.gpgkeys_ldap then wipe keyserver.gpgkeys_ldap ~CFR~V + -ifthere keyserver.o.* then wipe keyserver.o.* ~CFR~V clean-tools: -ifthere tools.gpgsplit then wipe tools.gpgsplit ~CFR~V + -ifthere tools.o.* then wipe tools.o.* ~CFR~V clean-riscos: -ifthere riscos.jpegview.jpegview then wipe riscos.jpegview.jpegview ~CFR~V @@ -416,8 +417,8 @@ dev: clean-version fast-dev: BUILD setver configure/ac AC_INIT(gnupg, , dev wipe distrib.private.!GnuPG.gpg* ~CFR~V - $(MAKE) tools.gpgsplit -$(MAKE) keyserver.gpgkeys_ldap + $(MAKE) tools.gpgsplit $(MAKE) distrib.gnupgdev/zip ifthere <WebServe$ServeRoot>.private.gnupgdev/zip then wipe <WebServe$ServeRoot>.private.gnupgdev/zip ~CFR~V rename distrib.gnupgdev/zip <WebServe$ServeRoot>.private.gnupgdev/zip diff --git a/scripts/conf-riscos/include/config.h b/scripts/conf-riscos/include/config.h index 16732b99f..f7258e0d3 100644 --- a/scripts/conf-riscos/include/config.h +++ b/scripts/conf-riscos/include/config.h @@ -371,6 +371,7 @@ #ifdef IS_DEVELOPMENT_VERSION #define M_GUARD + #define DEBUG #endif #include "g10defs.h" diff --git a/util/ChangeLog b/util/ChangeLog index 89b5b695f..dcb62a4e7 100644 --- a/util/ChangeLog +++ b/util/ChangeLog @@ -1,3 +1,11 @@ +2002-04-22 Stefan Bellon <[email protected]> + + * riscos.c (riscos_open, riscos_fopen, riscos_fstat, set_filetype): + Removed as they're not needed anymore. + + * iobuf.c (direct_open) [__riscos__]: Don't allow opening of + directories. + 2002-04-08 Werner Koch <[email protected]> Fixed filename of last entry. diff --git a/util/iobuf.c b/util/iobuf.c index dc4d019fe..5df2d6975 100644 --- a/util/iobuf.c +++ b/util/iobuf.c @@ -208,7 +208,20 @@ direct_open (const char *fname, const char *mode) else { oflag = O_RDONLY; } +#ifndef __riscos__ return open (fname, oflag, cflag ); +#else + { + struct stat buf; + int rc = stat( fname, &buf ); + + /* Don't allow iobufs on directories */ + if( !rc && S_ISDIR(buf.st_mode) && !S_ISREG(buf.st_mode) ) + return __set_errno( EISDIR ); + else + return open( fname, oflag, cflag ); + } +#endif #endif } diff --git a/util/riscos.c b/util/riscos.c index 835730d79..2b4e92bd5 100644 --- a/util/riscos.c +++ b/util/riscos.c @@ -70,18 +70,6 @@ is_read_only(const char *filename) return 0; } -static void -set_filetype(const char *filename, const int type) -{ - _kernel_swi_regs r; - - r.r[0] = 18; - r.r[1] = (int) filename; - r.r[2] = type; - - if (_kernel_swi(OS_File, &r, &r)) - log_fatal("Can't set filetype for file %s!\nIs the file on a read-only file system?\n", filename); -} /* exported RISC OS functions */ @@ -126,124 +114,6 @@ riscos_kill(pid_t pid, int sig) return __set_errno(ESRCH); } -FILE * -riscos_fopen(const char *filename, const char *mode) -{ - FILE *fp; - _kernel_swi_regs r; - _kernel_oserror *e; - int filetype; - - r.r[0] = 17; - r.r[1] = (int) filename; - if (e =_kernel_swi(OS_File, &r, &r)) - log_fatal("Can't retrieve object information for %s!\n", filename); - if (r.r[0] == 2) { - errno = EISDIR; - return NULL; - } - if (r.r[0] == 3) { - /* setting file to to non-image file, after fopening, restore */ - filetype = (r.r[2] >> 8) & 0xfff; - set_filetype(filename, 0xfff); - fp = fopen(filename, mode); - set_filetype(filename, filetype); - } - else { - fp = fopen(filename, mode); - } - return fp; -} - -int -riscos_open(const char *filename, int oflag, ...) -{ - va_list ap; - _kernel_swi_regs r; - _kernel_oserror *e; - int fd, mode, filetype; - - r.r[0] = 17; - r.r[1] = (int) filename; - if (e =_kernel_swi(OS_File, &r, &r)) - log_fatal("Can't retrieve object information for %s!\n", filename); - if (r.r[0] == 2) { - errno = EISDIR; - return NULL; - } - - va_start(ap, oflag); - mode = va_arg(ap, int); - va_end(ap); - - if (r.r[0] == 3) { - /* setting file to to non-image file, after opening, restore */ - filetype = (r.r[2] >> 8) & 0xfff; - set_filetype(filename, 0xfff); - if (!mode) - fd = open(filename, oflag); - else - fd = open(filename, oflag, mode); - set_filetype(filename, filetype); - } - else { - if (!mode) - fd = open(filename, oflag); - else - fd = open(filename, oflag, mode); - } - return fd; -} - -int -riscos_fstat(int fildes, struct stat *buf) -{ - _kernel_swi_regs r; - _kernel_oserror *e; - char *filename; - int rc, filetype; - int handle = (int) __u->fd[fildes].handle; - - r.r[0] = 7; - r.r[1] = handle; - r.r[2] = 0; - r.r[5] = 0; - if (e = _kernel_swi(OS_Args, &r, &r)) - log_fatal("Can't convert from file handle to name!\n"); - - filename = m_alloc(1 - r.r[5]); - - r.r[0] = 7; - r.r[1] = handle; - r.r[2] = (int) filename; - r.r[5] = 1-r.r[5]; - if (e = _kernel_swi(OS_Args, &r, &r)) - log_fatal("Can't convert from file handle to name!\n"); - - r.r[0] = 17; - r.r[1] = (int) filename; - if (e =_kernel_swi(OS_File, &r, &r)) - log_fatal("Can't retrieve object information for %s!\n", filename); - if (r.r[0] == 2) { - errno = EISDIR; - return NULL; - } - if (r.r[0] == 3) { - /* setting file to to non-image file, after fstating, restore */ - filetype = (r.r[2] >> 8) & 0xfff; - set_filetype(filename, 0xfff); - rc = fstat(fildes, buf); - set_filetype(filename, filetype); - } - else { - rc = fstat(fildes, buf); - } - - m_free(filename); - - return rc; -} - int riscos_access(const char *path, int amode) { |