summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
6bcc720)
environment variable isn't set.
The HOME environment variable defines in which directory the Maildir will
be found. If HOME is set to ``/home/charlie'', ``/home/charlie/Maildir''
will be where delivery is attempted to. If this variable is not set,
The HOME environment variable defines in which directory the Maildir will
be found. If HOME is set to ``/home/charlie'', ``/home/charlie/Maildir''
will be where delivery is attempted to. If this variable is not set,
+B<mdeliver> will fall back to using getpwuid(3).
#include <errno.h>
#include <fcntl.h>
#include <limits.h>
#include <errno.h>
#include <fcntl.h>
#include <limits.h>
#include <stdarg.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdarg.h>
#include <stdbool.h>
#include <stdio.h>
{
char *home;
char newfn[LEN_FILENAME];
{
char *home;
char newfn[LEN_FILENAME];
struct stat st;
if (argv[1] && argv[1][0] == '-' && argv[1][1] == 'v') {
struct stat st;
if (argv[1] && argv[1][0] == '-' && argv[1][1] == 'v') {
}
if ((home = getenv("HOME")) == NULL) {
}
if ((home = getenv("HOME")) == NULL) {
- errx("HOME is not set.");
+ if ((pwd = getpwuid(geteuid())) != NULL) {
+ home = pwd->pw_dir;
+ } else {
+ errx("HOME is not set and getpwuid() failed.");
+ }
}
if (chdir(home) != 0) {
}
if (chdir(home) != 0) {