Kamil Dudka 8d9eac
diff --git a/man/chcon.x b/man/chcon.x
Kamil Dudka 8d9eac
index 8c1ff6f..c84fb96 100644
Kamil Dudka 8d9eac
--- a/man/chcon.x
Kamil Dudka 8d9eac
+++ b/man/chcon.x
Ondrej Vasik 893c38
@@ -1,4 +1,4 @@
Ondrej Vasik 893c38
 [NAME]
Ondrej Vasik 0363d6
-chcon \- change file security context
Ondrej Vasik 0363d6
+chcon \- change file SELinux security context
Ondrej Vasik 893c38
 [DESCRIPTION]
Ondrej Vasik 0363d6
 .\" Add any additional description here
Kamil Dudka 8d9eac
diff --git a/man/runcon.x b/man/runcon.x
Kamil Dudka 8d9eac
index d2df13e..5c5f5d8 100644
Kamil Dudka 8d9eac
--- a/man/runcon.x
Kamil Dudka 8d9eac
+++ b/man/runcon.x
Ondrej Vasik 893c38
@@ -1,5 +1,5 @@
Ondrej Vasik 893c38
 [NAME]
Ondrej Vasik 893c38
-runcon \- run command with specified security context
Ondrej Vasik 893c38
+runcon \- run command with specified SELinux security context
Ondrej Vasik 893c38
 [DESCRIPTION]
Ondrej Vasik 893c38
 Run COMMAND with completely-specified CONTEXT, or with current or
Ondrej Vasik 893c38
 transitioned security context modified by one or more of LEVEL,
Kamil Dudka 8d9eac
diff --git a/src/cp.c b/src/cp.c
Kamil Dudka 8d9eac
index 1b528c6..25dbb88 100644
Kamil Dudka 8d9eac
--- a/src/cp.c
Kamil Dudka 8d9eac
+++ b/src/cp.c
Kamil Dudka 8d9eac
@@ -203,6 +203,9 @@ Copy SOURCE to DEST, or multiple SOURCE(s) to DIRECTORY.\n\
Ondrej Vasik 66a4fe
                                  all\n\
Ondrej Vasik 66a4fe
 "), stdout);
Ondrej Vasik 66a4fe
       fputs (_("\
Ondřej Vašík 83c139
+  -c                           deprecated, same as --preserve=context\n\
Ondrej Vasik 66a4fe
+"), stdout);
Ondrej Vasik 66a4fe
+      fputs (_("\
Ondrej Vasik 66a4fe
       --no-preserve=ATTR_LIST  don't preserve the specified attributes\n\
Ondrej Vasik 66a4fe
       --parents                use full source file name under DIRECTORY\n\
Ondrej Vasik 66a4fe
 "), stdout);
Kamil Dudka 8d9eac
@@ -929,7 +932,7 @@ main (int argc, char **argv)
Kamil Dudka 8d9eac
   selinux_enabled = (0 < is_selinux_enabled ());
Kamil Dudka 8d9eac
   cp_option_init (&x);
Ondrej Vasik 66a4fe
 
Ondřej Vašík bb33bc
-  while ((c = getopt_long (argc, argv, "abdfHilLnprst:uvxPRS:TZ",
Ondřej Vašík bb33bc
+  while ((c = getopt_long (argc, argv, "abcdfHilLnprst:uvxPRS:TZ",
Ondrej Vasik 66a4fe
                            long_opts, NULL))
Ondrej Vasik 66a4fe
          != -1)
Ondrej Vasik 66a4fe
     {
Kamil Dudka 8d9eac
@@ -977,6 +980,17 @@ main (int argc, char **argv)
Ondrej Vasik 66a4fe
           copy_contents = true;
Ondrej Vasik 66a4fe
           break;
Ondrej Vasik 66a4fe
 
Ondrej Vasik 66a4fe
+        case 'c':
Ondřej Vašík bbc813
+          fprintf (stderr, "%s: warning: option '-c' is deprecated, please use '--preserve=context' instead\n", argv[0]);
Kamil Dudka 9de25c
+          if ( x.set_security_context ) {
Ondrej Vasik 66a4fe
+              (void) fprintf(stderr, "%s: cannot force target context and preserve it\n", argv[0]);
Ondrej Vasik 66a4fe
+             exit( 1 );
Ondrej Vasik 66a4fe
+           }
Ondrej Vasik 66a4fe
+           else if (selinux_enabled) {
Ondrej Vasik 66a4fe
+              x.preserve_security_context = true;
Ondrej Vasik 66a4fe
+              x.require_preserve_context = true;
Ondrej Vasik 66a4fe
+           }
Ondrej Vasik 66a4fe
+          break;
Ondrej Vasik 66a4fe
         case 'd':
Ondrej Vasik 66a4fe
           x.preserve_links = true;
Ondrej Vasik 66a4fe
           x.dereference = DEREF_NEVER;
Kamil Dudka c168f3
diff --git a/doc/coreutils.texi b/doc/coreutils.texi
Kamil Dudka c168f3
index 47e4480..cff2ead 100644
Kamil Dudka c168f3
--- a/doc/coreutils.texi
Kamil Dudka c168f3
+++ b/doc/coreutils.texi
Kamil Dudka c168f3
@@ -8083,6 +8083,11 @@ done
Kamil Dudka c168f3
 exit $fail
Kamil Dudka c168f3
 @end example
Kamil Dudka c168f3
 
Kamil Dudka c168f3
+@item -c
Kamil Dudka c168f3
+@cindex SELinux security context information, preserving
Kamil Dudka c168f3
+Preserve SELinux security context of the original files if possible.
Kamil Dudka c168f3
+Some file systems don't support storing of SELinux security context.
Kamil Dudka c168f3
+
Kamil Dudka c168f3
 @item --copy-contents
Kamil Dudka c168f3
 @cindex directories, copying recursively
Kamil Dudka c168f3
 @cindex copying directories recursively
Kamil Dudka 8d9eac
diff --git a/src/install.c b/src/install.c
Kamil Dudka 8d9eac
index d79d597..437889a 100644
Kamil Dudka 8d9eac
--- a/src/install.c
Kamil Dudka 8d9eac
+++ b/src/install.c
Kamil Dudka 8d9eac
@@ -673,7 +673,7 @@ In the 4th form, create all components of the given DIRECTORY(ies).\n\
Ondřej Vašík 50a3ba
   -v, --verbose       print the name of each directory as it is created\n\
Ondřej Vašík 50a3ba
 "), stdout);
Ondřej Vašík 50a3ba
       fputs (_("\
Ondřej Vašík 50a3ba
-      --preserve-context  preserve SELinux security context\n\
Ondřej Vašík 83c139
+  -P, --preserve-context  preserve SELinux security context (-P deprecated)\n\
Ondřej Vašík 9c33d8
   -Z                      set SELinux security context of destination\n\
Kamil Dudka 8d9eac
                             file and each created directory to default type\n\
Ondřej Vašík 9c33d8
       --context[=CTX]     like -Z, or if CTX is specified then set the\n\
Kamil Dudka 8d9eac
@@ -824,7 +824,7 @@ main (int argc, char **argv)
Kamil Dudka 8d9eac
   dir_arg = false;
Kamil Dudka 8d9eac
   umask (0);
Ondrej Vasik 66a4fe
 
Ondřej Vašík bb33bc
-  while ((optc = getopt_long (argc, argv, "bcCsDdg:m:o:pt:TvS:Z", long_options,
Ondřej Vašík bb33bc
+  while ((optc = getopt_long (argc, argv, "bcCsDdg:m:o:pPt:TvS:Z", long_options,
Ondrej Vasik 66a4fe
                               NULL)) != -1)
Ondrej Vasik 66a4fe
     {
Ondrej Vasik 66a4fe
       switch (optc)
Kamil Dudka 8d9eac
@@ -885,6 +885,8 @@ main (int argc, char **argv)
Ondřej Vašík 50a3ba
           no_target_directory = true;
Ondřej Vašík 50a3ba
           break;
Ondřej Vašík 50a3ba
 
Ondrej Vasik 66a4fe
+        case 'P':
Ondřej Vašík bbc813
+          fprintf (stderr, "%s: warning: option '-P' is deprecated, please use '--preserve-context' instead\n", argv[0]);
Ondrej Vasik 66a4fe
         case PRESERVE_CONTEXT_OPTION:
Ondřej Vašík bb33bc
           if (! selinux_enabled)
Ondrej Vasik 66a4fe
             {
Kamil Dudka 8d9eac
@@ -892,6 +894,10 @@ main (int argc, char **argv)
Ondrej Vasik 66a4fe
                              "this kernel is not SELinux-enabled"));
Ondrej Vasik 66a4fe
               break;
Ondrej Vasik 66a4fe
             }
Ondrej Vasik 66a4fe
+          if ( x.set_security_context ) {
Ondrej Vasik 66a4fe
+             (void) fprintf(stderr, "%s: cannot force target context and preserve it\n", argv[0]);
Ondrej Vasik 66a4fe
+             exit( 1 );
Ondrej Vasik 66a4fe
+          }
Ondrej Vasik 66a4fe
           x.preserve_security_context = true;
Ondrej Vasik 66a4fe
           use_default_selinux_context = false;
Ondrej Vasik 66a4fe
           break;