From 6c5221593ecbcae79926055f67bb2e0384e7f98f Mon Sep 17 00:00:00 2001 From: Ben Kibbey Date: Sun, 7 Jan 2007 08:52:42 -0500 Subject: [PATCH] Version 0.3. --- TODO | 8 ++++ configure.ac | 2 +- libpwmd/NEWS | 2 - libpwmd/PROTOCOL | 114 ------------------------------------------------------- 4 files changed, 9 insertions(+), 117 deletions(-) delete mode 100644 libpwmd/PROTOCOL diff --git a/TODO b/TODO index 0f83975b..6a4bcd56 100644 --- a/TODO +++ b/TODO @@ -3,6 +3,8 @@ of these API's have the ability to specify custom memory allocators. Let the LIST command take an element path as an argument. +Add a ATTR_GET command. + If an element has a TARGET attribute, should following elements be inherited from the target?: @@ -16,3 +18,9 @@ from the target?: BEGIN ... new element2 value OK + +File locking. pwmd will return old data if client1 connects and opens a file, +then client2 connects opening the same file, client1 modifies data and saves +the file, client2 gets some data that may have been modified by client1. Might +be as simple as adding a flag in the file cache to reopen the file or just +deny writing until all other clients have exited. diff --git a/configure.ac b/configure.ac index 7dc99fea..375685ab 100644 --- a/configure.ac +++ b/configure.ac @@ -1,6 +1,6 @@ dnl Process this file with autoconf to produce a configure script. AC_PREREQ(2.59) -AC_INIT(pwmd, 0.2, [Ben Kibbey bjk@luxsci.net]) +AC_INIT(pwmd, 0.3, [Ben Kibbey bjk@luxsci.net]) AC_CONFIG_AUX_DIR(build) AC_CANONICAL_TARGET AM_INIT_AUTOMAKE([foreign]) diff --git a/libpwmd/NEWS b/libpwmd/NEWS index c8668dff..8eb99275 100644 --- a/libpwmd/NEWS +++ b/libpwmd/NEWS @@ -9,8 +9,6 @@ encodes the key. Updates for the new ATTR protocol command. -Include PROTOCOL in the dist. - libPWMD v0.0.1 -------------- diff --git a/libpwmd/PROTOCOL b/libpwmd/PROTOCOL deleted file mode 100644 index 92a25bcc..00000000 --- a/libpwmd/PROTOCOL +++ /dev/null @@ -1,114 +0,0 @@ -The data is stored in an AES-128-ECB encrypted XML file. A client connects to -the server and issues commands that manipulate the data. Through the use of -a file cache and shared memory passwords do not need to be issued for each -file each time a client connects. - -The server uses a simple protocol to communicate with a client. All non-data -responses are prefixed by a server response code followed by a space followed -by an (optional) description followed by a newline character. There are three -non-data related response codes: NFO for informational messages, ERR for error -messages and OK if the command succeeded. - -A data response is prefixed with a BEGIN response code followed by a space -then an integer specifying the number of following data bytes then a newline -character. After all of the bytes have been sent a newline character then an -OK response code then another newline will be sent. - -Protocol commands: - -OPEN [] - Opens using . If file is not found on the filesystem, then - a new file is created. If the file is found, it is looked for in the file - cache for an existing key. If found, the existing key will be used for - decryption. If the cached key fails then the , if specified, will be - tried. - - -SAVE [] - Encrypts and writes any changes to the file to disk. If is not - specified then the currently cached key will be used. If the file is a new - file which hasn't yet been saved, is required. - - -CACHE CLEARALL | CLEAR | ISCACHED - CLEARALL - Remove all files from the cache. This will require a key for - the next OPEN or SAVE command for existing files. - - CLEAR - Like CLEARALL but only for the specified file. - - ISCACHED - A response code of OK will be returned if the specified file is - in the file cache. If not in the cache or the file doesn't - exist on the filesystem and ERR response is returned. - - A file doesn't need to be opened to use this command. - - -LIST [] - If no account is given, then a list of accounts is returned with a BEGIN - repsonse code. If given, then the element tree for the account is - returned. See the ATTR command and the VALUE attribute. - - -STORE [TAB [TAB ...] TAB ] - Stores an element tree into the existing , creates a new - tree or modifies the existing element path. If no elements are - specifed an empty account is created. Otherwise, elements are TAB - deliminated and the value will be the last TAB deliminated argument. The - only restriction of element names is that they not contain any whitespace. - There is no whitespace between the TAB deliminated element arguments. It - is recommended that the value be base 64 encoded to prevent libXML and - pwmd parsing errors. - - -DELETE [TAB [TAB ...]] - Removes an element tree from or the entire if no - elements are given. - - -GET TAB [TAB ...] - Retrieves the value for the specified element tree. See the ATTR command - and VALUE attribute below. The data is returned with the BEGIN response - code. - - -ATTR SET | DELETE | LIST [] [arg2] - ATTR SET attribute account[element[...]] attribute_value - ATTR DELETE attribute account[element[...]] - ATTR LIST account[element[...]] - - The NAME attribute cannot be DELETE'd if the element path is only the - account name. Although it can be SET to change the account name. - - There is one other special attribute which is TARGET. This is like a - "pointer" that points to another element in the document: - - ATTR SET TARGET account[element[...]] account[element[...]] - - Then the GET and LIST commands for would show the value of . - Note that if has both a TARGET attribute and an element value, then - only the TARGET attribute will be used in other commands. If the target - has been renamed or deleted afterwards then the GET command will fail and - the LIST command will silently ignore the target. - - -HELP [] - Shows protocol command help for or shows available commands if - is not specified. A file doesn't need to be opened to use this - comand. - - -DUMP - Show the in memory document. Useful for pruning empty elements which - aren't shown with the LIST command. - - -QUIT - Closes the connection. Use the SAVE command before this command as any - changes will be lost. - - -If a command fails then the ERR response is returned followed by a protocol -error code and description. See src/pwmd_error.h or libpwmd/libpwmd.h for -error codes. - -Ben Kibbey -- 2.11.4.GIT