[Fedora-directory-commits] adminserver/lib/libadmin install.c, 1.6, 1.6.2.1 util.c, 1.10, 1.10.2.1
Richard Allen Megginson (rmeggins)
fedora-directory-commits at redhat.com
Mon Jul 14 20:58:49 UTC 2008
- Previous message (by thread): [Fedora-directory-commits] adminserver/lib/base nscputil.cpp, 1.3, 1.3.2.1 buffer.cpp, 1.4, NONE eventhandler.cpp, 1.3, NONE eventlog.cpp, 1.3, NONE ntdaemon.cpp, 1.3, NONE nterrors.cpp, 1.3, NONE ntpipe.cpp, 1.3, NONE
- Next message (by thread): [Fedora-directory-commits] adminserver/lib/libsi18n getstrprop.c, 1.4, 1.4.2.1 gsadmserv.h, 1.6, 1.6.2.1 coreres.c, 1.3, NONE coreres.h, 1.3, NONE getlang.c, 1.5, NONE lock.h, 1.3, NONE makstrdb.c, 1.4, NONE propset.c, 1.4, NONE propset.h, 1.3, NONE reshash.c, 1.3, NONE reshash.h, 1.3, NONE txtfile.c, 1.4, NONE txtfile.h, 1.3, NONE
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Author: rmeggins
Update of /cvs/dirsec/adminserver/lib/libadmin
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv9594/adminserver/lib/libadmin
Modified Files:
Tag: Directory_Server_8_0_Branch
install.c util.c
Log Message:
remove obsolete code from 8.0 branch
Index: install.c
===================================================================
RCS file: /cvs/dirsec/adminserver/lib/libadmin/install.c,v
retrieving revision 1.6
retrieving revision 1.6.2.1
diff -u -r1.6 -r1.6.2.1
--- install.c 9 May 2007 00:26:37 -0000 1.6
+++ install.c 14 Jul 2008 20:58:47 -0000 1.6.2.1
@@ -51,7 +51,7 @@
{
int sd;
struct sockaddr_in sa_server;
- int one = 1, ret;
+ int ret;
#ifdef XP_WIN32
WSADATA wsd;
Index: util.c
===================================================================
RCS file: /cvs/dirsec/adminserver/lib/libadmin/util.c,v
retrieving revision 1.10
retrieving revision 1.10.2.1
diff -u -r1.10 -r1.10.2.1
--- util.c 31 Oct 2007 05:30:54 -0000 1.10
+++ util.c 14 Jul 2008 20:58:47 -0000 1.10.2.1
@@ -186,130 +186,6 @@
return ans;
}
-int ADM_mkdir_p(char *dir, int mode)
-{
- char path[PATH_MAX];
- struct stat fi;
- char *slash = NULL;
-
- if (dir)
- PL_strncpyz (path, dir, sizeof(path));
- else
- return 0;
-
- if (slash = strchr(path, FILE_PATHSEP))
- slash++; /* go past root */
- else
- return 0;
-
- while (slash && *slash) {
- slash = strchr(slash, FILE_PATHSEP);
- if (slash) *slash = '\0'; /* check path till here */
-
- if (stat(path, &fi) == -1) {
-#ifdef XP_UNIX
- if (mkdir(path, mode) == -1)
-#else /* XP_WIN32 */
- if (!CreateDirectory(path, NULL))
-#endif
- return 0;
- }
-
- if (slash) {
- *slash = FILE_PATHSEP; /* restore path */
- slash++; /* check remaining path */
- }
- }
- return 1;
-}
-
-int ADM_copy_directory(char *src_dir, char *dest_dir)
-{
- SYS_DIR ds;
- SYS_DIRENT *d;
- struct stat fi;
- char src_file[PATH_MAX], dest_file[PATH_MAX], fullname[PATH_MAX];
-
- if (!(ds = dir_open(src_dir)))
- report_error(FILE_ERROR, "Can't read directory", src_dir);
-
- while (d = dir_read(ds)) {
- if (d->d_name[0] != '.') {
- PR_snprintf(fullname, sizeof(fullname), "%s/%s", src_dir, d->d_name);
- if (system_stat(fullname, &fi) == -1)
- continue;
-
- PR_snprintf(src_file, sizeof(src_file), "%s%c%s", src_dir, FILE_PATHSEP, d->d_name);
- PR_snprintf(dest_file, sizeof(dest_file), "%s%c%s", dest_dir, FILE_PATHSEP, d->d_name);
- if (S_ISDIR(fi.st_mode)) {
- char *sub_src_dir = STRDUP(src_file);
- char *sub_dest_dir = STRDUP(dest_file);
- if (!ADM_mkdir_p(sub_dest_dir, 0755)) {
- report_error(FILE_ERROR, "Cannot create directory",
- sub_dest_dir);
- return 0;
- }
- if (!ADM_copy_directory(sub_src_dir, sub_dest_dir))
- return 0;
- FREE(sub_src_dir);
- FREE(sub_dest_dir);
- }
- else
- cp_file(src_file, dest_file, 0644);
- }
- }
- dir_close(ds);
- return(1);
-}
-
-void ADM_remove_directory(char *path)
-{
- struct stat finfo;
- char **dirlisting;
- register int x=0;
- int stat_good = 0;
- char *fullpath = NULL;
-
-#ifdef XP_UNIX
- stat_good = (lstat(path, &finfo) == -1 ? 0 : 1);
-#else /* XP_WIN32 */
- stat_good = (stat(path, &finfo) == -1 ? 0 : 1);
-#endif
-
- if(!stat_good) return;
-
- if(S_ISDIR(finfo.st_mode)) {
- dirlisting = list_directory(path,1);
- if(!dirlisting) return;
-
- for(x=0; dirlisting[x]; x++) {
- fullpath = (char *) MALLOC(strlen(path) +
- strlen(dirlisting[x]) + 4);
- sprintf(fullpath, "%s%c%s", path, FILE_PATHSEP, dirlisting[x]);
-#ifdef XP_UNIX
- stat_good = (lstat(fullpath, &finfo) == -1 ? 0 : 1);
-#else /* XP_WIN32 */
- stat_good = (stat(fullpath, &finfo) == -1 ? 0 : 1);
-#endif
- if(!stat_good) continue;
- if(S_ISDIR(finfo.st_mode)) {
- ADM_remove_directory(fullpath);
- } else {
- unlink(fullpath);
- }
- FREE(fullpath);
- }
-#ifdef XP_UNIX
- rmdir(path);
-#else /* XP_WIN32 */
- RemoveDirectory(path);
-#endif
- } else {
- delete_file(path);
- }
- return;
-}
-
/* return: mtime(f1) < mtime(f2) ? */
int mtime_is_earlier(char *file1, char *file2)
{
@@ -1382,7 +1258,7 @@
ptr = PL_strdup(ptr);
}
/* copy now points at the parent, ptr at the child */
- if (pdir = PR_OpenDir(copy)) {
+ if ((pdir = PR_OpenDir(copy))) {
for(pent = PR_ReadDir(pdir, PR_SKIP_BOTH); pent && !ret;
pent = PR_ReadDir(pdir, PR_SKIP_BOTH)) {
ret = !strcmp(pent->name, ptr);
@@ -1393,7 +1269,7 @@
ret = 0;
/* we've verified that name is a valid directory - see if
the given filename exists in that directory */
- if (pdir = PR_OpenDir(name)) {
+ if ((pdir = PR_OpenDir(name))) {
for(pent = PR_ReadDir(pdir, PR_SKIP_BOTH); pent && !ret;
pent = PR_ReadDir(pdir, PR_SKIP_BOTH)) {
if (childlen > 0) {
- Previous message (by thread): [Fedora-directory-commits] adminserver/lib/base nscputil.cpp, 1.3, 1.3.2.1 buffer.cpp, 1.4, NONE eventhandler.cpp, 1.3, NONE eventlog.cpp, 1.3, NONE ntdaemon.cpp, 1.3, NONE nterrors.cpp, 1.3, NONE ntpipe.cpp, 1.3, NONE
- Next message (by thread): [Fedora-directory-commits] adminserver/lib/libsi18n getstrprop.c, 1.4, 1.4.2.1 gsadmserv.h, 1.6, 1.6.2.1 coreres.c, 1.3, NONE coreres.h, 1.3, NONE getlang.c, 1.5, NONE lock.h, 1.3, NONE makstrdb.c, 1.4, NONE propset.c, 1.4, NONE propset.h, 1.3, NONE reshash.c, 1.3, NONE reshash.h, 1.3, NONE txtfile.c, 1.4, NONE txtfile.h, 1.3, NONE
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the Fedora-directory-commits
mailing list