📄 cryptfsd.c
字号:
/* $Id: cryptfsd.C,v 1.2 2001/10/12 21:30:47 dm Exp $ *//* * * Copyright (C) 2001 David Mazieres (dm@uun.org) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2, or (at * your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA * */#include "cryptfs.h"#include "mount_prot.h"#include "rxx.h"#include "nfsserv.h"#include "nfsmounter.h"#include "getfh3.h"bool opt_nodaemon = getenv ("SFS_RUNINPLACE");str mntpath ("/cfs");ptr<axprt_unix> nmx;ptr<aclnt> nmc;static voidusage (){ warnx << "usage: " << progname << " [-d] [/mountpoint]\n"; exit (1);}intmain (int argc, char **argv){ setprogname (argv[0]); sfsconst_init (); int ch; while ((ch = getopt (argc, argv, "d")) != -1) switch (ch) { case 'd': opt_nodaemon = true; break; default: usage (); break; } if (optind == argc - 1) { mntpath = argv[optind]; if (mntpath[0] != '/') usage (); } else if (argc != optind) usage (); if (access (mntpath, 0) < 0 && errno == ENOENT && mkdir (mntpath, 0555) < 0) fatal ("mkdir (%s): %m\n", mntpath.cstr ()); random_init_file (sfsdir << "/random_seed"); str nmpath = fix_exec_path ("nfsmounter"); if (!nmpath) fatal ("cannot find nfsmounter daemon\n"); if (!opt_nodaemon) daemonize (); warn ("version %s, pid %d\n", VERSION, getpid ()); nmx = axprt_unix_spawn (nmpath, 0, "nfsmounter", mntpath.cstr (), NULL); if (!nmx) fatal ("%s: %m\n", nmpath.cstr ()); nmc = aclnt::alloc (nmx, nfsmounter_prog_1); nmc->seteofcb (wrap (exit, 1)); rootdir->link (afsreg::alloc (VERSION "\n"), ".version"); rootdir->link (afsreg::alloc (strbuf ("%d\n", getpid ())), ".pid"); adm_init (); amain ();}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -