Skip to content

move the repository stage into the repodata file#575

Closed
Duncaen wants to merge 8 commits into
void-linux:masterfrom
Duncaen:stagedata
Closed

move the repository stage into the repodata file#575
Duncaen wants to merge 8 commits into
void-linux:masterfrom
Duncaen:stagedata

Conversation

@Duncaen

@Duncaen Duncaen commented Oct 28, 2023

Copy link
Copy Markdown
Member

By combining repodata and stage data into a single file its easier to
use remote stagedata when enabled. This also avoids having to come up
with a new mechanism to fetch -stagedata and having to keep -repodata
and -stagedata in sync.

}

for (int i = args; i < argc; i++) {
r = index_add_pkg(xhp, index, stage, argv[i], force);

Check failure

Code scanning / CodeQL

Uncontrolled data used in path expression

This argument to a file access function is derived from [user input (a command-line argument)](1) and then passed to index_add_pkg(file), which calls xbps_file_sha256(file), which calls xbps_file_sha256_raw(file), which calls open(__file).
Comment thread lib/repo.c
return -ENAMETOOLONG;
}

fd = open(path, O_WRONLY|O_CREAT|O_CLOEXEC, 0660);

Check failure

Code scanning / CodeQL

Uncontrolled data used in path expression

This argument to a file access function is derived from [user input (a command-line argument)](1) and then passed to open(__file).
printf("index: removed pkg %s\n", pkgver);
}
xbps_dictionary_get_cstring_nocopy(obj, "filename-sha256", &sha256);
if (xbps_file_sha256_check(path, sha256) != 0)

Check failure

Code scanning / CodeQL

Uncontrolled data used in path expression

This argument to a file access function is derived from [user input (a command-line argument)](1) and then passed to xbps_file_sha256_check(file), which calls xbps_file_sha256_raw(file), which calls open(__file).
Comment thread lib/repo.c
errno = -r;
return NULL;
}
repo->xhp = xhp;

Check warning

Code scanning / CodeQL

Local variable address stored in non-local memory

A stack address which arrived via a [parameter](1) may be assigned to a non-local variable.
@Duncaen
Duncaen force-pushed the stagedata branch 2 times, most recently from 729b7ab to 5be8009 Compare May 11, 2025 17:03

@classabbyamp classabbyamp left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems fine overall. is there any function to merge an existing stagedata into a repodata, or is it assumed that the user should unstage before upgrading xbps?

Comment thread data/xbps.d.5 Outdated
Comment thread include/xbps.h.in Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants