]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
update manpages 841/head
authorChristian Brauner <christian.brauner@mailbox.org>
Tue, 23 Feb 2016 07:08:58 +0000 (08:08 +0100)
committerChristian Brauner <christian.brauner@mailbox.org>
Tue, 23 Feb 2016 09:26:31 +0000 (10:26 +0100)
- add note to lxc-clone manpage that it is superseded by lxc-copy
- add note to lxc-start-ephemeral manpage that it is superseded by lxc-copy
- fix typo in lxc-attach manpage
- fix some of my comments in lxc_ls.c

Signed-off-by: Christian Brauner <christian.brauner@mailbox.org>
doc/lxc-attach.sgml.in
doc/lxc-clone.sgml.in
doc/lxc-start-ephemeral.sgml.in
src/lxc/lxc_ls.c

index 653ce1d9bd917ea22a9b29b8e40d0762f094e062..258bf36775d9433f3847fbc3f386609cad160041 100644 (file)
@@ -83,7 +83,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
     specified namespaces of a container and ran a shell or the specified
     command without allocating a pseudo terminal. This made them vulnerable to
     input faking via a TIOCSTI <command>ioctl</command> call after switching
-    between userspace execution contexts with different privilegel levels. Newer
+    between userspace execution contexts with different privilege levels. Newer
     versions of <command>lxc-attach</command> will try to allocate a pseudo
     terminal master/slave pair and attach any standard file descriptors which
     refer to a terminal to the slave side of the pseudo terminal before
index aef6b44ce4c74773ecbcedfaeddbbb0b23df849e..42c119cdbeba23aa2de01a3fb86bd14f572f4e8e 100644 (file)
@@ -275,6 +275,13 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
     </para>
   </refsect1>
 
+  <refsect1>
+    <title>Notes</title>
+    <para>
+    <command>lxc-clone</command> is superseded by <command>lxc-copy</command>.
+    </para>
+  </refsect1>
+
   &seealso;
 
   <refsect1>
index 0e2c7adb59946db6ddffb2ba9c6672939660117c..6db4059434fa73a8341697111b7430597cdfc52f 100644 (file)
@@ -227,6 +227,14 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
     </variablelist>
   </refsect1>
 
+  <refsect1>
+    <title>Notes</title>
+    <para>
+    <command>lxc-start-ephemeral</command> is superseded by
+    <command>lxc-copy</command>.
+    </para>
+  </refsect1>
+
   &seealso;
 
   <refsect1>
index 69e8f8a276455b6ac1816142ec3b52ed67002d1c..26d4a74e5f5d6c3f007b25a08e7f48627b87b047 100644 (file)
@@ -94,13 +94,6 @@ static void ls_field_width(const struct ls *l, const size_t size,
                struct lengths *lht);
 static void ls_free(struct ls *l, size_t size);
 static void ls_free_arr(char **arr, size_t size);
-/*
- * This is a very lenient function. It tries to gather as much information about
- * a container as it can thereby skipping over possible failures (e.g. failed
- * non-fatal strdup() or malloc() failures in functions it calls etc.). It will
- * only bail if the minimum amount of information (name and state of the
- * container) cannot be retrieved.
- */
 static int ls_get(struct ls **m, size_t *size, const struct lxc_arguments *args,
                const char *basepath, const char *parent, unsigned int lvl,
                char **lockpath, size_t len_lockpath, char **grps_must,
@@ -490,7 +483,7 @@ static int ls_get(struct ls **m, size_t *size, const struct lxc_arguments *args,
                if (args->ls_nesting && running) {
                        struct wrapargs wargs = (struct wrapargs){.args = NULL};
                        /* Open a socket so that the child can communicate with us. */
-                       check = socketpair(PF_LOCAL, SOCK_STREAM | SOCK_CLOEXEC, 0, wargs.pipefd);
+                       check = socketpair(AF_LOCAL, SOCK_STREAM | SOCK_CLOEXEC, 0, wargs.pipefd);
                        if (check == -1)
                                goto put_and_next;
 
@@ -508,7 +501,7 @@ static int ls_get(struct ls **m, size_t *size, const struct lxc_arguments *args,
                        aopt.env_policy = LXC_ATTACH_CLEAR_ENV;
 
                        /* fork(): Attach to the namespace of the container and
-                        * run ls_get() in it which is called in ls_get_wrapper(). */
+                        * run ls_get() in it which is called in ls_get_wrapper(). */
                        check = c->attach(c, ls_get_wrapper, &wargs, &aopt, &out);
                        /* close the socket */
                        close(wargs.pipefd[1]);
@@ -667,9 +660,9 @@ static double ls_get_swap(struct lxc_container *c)
        if (!swap)
                goto out;
 
-       swap = 1 + swap + 4 + 1; // '\n' + tmp + swap + ' '
+       swap = 1 + swap + 4 + 1; // start_of_swap_value = '\n' + strlen(swap) + ' '
 
-       char *tmp = strchr(swap, '\n');
+       char *tmp = strchr(swap, '\n'); // find end of swap value
        if (!tmp)
                goto out;
 
@@ -923,11 +916,11 @@ static int my_parser(struct lxc_arguments *args, int c, char *arg)
        case LS_NESTING:
                /* In case strtoul() receives a string that represents a
                 * negative number it will return ULONG_MAX - the number that
-                * string represents if the number the string represents is <
-                * ULONG_MAX and ULONG_MAX otherwise. But it will consider this
-                * valid input and not set errno. So we check manually if the
-                * first character of num_string == '-'. Otherwise the default
-                * level remains set. */
+                * the string represents if the number the string represents is
+                * < ULONG_MAX and ULONG_MAX otherwise. But it will consider
+                * this valid input and not set errno. So we check manually if
+                * the first character of num_string == '-'. Otherwise the
+                * default level remains set. */
                if (arg && !(*arg == '-')) {
                        errno = 0;
                        m = strtoul(arg, &invalid, 0);
@@ -962,8 +955,7 @@ static int ls_get_wrapper(void *wrap)
        close(wargs->pipefd[0]);
 
        /* &(char *){NULL} is no magic. It's just a compound literal which
-        * avoids having a pointless variable in main() that serves no purpose
-        * here. */
+        * allows us to avoid keeping a pointless variable around. */
        ls_get(&m, &len, wargs->args, "", wargs->parent, wargs->nestlvl, &(char *){NULL}, 0, wargs->grps_must, wargs->grps_must_len);
        if (!m)
                goto out;
@@ -992,7 +984,7 @@ static int ls_remove_lock(const char *path, const char *name,
 {
        /* Avoid doing unnecessary work if we can. */
        if (recalc) {
-               size_t newlen = strlen(path) + strlen(name) + strlen(RUNTIME_PATH) + /* /+lxc+/+lock+/+/= */ 11 + 1;
+               size_t newlen = strlen(path) + strlen(name) + strlen(RUNTIME_PATH) + /* / + lxc + / + lock + / + / = */ 11 + 1;
                if (newlen > *len_lockpath) {
                        char *tmp = realloc(*lockpath, newlen * 2);
                        if (!tmp)