mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-23 00:47:31 +09:00
Replace NSS with Pale Moon's
This commit is contained in:
parent
ff1e5e48bf
commit
8c2e376f94
2870 changed files with 1762232 additions and 1374220 deletions
|
|
@ -26,16 +26,12 @@ typedef unsigned int mode_t;
|
|||
|
||||
#define HAVE_LCHOWN
|
||||
|
||||
#if defined(AIX) || defined(BSDI) || defined(HPUX) || defined(LINUX) || defined(SUNOS4) || defined(SCO) || defined(UNIXWARE) || defined(NTO) || defined(DARWIN) || defined(BEOS) || defined(__riscos__)
|
||||
#if defined(AIX) || defined(BSDI) || defined(HPUX) || defined(LINUX) || defined(SUNOS4) || defined(SCO) || defined(UNIXWARE) || defined(NTO) || defined(DARWIN) || defined(__riscos__)
|
||||
#undef HAVE_LCHOWN
|
||||
#endif
|
||||
|
||||
#define HAVE_FCHMOD
|
||||
|
||||
#if defined(BEOS)
|
||||
#undef HAVE_FCHMOD
|
||||
#endif
|
||||
|
||||
#ifdef LINUX
|
||||
#include <getopt.h>
|
||||
#endif
|
||||
|
|
@ -88,8 +84,8 @@ mkdirs(char *path, mode_t mode)
|
|||
char * cp;
|
||||
int rv;
|
||||
struct stat sb;
|
||||
|
||||
if (!path || !path[0])
|
||||
|
||||
if (!path || !path[0])
|
||||
fail("Null pointer or empty string passed to mkdirs()");
|
||||
while (*path == '/' && path[1] == '/')
|
||||
path++;
|
||||
|
|
@ -107,7 +103,7 @@ mkdirs(char *path, mode_t mode)
|
|||
if (errno != EEXIST)
|
||||
fail("mkdirs cannot make %s", path);
|
||||
fprintf(stderr, "directory creation race: %s\n", path);
|
||||
if (!stat(path, &sb) && S_ISDIR(sb.st_mode))
|
||||
if (!stat(path, &sb) && S_ISDIR(sb.st_mode))
|
||||
rv = 0;
|
||||
}
|
||||
return rv;
|
||||
|
|
@ -120,7 +116,7 @@ touid(char *owner)
|
|||
uid_t uid;
|
||||
char *cp;
|
||||
|
||||
if (!owner || !owner[0])
|
||||
if (!owner || !owner[0])
|
||||
fail("Null pointer or empty string passed to touid()");
|
||||
pw = getpwnam(owner);
|
||||
if (pw)
|
||||
|
|
@ -138,7 +134,7 @@ togid(char *group)
|
|||
gid_t gid;
|
||||
char *cp;
|
||||
|
||||
if (!group || !group[0])
|
||||
if (!group || !group[0])
|
||||
fail("Null pointer or empty string passed to togid()");
|
||||
gr = getgrnam(group);
|
||||
if (gr)
|
||||
|
|
@ -259,8 +255,9 @@ main(int argc, char **argv)
|
|||
len = strlen(name);
|
||||
base = xbasename(name);
|
||||
bnlen = strlen(base);
|
||||
toname = (char*)xmalloc(tdlen + 1 + bnlen + 1);
|
||||
sprintf(toname, "%s/%s", todir, base);
|
||||
size_t toname_len = tdlen + 1 + bnlen + 1;
|
||||
toname = (char*)xmalloc(toname_len);
|
||||
snprintf(toname, toname_len, "%s/%s", todir, base);
|
||||
retry:
|
||||
exists = (lstat(toname, &tosb) == 0);
|
||||
|
||||
|
|
@ -274,7 +271,7 @@ retry:
|
|||
}
|
||||
if (!exists && mkdir(toname, mode) < 0) {
|
||||
/* we probably have two nsinstall programs in a race here. */
|
||||
if (errno == EEXIST && !stat(toname, &sb) &&
|
||||
if (errno == EEXIST && !stat(toname, &sb) &&
|
||||
S_ISDIR(sb.st_mode)) {
|
||||
fprintf(stderr, "directory creation race: %s\n", toname);
|
||||
goto retry;
|
||||
|
|
@ -292,7 +289,7 @@ retry:
|
|||
/* -L implies -l and prefixes names with a $cwd arg. */
|
||||
len += lplen + 1;
|
||||
linkname = (char*)xmalloc(len + 1);
|
||||
sprintf(linkname, "%s/%s", linkprefix, name);
|
||||
snprintf(linkname, len+1, "%s/%s", linkprefix, name);
|
||||
} else if (dorelsymlink) {
|
||||
/* Symlink the relative path from todir to source name. */
|
||||
linkname = (char*)xmalloc(PATH_MAX);
|
||||
|
|
@ -348,7 +345,7 @@ retry:
|
|||
fromfd = open(name, O_RDONLY);
|
||||
if (fromfd < 0 || fstat(fromfd, &sb) < 0)
|
||||
fail("cannot access %s", name);
|
||||
if (exists &&
|
||||
if (exists &&
|
||||
(!S_ISREG(tosb.st_mode) || access(toname, W_OK) < 0)) {
|
||||
int rmrv;
|
||||
rmrv = (S_ISDIR(tosb.st_mode) ? rmdir : unlink)(toname);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue