summaryrefslogtreecommitdiff
path: root/trans/magic.c
AgeCommit message (Collapse)Author
2014-04-15Include the MIG-generated server header filesJustus Winter
This enables the compiler to check that the server function declarations match MIGs expectations. Fix a few oddities along the way. * console-client/trans.c: Include MIG-generated server header file(s). * console/console.c: Likewise. Also, fix declarations. * console/mutations.h (TIOCTL_IMPORTS): Just use libnetfs/priv.h. * console/priv.h: Delete now unused file. * ext2fs/storeinfo.c: Include MIG-generated server header file(s). * fatfs/inode.c: Likewise. * fatfs/main.c: Likewise. Also, fix declaration. * isofs/inode.c: Likewise. * libdiskfs/boot-start.c: Likewise. * libdiskfs/file-chg.c: Include the correct MIG-generated server header file. * libdiskfs/file-chmod.c: Include MIG-generated server header file(s). * libdiskfs/file-get-fs-opts.c: Likewise. * libdiskfs/init-startup.c: Likewise. * libnetfs/file-get-children.c: Likewise. * libnetfs/file-getcontrol.c: Include the correct MIG-generated server header file. * libnetfs/file-set-translator.c: Include MIG-generated server header file(s). * libnetfs/fsstubs.c: Likewise. * libtrivfs/file-access.c: Likewise. * libtrivfs/file-chauthor.c: Likewise. * libtrivfs/file-chflags.c: Likewise. * libtrivfs/file-chg.c: Likewise. * libtrivfs/file-chmod.c: Likewise. * libtrivfs/file-chown.c: Likewise. * libtrivfs/file-exec.c: Likewise. * libtrivfs/file-get-children.c: Likewise. * libtrivfs/file-get-fs-options.c: Likewise. * libtrivfs/file-get-source.c: Likewise. * libtrivfs/file-get-storage-info.c: Likewise. * libtrivfs/file-get-trans.c: Likewise. * libtrivfs/file-get-transcntl.c: Likewise. * libtrivfs/file-getcontrol.c: Likewise. * libtrivfs/file-getfh.c: Likewise. * libtrivfs/file-getlinknode.c: Likewise. * libtrivfs/file-lock.c: Likewise. * libtrivfs/file-reparent.c: Likewise. * libtrivfs/file-set-size.c: Likewise. * libtrivfs/file-set-trans.c: Likewise. * libtrivfs/file-statfs.c: Likewise. * libtrivfs/file-sync.c: Likewise. * libtrivfs/file-syncfs.c: Likewise. * libtrivfs/file-utimes.c: Likewise. * libtrivfs/fsys-forward.c: Likewise. * libtrivfs/fsys-get-options.c: Likewise. * libtrivfs/fsys-getroot.c: Likewise. * libtrivfs/fsys-goaway.c: Likewise. * libtrivfs/fsys-set-options.c: Likewise. * libtrivfs/fsys-stubs.c: Likewise. * libtrivfs/fsys-syncfs.c: Likewise. * libtrivfs/io-async-icky.c: Likewise. * libtrivfs/io-async.c: Likewise. * libtrivfs/io-duplicate.c: Likewise. * libtrivfs/io-identity.c: Likewise. * libtrivfs/io-map.c: Likewise. * libtrivfs/io-modes-get.c: Likewise. * libtrivfs/io-modes-off.c: Likewise. * libtrivfs/io-modes-on.c: Likewise. * libtrivfs/io-modes-set.c: Likewise. * libtrivfs/io-owner-get.c: Likewise. * libtrivfs/io-owner-mod.c: Likewise. * libtrivfs/io-pathconf.c: Likewise. * libtrivfs/io-read.c: Likewise. * libtrivfs/io-readable.c: Likewise. * libtrivfs/io-reauthenticate.c: Likewise. * libtrivfs/io-restrict-auth.c: Likewise. * libtrivfs/io-revoke.c: Likewise. * libtrivfs/io-seek.c: Likewise. * libtrivfs/io-select.c: Likewise. * libtrivfs/io-stat.c: Likewise. * libtrivfs/io-stubs.c: Likewise. * libtrivfs/io-version.c: Likewise. * libtrivfs/io-write.c: Likewise. * pfinet/tunnel.c: Likewise. * storeio/io.c: Likewise. * storeio/storeio.c: Likewise. * term/users.c: Likewise. * tmpfs/node.c: Likewise. * trans/fakeroot.c: Likewise. Also, include all server headers that provide the X_server_routine functions... (netfs_demuxer): ... that were previously declared here. * trans/fifo.c: Include MIG-generated server header file(s). * trans/firmlink.c: Likewise. * trans/hello-mt.c: Likewise. * trans/hello.c: Likewise. * trans/magic.c: Likewise. * trans/mtab.c: Likewise. * trans/new-fifo.c: Likewise. * trans/null.c: Likewise. * trans/proxy-defpager.c: Likewise. * trans/streamio.c: Likewise. * libdiskfs/fsmutations.h: Qualify the import with the libraries path. Without this change, out-of-tree builds would no longer work. * libnetfs/mutations.h: Likewise. * libtrivfs/mig-mutate.h: Likewise.
2005-07-122005-07-12 Marcus Brinkmann <marcus@gnu.org>Marcus Brinkmann
* magic.c (magic_getroot): Deallocate DOTDOT if processing here. (magic_open): Do not allocate and deallocate DOTDOT, just consume the reference given to us. (magic_peropen_destroy): New function. (main): If in directory mode, install magic_peropen_destroy hook.
2003-03-062003-03-05 Roland McGrath <roland@frob.com>Roland McGrath
Make /hurd/magic support translator delegation via /servers/magic. * magic.c (struct magic): New structure. (magic, directory, dirbuf, dirbufsize): Variables removed, not members of struct magic. (trivfs_modify_stat, magic_getroot, trivfs_S_dir_readdir): Use a struct magic hanging off CNTL->hook rather than global variables. (trivfs_append_args): Likewise. (trivfs_S_dir_lookup): Likewise. Let magic string be null to indicate prepending nothing in --directory mode. (parse_opt): Use struct magic in STATE->input instead of globals. If no argument, turn on --directory and leave M->magic null. (argp): New static variable, instead of auto in main. (main): Set both trivfs hook functions unconditionally. Use a struct magic, pass it to argp_parse and store it in FSYS->hook. Move directory buffer setup to ... (parse_opt): ... here, do it on ARGP_KEY_SUCCESS. (magic_open): Track users with a count. (magic_protid_destroy): New function to track users. (main): Set trivfs_protid_destroy_hook to that. (trivfs_goaway): Call ports_destroy_right if FSYS has no users. (all_fsys): New variable, list of all filesystems. (trivfs_clean_cntl): New function, exit if no filesystems left. (main): Put FSYS on that list. On timeout with no RPCs, try trivfs_goaway on each filesystem on the list. (trivfs_S_fsys_forward): New function. (delegate): New variable. (options): New option -U/--use-server to set it.
2002-06-152002-06-15 Roland McGrath <roland@frob.com>Roland McGrath
* magic.c (trivfs_S_dir_readdir): u_int -> size_t
2002-05-262002-05-26 Marcus Brinkmann <marcus@gnu.org>Marcus Brinkmann
* magic.c (trivfs_S_dir_readdir): Increment I after comparing it with ENTRY, to fix off-by-one error.
2001-06-162001-04-01 Neal H Walfield <neal@cs.uml.edu>Roland McGrath
* magic.c (trivfs_S_dir_lookup): Use iohelp_dup_iouser as per the new semantics.
2001-02-262001-02-25 Roland McGrath <roland@frob.com>Roland McGrath
* symlink.c: Include <string.h> for decls of built-ins. * firmlink.c: Include <stdlib.h> for exit decl. * ifsock.c: Likewise. * null.c: Likewise. * magic.c: Likewise. * fifo.c: Likewise. * hello.c: Likewise. * hello-mt.c: Likewise.
2001-02-12auth/Marcus Brinkmann
2001-02-12 Marcus Brinkmann <marcus@gnu.org> * auth.c (main): New variable ARGP defining a doc string. Pass address of ARGP to argp_parse(). exec/ 2001-02-12 Marcus Brinkmann <marcus@gnu.org> * main.c: Change hurd version name from proc to exec. (main): Add period to doc string. ftpfs/ 2001-02-12 Marcus Brinkmann <marcus@gnu.org> * ftpfs.c: Include <version.h>. Add global variable ARGP_PROGRAM_VERSION. Add period to DOC. hostmux/ 2001-02-12 Marcus Brinkmann <marcus@gnu.org> * hostmux.c: Include <version.h>. Add global variable ARGP_PROGRAM_VERSION. Add period to DOC. usermux/ 2001-02-12 Marcus Brinkmann <marcus@gnu.org> * usermux.c (options): Include <version.h>. Add global variable ARGP_PROGRAM_VERSION. Add period to DOC. trans/ 2001-02-12 Marcus Brinkmann <marcus@gnu.org> * fifo.c: Make version string say `fifo', not `null'. Add period to doc text in ARGP. * firmlink.c: Add period to doc text in ARGP_DOC, convert semi-colon to colon. * magic.c (options): Add period to DOC. * new-fifo.c (fifo_trans_parse_args): Add doc string to ARGP. Include <version.h>, new global variable ARGP_PROGRAM_VERSION. * crash.c: Include <version.h>, add global variable ARGP_PROGRAM_VERSION. * hello.c: Include <version.h>, add global variable ARGP_PROGRAM_VERSION. (hello_argp): Add doc string. * hello-mt.c: Likewise. * streamio.c: Add period to DOC. Change streamdev to streamio in version string. * password.c (main): Add period to doc string in ARGP.
1999-10-111999-10-11 Roland McGrath <roland@baalperazim.frob.com>Roland McGrath
* magic.c: Rewritten using libtrivfs. With new flag --directory/-d, present an empty directory that has . and .. as normal and lists no other contents, but looking up anything else within it does the magical retry. * Makefile (magic): Update library deps accordingly.
1999-09-011999-08-31 Marcus Brinkmann <Marcus.Brinkmann@ruhr-uni-bochum.de>Roland McGrath
* bogus-fifo.c (main): Deallocate bootstrap port after using it. * fifo.c (main): Likewise. * firmlink.c (main): Likewise. * ifsock.c (main): Likewise. * magic.c (main): Likewise. * null.c (main): Likewise. * symlink.c (main): Likewise.
1998-07-201998-07-20 Roland McGrath <roland@baalperazim.frob.com>Roland McGrath
* firmlink.c (main): Fix return type to int, and use return. * fwd.c (main): Likewise. * new-fifo.c (main): Likewise. * magic.c (main): Likewise. * fifo.c (main): Likewise. * null.c (main): Likewise.
1997-07-15(main): Actually parse the arg.Miles Bader
1997-07-15(main):Miles Bader
Use argp to parse args. (argp_program_version, args_doc, doc): New variables. Add new includes <argp.h> & <version.h>.
1995-11-06(S_fsys_get_options): New function.Miles Bader
(main): Add flags argument to fsys_startup call. (S_fsys_startup): Add FLAGS arg.
1995-10-08(S_fsys_getpriv): Add new extra args.Miles Bader
1995-08-24(S_fsys_forward): New function.Miles Bader
1995-05-12Add fsys_set_options, replacing fsys_mod_readonly.Miles Bader
1995-03-31Don't deallocate our right to the underlying disk node, so we don't getMiles Bader
garbage collected prematurely. Also move the check for the bootstrap port after the args check, so that users can run it from the shell to get a usage message.
1995-03-30Initial revisionMiles Bader