Report static independent version to kernel, don't mix this with autoconf package version.
Signed-off-by: Alon Bar-Lev <[EMAIL PROTECTED]> --- diff -urNp ecryptfs-utils-23/src/libecryptfs/main.c ecryptfs-utils-24_beta1/src/libecryptfs/main.c --- ecryptfs-utils-23/src/libecryptfs/main.c 2007-08-20 14:54:16.000000000 +0300 +++ ecryptfs-utils-24_beta1/src/libecryptfs/main.c 2007-10-04 01:40:20.000000000 +0200 @@ -45,7 +45,8 @@ void ecryptfs_get_versions(int *major, i { *major = ECRYPTFS_VERSION_MAJOR; *minor = ECRYPTFS_VERSION_MINOR; - *file_version = ECRYPTFS_SUPPORTED_FILE_VERSION; + if (file_version) + *file_version = ECRYPTFS_SUPPORTED_FILE_VERSION; } inline void to_hex(char *dst, char *src, int src_size) @@ -151,10 +152,10 @@ generate_payload(struct ecryptfs_auth_to char *salt, char *session_key_encryption_key) { int rc = 0; - unsigned char major, minor; + int major, minor; memset(auth_tok, 0, sizeof(struct ecryptfs_auth_tok)); - rc = generate_version_from_string(&major, &minor, VERSION); + ecryptfs_get_versions (&major, &minor, NULL); auth_tok->version = (((uint16_t)(major << 8) & 0xFF00) | ((uint16_t)minor & 0x00FF)); auth_tok->token_type = ECRYPTFS_PASSWORD; @@ -188,14 +189,14 @@ ecryptfs_generate_key_payload(struct ecr struct ecryptfs_key_mod *key_mod, char *sig, size_t blob_size) { - unsigned char major, minor; + int major, minor; unsigned char *key_data; size_t key_data_len; size_t blob_size_tmp; int rc = 0; memset(auth_tok, 0, sizeof(struct ecryptfs_auth_tok) + blob_size); - rc = generate_version_from_string(&major, &minor, VERSION); + ecryptfs_get_versions (&major, &minor, NULL); auth_tok->version = (((uint16_t)(major << 8) & 0xFF00) | ((uint16_t)minor & 0x00FF)); auth_tok->token_type = ECRYPTFS_PRIVATE_KEY; @@ -397,26 +398,6 @@ out: return rc; } -int generate_version_from_string(unsigned char *major, unsigned char *minor, - char *version) -{ - int rc = 0; - unsigned int tmp_major, tmp_minor; - - rc = sscanf(version, "%d.%d", &tmp_major, &tmp_minor); - if (tmp_major > 255 || tmp_minor > 255) { - rc = 1; - (*major) = 0; - (*minor) = 0; - goto out; - } - rc = 0; - (*major) = (unsigned char)tmp_major; - (*minor) = (unsigned char)tmp_minor; -out: - return rc; -} - static int zombie_semaphore_get(void) { int sem_id; ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ eCryptfs-devel mailing list eCryptfs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ecryptfs-devel