comotion / cpm

Console Password Manager

Home Page:http://www.harry-b.de/dokuwiki/doku.php?id=harry:cpm

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ulimit

bruberg opened this issue · comments

On Debian based systems, looks like memlock must be set to something around 32768.

how did you come by 32768? do you have a large cpm database?

a stock compile and the packaging process works fine with the default of 5010 or so here on debian squeeze

please give me ulimit -a when this problem appears

On Lenny with default contents in /etc/security/limits.conf:

  ~$ cat /etc/debian_version
  5.0.4
  ~$ uname -a
  Linux somehost.example.com 2.6.26-2-xen-amd64 #1 SMP Wed May 12 18:37:58 UTC 2010 x86_64 GNU/Linux
  ~$ cpm --security
  Running without root privileges:                  yes
  Memory protection from core dumps:                yes
  Memory protection from swap writings:             no
  Max. memory lock ok:                              no (32 kB)
  Memory protection from ptrace spying:             yes
  Validation of environment variables:              yes
  ~$ ulimit -l
  32
  ~$ su -
  ~# ulimit -a
  core file size          (blocks, -c) 0
  data seg size           (kbytes, -d) unlimited
  scheduling priority             (-e) 0
  file size               (blocks, -f) unlimited
  pending signals                 (-i) 4160
  max locked memory       (kbytes, -l) 32
  max memory size         (kbytes, -m) unlimited
  open files                      (-n) 1024
  pipe size            (512 bytes, -p) 8
  POSIX message queues     (bytes, -q) 819200
  real-time priority              (-r) 0
  stack size              (kbytes, -s) 8192
  cpu time               (seconds, -t) unlimited
  max user processes              (-u) 4160
  virtual memory          (kbytes, -v) unlimited
  file locks                      (-x) unlimited
  ~# ulimit -l 5120 # ref. http://www.harry-b.de/dokuwiki/doku.php?id=harry:cpm#memory_issues
  ~# ulimit -a
  core file size          (blocks, -c) 0
  data seg size           (kbytes, -d) unlimited
  scheduling priority             (-e) 0
  file size               (blocks, -f) unlimited
  pending signals                 (-i) 4160
  max locked memory       (kbytes, -l) 5120
  max memory size         (kbytes, -m) unlimited
  open files                      (-n) 1024
  pipe size            (512 bytes, -p) 8
  POSIX message queues     (bytes, -q) 819200
  real-time priority              (-r) 0
  stack size              (kbytes, -s) 8192
  cpu time               (seconds, -t) unlimited
  max user processes              (-u) 4160
  virtual memory          (kbytes, -v) unlimited
  file locks                      (-x) unlimited
  ~# su - $UNPRIVILEGED_USER
  ~$ cpm --security
  Running without root privileges:                  yes
  Memory protection from core dumps:                yes
  Memory protection from swap writings:             yes
  Max. memory lock ok:                              yes (5120 kB)
  Memory protection from ptrace spying:             yes
  Validation of environment variables:              yes

Fix, add something like:

-               -       memlock         5120
  
to /etc/security/limits.conf.

br,
Knut

ok, this is not really a CPM issue. CPM can't frob the limit, and does warn you if the limit is too low.

my memlock is unlimited by the way. not a problem on a single user system