Whats the mechanism behind sudo that stores the password for all subsequent calls to sudo?
Mechanism behind password storage in sudo
sudo;password
To clarify, sudo uses a timestamp cache file (configured at build time with --with-rundir) and stores a timestamp entry (see ts_write() with it's struct timestamp argument) to the file. That struct is defined struct ts_cookie {    char *fname;    int fd;    pid_t sid;    bool locked;    off_t pos;    struct timestamp_entry key;};where fname is set as the path to the cache file (and not the user's password) -- see timestamp_open() where it uses asprintf(&fname, %s/%s, def_timestampdir, user) to set fname.