Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
6
66
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Eric Vidal
66
Commits
496a000a
Commit
496a000a
authored
5 years ago
by
Eric Vidal
Browse files
Options
Downloads
Patches
Plain Diff
always check existence of 66 main directory
parent
007b670d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/66/66-tree.c
+31
-32
31 additions, 32 deletions
src/66/66-tree.c
with
31 additions
and
32 deletions
src/66/66-tree.c
+
31
−
32
View file @
496a000a
...
...
@@ -107,6 +107,11 @@ static void auto_check(char *dst,char const *str,size_t baselen,mode_t mode)
if
(
!
scan_mode
(
dst
,
mode
))
auto_dir
(
dst
,
0755
)
;
}
static
void
auto_check_one
(
char
*
dst
,
mode_t
mode
)
{
if
(
!
scan_mode
(
dst
,
mode
))
auto_dir
(
dst
,
0755
)
;
}
static
void
inline
auto_stralloc
(
stralloc
*
sa
,
char
const
*
str
)
{
if
(
!
stralloc_cats
(
sa
,
str
))
strerr_diefu1sys
(
111
,
"append stralloc"
)
;
...
...
@@ -135,40 +140,34 @@ int sanitize_tree(stralloc *dstree, char const *base, char const *tree,uid_t own
/** base is /var/lib/66 or $HOME/.66*/
/** this verification is made in case of
* first use of 66-*** tools */
r
=
scan_mode
(
dst
,
S_IFDIR
)
;
if
(
r
<
0
)
strerr_diefu2x
(
111
,
"invalid directory: "
,
dst
)
;
if
(
!
r
)
auto_check
(
dst
,
SS_SYSTEM
,
baselen
,
0755
)
;
/** create extra directory for service part */
if
(
!
owner
)
{
VERBO3
strerr_warnt3x
(
"create directory: "
,
dst
,
SS_SYSTEM
)
;
auto_create
(
dst
,
SS_SYSTEM
,
baselen
,
0755
)
;
/** create extra directory for service part */
if
(
!
owner
)
{
auto_dir
(
SS_LOGGER_SYSDIR
,
0755
)
;
auto_dir
(
SS_SERVICE_SYSDIR
,
0755
)
;
auto_dir
(
SS_SERVICE_ADMDIR
,
0755
)
;
auto_dir
(
SS_SERVICE_ADMCONFDIR
,
0755
)
;
}
else
{
size_t
extralen
;
stralloc
extra
=
STRALLOC_ZERO
;
if
(
!
set_ownerhome
(
&
extra
,
owner
))
strerr_diefu1sys
(
111
,
"set home directory"
)
;
extralen
=
extra
.
len
;
auto_stralloc_0
(
&
extra
,
SS_LOGGER_USERDIR
)
;
auto_dir
(
extra
.
s
,
0755
)
;
extra
.
len
=
extralen
;
auto_stralloc_0
(
&
extra
,
SS_SERVICE_USERDIR
)
;
auto_dir
(
extra
.
s
,
0755
)
;
extra
.
len
=
extralen
;
auto_stralloc_0
(
&
extra
,
SS_SERVICE_USERCONFDIR
)
;
auto_dir
(
extra
.
s
,
0755
)
;
stralloc_free
(
&
extra
)
;
}
auto_check_one
(
SS_LOGGER_SYSDIR
,
0755
)
;
auto_check_one
(
SS_SERVICE_SYSDIR
,
0755
)
;
auto_check_one
(
SS_SERVICE_ADMDIR
,
0755
)
;
auto_check_one
(
SS_SERVICE_ADMCONFDIR
,
0755
)
;
}
else
{
size_t
extralen
;
stralloc
extra
=
STRALLOC_ZERO
;
if
(
!
set_ownerhome
(
&
extra
,
owner
))
strerr_diefu1sys
(
111
,
"set home directory"
)
;
extralen
=
extra
.
len
;
auto_stralloc_0
(
&
extra
,
SS_LOGGER_USERDIR
)
;
auto_check_one
(
extra
.
s
,
0755
)
;
extra
.
len
=
extralen
;
auto_stralloc_0
(
&
extra
,
SS_SERVICE_USERDIR
)
;
auto_check_one
(
extra
.
s
,
0755
)
;
extra
.
len
=
extralen
;
auto_stralloc_0
(
&
extra
,
SS_SERVICE_USERCONFDIR
)
;
auto_check_one
(
extra
.
s
,
0755
)
;
stralloc_free
(
&
extra
)
;
}
auto_check
(
dst
,
SS_TREE_CURRENT
,
baselen
,
0755
)
;
auto_string
(
dst
,
SS_SYSTEM
,
baselen
)
;
auto_check
(
dst
,
SS_BACKUP
,
baselen
+
SS_SYSTEM_LEN
,
0755
)
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment