08-01-2008
Quote:
Originally Posted by
Perderabo
There is no such thing as "full rights" to a file you do not own unless you are root. Invoking utime() is not reading, nor writing, nor executing a file.
Yes, I understand this. When I said full-rights, I only meant rwx. Interestingly enough, tar extraction will chown the file to the extractor if the extractor has write rights to the file to affect a replace.
I was merely citing a work-around to the initial poster.
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
I need to do a bakcup for some files, in the same tape but in diferente time....
at 9am i need the file /public/test1.txt then...
tar -cvf /dev/st0 /public/test1.txt
at 12pm i need the file /public/test2.txt the....
tar ¿? /public/test2.txt
in this point i have problem beacuse when... (3 Replies)
Discussion started by: sokobans
3 Replies
2. UNIX for Advanced & Expert Users
hi ,
On AIX 4.3.3
I typed the following command
tar -cvf <filename> ( actually I forgot to type the device name)
the output was change in the file size to 10240 bytes
I tried tar -xvf to extract the same but file size is same.
The file was "txt" file and was readable before the... (2 Replies)
Discussion started by: amit
2 Replies
3. UNIX for Advanced & Expert Users
Can someone please verify for me if tar compresses the directory or filesystem it is asked to back up??
reason am asking is I checked the size of the /home directory before running a tar command
now, after I ran the tar command and the tar was done extracting the directory from the archive, I... (2 Replies)
Discussion started by: TRUEST
2 Replies
4. UNIX for Advanced & Expert Users
I am using a tar command to backup my system. It works properly.
I have had some trouble and I need to restore a few files.
I am using the following command :
tar xvf /dev/rmt2h myfile_to_restore
The tar command seemd to work but after a long time I got the following error message :... (6 Replies)
Discussion started by: renard
6 Replies
5. Shell Programming and Scripting
The below tar command works fine for me,
tar -cvf - `find ./srcdir -type d` | (cd ./destdir ; tar -xvf - )
but this version is giving error to me:
cd ./srcdir &&
tar -cf - . |
gzip -9 |
cd ../destdir &&
gzip -d |
tar -xf -
error is: gzip: compressed data not read from a terminal.... (2 Replies)
Discussion started by: royalibrahim
2 Replies
6. UNIX for Dummies Questions & Answers
I've done a tar -cvf data.tar *
in our live data directory on a Solaris machine.
I copy the tar file to the test area and try
tar -xvf data.tar .
and it uses the full path in the tar file and overwrites the live ones again.
I've used tar many a time and don't understand why its happening.... (1 Reply)
Discussion started by: kinhell
1 Replies
7. Shell Programming and Scripting
i have some 685 files in my directory.Below the count:
find . -name "CurrentCollectorMeterReadBackup_2009*" -exec ls -ltr {} \; | wc -l
685
i want to tar them but it is telling me arg list too long. how to tar all this files in one shot
tar -cvf - -L... (1 Reply)
Discussion started by: ali560045
1 Replies
8. UNIX for Dummies Questions & Answers
Hi all,
4 files are returned when i issue 'find . -mtime -1 -type f -ls'.
./ora_475244.aud
./ora_671958.aud
./ora_934052.aud
./ora_934050.aud
However, when I issued the below command:
tar -cvf test.tar `find . -mtime -1 -type f`, the tar file only contains the 1st file -... (2 Replies)
Discussion started by: ahSher
2 Replies
9. Linux
can someone help me here. apparently, the colon i included in the name of this file is making it difficult for tar to untar it. please help
####### tar xvf DailyConfigs_Nov-19-11\:00-2009.tar
rsh: DailyConfigs_Nov-19-11: Name or service not known
tar: DailyConfigs_Nov-19-11\:00-2009.tar:... (4 Replies)
Discussion started by: SkySmart
4 Replies
10. Shell Programming and Scripting
Hi all,
I have a tar file and inside that tar file is a folder with additional tar.gz files. What I want to do is look inside the first tar file and then find the second tar file I'm looking for, look inside that tar.gz file to find a certain directory. I'm encountering issues by trying to... (1 Reply)
Discussion started by: bashnewbee
1 Replies
LEARN ABOUT FREEBSD
cap_rights_init
CAP_RIGHTS_INIT(3) BSD Library Functions Manual CAP_RIGHTS_INIT(3)
NAME
cap_rights_init, cap_rights_set, cap_rights_clear, cap_rights_is_set, cap_rights_is_valid, cap_rights_merge, cap_rights_remove,
cap_rights_contains -- manage cap_rights_t structure
LIBRARY
Standard C Library (libc, -lc)
SYNOPSIS
#include <sys/capsicum.h>
cap_rights_t *
cap_rights_init(cap_rights_t *rights, ...);
cap_rights_t *
cap_rights_set(cap_rights_t *rights, ...);
cap_rights_t *
cap_rights_clear(cap_rights_t *rights, ...);
bool
cap_rights_is_set(const cap_rights_t *rights, ...);
bool
cap_rights_is_valid(const cap_rights_t *rights);
cap_rights_t *
cap_rights_merge(cap_rights_t *dst, const cap_rights_t *src);
cap_rights_t *
cap_rights_remove(cap_rights_t *dst, const cap_rights_t *src);
bool
cap_rights_contains(const cap_rights_t *big, const cap_rights_t *little);
DESCRIPTION
The functions documented here allow to manage the cap_rights_t structure.
Capability rights should be separated with comma when passed to the cap_rights_init(), cap_rights_set(), cap_rights_clear() and
cap_rights_is_set() functions. For example:
cap_rights_set(&rights, CAP_READ, CAP_WRITE, CAP_FSTAT, CAP_SEEK);
The complete list of the capability rights can be found in the rights(4) manual page.
The cap_rights_init() function initialize provided cap_rights_t structure. Only properly initialized structure can be passed to the remain-
ing functions. For convenience the structure can be filled with capability rights instead of calling the cap_rights_set() function later.
For even more convenience pointer to the given structure is returned, so it can be directly passed to cap_rights_limit(2):
cap_rights_t rights;
if (cap_rights_limit(fd, cap_rights_init(&rights, CAP_READ, CAP_WRITE)) < 0)
err(1, "Unable to limit capability rights");
The cap_rights_set() function adds the given capability rights to the given cap_rights_t structure.
The cap_rights_clear() function removes the given capability rights from the given cap_rights_t structure.
The cap_rights_is_set() function checks if all the given capability rights are set for the given cap_rights_t structure.
The cap_rights_is_valid() function verifies if the given cap_rights_t structure is valid.
The cap_rights_merge() function merges all capability rights present in the src structure into the dst structure.
The cap_rights_remove() function removes all capability rights present in the src structure from the dst structure.
The cap_rights_contains() function checks if the big structure contains all capability rights present in the little structure.
RETURN VALUES
The functions never fail. In case an invalid capability right or an invalid cap_rights_t structure is given as an argument, the program will
be aborted.
The cap_rights_init(), cap_rights_set() and cap_rights_clear() functions return pointer to the cap_rights_t structure given in the rights
argument.
The cap_rights_merge() and cap_rights_remove() functions return pointer to the cap_rights_t structure given in the dst argument.
The cap_rights_is_set() returns true if all the given capability rights are set in the rights argument.
The cap_rights_is_valid() function performs various checks to see if the given cap_rights_t structure is valid and returns true if it is.
The cap_rights_contains() function returns true if all capability rights set in the little structure are also present in the big structure.
EXAMPLES
The following example demonstrates how to prepare a cap_rights_t structure to be passed to the cap_rights_limit(2) system call.
cap_rights_t rights;
int fd;
fd = open("/tmp/foo", O_RDWR);
if (fd < 0)
err(1, "open() failed");
cap_rights_init(&rights, CAP_FSTAT, CAP_READ);
if (allow_write_and_seek)
cap_rights_set(&rights, CAP_WRITE, CAP_SEEK);
if (dont_allow_seek)
cap_rights_clear(&rights, CAP_SEEK);
if (cap_rights_limit(fd, &rights) < 0 && errno != ENOSYS)
err(1, "cap_rights_limit() failed");
SEE ALSO
cap_rights_limit(2), open(2), capsicum(4), rights(4)
HISTORY
Support for capabilities and capabilities mode was developed as part of the TrustedBSD Project.
AUTHORS
This family of functions was created by Pawel Jakub Dawidek <pawel@dawidek.net> under sponsorship from the FreeBSD Foundation.
BSD
March 27, 2014 BSD