Console Password Manager (CPM) issues with Ubuntu Karmic (and Maverick, Natty, and anything else newer...)

I've been searching for a decent password manager that works over the console and finally found one (this was awhile back and since then i've found many others like yapet, etc):

CPM Console Password Manager

I really liked the simplicity of CPM and the use of GPG was great. Unfortunately, since the development of CPM has halted, it has not been updated in quite a while. This also means issues with newer libraries and whatnot so it does not compile as easily as before.

I had this error during compilation which drove me nuts since my database was written using CPM so I could not get all my data out. Thankfully someone found out the issue and here is the solution:

-- CPM with Ubuntu Karmic compilation issue & solutions

In file included from /usr/include/fcntl.h:217, from cpm.h:35, from security.c:27: In function ‘open’, inlined from ‘initSecurity’ at security.c:498: /usr/include/bits/fcntl2.h:51: error: call to ‘__open_missing_mode’ declared with attribute error: open with O_CREAT in second argument needs 3 arguments make: *** [security.o] Error 1

As usual, the above message clearly states the issue with the code — error: open with O_CREAT in second argument needs 3 arguments

Solution is to edit line 498 of security.c and edited the line

canary = open(“/dev/null”, O_CREAT);

to reflect

canary = open(“/dev/null”, O_CREAT, 0666);

I had to edit this file to get cpm working on my local machine with Ubuntu Karmic installed. --

Did this small fix and voila, it finally compiled cleanly and installed just fine. Hope this helps someone...

This article was updated on January 4, 2023

Zivago Lee

I currently reside in San Francisco, California and I love tech, cars and food so as you can see, my blog will be just about that!