summaryrefslogtreecommitdiffstats
path: root/sbin/gbde/gbde.c
diff options
context:
space:
mode:
authorpjd <pjd@FreeBSD.org>2005-02-03 13:12:17 +0000
committerpjd <pjd@FreeBSD.org>2005-02-03 13:12:17 +0000
commit492540a83026aab6778375843b42af97a4405602 (patch)
treec5faaa104cc88d422f4b420fe230cfa620d1e8f8 /sbin/gbde/gbde.c
parent3ba37139baafed93cdec495eb7ee9c9b95435054 (diff)
downloadFreeBSD-src-492540a83026aab6778375843b42af97a4405602.zip
FreeBSD-src-492540a83026aab6778375843b42af97a4405602.tar.gz
- Remove bogus O_CREAT flag. We really don't want to create a file here.
PR: bin/67793 Submitted by: Amir Shalem <amir@boom.org.il> - Sync usage with manual page. Approved by: phk MFC after: 1 week
Diffstat (limited to 'sbin/gbde/gbde.c')
-rw-r--r--sbin/gbde/gbde.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/sbin/gbde/gbde.c b/sbin/gbde/gbde.c
index 0d75f38..5b26186 100644
--- a/sbin/gbde/gbde.c
+++ b/sbin/gbde/gbde.c
@@ -137,11 +137,11 @@ usage(const char *reason)
p = getprogname();
fprintf(stderr, "Usage error: %s", reason);
fprintf(stderr, "Usage:\n");
- fprintf(stderr, "\t%s attach dest [-l lockfile]\n", p);
+ fprintf(stderr, "\t%s attach dest [-l lockfile] [-p pass-phrase]\n", p);
fprintf(stderr, "\t%s detach dest\n", p);
- fprintf(stderr, "\t%s init /dev/dest [-i] [-f filename] [-L lockfile]\n", p);
- fprintf(stderr, "\t%s setkey dest [-n key] [-l lockfile] [-L lockfile]\n", p);
- fprintf(stderr, "\t%s destroy dest [-n key] [-l lockfile] [-L lockfile]\n", p);
+ fprintf(stderr, "\t%s init /dev/dest [-i] [-f filename] [-L lockfile] [-P pass-phrase]\n", p);
+ fprintf(stderr, "\t%s setkey dest [-n key] [-l lockfile] [-p pass-phrase] [-L new-lockfile] [-P new-pass-phrase]\n", p);
+ fprintf(stderr, "\t%s destroy dest [-n key] [-l lockfile] [-p pass-phrase] [-L lockfile]\n", p);
exit (1);
}
@@ -799,13 +799,13 @@ main(int argc, char **argv)
}
if (doopen) {
- dfd = open(dest, O_RDWR | O_CREAT, 0644);
- if (dfd < 0) {
+ dfd = open(dest, O_RDWR);
+ if (dfd < 0 && dest[0] != '/') {
if (snprintf(buf, sizeof(buf), "%s%s",
_PATH_DEV, dest) >= (ssize_t)sizeof(buf))
errno = ENAMETOOLONG;
else
- dfd = open(buf, O_RDWR | O_CREAT, 0644);
+ dfd = open(buf, O_RDWR);
}
if (dfd < 0)
err(1, "%s", dest);
OpenPOWER on IntegriCloud