Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:illuusio
pam_mount
pam_mount-truecrypt6x-1.25.diff
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File pam_mount-truecrypt6x-1.25.diff of Package pam_mount
diff -urN pam_mount-1.25/src/Makefile.am pam_mount-1.25-patch/src/Makefile.am --- pam_mount-1.25/src/Makefile.am 2009-05-09 09:11:39.000000000 +0300 +++ pam_mount-1.25-patch/src/Makefile.am 2009-05-13 12:23:50.000000000 +0300 @@ -7,7 +7,7 @@ module_LTLIBRARIES = pam_mount.la bin_PROGRAMS = pmt-fd0ssh pmt-ofl sbin_PROGRAMS = pmt-ehd pmvarrun -ssbin_PROGRAMS = mount.crypt mount.encfs13 +ssbin_PROGRAMS = mount.crypt mount.encfs13 mount.truecrypt noinst_PROGRAMS = autoloop ismnt noinst_SCRIPTS = umount.crypt @@ -36,6 +36,9 @@ mount_encfs13_SOURCES = mtencfs13.c mount_encfs13_LDADD = ${libHX_LIBS} +mount_truecrypt_SOURCES = mttruecr.c +mount_truecrypt_LDADD = ${libHX_LIBS} + pmt_ehd_SOURCES = ehd.c log.c misc.c spawn.c ${crypto_sources} pmt_ehd_LDADD = ${libHX_LIBS} ${libcrypto_LIBS} diff -urN pam_mount-1.25/src/mount.c pam_mount-1.25-patch/src/mount.c --- pam_mount-1.25/src/mount.c 2009-05-09 09:11:39.000000000 +0300 +++ pam_mount-1.25-patch/src/mount.c 2009-05-20 14:27:56.000000000 +0300 @@ -310,6 +310,9 @@ case CMD_FUSEMOUNT: type = CMD_FUSEUMOUNT; break; + case CMD_TRUECRYPTMOUNT: + type = CMD_TRUECRYPTUMOUNT; + break; default: type = CMD_UMOUNT; break; diff -urN pam_mount-1.25/src/mttruecr.c pam_mount-1.25-patch/src/mttruecr.c --- pam_mount-1.25/src/mttruecr.c 1970-01-01 02:00:00.000000000 +0200 +++ pam_mount-1.25-patch/src/mttruecr.c 2009-05-20 14:30:57.000000000 +0300 @@ -0,0 +1,95 @@ + /* + * Copyright (c) 2009, Ilmi Solutions Oy + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following + * conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the distribution. + * * Neither the name of the <ORGANIZATION> nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include <assert.h> +#include <stdio.h> +#include <stdlib.h> +#include <unistd.h> +#include <string.h> +#include <libHX/defs.h> +#include <libHX/option.h> +#include <libHX/proc.h> +#include <libHX/string.h> + +static char *mt_opts; + +/* This gets called as mount.encfs13 /srcdir /dstdir -o foo */ +int main(int argc, const char **argv) +{ + unsigned int i = 0; + const char *args[11]; + unsigned char buf[256]; + char password[256]; + + struct HXoption options_table[] = { + {.sh = 'o', .type = HXTYPE_STRING, .ptr = &mt_opts, + .help = "Mount options"}, + HXOPT_AUTOHELP, + HXOPT_TABLEEND, + }; + if (HX_getopt(options_table, &argc, &argv, HXOPT_USAGEONERR) <= 0) + return EXIT_FAILURE; + if (argc < 2) { + fprintf(stderr, "%s: You need to specify source directory and " + "mountpoint\n", *argv); + return EXIT_FAILURE; + } + + if (strncmp(HX_basename(*argv), "umount", strlen("umount")) == 0) { + args[i++] = "truecrypt"; + args[i++] = "-t"; + args[i++] = "--dismount"; + args[i++] = "--non-interactive"; + args[i++] = argv[1]; /* mntpt */ + args[i++] = NULL; + } else { + // Read from -p0 + memset( buf, 0x00, 256 ); + memset( password, 0x00, 256 ); + read( 0, buf, 256); + + args[i++] = "truecrypt"; + args[i++] = "-t"; + args[i++] = "--mount"; + args[i++] = "--non-interactive"; + sprintf(password, "--password=%s", (char *) buf ); + args[i++] = password; + args[i++] = argv[1]; /* src */ + args[i++] = argv[2]; /* mntpt */ + args[i++] = NULL; + } + // assert(i < ARRAY_SIZE(args)); + execvp("truecrypt", const_cast2(char * const *, args)); + return -1; + + +} diff -urN pam_mount-1.25/src/pam_mount.h pam_mount-1.25-patch/src/pam_mount.h --- pam_mount-1.25/src/pam_mount.h 2009-05-09 09:11:39.000000000 +0300 +++ pam_mount-1.25-patch/src/pam_mount.h 2009-05-11 16:38:14.000000000 +0300 @@ -71,6 +71,8 @@ CMD_FSCK, CMD_PMVARRUN, CMD_FD0SSH, + CMD_TRUECRYPTMOUNT, + CMD_TRUECRYPTUMOUNT, _CMD_MAX, CMD_NONE, }; diff -urN pam_mount-1.25/src/rdconf1.c pam_mount-1.25-patch/src/rdconf1.c --- pam_mount-1.25/src/rdconf1.c 2009-05-09 09:11:39.000000000 +0300 +++ pam_mount-1.25-patch/src/rdconf1.c 2009-05-20 14:20:56.000000000 +0300 @@ -1343,6 +1343,8 @@ {CMD_UMOUNT, NULL, "umount", {"umount", "%(MNTPT)", NULL}}, {CMD_FSCK, NULL, "fsck", {"fsck", "-p", "%(FSCKTARGET)", NULL}}, {CMD_PMVARRUN, NULL, "pmvarrun", {"pmvarrun", "-u", "%(USER)", "-o", "%(OPERATION)", NULL}}, + {CMD_TRUECRYPTMOUNT, "truecrypt", "truecrypt", {"mount", "-p0", "-t", "%(FSTYPE)", "%(VOLUME)", "%(MNTPT)", NULL}}, + {CMD_TRUECRYPTUMOUNT, "truecrypt", "truecrypt", {"truecrypt", "-t", "--dismount", "%(VOLUME)", NULL}}, {-1}, }; @@ -1370,5 +1372,7 @@ {"smbumount", rc_command, CMD_SMBUMOUNT}, {"umount", rc_command, CMD_UMOUNT}, {"volume", rc_volume, CMD_NONE}, + {"truecryptmount", rc_command, CMD_TRUECRYPTMOUNT}, + {"truecryptumount", rc_command, CMD_TRUECRYPTUMOUNT}, {NULL}, };
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor