+2003-03-06 Alexandra Ellwood <lxs@mit.edu>
+ * profile.hin, prof_file.c (profile_flush_file_data): Stop copying
+ the resource fork. We stopped writing resources to the krb5
+ configuration in KfM 4.5.x. In KfM 5.0 will no longer read
+ preferences from the resource fork so we can destroy it on copy.
+
+ * prof-int.h: No longer include MoreFiles. Removed framework style
+ includes for Kerberos headers.
+
+ * prof_FSp_glue.c, prof_init.c, profile.hin: Moved Mac FSSpec-based
+ functions into a separate file so they will only be built with KfM.
+ These functions will be exported but not in the headers because
+ they are deprecated.
+
2003-01-17 Ken Raeburn <raeburn@mit.edu>
* prof_file.c (profile_flush_file_data) [_WIN32]: Don't call
--- /dev/null
+/*
+ * prof_FSp_glue.c --- Deprecated FSSpec functions. Mac-only.
+ */
+
+#include "prof_int.h"
+
+#include <Kerberos/FSpUtils.h>
+#include <limits.h>
+
+long KRB5_CALLCONV FSp_profile_init (const FSSpec* files, profile_t *ret_profile);
+
+long KRB5_CALLCONV FSp_profile_init_path (const FSSpec* files, profile_t *ret_profile);
+
+errcode_t KRB5_CALLCONV
+FSp_profile_init(files, ret_profile)
+ const FSSpec* files;
+ profile_t *ret_profile;
+{
+ unsigned int fileCount = 0;
+ const FSSpec *nextSpec;
+ profile_filespec_t *pathArray = NULL;
+ unsigned int i;
+ errcode_t retval = 0;
+
+ for (nextSpec = files; ; nextSpec++) {
+ if ((nextSpec -> vRefNum == 0) &&
+ (nextSpec -> parID == 0) &&
+ (StrLength (nextSpec -> name) == 0))
+ break;
+ fileCount++;
+ }
+
+ pathArray = (profile_filespec_t *) malloc ((fileCount + 1) * sizeof(const_profile_filespec_t));
+ if (pathArray == NULL) {
+ retval = ENOMEM;
+ }
+
+ if (retval == 0) {
+ for (i = 0; i < fileCount + 1; i++) {
+ pathArray [i] = NULL;
+ }
+ }
+
+ if (retval == 0) {
+ for (i = 0; i < fileCount; i++) {
+ OSStatus err = noErr;
+
+ if (err == noErr) {
+ pathArray[i] = (char *) malloc (sizeof(char) * PATH_MAX);
+ if (pathArray[i] == NULL) {
+ err = memFullErr;
+ }
+ }
+ /* convert the FSSpec to an path */
+ if (err == noErr) {
+ err = FSSpecToPOSIXPath (&files[i], pathArray[i], PATH_MAX);
+ }
+
+ if (err == memFullErr) {
+ retval = ENOMEM;
+ break;
+ } else if (err != noErr) {
+ retval = ENOENT;
+ break;
+ }
+ }
+ }
+
+ if (retval == 0) {
+ retval = profile_init ((const_profile_filespec_t *) pathArray,
+ ret_profile);
+ }
+
+ if (pathArray != NULL) {
+ for (i = 0; i < fileCount; i++) {
+ if (pathArray [i] != 0)
+ free (pathArray [i]);
+ }
+ free (pathArray);
+ }
+
+ return retval;
+}
+
+errcode_t KRB5_CALLCONV
+FSp_profile_init_path(files, ret_profile)
+ const FSSpec* files;
+ profile_t *ret_profile;
+{
+ return FSp_profile_init (files, ret_profile);
+}
goto errout;
}
-#ifdef COPY_RESOURCE_FORK
- {
- FSSpec from;
- FSSpec to;
- OSErr err = FSpLocationFromFullPOSIXPath (data -> filespec, &from);
- if (err == noErr) {
- err = FSpLocationFromFullPOSIXPath (new_file, &to);
- }
- if (err == noErr) {
- err = FSpResourceForkCopy (&from, &to);
- }
- if (err != noErr) {
- retval = ENOENT;
- goto end;
- }
- }
-#endif
-
unlink(old_file);
if (make_hard_link(data->filespec, old_file) == 0) {
/* Okay, got the hard link. Yay. Now we've got our
#endif
#include <errno.h>
-#if TARGET_OS_MAC
-#include <Kerberos/FullPOSIXPath.h>
-#endif
-
#include "prof_int.h"
/* Find a 4-byte integer type */
return retval;
}
-#if TARGET_OS_MAC
-KRB5_DLLIMP errcode_t KRB5_CALLCONV
-FSp_profile_init(files, ret_profile)
- const FSSpec* files;
- profile_t *ret_profile;
-{
- UInt32 fileCount = 0;
- const FSSpec* nextSpec;
- char** pathArray = NULL;
- UInt32 i;
- errcode_t retval = 0;
-
- for (nextSpec = files; ; nextSpec++) {
- if ((nextSpec -> vRefNum == 0) &&
- (nextSpec -> parID == 0) &&
- (StrLength (nextSpec -> name) == 0))
- break;
- fileCount++;
- }
-
- pathArray = malloc ((fileCount + 1) * sizeof (char*));
- if (pathArray == NULL) {
- retval = ENOMEM;
- }
-
- if (retval == 0) {
- for (i = 0; i < fileCount + 1; i++) {
- pathArray [i] = NULL;
- }
-
- for (i = 0; i < fileCount; i++) {
- OSErr err = FSpGetFullPOSIXPath (&files [i], &pathArray [i]);
- if (err == memFullErr) {
- retval = ENOMEM;
- break;
- } else if (err != noErr) {
- retval = ENOENT;
- break;
- }
- }
- }
-
- if (retval == 0) {
- retval = profile_init (pathArray, ret_profile);
- }
-
- if (pathArray != NULL) {
- for (i = 0; i < fileCount; i++) {
- if (pathArray [i] != 0)
- free (pathArray [i]);
- }
- free (pathArray);
- }
-
- return retval;
-}
-
-KRB5_DLLIMP errcode_t KRB5_CALLCONV
-FSp_profile_init_path(files, ret_profile)
- const FSSpec* files;
- profile_t *ret_profile;
-{
- return FSp_profile_init (files, ret_profile);
-}
-#endif /* TARGET_OS_MAC */
-
errcode_t KRB5_CALLCONV
profile_flush(profile)
profile_t profile;
*/
#include <time.h>
+#include <stdio.h>
#if defined(macintosh) || (defined(__MACH__) && defined(__APPLE__))
#include <TargetConditionals.h>
-#include <Kerberos/com_err.h>
-#include <Kerberos/FullPOSIXPath.h>
-#include <CoreServices/CoreServices.h>
#define USE_PTHREADS
#define PROFILE_SUPPORTS_FOREIGN_NEWLINES
#define SHARE_TREE_DATA
-#else
-#include "com_err.h"
#endif
+#include "com_err.h"
#include "profile.h"
#if defined(_WIN32)
#pragma enumsalwaysint on
#endif
#pragma options align=mac68k
- /* We use file paths as unique file identifiers */
- #define COPY_RESOURCE_FORK 1
#endif
#ifndef KRB5_CALLCONV
long KRB5_CALLCONV profile_init_path
(const_profile_filespec_list_t filelist, profile_t *ret_profile);
-/* On Mac Carbon, also provide FSSpec variants */
-#if TARGET_OS_MAC && defined(__FILES__)
-long KRB5_CALLCONV FSp_profile_init
- (const FSSpec* files, profile_t *ret_profile);
-
-long KRB5_CALLCONV FSp_profile_init_path
- (const FSSpec* files, profile_t *ret_profile);
-#endif
-
long KRB5_CALLCONV profile_flush
(profile_t profile);