|
rpm
5.4.14
|
#include "system.h"#include <rpmio_internal.h>#include <rpmmacro.h>#include <rpmdir.h>#include <rpmdav.h>#include <rpmhash.h>#include <ugid.h>#include "debug.h"
Go to the source code of this file.
Macros | |
| #define | _RPMDIR_INTERNAL |
| #define | _RPMDAV_INTERNAL |
| #define | g_strdup xstrdup |
| #define | g_free free |
| #define | MAXCOLS 30 |
| #define | alloca_strdup(_s) strcpy((char *)alloca(strlen(_s)+1), (_s)) |
Functions | |
| static int | ftpMkdir (const char *path, mode_t mode) |
| static int | ftpChdir (const char *path) |
| static int | ftpRmdir (const char *path) |
| static int | ftpRename (const char *oldpath, const char *newpath) |
| static int | ftpUnlink (const char *path) |
| int | Mkdir (const char *path, mode_t mode) |
| mkdir(2) clone. More... | |
| int | Chdir (const char *path) |
| chdir(2) clone. More... | |
| int | Rmdir (const char *path) |
| rmdir(2) clone. More... | |
| int | Chroot (const char *path) |
| chroot(2) clone. More... | |
| int | Open (const char *path, int flags, mode_t mode) |
| open(2) clone. More... | |
| int | Rename (const char *oldpath, const char *newpath) |
| rename(2) clone. More... | |
| int | Link (const char *oldpath, const char *newpath) |
| link(2) clone. More... | |
| int | Unlink (const char *path) |
| unlink(2) clone. More... | |
| for (numcols=0;*p &&numcols< 30;numcols++) | |
| if (str!=NULL &&(pos=strstr(week, str))!=NULL) | |
| static int | is_year (const char *str, struct tm *tim) |
| static int | ftpNLST (const char *url, ftpSysCall_t ftpSysCall, struct stat *st, char *rlbuf, size_t rlbufsiz) |
| static const char * | statstr (const struct stat *st, char *buf) |
| static int | ftpStat (const char *path, struct stat *st) |
| static int | ftpLstat (const char *path, struct stat *st) |
| static int | ftpReadlink (const char *path, char *buf, size_t bufsiz) |
| DIR * | ftpOpendir (const char *path) |
| Create an argv directory from an ftp:// URI. More... | |
| static char * | ftpRealpath (const char *path, char *resolved_path) |
| int | Stat (const char *path, struct stat *st) |
| stat(2) clone. More... | |
| int | Lstat (const char *path, struct stat *st) |
| lstat(2) clone. More... | |
| int | Fstat (FD_t fd, struct stat *st) |
| fstat(2) clone. More... | |
| int | Fadvise (FD_t fd, off_t offset, off_t len, int advice) |
| posix_fadvise(2) clone. More... | |
| int | Fallocate (FD_t fd, off_t offset, off_t len) |
| posix_fallocate(3)/fallocate(2) clone. More... | |
| int | Chown (const char *path, uid_t owner, gid_t group) |
| chown(2) clone. More... | |
| int | Fchown (FD_t fd, uid_t owner, gid_t group) |
| fchown(2) clone. More... | |
| int | Lchown (const char *path, uid_t owner, gid_t group) |
| lchown(2) clone. More... | |
| int | Chmod (const char *path, mode_t mode) |
| chmod(2) clone. More... | |
| int | Lchmod (const char *path, mode_t mode) |
| lchmod(2) clone. More... | |
| int | Fchmod (FD_t fd, mode_t mode) |
| fchmod(2) clone. More... | |
| int | Chflags (const char *path, unsigned int flags) |
| chflags(2) clone. More... | |
| int | Lchflags (const char *path, unsigned int flags) |
| lchflags(2) clone. More... | |
| int | Fchflags (FD_t fd, unsigned int flags) |
| fchflags(2) clone. More... | |
| int | Mkfifo (const char *path, mode_t mode) |
| mkfifo(3) clone. More... | |
| int | Mknod (const char *path, mode_t mode, dev_t dev) |
| mknod(3) clone. More... | |
| int | Utime (const char *path, const struct utimbuf *buf) |
| int | Utimes (const char *path, const struct timeval times[2]) |
| int | Lutimes (const char *path, const struct timeval times[2]) |
| int | Symlink (const char *oldpath, const char *newpath) |
| symlink(3) clone. More... | |
| int | Readlink (const char *path, char *buf, size_t bufsiz) |
| readlink(2) clone. More... | |
| int | Access (const char *path, int amode) |
| access(2) clone. More... | |
| int | Glob_pattern_p (const char *pattern, int quote) |
| glob_pattern_p(3) clone. More... | |
| int | Glob_error (const char *epath, int eerrno) |
| glob_error(3) clone. More... | |
| int | Glob (const char *pattern, int flags, int errfunc(const char *epath, int eerrno), void *_pglob) |
| glob(3) clone. More... | |
| void | Globfree (void *_pglob) |
| globfree(3) clone. More... | |
| char * | Realpath (const char *path, char *resolved_path) |
| realpath(3) clone. More... | |
| off_t | Lseek (int fdno, off_t offset, int whence) |
| lseek(2) clone. More... | |
Variables | |
| const char * | _chroot_prefix = NULL |
| static int | current_mday |
| static int | current_mon |
| static int | current_year |
| static char * | columns [30] |
| static int | column_ptr [30] |
| static | int |
| int | numcols |
| return | |
| const char * | pos |
| static size_t | ftpBufAlloced |
| static char * | ftpBuf |
| #define alloca_strdup | ( | _s | ) | strcpy((char *)alloca(strlen(_s)+1), (_s)) |
access(2) clone.
Definition at line 2196 of file rpmrpc.c.
References _rpmio_debug, errno, exit, fprintf(), rc, URL_IS_DASH, URL_IS_FTP, URL_IS_HKP, URL_IS_HTTP, URL_IS_HTTPS, URL_IS_MONGO, URL_IS_PATH, URL_IS_UNKNOWN, and urlPath().
Referenced by createDir(), main(), rpmioAccess(), rpmrepoTestSetupDirs(), and rpmsqlNew().
| int Chdir | ( | const char * | path | ) |
chdir(2) clone.
Definition at line 105 of file rpmrpc.c.
References _rpmio_debug, errno, fprintf(), ftpChdir(), URL_IS_DASH, URL_IS_FTP, URL_IS_HKP, URL_IS_HTTP, URL_IS_HTTPS, URL_IS_MONGO, URL_IS_PATH, URL_IS_UNKNOWN, and urlPath().
Referenced by getOutputFrom(), rpmpsmStage(), rpmtsPrepare(), and runScript().
chflags(2) clone.
Definition at line 1861 of file rpmrpc.c.
References _rpmio_debug, errno, fprintf(), URL_IS_DASH, URL_IS_FTP, URL_IS_HKP, URL_IS_HTTP, URL_IS_HTTPS, URL_IS_MONGO, URL_IS_PATH, URL_IS_UNKNOWN, and urlPath().
| int Chmod | ( | const char * | path, |
| mode_t | mode | ||
| ) |
chmod(2) clone.
Definition at line 1765 of file rpmrpc.c.
References _rpmio_debug, errno, exit, fprintf(), rc, URL_IS_DASH, URL_IS_FTP, URL_IS_HKP, URL_IS_HTTP, URL_IS_HTTPS, URL_IS_MONGO, URL_IS_PATH, URL_IS_UNKNOWN, and urlPath().
Referenced by iosmStage().
| int Chown | ( | const char * | path, |
| uid_t | owner, | ||
| gid_t | group | ||
| ) |
chown(2) clone.
Definition at line 1674 of file rpmrpc.c.
References _rpmio_debug, errno, exit, fprintf(), rc, URL_IS_DASH, URL_IS_FTP, URL_IS_HKP, URL_IS_HTTP, URL_IS_HTTPS, URL_IS_MONGO, URL_IS_PATH, URL_IS_UNKNOWN, and urlPath().
Referenced by createDir(), iosmStage(), and rpmioMkpath().
| int Chroot | ( | const char * | path | ) |
chroot(2) clone.
Definition at line 176 of file rpmrpc.c.
References _chroot_prefix, _free(), _rpmio_debug, errno, fprintf(), NULL, rc, rpmGetPath(), strcmp(), URL_IS_DASH, URL_IS_FTP, URL_IS_HKP, URL_IS_HTTP, URL_IS_HTTPS, URL_IS_MONGO, URL_IS_PATH, URL_IS_UNKNOWN, and urlPath().
Referenced by rpmpsmStage(), rpmtsPrepare(), and runScript().
posix_fadvise(2) clone.
Definition at line 1495 of file rpmrpc.c.
References _, _rpmio_debug, fdGetOPath(), fdno, Fileno(), fprintf(), NULL, path, rc, rpmlog(), RPMLOG_DEBUG, URL_IS_PATH, URL_IS_UNKNOWN, and urlPath().
Referenced by iosmStage(), rpmgiOpen(), and rpmShowProgress().
posix_fallocate(3)/fallocate(2) clone.
Definition at line 1548 of file rpmrpc.c.
References _, _rpmio_debug, fdGetOPath(), fdno, Fileno(), fprintf(), int, NULL, offset, path, rc, rpmlog(), RPMLOG_DEBUG, URL_IS_PATH, URL_IS_UNKNOWN, and urlPath().
fchflags(2) clone.
Definition at line 1927 of file rpmrpc.c.
References _rpmio_debug, errno, fdGetOPath(), Fileno(), fprintf(), URL_IS_DASH, URL_IS_FTP, URL_IS_HKP, URL_IS_HTTP, URL_IS_HTTPS, URL_IS_MONGO, URL_IS_PATH, URL_IS_UNKNOWN, and urlPath().
fchmod(2) clone.
Definition at line 1830 of file rpmrpc.c.
References _rpmio_debug, errno, exit, fdGetOPath(), Fileno(), fprintf(), rc, URL_IS_DASH, URL_IS_FTP, URL_IS_HKP, URL_IS_HTTP, URL_IS_HTTPS, URL_IS_MONGO, URL_IS_PATH, URL_IS_UNKNOWN, and urlPath().
fchown(2) clone.
Definition at line 1704 of file rpmrpc.c.
References _rpmio_debug, errno, exit, fdGetOPath(), Fileno(), fprintf(), rc, URL_IS_DASH, URL_IS_FTP, URL_IS_HKP, URL_IS_HTTP, URL_IS_HTTPS, URL_IS_MONGO, URL_IS_PATH, URL_IS_UNKNOWN, and urlPath().
fstat(2) clone.
Definition at line 1441 of file rpmrpc.c.
References _rpmio_debug, _FD_s::contentLength, errno, exit, fdGetOPath(), Fileno(), fprintf(), hashFunctionString(), _FD_s::lastModified, memset(), NULL, path, rc, URL_IS_DASH, URL_IS_FTP, URL_IS_HKP, URL_IS_HTTP, URL_IS_HTTPS, URL_IS_MONGO, URL_IS_PATH, URL_IS_UNKNOWN, and urlPath().
Referenced by printSize(), rpmiobSlurp(), and rpmReadHeader().
|
static |
|
static |
|
static |
|
static |
Definition at line 989 of file rpmrpc.c.
References _url_iobuf_size, alloca_strdup, assert(), exit, fd, fdFgets(), fdLink(), ftpChdir(), ftpOpen(), ftpReq(), int, n, ne, NULL, o, oe, urlinfo_s::openError, path, rc, s, se, u, ufdClose(), urlPath(), void, xcalloc(), and xrealloc.
Referenced by ftpLstat(), ftpOpendir(), ftpReadlink(), and ftpStat().
| DIR* ftpOpendir | ( | const char * | path | ) |
|
static |
Definition at line 1243 of file rpmrpc.c.
References _ftp_debug, fprintf(), ftpNLST(), NULL, and rc.
Referenced by Readlink().
|
static |
|
static |
|
static |
|
static |
|
static |
| int Glob | ( | const char * | pattern, |
| int | flags, | ||
| int | errfuncconst char *epath, int eerrno, | ||
| void * | _pglob | ||
| ) |
glob(3) clone.
Definition at line 2277 of file rpmrpc.c.
References _rpmio_debug, dirent, fprintf(), getenv(), glob_t::gl_closedir, glob_t::gl_lstat, glob_t::gl_opendir, glob_t::gl_readdir, glob_t::gl_stat, glob(), GLOB_ALTDIRFUNC, GLOB_TILDE, Lstat(), Stat(), URL_IS_DASH, URL_IS_FTP, URL_IS_HKP, URL_IS_HTTP, URL_IS_HTTPS, URL_IS_MONGO, URL_IS_PATH, URL_IS_UNKNOWN, urlPath(), and void.
Referenced by rpmGlob().
glob_pattern_p(3) clone.
Definition at line 2231 of file rpmrpc.c.
References c, p, URL_IS_HKP, URL_IS_HTTP, URL_IS_HTTPS, and urlPath().
Referenced by dbiFindMatches(), handleOneTrigger(), initGlobs(), processBinaryFile(), rpmdbTriggerGlobs(), rpmGlob(), rpmQueryVerify(), and runImmedTriggers().
globfree(3) clone.
Definition at line 2322 of file rpmrpc.c.
References _rpmio_debug, fprintf(), and globfree().
Referenced by rpmGlob().
|
static |
lchflags(2) clone.
Definition at line 1893 of file rpmrpc.c.
References _rpmio_debug, errno, fprintf(), rc, URL_IS_DASH, URL_IS_FTP, URL_IS_HKP, URL_IS_HTTP, URL_IS_HTTPS, URL_IS_MONGO, URL_IS_PATH, URL_IS_UNKNOWN, and urlPath().
| int Lchmod | ( | const char * | path, |
| mode_t | mode | ||
| ) |
lchmod(2) clone.
Definition at line 1795 of file rpmrpc.c.
References _rpmio_debug, errno, exit, fprintf(), rc, URL_IS_DASH, URL_IS_FTP, URL_IS_HKP, URL_IS_HTTP, URL_IS_HTTPS, URL_IS_MONGO, URL_IS_PATH, URL_IS_UNKNOWN, and urlPath().
| int Lchown | ( | const char * | path, |
| uid_t | owner, | ||
| gid_t | group | ||
| ) |
lchown(2) clone.
Definition at line 1735 of file rpmrpc.c.
References _rpmio_debug, errno, exit, fprintf(), lchown, rc, URL_IS_DASH, URL_IS_FTP, URL_IS_HKP, URL_IS_HTTP, URL_IS_HTTPS, URL_IS_MONGO, URL_IS_PATH, URL_IS_UNKNOWN, and urlPath().
Referenced by iosmStage().
| int Link | ( | const char * | oldpath, |
| const char * | newpath | ||
| ) |
link(2) clone.
Definition at line 345 of file rpmrpc.c.
References _rpmio_debug, fprintf(), ne, NULL, oe, URL_IS_DASH, URL_IS_FTP, URL_IS_HKP, URL_IS_HTTP, URL_IS_HTTPS, URL_IS_MONGO, URL_IS_PATH, URL_IS_UNKNOWN, urlPath(), and xstrncasecmp().
Referenced by iosmStage().
lseek(2) clone.
Definition at line 2417 of file rpmrpc.c.
References _rpmio_debug, and fprintf().
| int Lstat | ( | const char * | path, |
| struct stat * | st | ||
| ) |
lstat(2) clone.
Definition at line 1401 of file rpmrpc.c.
References _rpmio_debug, davLstat(), errno, exit, fprintf(), ftpLstat(), rc, URL_IS_DASH, URL_IS_FTP, URL_IS_HKP, URL_IS_HTTP, URL_IS_HTTPS, URL_IS_MONGO, URL_IS_PATH, URL_IS_UNKNOWN, and urlPath().
Referenced by addFile(), checkOwners(), fsmStage(), Fts_open(), Glob(), iosmStage(), main(), prepFetch(), rpmfiDecideFate(), rpmQueryVerify(), rpmvfVerify(), and statFormat().
| int Lutimes | ( | const char * | path, |
| const struct timeval | times[2] | ||
| ) |
Definition at line 2084 of file rpmrpc.c.
References _rpmio_debug, errno, exit, fprintf(), rc, URL_IS_DASH, URL_IS_FTP, URL_IS_HKP, URL_IS_HTTP, URL_IS_HTTPS, URL_IS_MONGO, URL_IS_PATH, URL_IS_UNKNOWN, and urlPath().
| int Mkdir | ( | const char * | path, |
| mode_t | mode | ||
| ) |
mkdir(2) clone.
Definition at line 73 of file rpmrpc.c.
References _rpmio_debug, davMkdir(), fprintf(), ftpMkdir(), URL_IS_DASH, URL_IS_FTP, URL_IS_HKP, URL_IS_HTTP, URL_IS_HTTPS, URL_IS_MONGO, URL_IS_PATH, URL_IS_UNKNOWN, and urlPath().
Referenced by iosmStage(), rpmioMkpath(), rpmMkdirPath(), and rpmrepoMkdir().
| int Mkfifo | ( | const char * | path, |
| mode_t | mode | ||
| ) |
mkfifo(3) clone.
Definition at line 1959 of file rpmrpc.c.
References _rpmio_debug, errno, exit, fprintf(), rc, URL_IS_DASH, URL_IS_FTP, URL_IS_HKP, URL_IS_HTTP, URL_IS_HTTPS, URL_IS_MONGO, URL_IS_PATH, URL_IS_UNKNOWN, and urlPath().
Referenced by iosmStage().
| int Mknod | ( | const char * | path, |
| mode_t | mode, | ||
| dev_t | dev | ||
| ) |
mknod(3) clone.
Definition at line 1989 of file rpmrpc.c.
References _rpmio_debug, errno, exit, fprintf(), rc, URL_IS_DASH, URL_IS_FTP, URL_IS_HKP, URL_IS_HTTP, URL_IS_HTTPS, URL_IS_MONGO, URL_IS_PATH, URL_IS_UNKNOWN, and urlPath().
Referenced by iosmStage().
open(2) clone.
Definition at line 219 of file rpmrpc.c.
References _chroot_prefix, _free(), _rpmio_debug, errno, fdno, fn, fprintf(), nb, NULL, rpmExpand(), URL_IS_DASH, URL_IS_FTP, URL_IS_HKP, URL_IS_HTTP, URL_IS_HTTPS, URL_IS_MONGO, URL_IS_PATH, URL_IS_UNKNOWN, urlPath(), and void.
Referenced by db_init().
| int Readlink | ( | const char * | path, |
| char * | buf, | ||
| size_t | bufsiz | ||
| ) |
readlink(2) clone.
Definition at line 2154 of file rpmrpc.c.
References _rpmio_debug, errno, exit, fprintf(), ftpReadlink(), rc, URL_IS_DASH, URL_IS_FTP, URL_IS_HKP, URL_IS_HTTP, URL_IS_HTTPS, URL_IS_MONGO, URL_IS_PATH, URL_IS_UNKNOWN, and urlPath().
Referenced by genCpioListAndHeader(), iosmStage(), rpmfiDecideFate(), rpmvfVerify(), and statFormat().
| char* Realpath | ( | const char * | path, |
| char * | resolved_path | ||
| ) |
realpath(3) clone.
Definition at line 2330 of file rpmrpc.c.
References _free(), _rpmio_debug, davRealpath(), fprintf(), ftpRealpath(), NULL, PATH_MAX, realpath(), rpmExpand(), rpmGetPath(), s, t, URL_IS_DASH, URL_IS_FTP, URL_IS_HKP, URL_IS_HTTP, URL_IS_HTTPS, URL_IS_MONGO, URL_IS_PATH, URL_IS_UNKNOWN, urlPath(), and xstrdup().
Referenced by doLookup(), for(), rpmdbURIPath(), rpmQueryVerify(), rpmReadHeader(), rpmrepoDoPkgMetadata(), and rpmrepoRealpath().
| int Rename | ( | const char * | oldpath, |
| const char * | newpath | ||
| ) |
rename(2) clone.
Definition at line 286 of file rpmrpc.c.
References _rpmio_debug, davRename(), fprintf(), ftpRename(), ne, NULL, oe, strcmp(), URL_IS_DASH, URL_IS_FTP, URL_IS_HKP, URL_IS_HTTP, URL_IS_HTTPS, URL_IS_MONGO, URL_IS_PATH, URL_IS_UNKNOWN, urlPath(), and xstrncasecmp().
Referenced by iosmStage(), rpmrepoDoFinalMove(), rpmrepoDoRepoMetadata(), and rpmReSign().
| int Rmdir | ( | const char * | path | ) |
rmdir(2) clone.
Definition at line 141 of file rpmrpc.c.
References _rpmio_debug, davRmdir(), fprintf(), ftpRmdir(), URL_IS_DASH, URL_IS_FTP, URL_IS_HKP, URL_IS_HTTP, URL_IS_HTTPS, URL_IS_MONGO, URL_IS_PATH, URL_IS_UNKNOWN, and urlPath().
Referenced by buildSpec(), iosmStage(), and rpmrepoDoFinalMove().
| int Stat | ( | const char * | path, |
| struct stat * | st | ||
| ) |
stat(2) clone.
Definition at line 1361 of file rpmrpc.c.
References _rpmio_debug, davStat(), errno, exit, fprintf(), ftpStat(), rc, URL_IS_DASH, URL_IS_FTP, URL_IS_HKP, URL_IS_HTTP, URL_IS_HTTPS, URL_IS_MONGO, URL_IS_PATH, URL_IS_UNKNOWN, and urlPath().
Referenced by cacheStashLatest(), db3open(), for(), Fts_open(), getFilesystemList(), Glob(), iosmStage(), main(), makeGPGSignature(), packageBinaries(), populateInstallHeader(), processSourceFiles(), rpmAddSignature(), rpmcliEvalSlurp(), rpmdsSysinfo(), rpmGetFilesystemUsage(), rpmioExists(), rpmioMkpath(), rpmMkdirPath(), rpmpythonSlurp(), rpmrbLoadClasses(), rpmrepoInitPopt(), and rpmtsRebuildDB().
|
static |
| int Symlink | ( | const char * | oldpath, |
| const char * | newpath | ||
| ) |
symlink(3) clone.
Definition at line 2120 of file rpmrpc.c.
References _rpmio_debug, errno, exit, fprintf(), out, rc, URL_IS_DASH, URL_IS_FTP, URL_IS_HKP, URL_IS_HTTP, URL_IS_HTTPS, URL_IS_MONGO, URL_IS_PATH, URL_IS_UNKNOWN, and urlPath().
Referenced by iosmStage().
| int Unlink | ( | const char * | path | ) |
unlink(2) clone.
Definition at line 397 of file rpmrpc.c.
References _rpmio_debug, davUnlink(), errno, exit, fprintf(), ftpUnlink(), rc, URL_IS_DASH, URL_IS_FTP, URL_IS_HKP, URL_IS_HTTP, URL_IS_HTTPS, URL_IS_MONGO, URL_IS_PATH, URL_IS_UNKNOWN, and urlPath().
Referenced by buildSpec(), db3open(), doRmSource(), fsmStage(), iosmStage(), makeGPGSignature(), makeHDRSignature(), rpmdbExportHR_MIB(), rpmrepoDoFinalMove(), rpmrepoDoRepoMetadata(), rpmReSign(), rpmtsRebuildDB(), rpmtsRollback(), runScript(), sql_close(), urlGetFile(), and writeRPM().
| int Utime | ( | const char * | path, |
| const struct utimbuf * | buf | ||
| ) |
Definition at line 2021 of file rpmrpc.c.
References _rpmio_debug, errno, exit, fprintf(), rc, URL_IS_DASH, URL_IS_FTP, URL_IS_HKP, URL_IS_HTTP, URL_IS_HTTPS, URL_IS_MONGO, URL_IS_PATH, URL_IS_UNKNOWN, and urlPath().
Referenced by iosmStage(), and rpmdbExportHR_MIB().
| int Utimes | ( | const char * | path, |
| const struct timeval | times[2] | ||
| ) |
Definition at line 2052 of file rpmrpc.c.
References _rpmio_debug, errno, exit, fprintf(), rc, URL_IS_DASH, URL_IS_FTP, URL_IS_HKP, URL_IS_HTTP, URL_IS_HTTPS, URL_IS_MONGO, URL_IS_PATH, URL_IS_UNKNOWN, and urlPath().
| const char* _chroot_prefix = NULL |
|
static |
Definition at line 985 of file rpmrpc.c.
Referenced by ftpOpendir().
|
static |
| const char * pos |
Definition at line 501 of file rpmrpc.c.
Referenced by fdSeek(), Fseek(), fsmSetup(), iosmSetup(), and rpmtsAddInstallElement().
1.8.5