1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-06-08 23:37:47 +02:00

RISC OS specific changes

This commit is contained in:
Stefan Bellon 2002-04-22 15:49:31 +00:00
parent c530d811c6
commit 70618e5175
13 changed files with 81 additions and 156 deletions

View File

@ -1,3 +1,8 @@
2002-04-22 Stefan Bellon <sbellon@sbellon.de>
* rndriscos.c (func_table): Made func a function pointer.
(init_device): Improved loading of CryptRandom module.
2002-04-18 Werner Koch <wk@gnupg.org>
* rndlinux.c, rndegd.c, rndunix.c (func_table): Made func a

View File

@ -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 );

View File

@ -1,3 +1,11 @@
2002-04-22 Stefan Bellon <sbellon@sbellon.de>
* 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 <dshaw@jabberwocky.com>
* keygen.c (generate_subkeypair): 2440bis04 adds that creating

View File

@ -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)

View File

@ -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);
}

View File

@ -1,3 +1,8 @@
2002-04-22 Stefan Bellon <sbellon@sbellon.de>
* util.h [__riscos__]: Removed riscos_open, riscos_fopen and
riscos_fstat as those special versions aren't needed anymore.
2002-02-19 David Shaw <dshaw@jabberwocky.com>
* keyserver.h: Add KEYSERVER_NOT_SUPPORTED for unsupported actions

View File

@ -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__ */

View File

@ -1,3 +1,11 @@
2002-04-22 Stefan Bellon <sbellon@sbellon.de>
* 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 <dshaw@jabberwocky.com>
* gnupg.spec.in: Removed pubring.asc and OPTIONS. Added

View File

@ -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

View File

@ -371,6 +371,7 @@
#ifdef IS_DEVELOPMENT_VERSION
#define M_GUARD
#define DEBUG
#endif
#include "g10defs.h"

View File

@ -1,3 +1,11 @@
2002-04-22 Stefan Bellon <sbellon@sbellon.de>
* 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 <wk@gnupg.org>
Fixed filename of last entry.

View File

@ -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
}

View File

@ -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)
{