rpm
4.5
|
#include "system.h"
#include <rpmio_internal.h>
#include <rpmdav.h>
#include "ugid.h"
#include "debug.h"
Go to the source code of this file.
Macros | |
#define | _RPMDAV_INTERNAL |
#define | g_strdup xstrdup |
#define | g_free free |
#define | MAXCOLS 30 |
#define | alloca_strdup(_s) strcpy(alloca(strlen(_s)+1), (_s)) |
Enumerations | |
enum | ftpSysCall_t { DO_FTP_STAT = 1, DO_FTP_LSTAT = 2, DO_FTP_READLINK = 3, DO_FTP_ACCESS = 4, DO_FTP_GLOB = 5 } |
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... | |
static int | vfs_split_text (char *p) |
static int | is_num (int idx) |
static int | is_dos_date (const char *str) |
static int | is_week (const char *str, struct tm *tim) |
static int | is_month (const char *str, struct tm *tim) |
static int | is_time (const char *str, struct tm *tim) |
static int | is_year (const char *str, struct tm *tim) |
static int | vfs_parse_filetype (char c) |
static int | vfs_parse_filemode (const char *p) |
static int | vfs_parse_filedate (int idx, time_t *t) |
static int | vfs_parse_ls_lga (char *p, struct stat *st, const char **filename, const char **linkname) |
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) |
static DIR * | ftpOpendir (const char *path) |
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 | Chown (const char *path, uid_t owner, gid_t group) |
chown(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 | 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) |
utime(2) clone. More... | |
int | Utimes (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), glob_t *pglob) |
glob(3) clone. More... | |
void | Globfree (glob_t *pglob) |
globfree(3) clone. More... | |
DIR * | Opendir (const char *path) |
opendir(3) clone. More... | |
struct dirent * | Readdir (DIR *dir) |
readdir(3) clone. More... | |
int | Closedir (DIR *dir) |
closedir(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 size_t | ftpBufAlloced = 0 |
static char * | ftpBuf = NULL |
static int | ftp_st_ino = 0xdead0000 |
#define alloca_strdup | ( | _s | ) | strcpy(alloca(strlen(_s)+1), (_s)) |
#define g_free free |
Definition at line 353 of file rpmrpc.c.
Referenced by vfs_parse_ls_lga().
#define g_strdup xstrdup |
Definition at line 352 of file rpmrpc.c.
Referenced by vfs_parse_ls_lga().
#define MAXCOLS 30 |
Definition at line 366 of file rpmrpc.c.
Referenced by vfs_split_text().
enum ftpSysCall_t |
int Access | ( | const char * | path, |
int | amode | ||
) |
access(2) clone.
Definition at line 1628 of file rpmrpc.c.
References _rpmio_debug, errno, URL_IS_DASH, URL_IS_FTP, URL_IS_HKP, URL_IS_HTTP, URL_IS_HTTPS, URL_IS_PATH, URL_IS_UNKNOWN, and urlPath().
Referenced by rpmdbRebuild(), rpmInstallSourcePackage(), and rpmioAccess().
int Chdir | ( | const char * | path | ) |
chdir(2) clone.
Definition at line 95 of file rpmrpc.c.
References errno, ftpChdir(), URL_IS_DASH, URL_IS_FTP, URL_IS_HKP, URL_IS_PATH, URL_IS_UNKNOWN, and urlPath().
Referenced by getOutputFrom(), rpmpsmStage(), rpmtsRun(), and runScript().
int Chmod | ( | const char * | path, |
mode_t | mode | ||
) |
chmod(2) clone.
Definition at line 1436 of file rpmrpc.c.
References _rpmio_debug, errno, URL_IS_DASH, URL_IS_FTP, URL_IS_HKP, URL_IS_HTTP, URL_IS_HTTPS, URL_IS_PATH, URL_IS_UNKNOWN, and urlPath().
Referenced by fsmStage().
int Chown | ( | const char * | path, |
uid_t | owner, | ||
gid_t | group | ||
) |
chown(2) clone.
Definition at line 1384 of file rpmrpc.c.
References _rpmio_debug, errno, URL_IS_DASH, URL_IS_FTP, URL_IS_HKP, URL_IS_HTTP, URL_IS_HTTPS, URL_IS_PATH, URL_IS_UNKNOWN, and urlPath().
Referenced by fsmStage().
int Chroot | ( | const char * | path | ) |
chroot(2) clone.
Definition at line 145 of file rpmrpc.c.
References _chroot_prefix, _free(), _rpmio_debug, errno, rpmGetPath(), URL_IS_DASH, URL_IS_FTP, URL_IS_HKP, URL_IS_HTTP, URL_IS_HTTPS, URL_IS_PATH, URL_IS_UNKNOWN, and urlPath().
Referenced by rpmpsmStage(), rpmtsRun(), and runScript().
int Closedir | ( | DIR * | dir | ) |
closedir(3) clone.
Definition at line 1798 of file rpmrpc.c.
References _rpmio_debug.
Referenced by Fts_open(), and Glob().
|
static |
|
static |
Definition at line 1151 of file rpmrpc.c.
References _ftp_debug, DO_FTP_LSTAT, ftp_st_ino, ftpNLST(), and statstr().
Referenced by Lstat().
|
static |
|
static |
Definition at line 921 of file rpmrpc.c.
References _url_iobuf_size, alloca_strdup, DO_FTP_ACCESS, DO_FTP_GLOB, DO_FTP_LSTAT, DO_FTP_READLINK, DO_FTP_STAT, fdFgets(), fdLink(), ftpBuf, ftpBufAlloced, ftpChdir(), ftpOpen(), ftpReq(), urlinfo_s::openError, ufdClose(), urlPath(), vfs_parse_ls_lga(), xcalloc(), and xrealloc().
Referenced by ftpLstat(), ftpOpendir(), ftpReadlink(), and ftpStat().
|
static |
|
static |
Definition at line 1166 of file rpmrpc.c.
References _ftp_debug, DO_FTP_READLINK, and ftpNLST().
Referenced by Readlink().
|
static |
|
static |
|
static |
|
static |
Definition at line 1135 of file rpmrpc.c.
References _ftp_debug, DO_FTP_STAT, ftp_st_ino, ftpNLST(), and statstr().
Referenced by Stat().
|
static |
int Glob | ( | const char * | pattern, |
int | flags, | ||
int | errfuncconst char *epath, int eerrno, | ||
glob_t * | pglob | ||
) |
glob(3) clone.
Definition at line 1704 of file rpmrpc.c.
References _rpmio_debug, Closedir(), Lstat(), Opendir(), Readdir(), Stat(), URL_IS_DASH, URL_IS_FTP, URL_IS_HKP, URL_IS_HTTP, URL_IS_HTTPS, URL_IS_PATH, URL_IS_UNKNOWN, and urlPath().
Referenced by rpmGlob().
int Glob_error | ( | const char * | epath, |
int | eerrno | ||
) |
int Glob_pattern_p | ( | const char * | pattern, |
int | quote | ||
) |
glob_pattern_p(3) clone.
Definition at line 1659 of file rpmrpc.c.
References URL_IS_HKP, URL_IS_HTTP, URL_IS_HTTPS, and urlPath().
Referenced by processBinaryFile(), and rpmGlob().
void Globfree | ( | glob_t * | pglob | ) |
globfree(3) clone.
Definition at line 1753 of file rpmrpc.c.
References _rpmio_debug.
Referenced by rpmGlob().
|
static |
Definition at line 410 of file rpmrpc.c.
Referenced by vfs_parse_filedate(), and vfs_parse_ls_lga().
|
static |
Definition at line 438 of file rpmrpc.c.
Referenced by vfs_parse_filedate(), and vfs_parse_ls_lga().
|
static |
Definition at line 399 of file rpmrpc.c.
References columns.
Referenced by vfs_parse_filedate(), and vfs_parse_ls_lga().
|
static |
Definition at line 455 of file rpmrpc.c.
Referenced by vfs_parse_filedate().
|
static |
Definition at line 421 of file rpmrpc.c.
Referenced by vfs_parse_filedate(), and vfs_parse_ls_lga().
|
static |
Definition at line 474 of file rpmrpc.c.
Referenced by vfs_parse_filedate().
int Lchown | ( | const char * | path, |
uid_t | owner, | ||
gid_t | group | ||
) |
lchown(2) clone.
Definition at line 1410 of file rpmrpc.c.
References _rpmio_debug, errno, lchown, URL_IS_DASH, URL_IS_FTP, URL_IS_HKP, URL_IS_HTTP, URL_IS_HTTPS, URL_IS_PATH, URL_IS_UNKNOWN, and urlPath().
Referenced by fsmStage().
int Link | ( | const char * | oldpath, |
const char * | newpath | ||
) |
link(2) clone.
Definition at line 280 of file rpmrpc.c.
References _rpmio_debug, URL_IS_DASH, URL_IS_FTP, URL_IS_HKP, URL_IS_HTTP, URL_IS_HTTPS, URL_IS_PATH, URL_IS_UNKNOWN, urlPath(), and xstrncasecmp().
Referenced by fsmStage().
off_t Lseek | ( | int | fdno, |
off_t | offset, | ||
int | whence | ||
) |
lseek(2) clone.
Definition at line 1883 of file rpmrpc.c.
References _rpmio_debug.
int Lstat | ( | const char * | path, |
struct stat * | st | ||
) |
lstat(2) clone.
Definition at line 1358 of file rpmrpc.c.
References _rpmio_debug, errno, ftpLstat(), URL_IS_DASH, URL_IS_FTP, URL_IS_HKP, URL_IS_PATH, URL_IS_UNKNOWN, and urlPath().
Referenced by addFile(), checkOwners(), fsmStage(), Fts_open(), Glob(), prepFetch(), rpmQueryVerify(), rpmtsRun(), rpmVerifyFile(), and statFormat().
int Mkdir | ( | const char * | path, |
mode_t | mode | ||
) |
mkdir(2) clone.
Definition at line 72 of file rpmrpc.c.
References ftpMkdir(), URL_IS_DASH, URL_IS_FTP, URL_IS_HKP, URL_IS_PATH, URL_IS_UNKNOWN, and urlPath().
Referenced by fsmStage(), packageBinaries(), rpmdbRebuild(), rpmioMkpath(), and rpmMkdirPath().
int Mkfifo | ( | const char * | path, |
mode_t | mode | ||
) |
mkfifo(3) clone.
Definition at line 1462 of file rpmrpc.c.
References _rpmio_debug, errno, URL_IS_DASH, URL_IS_FTP, URL_IS_HKP, URL_IS_HTTP, URL_IS_HTTPS, URL_IS_PATH, URL_IS_UNKNOWN, and urlPath().
Referenced by fsmStage().
int Mknod | ( | const char * | path, |
mode_t | mode, | ||
dev_t | dev | ||
) |
mknod(3) clone.
Definition at line 1488 of file rpmrpc.c.
References _rpmio_debug, errno, URL_IS_DASH, URL_IS_FTP, URL_IS_HKP, URL_IS_HTTP, URL_IS_HTTPS, URL_IS_PATH, URL_IS_UNKNOWN, and urlPath().
Referenced by fsmStage().
int Open | ( | const char * | path, |
int | flags, | ||
mode_t | mode | ||
) |
open(2) clone.
Definition at line 178 of file rpmrpc.c.
References _chroot_prefix, _free(), _rpmio_debug, errno, rpmExpand(), URL_IS_DASH, URL_IS_FTP, URL_IS_HKP, URL_IS_HTTP, URL_IS_HTTPS, URL_IS_PATH, URL_IS_UNKNOWN, and urlPath().
Referenced by db_init().
DIR* Opendir | ( | const char * | path | ) |
opendir(3) clone.
Definition at line 1760 of file rpmrpc.c.
References _rpmio_debug, ftpOpendir(), URL_IS_DASH, URL_IS_FTP, URL_IS_HKP, URL_IS_PATH, URL_IS_UNKNOWN, and urlPath().
Referenced by Fts_open(), and Glob().
|
read |
readdir(3) clone.
Definition at line 1787 of file rpmrpc.c.
References _rpmio_debug.
Referenced by Fts_open(), and Glob().
int Readlink | ( | const char * | path, |
char * | buf, | ||
size_t | bufsiz | ||
) |
readlink(2) clone.
Definition at line 1600 of file rpmrpc.c.
References _rpmio_debug, errno, ftpReadlink(), URL_IS_DASH, URL_IS_FTP, URL_IS_HKP, URL_IS_PATH, URL_IS_UNKNOWN, and urlPath().
Referenced by fsmStage(), genCpioListAndHeader(), rpmVerifyFile(), and statFormat().
char* Realpath | ( | const char * | path, |
char * | resolved_path | ||
) |
realpath(3) clone.
Definition at line 1809 of file rpmrpc.c.
References _free(), _rpmio_debug, ftpRealpath(), PATH_MAX, realpath(), rpmExpand(), rpmGetPath(), URL_IS_DASH, URL_IS_FTP, URL_IS_PATH, URL_IS_UNKNOWN, urlPath(), and xstrdup().
Referenced by rpmReadHeader().
int Rename | ( | const char * | oldpath, |
const char * | newpath | ||
) |
rename(2) clone.
Definition at line 231 of file rpmrpc.c.
References _rpmio_debug, ftpRename(), URL_IS_DASH, URL_IS_FTP, URL_IS_HKP, URL_IS_HTTP, URL_IS_HTTPS, URL_IS_PATH, URL_IS_UNKNOWN, urlPath(), and xstrncasecmp().
Referenced by fsmStage().
int Rmdir | ( | const char * | path | ) |
rmdir(2) clone.
Definition at line 119 of file rpmrpc.c.
References ftpRmdir(), URL_IS_DASH, URL_IS_FTP, URL_IS_HKP, URL_IS_PATH, URL_IS_UNKNOWN, and urlPath().
Referenced by fsmStage(), and rpmdbRebuild().
int Stat | ( | const char * | path, |
struct stat * | st | ||
) |
stat(2) clone.
Definition at line 1332 of file rpmrpc.c.
References _rpmio_debug, errno, ftpStat(), URL_IS_DASH, URL_IS_FTP, URL_IS_HKP, URL_IS_PATH, URL_IS_UNKNOWN, and urlPath().
Referenced by db3open(), fsmStage(), Fts_open(), Glob(), packageBinaries(), processSourceFiles(), rpmdsSysinfo(), rpmioFileExists(), rpmioMkpath(), and rpmMkdirPath().
|
static |
Definition at line 1114 of file rpmrpc.c.
Referenced by ftpLstat(), and ftpStat().
int Symlink | ( | const char * | oldpath, |
const char * | newpath | ||
) |
symlink(3) clone.
Definition at line 1570 of file rpmrpc.c.
References _rpmio_debug, errno, URL_IS_DASH, URL_IS_FTP, URL_IS_HKP, URL_IS_HTTP, URL_IS_HTTPS, URL_IS_PATH, URL_IS_UNKNOWN, and urlPath().
Referenced by fsmStage().
int Unlink | ( | const char * | path | ) |
unlink(2) clone.
Definition at line 328 of file rpmrpc.c.
References ftpUnlink(), URL_IS_DASH, URL_IS_FTP, URL_IS_HKP, URL_IS_PATH, URL_IS_UNKNOWN, and urlPath().
Referenced by build(), checkSpec(), db3open(), fsmStage(), rpmdbExportInfo(), rpmdbRemoveDatabase(), rpmInstall(), rpmtsRollback(), urlGetFile(), and writeRPM().
int Utime | ( | const char * | path, |
const struct utimbuf * | buf | ||
) |
utime(2) clone.
Definition at line 1516 of file rpmrpc.c.
References _rpmio_debug, errno, URL_IS_DASH, URL_IS_FTP, URL_IS_HKP, URL_IS_HTTP, URL_IS_HTTPS, URL_IS_PATH, URL_IS_UNKNOWN, and urlPath().
Referenced by fsmStage(), and rpmdbExportInfo().
int Utimes | ( | const char * | path, |
const struct timeval | times[2] | ||
) |
Definition at line 1543 of file rpmrpc.c.
References _rpmio_debug, errno, URL_IS_DASH, URL_IS_FTP, URL_IS_HKP, URL_IS_HTTP, URL_IS_HTTPS, URL_IS_PATH, URL_IS_UNKNOWN, and urlPath().
|
static |
Definition at line 585 of file rpmrpc.c.
References columns, current_mday, current_mon, current_year, is_dos_date(), is_month(), is_num(), is_time(), is_week(), and is_year().
Referenced by vfs_parse_ls_lga().
|
static |
Definition at line 525 of file rpmrpc.c.
Referenced by vfs_parse_ls_lga().
|
static |
|
static |
Definition at line 696 of file rpmrpc.c.
References column_ptr, columns, g_free, g_strdup, gnameToGid(), is_dos_date(), is_month(), is_num(), is_week(), S_ISLNK, unameToUid(), vfs_parse_filedate(), vfs_parse_filemode(), vfs_parse_filetype(), vfs_split_text(), and xmalloc().
Referenced by ftpNLST().
|
static |
Definition at line 375 of file rpmrpc.c.
References column_ptr, columns, and MAXCOLS.
Referenced by vfs_parse_ls_lga().
const char* _chroot_prefix = NULL |
|
static |
Definition at line 371 of file rpmrpc.c.
Referenced by vfs_parse_ls_lga(), and vfs_split_text().
|
static |
Definition at line 369 of file rpmrpc.c.
Referenced by is_num(), vfs_parse_filedate(), vfs_parse_ls_lga(), and vfs_split_text().
|
static |
Definition at line 359 of file rpmrpc.c.
Referenced by vfs_parse_filedate().
|
static |
Definition at line 361 of file rpmrpc.c.
Referenced by vfs_parse_filedate().
|
static |
Definition at line 363 of file rpmrpc.c.
Referenced by vfs_parse_filedate().
|
static |
Definition at line 1132 of file rpmrpc.c.
Referenced by ftpLstat(), and ftpStat().
|
static |
Definition at line 916 of file rpmrpc.c.
Referenced by ftpNLST(), and ftpOpendir().