~ubuntu-branches/ubuntu/utopic/coreutils/utopic-proposed

« back to all changes in this revision

Viewing changes to src/chcon.c

  • Committer: Package Import Robot
  • Author(s): Colin Watson
  • Date: 2012-11-28 03:03:42 UTC
  • mfrom: (8.3.4 sid)
  • Revision ID: package-import@ubuntu.com-20121128030342-21zanj8354gas5gr
Tags: 8.20-3ubuntu1
* Resynchronise with Debian.  Remaining changes:
  - Make 'uname -i -p' return the real processor/hardware, instead of
    unknown.
  - Build-depend on gettext:any instead of on gettext, so that apt-get can
    properly resolve build-dependencies on the tool when cross-building.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* chcon -- change security context of files
2
 
   Copyright (C) 2005-2011 Free Software Foundation, Inc.
 
2
   Copyright (C) 2005-2012 Free Software Foundation, Inc.
3
3
 
4
4
   This program is free software: you can redistribute it and/or modify
5
5
   it under the terms of the GNU General Public License as published by
29
29
#include "selinux-at.h"
30
30
#include "xfts.h"
31
31
 
32
 
/* The official name of this program (e.g., no `g' prefix).  */
 
32
/* The official name of this program (e.g., no 'g' prefix).  */
33
33
#define PROGRAM_NAME "chcon"
34
34
 
35
35
#define AUTHORS \
46
46
/* Level of verbosity. */
47
47
static bool verbose;
48
48
 
49
 
/* Pointer to the device and inode numbers of `/', when --recursive.
 
49
/* Pointer to the device and inode numbers of '/', when --recursive.
50
50
   Otherwise NULL.  */
51
51
static struct dev_ino *root_dev_ino;
52
52
 
345
345
usage (int status)
346
346
{
347
347
  if (status != EXIT_SUCCESS)
348
 
    fprintf (stderr, _("Try `%s --help' for more information.\n"),
349
 
             program_name);
 
348
    emit_try_help ();
350
349
  else
351
350
    {
352
351
      printf (_("\
359
358
Change the security context of each FILE to CONTEXT.\n\
360
359
With --reference, change the security context of each FILE to that of RFILE.\n\
361
360
\n\
 
361
"), stdout);
 
362
      fputs (_("\
 
363
      --dereference      affect the referent of each symbolic link (this is\n\
 
364
                         the default), rather than the symbolic link itself\n\
362
365
  -h, --no-dereference   affect symbolic links instead of any referenced file\n\
363
366
"), stdout);
364
367
      fputs (_("\
 
368
  -u, --user=USER        set user USER in the target security context\n\
 
369
  -r, --role=ROLE        set role ROLE in the target security context\n\
 
370
  -t, --type=TYPE        set type TYPE in the target security context\n\
 
371
  -l, --range=RANGE      set range RANGE in the target security context\n\
 
372
"), stdout);
 
373
      fputs (_("\
365
374
      --reference=RFILE  use RFILE's security context rather than specifying\n\
366
375
                         a CONTEXT value\n\
 
376
"), stdout);
 
377
      fputs (_("\
367
378
  -R, --recursive        operate on files and directories recursively\n\
 
379
"), stdout);
 
380
      fputs (_("\
368
381
  -v, --verbose          output a diagnostic for every file processed\n\
369
382
"), stdout);
370
383
      fputs (_("\
371
 
  -u, --user=USER        set user USER in the target security context\n\
372
 
  -r, --role=ROLE        set role ROLE in the target security context\n\
373
 
  -t, --type=TYPE        set type TYPE in the target security context\n\
374
 
  -l, --range=RANGE      set range RANGE in the target security context\n\
375
384
\n\
376
 
"), stdout);
377
 
      fputs (_("\
378
385
The following options modify how a hierarchy is traversed when the -R\n\
379
386
option is also specified.  If more than one is specified, only the final\n\
380
387
one takes effect.\n\