Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
liblongpath-rsync
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
liblongpath
liblongpath-rsync
Commits
db9c9e27
Commit
db9c9e27
authored
Apr 24, 2007
by
Wayne Davison
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added arg-parsing to tls.c.
parent
9439c0cb
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
44 additions
and
10 deletions
+44
-10
devices.test
testsuite/devices.test
+1
-1
rsync.fns
testsuite/rsync.fns
+1
-1
tls.c
tls.c
+42
-8
No files found.
testsuite/devices.test
View file @
db9c9e27
...
...
@@ -25,7 +25,7 @@ case `id -u` in
# If we can't test the real device code, try to test --fake-super instead
$RSYNC
--
version
|
grep
", xattrs"
>/
dev
/
null
||
test_skipped
"Rsync needs root/fakeroot/--fake-super for device tests"
RSYNC
=
"
$RSYNC
--fake-super"
export
RSYNC_FAKE_SUPER
=
1
TLS_ARGS
=--
fake
-
super
case
"`xattr 2>&1`"
in
*--
list
:*
)
mknod
()
{
...
...
testsuite/rsync.fns
View file @
db9c9e27
...
...
@@ -66,7 +66,7 @@ printmsg() {
}
rsync_ls_lR
()
{
find
"
$@
"
-print
|
sort
|
sed
's/ /\\ /g'
| xargs
"
$TOOLDIR
/tls"
find
"
$@
"
-print
|
sort
|
sed
's/ /\\ /g'
| xargs
"
$TOOLDIR
/tls"
$TLS_ARGS
}
check_perms
()
{
...
...
tls.c
View file @
db9c9e27
...
...
@@ -34,6 +34,7 @@
* change. */
#include "rsync.h"
#include "popt.h"
#include "lib/sysxattrs.h"
#define PROGRAM "tls"
...
...
@@ -168,20 +169,53 @@ static void list_file(const char *fname)
datebuf
,
fname
,
linkbuf
);
}
static
struct
poptOption
long_options
[]
=
{
/* longName, shortName, argInfo, argPtr, value, descrip, argDesc */
{
"fake-super"
,
'f'
,
POPT_ARG_VAL
,
&
am_root
,
-
1
,
0
,
0
},
{
"help"
,
'h'
,
POPT_ARG_NONE
,
0
,
'h'
,
0
,
0
},
{
0
,
0
,
0
,
0
,
0
,
0
,
0
}
};
static
void
tls_usage
(
int
ret
)
{
FILE
*
F
=
ret
?
stderr
:
stdout
;
fprintf
(
F
,
"usage: "
PROGRAM
" [OPTIONS] FILE ...
\n
"
);
fprintf
(
F
,
"Trivial file listing program for portably checking rsync
\n
"
);
fprintf
(
F
,
"
\n
Options:
\n
"
);
fprintf
(
F
,
" -f, --fake-super store/recover privileged attrs using xattrs
\n
"
);
fprintf
(
F
,
" -h, --help show this help (-h works with no other options)
\n
"
);
exit
(
ret
);
}
int
main
(
int
argc
,
char
*
argv
[])
{
if
(
argc
<
2
)
{
fprintf
(
stderr
,
"usage: "
PROGRAM
" FILE ...
\n
"
"Trivial file listing program for portably checking rsync
\n
"
);
return
1
;
poptContext
pc
;
const
char
**
extra_args
;
int
opt
;
pc
=
poptGetContext
(
PROGRAM
,
argc
,
(
const
char
**
)
argv
,
long_options
,
0
);
while
((
opt
=
poptGetNextOpt
(
pc
))
!=
-
1
)
{
switch
(
opt
)
{
case
'h'
:
tls_usage
(
0
);
default:
fprintf
(
stderr
,
"%s: %s
\n
"
,
poptBadOption
(
pc
,
POPT_BADOPTION_NOALIAS
),
poptStrerror
(
opt
));
tls_usage
(
1
);
}
}
if
(
getenv
(
"RSYNC_FAKE_SUPER"
))
am_root
=
-
1
;
extra_args
=
poptGetArgs
(
pc
);
if
(
!
extra_args
||
*
extra_args
==
NULL
)
tls_usage
(
1
);
for
(
argv
++
;
*
argv
;
argv
++
)
list_file
(
*
argv
);
for
(;
*
extra_args
;
extra_args
++
)
list_file
(
*
extra_args
);
poptFreeContext
(
pc
);
return
0
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment