/* password.c - password read/update helper functions.
*
* Copyright 2012 Ashwini Kumar <ak.ashwini@gmail.com>
+ *
+ * TODO: cleanup
*/
#include "toys.h"
#define MAX_SALT_LEN 20 //3 for id, 16 for key, 1 for '\0'
int read_password(char * buff, int buflen, char* mesg);
int update_password(char *filename, char* username, char* encrypted);
+
+// TODO this goes away when lib/password.c cleaned up
/* chroot.c - Run command in new root directory.
*
* Copyright 2007 Rob Landley <rob@landley.net>
+ *
+ * TODO: The test for root is "==" so root can trivially escape a chroot by
+ * moving it below cwd, ala mkdir("sub"); chroot("sub"); chdir("../../../..")
+ * The container guys use pivot_root() to deal with this, which does actually
+ * edit mount tree. (New option? Kernel patch?)
USE_CHROOT(NEWTOY(chroot, "^<1", TOYFLAG_USR|TOYFLAG_SBIN))
*
* No support for PAM/securetty/selinux/login script/issue/utmp
* Relies on libcrypt for hash calculation.
+ *
+ * TODO: this command predates "pending" but needs cleanup. It #defines
+ * random stuff, calls exit() form a signal handler... yeah.
USE_LOGIN(NEWTOY(login, ">1fph:", TOYFLAG_BIN))
/* modinfo.c - Display module info
*
* Copyright 2012 Andre Renaud <andre@bluewatersys.com>
+ *
+ * TODO: cleanup
USE_MODINFO(NEWTOY(modinfo, "<1b:k:F:0", TOYFLAG_BIN))
* Copyright 2012 Kyungwan Han <asura321@gmail.com>
*
* No standard
+ *
+ * TODO: cleanup
USE_VCONFIG(NEWTOY(vconfig, "<2>4", TOYFLAG_NEEDROOT|TOYFLAG_SBIN))
/* vmstat.c - Report virtual memory statistics.
*
* Copyright 2012 Elie De Brauwer <eliedebrauwer@gmail.com>
+ *
+ * TODO: I have no idea how the "io" and "system" categories are calculated.
+ * whatever we're doing isn't matching what other implementations are doing.
USE_VMSTAT(NEWTOY(vmstat, ">2n", TOYFLAG_BIN))
unfinished stubs, others just need a more thorough inspection than we've had
time for yet. Everything in here defaults to "n" in defconfig.
-Library code awaiting cleanup lives in lib/pending.c
-
-The following commands predate the pending directory, and are awaiting
-cleanup but don't live here:
-
- vmstat, login, du, vconfig, chroot, cut, touch, modinfo, xargs
-
- lib/password.c
+Outside of this directory, several commands (and some library code) have
+TODO annotations.
This directory should go away before the 1.0 release. It's just a staging
area so code submissions don't get lost while awaiting more thorough (and
* Copyright 2012 Ranjan Kumar <ranjankumar.bth@gmail.com>
* Copyright 2012 Kyungwan Han <asura321@gmail.com>
*
- * http://pubs.opengroup.org/onlinepubs/9699919799/utilities/cut.html
+ * http://pubs.opengroup.org/onlinepubs/9699919799/utilities/cut.html
+ *
+ * TODO: cleanup
USE_CUT(NEWTOY(cut, "b:|c:|f:|d:sn[!cbf]", TOYFLAG_USR|TOYFLAG_BIN))
* Copyright 2012 Ashwini Kumar <ak.ashwini@gmail.com>
*
* See http://opengroup.org/onlinepubs/9699919799/utilities/du.html
+ *
+ * TODO: cleanup
USE_DU(NEWTOY(du, "d#<0hmlcaHkKLsx[-HL][-kKmh]", TOYFLAG_USR|TOYFLAG_BIN))
*
* Copyright 2012 Choubey Ji <warior.linux@gmail.com>
*
- * See http://pubs.opengroup.org/onlinepubs/9699919799/utilities/touch.html
+ * See http://pubs.opengroup.org/onlinepubs/9699919799/utilities/touch.html
+ *
+ * TODO: have another go at merging the -t and -d stanzas
USE_TOUCH(NEWTOY(touch, "acd:mr:t:h[!dtr]", TOYFLAG_BIN))
* Copyright 2011 Rob Landley <rob@landley.net>
*
* See http://opengroup.org/onlinepubs/9699919799/utilities/xargs.html
+ *
+ * TODO: Rich's whitespace objection, env size isn't fixed anymore.
USE_XARGS(NEWTOY(xargs, "^I:E:L#ptxrn#<1s#0", TOYFLAG_USR|TOYFLAG_BIN))