summaryrefslogtreecommitdiff
path: root/src/statcmd.c
AgeCommit message (Collapse)AuthorFilesLines
2019-01-22libdpkg: Cleanup fsys module symbol namesGuillem Jover1-16/+16
2018-10-08dpkg-divert, dpkg-statoverride: Add new --instdir and --root optionsGuillem Jover1-3/+29
This makes it possible to use alternative installation directories. And will make these commands honor those directories when specified for dpkg, and passed down to the maintainer script via the DPKG_ROOT environment variable.
2018-08-30libdpkg: Move db-fsys code from src to lib/dpkgGuillem Jover1-1/+1
This will prepare the ground for external programs to start using libdpkg to access the dpkg fsys database via a proper API, instead of messing with the on-disk layout in so many improper ways.
2018-08-01dpkg-statoverride: Remove redundant checkGuillem Jover1-1/+1
The condition is checking for the same multiple times. Warned-by: cppcheck
2015-05-30libdpkg: Rename DPKG_VERSION_ARCH to PACKAGE_RELEASEGuillem Jover1-1/+1
This avoids confusing the project-wide macro with the DPKG_VERSION_ namespaced ones.
2015-05-30dpkg: Fix setting the SE Linux context when a file has a statoverrideGuillem Jover1-4/+6
We need to pass the file type in the mode so that the SE labelling function does anything at all. Closes: #786435
2015-04-18debian: Update my copyright yearsGuillem Jover1-1/+1
2015-04-10Consistently use proper quotation marks all over the placeGuillem Jover1-2/+2
That is "" or '', and not the unbalanced `' pair.
2015-04-01dpkg-statoverride: Do not accept unknown user or group names on --addGuillem Jover1-6/+4
Cherry picked from commit 5c58085b746d234066ea94d386182cfc72c612ba. We should not allow adding user or group names to the database that do not exist in the system passwd database, as the main dpkg program uses strict parsing and will fail with an unrecoverable fatal error if it cannot find a matching name for a uid/gid. Regression introduced in commit e4d6db177fad401ddc8432cf0e2c64e4fcf7bc0d, where we went from too strict to too lax parsing. Closes: #775124
2015-03-30dpkg-statoverride: Set the SE Linux context on --updateGuillem Jover1-0/+4
When we update the file, we should apply the SE Linux context in the same way we are doing while unpacking binary packages. Closes: #690361
2014-10-06libdpkg: Make the uname and gname file_stat members non-constGuillem Jover1-2/+2
We need to allocate and free them.
2014-08-09dpkg-statoverride: Do not abort when user and group names are unknownGuillem Jover1-1/+13
When parsing the statoverride database from dpkg-statoverride do not consider it an error and refuse to operate at all if the user or group names are not known to the system, just preserve them. Closes: #563307
2014-05-28libdpkg: Uppercase and expand atomic_file_flags enum valuesGuillem Jover1-2/+2
2013-12-07Use https:// URLs instead of http:// when possibleGuillem Jover1-1/+1
2013-11-23libdpkg: New dpkg_locales_init()Guillem Jover1-4/+1
Switch all program to use the new function instead of open-coding it.
2013-10-14libdpkg: Rename and namespace option parsing and loading functionsGuillem Jover1-1/+1
2013-10-14libdpkg: Add dpkg-based program startup and shutdown functionsGuillem Jover1-4/+2
These will perform any necessary action when starting and exiting a dpkg-based program.
2013-10-14libdpkg: Refactor report output buffering setup into a new functionGuillem Jover1-2/+1
2013-04-04dpkg-statoverride: Refer to path instead of fileGuillem Jover1-5/+5
This clarifies the term removing the need to mention what file actually refers to. And gets rid of a first person usage.
2012-06-30Change all programs to accept -? instead of -h for help outputGuillem Jover1-2/+2
This switch frees the -h option to be used in the distant future for other purposes, it also uses a character that does not have any other obvious meaning for help output, and which is pretty safe to be used blindly by the user in the same way as --help.
2012-06-30Avoid full stop and double newline at the end of errors and warningsJonathan Nieder1-5/+5
Error messages like "couldn't parse control information from foo.deb" are not full sentences, so don't punctuate them like one. The main purpose of this patch is stylistic consistency, but perhaps it can also make copy-and-paste from messages like dpkg-query: no path found matching pattern /usr/bin/agrep. a little easier. Most actual full sentences should remain untouched. A few full sentences are error messages at heart, so this patch converts those to lower-case sentence fragment form, too. [guillem@debian.org: - Add missed strings. - Minor tweaks to strings. ] Closes: #624000 Requested-by: Jari Aalto <jari.aalto@cante.net> Signed-off-by: Guillem Jover <guillem@debian.org>
2012-03-31Rename file iterator variables to iterGuillem Jover1-8/+8
2012-03-31Rename iterfiles*() functions to files_db_iter_*()Guillem Jover1-6/+6
2012-03-14Rework common badusage strings to allow for possible translation reuseGuillem Jover1-1/+1
Use cmdinfo long name instead of hard-coding it in the literal string, and reword some strings to make them more generally usable.
2012-02-01Move copyright information from --version output to file comment headersGuillem Jover1-4/+0
Having to keep this information twice is error-prone as it easily gets out of sync. Having to translate it is bothersome. It's not consistent across dpkg tools, some do print it some don't. It's currently not accurate, as the output would need to include the holders for all files that end up being part of the binary. And listing it in the --versions output is visually annoying and the wrong place. Just keep this where it belongs, at the file comment headers, above the license information.
2012-01-02Use the new atomic file API instead of ad-hoc codeGuillem Jover1-24/+9
[hertzog@debian.org: - Switch dselect method option file. ]
2011-07-07libdpkg: Rename myopt module to optionsGuillem Jover1-1/+1
2011-07-07Fix printforhelp string in dpkg-divert and dpkg-statoverrideGuillem Jover1-1/+1
2011-07-07Use new dpkg_set_progname and dpkg_get_progname instead of thisnameGuillem Jover1-3/+4
The current implementation demanded libdpkg users to define thisname themselves, which is not really a nice interface to offer to programs. Closes: #631757
2011-07-07libdpkg: Do not require programs to define printforhelpGuillem Jover1-2/+3
Instead define it in myopt.c and initialize it through a new argument to myopt().
2011-04-02Rename struct cmdinfo member arg_func to action and call it directlyGuillem Jover1-3/+1
This avoids a temporary variable, given that now the function is strongly prototyped.
2011-04-02Use new action_func typedef instead of ad-hoc function castsGuillem Jover1-2/+2
2011-04-02Make all command line action functions return intGuillem Jover1-2/+2
This will allow using type-safe function pointers instead of casting them around. Replace all exit(3) calls with return statements. Remove DPKG_ATTR_NORET from function declarations, all functions are expected to return now.
2011-03-14Make admindir file local everywhereGuillem Jover1-2/+2
The interface to get and set the database directory is dpkg_db_get_dir() and dpkg_db_set_dir().
2011-03-14Use dpkg_db_set_dir() instead of pkgadmindir_init()Guillem Jover1-2/+2
Remove now unused pkgadmindir_init().
2011-03-14Use dpkg_db_get_path() instead of using m_asprintf() and admindirGuillem Jover1-1/+1
2011-02-11libdpkg: Rename cmdinfo arg membersGuillem Jover1-1/+1
The current names are not descriptive enough, so rename parg to arg_ptr, farg to arg_func, and finally arg to arg_int (which disambiguates what kind of data it's holding).
2011-01-16Propagate --admindir to programs run from maintainer scriptsGuillem Jover1-1/+3
Always set DPKG_ADMINDIR from dpkg so that all subprocesses inherit the variable and there's no possible security risk from a user process setting the variable to write onto a user controlled area. As usual, the order in which the admindir value is overridden is the following: built-in default, environment variable and command line option. Closes: #97076 Suggested-by: Brendan O'Dea <bod@debian.org>
2011-01-16Use m_asprintf() instead of building the strings piece by pieceGuillem Jover1-24/+14
This is way more compact, the strings are for temporary values, and the minimal possible performance difference does not matter here.
2011-01-16libdpkg: Rename varbufaddstr() to varbuf_add_str()Guillem Jover1-6/+6
Make the varbuf API a bit more consistent.
2011-01-16libdpkg: Rename varbufaddc() to varbuf_add_char()Guillem Jover1-3/+3
Make the varbuf API a bit more consistent.
2010-11-19libdpkg: Rename path_rtrim_slash_slashdot to path_trim_slash_slashdotGuillem Jover1-1/+1
2010-11-19Cleanup white spacesGuillem Jover1-1/+0
Remove trailing spaces. Remove blank lines not separating different code blocks. Remove blank lines at the end of the file.
2010-11-19Use push_error_context() instead of ad-hoc codeGuillem Jover1-2/+1
2010-11-19Move action and obsolete related functionality to the myopt moduleGuillem Jover1-14/+0
Reduce repeated code, and localize it where it belongs.
2010-11-19Refactor file_stat codeGuillem Jover1-7/+7
Create a new file_stat struct, and use it instead of the filestatoverride one.
2010-08-13Merge branch 'sid' (through tag '1.15.8.4')Guillem Jover1-2/+2
Conflicts: debian/changelog scripts/po/de.po
2010-08-13dpkg-statoverride: Fix typosGuillem Jover1-2/+2
2010-08-03Move glob module to libdpkgGuillem Jover1-1/+1
2010-06-02Refactor glob functions into its own moduleGuillem Jover1-28/+1