FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > ArchLinux > ArchLinux Pacman Development

 
 
LinkBack Thread Tools
 
Old 07-18-2011, 06:35 AM
Kerrick Staley
 
Default Revise siglevel_t, adding PACKAGE_HASH_OK field

The ALPM_SIG_PACKAGE_HASH_OK field indicates that secure hashes are to
be acceptable as signatures.

Also, having ALPM_SIG_USE_DEFAULT = (1 << 31) will cause alpm_siglevel_t
to be treated as an unsigned value on machines where int is 32 bits,
meaning negative numbers cannot be returned on error conditions. So,
make it (1 << 30). Still, there's no guarantee that signed
semantics will be used unless one of the enum values is negative. So,
supply ALPM_SIG_ERROR = -1 as a sort of dummy value (it can be used in
code, but "-1" is probably just as meaningful and is more consistent
with conventions used throughout the rest of the library).

Signed-off-by: Kerrick Staley <mail@kerrickstaley.com>
---
lib/libalpm/alpm.h | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/lib/libalpm/alpm.h b/lib/libalpm/alpm.h
index 6e1e4bc..ecd9173 100644
--- a/lib/libalpm/alpm.h
+++ b/lib/libalpm/alpm.h
@@ -94,13 +94,14 @@ typedef enum _alpm_siglevel_t {
ALPM_SIG_PACKAGE_OPTIONAL = (1 << 1),
ALPM_SIG_PACKAGE_MARGINAL_OK = (1 << 2),
ALPM_SIG_PACKAGE_UNKNOWN_OK = (1 << 3),
+ ALPM_SIG_PACKAGE_HASH_OK = (1 << 4),

ALPM_SIG_DATABASE = (1 << 10),
ALPM_SIG_DATABASE_OPTIONAL = (1 << 11),
ALPM_SIG_DATABASE_MARGINAL_OK = (1 << 12),
ALPM_SIG_DATABASE_UNKNOWN_OK = (1 << 13),

- ALPM_SIG_USE_DEFAULT = (1 << 31)
+ ALPM_SIG_USE_DEFAULT = (1 << 30)
} alpm_siglevel_t;

/**
--
1.7.6
 
Old 07-18-2011, 06:59 AM
Kerrick Staley
 
Default Revise siglevel_t, adding PACKAGE_HASH_OK field

And...
I didn't actually hit save, so this is missing the ALPM_SIG_ERROR
part. Here's the fixed version.

Revise siglevel_t, adding PACKAGE_HASH_OK field

The ALPM_SIG_PACKAGE_HASH_OK field indicates that secure hashes are to
be acceptable as signatures.

Also, having ALPM_SIG_USE_DEFAULT = (1 << 31) will cause alpm_siglevel_t
to be treated as an unsigned value on machines where int is 32 bits,
meaning negative numbers cannot be returned on error conditions. So,
make it (1 << 30). Still, there's no guarantee that signed
semantics will be used unless one of the enum values is negative. So,
supply ALPM_SIG_ERROR = -1 as a sort of dummy value (it can be used in
code, but "-1" is probably just as meaningful and is more consistent
with conventions used throughout the rest of the library).

Signed-off-by: Kerrick Staley <mail@kerrickstaley.com>
---
lib/libalpm/alpm.h | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/lib/libalpm/alpm.h b/lib/libalpm/alpm.h
index 6e1e4bc..93ffa89 100644
--- a/lib/libalpm/alpm.h
+++ b/lib/libalpm/alpm.h
@@ -90,17 +90,19 @@ typedef enum _alpm_fileconflicttype_t {
* PGP signature verification options
*/
typedef enum _alpm_siglevel_t {
+ ALPM_SIG_ERROR = -1,
ALPM_SIG_PACKAGE = (1 << 0),
ALPM_SIG_PACKAGE_OPTIONAL = (1 << 1),
ALPM_SIG_PACKAGE_MARGINAL_OK = (1 << 2),
ALPM_SIG_PACKAGE_UNKNOWN_OK = (1 << 3),
+ ALPM_SIG_PACKAGE_HASH_OK = (1 << 4),

ALPM_SIG_DATABASE = (1 << 10),
ALPM_SIG_DATABASE_OPTIONAL = (1 << 11),
ALPM_SIG_DATABASE_MARGINAL_OK = (1 << 12),
ALPM_SIG_DATABASE_UNKNOWN_OK = (1 << 13),

- ALPM_SIG_USE_DEFAULT = (1 << 31)
+ ALPM_SIG_USE_DEFAULT = (1 << 30)
} alpm_siglevel_t;

/**
 

Thread Tools




All times are GMT. The time now is 07:41 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org