View | Details | Raw Unified | Return to bug 232219 | Differences between
and this patch

Collapse All | Expand All

(-)/root/radmind.new/distinfo (-2 / +2 lines)
Lines 1-2 Link Here
1
SHA256 (radmind-1.14.1.tar.gz) = 92ce3d586245b107bf4e412b59eb02ec3e57b4d12a0b9a16b0fadf10983ed21f
1
SHA256 (radmind-1.15.1.tar.gz) = f8ca1770806d4b756d432d06399f11197b0841cea6dda0cfda34e85bf5747e2b
2
SIZE (radmind-1.14.1.tar.gz) = 403553
2
SIZE (radmind-1.15.1.tar.gz) = 449653
(-)/root/radmind.new/files/patch-.gitignore (-17 lines)
Lines 1-17 Link Here
1
--- ./.gitignore.orig	2010-12-13 04:42:49.000000000 +0100
2
+++ ./.gitignore	2014-06-29 12:15:04.241543320 +0200
3
@@ -10,12 +10,8 @@
4
 config.log
5
 config.status
6
 
7
-# External Libraries #
8
-######################
9
-libsnet
10
-
11
-# Comiled Files #
12
-#################
13
+# Compiled Files #
14
+##################
15
 *.o
16
 fsdiff
17
 ktcheck
(-)/root/radmind.new/files/patch-.gitmodules (-6 lines)
Lines 1-6 Link Here
1
--- ./.gitmodules.orig	2014-06-29 12:15:04.241543320 +0200
2
+++ ./.gitmodules	2014-06-29 12:15:04.242543988 +0200
3
@@ -0,0 +1,3 @@
4
+[submodule "libsnet"]
5
+	path = libsnet
6
+	url = git://libsnet.git.sourceforge.net/gitroot/libsnet/libsnet
(-)/root/radmind.new/files/patch-aclocal.m4 (-42 lines)
Lines 1-42 Link Here
1
--- ./aclocal.m4.orig	2010-12-13 04:42:49.000000000 +0100
2
+++ ./aclocal.m4	2014-06-29 12:15:04.242543988 +0200
3
@@ -105,16 +105,11 @@
4
 	    arches="-arch i386 -arch ppc"
5
 	    ;;
6
 
7
-	  darwin9*)
8
+	  darwin9*|darwin10*|darwin11*)
9
 	    dep_target="-mmacosx-version-min=10.4"
10
 	    macosx_sdk="MacOSX10.5.sdk"
11
 	    arches="-arch i386 -arch x86_64 -arch ppc -arch ppc64"
12
-	    ;;
13
-
14
-	  darwin10*)
15
-	    dep_target="-mmacosx-version-min=10.4"
16
-	    macosx_sdk="MacOSX10.6.sdk"
17
-	    arches="-arch i386 -arch x86_64 -arch ppc"
18
+	    LDFLAGS="$LDFLAGS -L/Developer/SDKs/$macosx_sdk/usr/lib"
19
 	    ;;
20
 
21
 	  *)
22
@@ -129,3 +124,20 @@
23
     fi
24
 ])
25
 
26
+AC_DEFUN([MACOSX_MUTE_DEPRECATION_WARNINGS],
27
+[
28
+    dnl Lion deprecates a system-provided OpenSSL. Build output
29
+    dnl is cluttered with useless deprecation warnings.
30
+
31
+    AS_IF([test x"$CC" = x"gcc"], [
32
+        case "${host_os}" in
33
+        darwin11*)
34
+            AC_MSG_NOTICE([muting deprecation warnings from compiler])
35
+            OPTOPTS="$OPTOPTS -Wno-deprecated-declarations"
36
+            ;;
37
+
38
+        *)
39
+            ;;
40
+        esac
41
+    ])
42
+])
(-)/root/radmind.new/files/patch-argcargv.c (-13 lines)
Lines 1-13 Link Here
1
--- ./argcargv.c.orig	2010-12-13 04:42:49.000000000 +0100
2
+++ ./argcargv.c	2014-06-29 12:15:04.243544285 +0200
3
@@ -48,7 +48,9 @@
4
 
5
     if ( acav == NULL ) {
6
 	if ( acavg == NULL ) {
7
-	    acavg = acav_alloc();
8
+	    if (( acavg = acav_alloc()) == NULL ) {
9
+		return( -1 );
10
+	    }
11
 	}
12
 	acav = acavg;
13
     }
(-)/root/radmind.new/files/patch-command.c (-230 lines)
Lines 1-230 Link Here
1
--- ./command.c.orig	2010-12-13 04:42:49.000000000 +0100
2
+++ ./command.c	2014-06-29 12:15:04.244544161 +0200
3
@@ -477,38 +477,90 @@
4
 
5
 /* looks for special file info in transcripts */
6
     char **
7
-special_t( char *transcript, char *epath )
8
+special_t( char *sp_path, char *remote_path )
9
 {
10
-    FILE		*fs;
11
-    int			ac, len;
12
-    char		**av;
13
+    FILE		*fs = NULL;
14
+    int			i, ac, len, ln;
15
+    char		**av = NULL;
16
+    char		*paths[ 4 ] = { NULL };
17
+    char		*p;
18
+    char		sp_t[ MAXPATHLEN ];
19
     static char		line[ MAXPATHLEN ];
20
 
21
-    if (( fs = fopen( transcript, "r" )) == NULL ) {
22
-	return( NULL );
23
-    }
24
+    /*
25
+     * in order, we look for special file transcript lines in the
26
+     * following locations:
27
+     *
28
+     *      - A transcript in the same directory and with the same name
29
+     *	      as the special file, but with a ".T" extension.
30
+     *
31
+     *      - A transcript named "<remote_id>.T" in the same directory as
32
+     *        the client's special file directory root.
33
+     *
34
+     *      - /var/radmind/transcript/special.T
35
+     *
36
+     * if no matching transcript line is found, default metadata is
37
+     * returned to the client (type: f; mode: 0444; owner: 0; group: 0).
38
+     */
39
+    paths[ 0 ] = sp_path;
40
+    paths[ 1 ] = special_dir;
41
+    paths[ 2 ] = "transcript/special.T";
42
+    paths[ 3 ] = NULL;
43
 
44
-    while ( fgets( line, MAXPATHLEN, fs ) != NULL ) {
45
-	len = strlen( line );
46
-	if (( line[ len - 1 ] ) != '\n' ) {
47
-	    syslog( LOG_ERR, "special_t: %s: line too long", transcript );
48
-	    break;
49
+    for ( i = 0; paths[ i ] != NULL; i++ ) {
50
+	if (( p = strrchr( paths[ i ], '.' )) != NULL
51
+		&& strcmp( p, ".T" ) == 0 ) {
52
+	    if ( strlen( paths[ i ] ) >= MAXPATHLEN ) {
53
+		syslog( LOG_WARNING, "special_t: path \"%s\" too long",
54
+			paths[ i ] );
55
+		continue;
56
+	    }
57
+	    strcpy( sp_t, paths[ i ] );
58
+	} else if ( snprintf( sp_t, MAXPATHLEN, "%s.T",
59
+			      paths[ i ] ) >= MAXPATHLEN ) {
60
+	    syslog( LOG_WARNING, "special_t: path \"%s.T\" too long", sp_path );
61
+	    continue;
62
 	}
63
 
64
-	if (( ac = argcargv( line, &av )) != 8 ) {
65
+	if (( fs = fopen( sp_t, "r" )) == NULL ) {
66
 	    continue;
67
 	}
68
-	if (( *av[ 0 ] != 'f' ) && ( *av[ 0 ] != 'a' )) {
69
-	    continue;
70
+
71
+	ln = 0;
72
+	while ( fgets( line, MAXPATHLEN, fs ) != NULL ) {
73
+	    ln++;
74
+	    len = strlen( line );
75
+	    if (( line[ len - 1 ] ) != '\n' ) {
76
+		syslog( LOG_ERR, "special_t: %s: line %d too long", sp_t, ln );
77
+		break;
78
+	    }
79
+
80
+	    /* only files and applefiles allowed */
81
+	    if ( strncmp( line, "f ", strlen( "f " )) != 0 &&
82
+			strncmp( line, "a ", strlen( "a " )) != 0 ) {
83
+		continue;
84
+	    }
85
+	    if (( ac = argcargv( line, &av )) != 8 ) {
86
+		syslog( LOG_WARNING, "special_t: %s: line %d: "
87
+			"bad transcript line", sp_t, ln );
88
+		continue;
89
+	    }
90
+
91
+	    if ( strcmp( av[ 1 ], remote_path ) == 0 ) { 
92
+		(void)fclose( fs );
93
+		return( av );
94
+	    }
95
 	}
96
 
97
-	if ( strcmp( av[ 1 ], epath ) == 0 ) { 
98
-	    (void)fclose( fs );
99
-	    return( av );
100
+	if ( fclose( fs ) != 0 ) {
101
+	    syslog( LOG_WARNING, "special_t: fclose %s: %m", sp_t );
102
 	}
103
+	fs = NULL;
104
     }
105
-
106
-    (void)fclose( fs );
107
+    if ( fs != NULL ) {
108
+	(void)fclose( fs );
109
+    }
110
+    
111
     return( NULL );
112
 }
113
 
114
@@ -624,11 +676,11 @@
115
     switch ( key ) {
116
     case K_COMMAND:
117
 	if ( ac == 2 ) {
118
-	    snet_writef( sn, "%s %s %o %d %d %d %" PRIofft "d %s\r\n",
119
+	    snet_writef( sn, RADMIND_STAT_FMT,
120
 		"f", "command", DEFAULT_MODE, DEFAULT_UID, DEFAULT_GID,
121
 		st.st_mtime, st.st_size, cksum_b64 );
122
 	} else {
123
-	    snet_writef( sn, "%s %s %o %d %d %d %" PRIofft "d %s\r\n",
124
+	    snet_writef( sn, RADMIND_STAT_FMT,
125
 		"f", av[ 2 ], DEFAULT_MODE, DEFAULT_UID, DEFAULT_GID,
126
 		st.st_mtime, st.st_size, cksum_b64 );
127
 	}
128
@@ -636,61 +688,33 @@
129
         
130
 		    
131
     case K_TRANSCRIPT:
132
-	snet_writef( sn, "%s %s %o %d %d %d %" PRIofft "d %s\r\n",
133
+	snet_writef( sn, RADMIND_STAT_FMT,
134
 		"f", av[ 2 ], 
135
 		DEFAULT_MODE, DEFAULT_UID, DEFAULT_GID,
136
 		st.st_mtime, st.st_size, cksum_b64 );
137
 	return( 0 );
138
     
139
     case K_SPECIAL:
140
-	/*  status on a special file comes from 1 of three cases:
141
-	 *  1. A transcript in the special file directory
142
-	 *  2. A transcript in the Transcript dir with .T appended
143
-	 *  3. No transcript is found, and constants are returned
144
-	 */
145
-
146
-        /* look for transcript containing the information */
147
-	if ( ( strlen( path ) + 2 ) > MAXPATHLEN ) {
148
-	    syslog( LOG_WARNING, 
149
-		"f_stat: transcript path longer than MAXPATHLEN" );
150
-
151
-	    /* return constants */
152
-	    snet_writef( sn, "%s %s %o %d %d %d %" PRIofft "d %s\r\n",
153
-		    "f", av[ 2 ], 
154
-		    DEFAULT_MODE, DEFAULT_UID, DEFAULT_GID,
155
-		    st.st_mtime, st.st_size, cksum_b64 );
156
-	    return( 0 );
157
-	}
158
-
159
-	/* if allowable, check for transcript in the special file directory */
160
-
161
-	strcat( path, ".T" );
162
-
163
-	/* store value of av[ 2 ], because argcargv will be called
164
+	/*
165
+	 * store value of av[ 2 ], because argcargv will be called
166
 	 * from special_t(), and that will blow away the current values
167
-	 * for av[ 2 ]
168
-	 *
169
-	 * Could just use new argvargc API... XXX  Notice how we never free
170
-	 * env_file...
171
+	 * for av[ 2 ].
172
 	 */
173
-
174
 	if (( enc_file = strdup( av[ 2 ] )) == NULL ) {
175
 	    syslog( LOG_ERR, "f_stat: strdup: %s %m", av[ 2 ] );
176
 	    return( -1 );
177
 	}
178
 
179
 	if (( av = special_t( path, enc_file )) == NULL ) {
180
-	    if (( av = special_t( "transcript/special.T", enc_file ))
181
-		    == NULL ) {
182
-		snet_writef( sn, "%s %s %o %d %d %d %" PRIofft "d %s\r\n",
183
-			"f", enc_file, 
184
-			DEFAULT_MODE, DEFAULT_UID, DEFAULT_GID, 
185
-			st.st_mtime, st.st_size, cksum_b64 );
186
-		free( enc_file );
187
-		return( 0 );
188
-	    }
189
+	    /* no special transcript match found, return defaults. */
190
+	    snet_writef( sn, RADMIND_STAT_FMT,
191
+		    "f", enc_file, 
192
+		    DEFAULT_MODE, DEFAULT_UID, DEFAULT_GID, 
193
+		    st.st_mtime, st.st_size, cksum_b64 );
194
+	    free( enc_file );
195
+	    return( 0 );
196
 	}
197
-	snet_writef( sn, "%s %s %s %s %s %d %" PRIofft "d %s\r\n",
198
+	snet_writef( sn, RADMIND_STAT_FMT,
199
 		av[ 0 ], enc_file,
200
 		av[ 2 ], av[ 3 ], av[ 4 ],
201
 		st.st_mtime, st.st_size, cksum_b64 );
202
@@ -1261,8 +1285,7 @@
203
 	    continue;
204
 	}
205
 	if ( strcmp( av[ 0 ], "@include" ) == 0 ) {
206
-	    depth++;
207
-	    if ( depth > RADMIND_MAX_INCLUDE_DEPTH ) {
208
+	    if ( depth >= RADMIND_MAX_INCLUDE_DEPTH ) {
209
 		syslog( LOG_ERR, "%s: line %d: include %s exceeds max depth",
210
 			path_config, linenum, av[ 1 ] );
211
 		goto command_k_done;
212
@@ -1277,7 +1300,7 @@
213
 		    continue;
214
 		}
215
 	    }
216
-	    if ( command_k( av[ 1 ], depth ) != 0 ) {
217
+	    if ( command_k( av[ 1 ], depth + 1 ) != 0 ) {
218
 		continue;
219
 	    }
220
 
221
@@ -1325,7 +1348,8 @@
222
 
223
     /* If we get here, the host that connected is not in the config
224
        file. So screw him. */
225
-    syslog( LOG_ERR, "host not in config file: %s", remote_host );
226
+    syslog( LOG_ERR, "host %s not in config file %s",
227
+		remote_host, path_config );
228
 
229
 command_k_done:
230
     snet_close( sn );
(-)/root/radmind.new/files/patch-command.h (-8 lines)
Lines 1-8 Link Here
1
--- ./command.h.orig	2010-12-13 04:42:49.000000000 +0100
2
+++ ./command.h	2014-06-29 12:15:04.244544161 +0200
3
@@ -13,3 +13,5 @@
4
     char	*c_name;
5
     int		(*c_func)( SNET *, int, char *[] );
6
 };
7
+
8
+#define RADMIND_STAT_FMT "%s %s %o %d %d %" PRItimet "d %" PRIofft "d %s\r\n"
(-)/root/radmind.new/files/patch-configure.ac (-51 lines)
Lines 1-51 Link Here
1
--- ./configure.ac.orig	2010-12-13 04:43:38.000000000 +0100
2
+++ ./configure.ac	2014-06-29 12:15:04.244544161 +0200
3
@@ -44,25 +44,36 @@
4
 
5
 # Check sizes
6
 AC_CHECK_SIZEOF(off_t)
7
+AC_CHECK_SIZEOF(time_t)
8
+
9
+# check early to make any required changes to environment for following tests.
10
+CHECK_UNIVERSAL_BINARIES
11
+
12
+# mute Mac OS X's helpful notices that using dylib OpenSSL
13
+MACOSX_MUTE_DEPRECATION_WARNINGS
14
 
15
 # Checks for libraries.
16
 AC_CHECK_LIB(c, inet_aton, libc_inet_aton=yes) 
17
 if test x$libc_inet_aton != xyes; then 
18
     AC_CHECK_LIB(resolv, inet_aton) 
19
 fi 
20
-AC_CHECK_LIB(c, lchown)
21
-AC_CHECK_LIB(c, lchmod)
22
+if test x$host_vendor = xapply; then
23
+    AC_CHECK_LIB(c, lchown, [AC_DEFINE(HAVE_LCHOWN)], [])
24
+    AC_CHECK_LIB(c, lchmod, [AC_DEFINE(HAVE_LCHMOD)], [])
25
+fi
26
 AC_CHECK_LIB(nsl, gethostbyaddr)
27
 AC_CHECK_LIB([socket], [socket])
28
 AC_CHECK_LIB([ssl], [SSL_accept], , [CHECK_SSL])
29
 AC_CHECK_HEADER([openssl/ssl.h], [], [AC_MSG_ERROR([header file <openssl/ssl.h>
30
 is required for this software.  You may be running RedHat 9.  If so, see the FAQ or the README for further instructions.])])
31
 AC_CHECK_LIB([crypto], [SSLeay_version], , [CHECK_SSL])
32
-AC_CHECK_FUNC([X509_VERIFY_PARAM_set_flags], [AC_DEFINE(HAVE_X509_VERIFY_PARAM)], [])
33
+AC_CHECK_LIB([crypto], [X509_VERIFY_PARAM_set_flags], [AC_DEFINE(HAVE_X509_VERIFY_PARAM)], [])
34
 
35
 # PAM
36
-AC_ARG_WITH([pam], AC_HELP_STRING([--with-pam=yes], [Pluggable Authentication Module support (default: yes)]), [], with_pam=yes)
37
+AC_ARG_WITH([pam], AC_HELP_STRING([--with-pam=PATH], [Pluggable Authentication Module support (default: /usr)]), [], with_pam=/usr)
38
 if test x_"$with_pam" != x_no; then
39
+    CPPFLAGS="${CPPFLAGS} -I$with_pam/include"
40
+    LDFLAGS="${LDFLAGS} -L$with_pam/lib"
41
     AC_CHECK_LIB([pam], [pam_start],
42
 	[
43
 	AC_CHECK_HEADERS(pam/pam_appl.h, , [AC_CHECK_HEADERS(security/pam_appl.h)])
44
@@ -75,7 +86,6 @@
45
 AC_CHECK_LIB(dns_sd, DNSServiceRegister)
46
 
47
 CHECK_ZLIB
48
-CHECK_UNIVERSAL_BINARIES
49
 
50
 # HPUX lacks wait4 and strtoll
51
 AC_CHECK_FUNCS(wait4 strtoll)
(-)/root/radmind.new/files/patch-contrib__specialist (-82 lines)
Lines 1-82 Link Here
1
--- ./contrib/specialist.orig	2014-06-29 12:15:04.244544161 +0200
2
+++ ./contrib/specialist	2014-06-29 12:15:04.245544128 +0200
3
@@ -0,0 +1,79 @@
4
+#! /bin/sh
5
+
6
+# specialist: assist creation of special files.
7
+
8
+PATH=/bin:/usr/bin:/usr/local/bin; export PATH
9
+
10
+SCRIPT=`basename "$0"`
11
+INPUT_FORMAT=${INPUT_FORMAT:=path}
12
+
13
+usage() {
14
+    echo "usage: ${SCRIPT} [ -T ]" 1>&2
15
+    exit 1
16
+}
17
+
18
+die() {
19
+    msg=$*
20
+
21
+    echo "${msg}" 1>&2
22
+    exit 2
23
+}
24
+
25
+# create a special transcript line for the given path.
26
+specialize() {
27
+    local path="$1"
28
+
29
+    [ -n "${path}" -a -f "${path}" ] || die "Invalid path: ${path}"
30
+
31
+    fsdiff -1 -c sha1 "${path}"
32
+    return $?
33
+}
34
+
35
+specialize_transcript() {
36
+    local path=""
37
+    status=0
38
+
39
+    while read type path remainder; do
40
+	if [ x"${type}" != x"f" ]; then
41
+	    continue
42
+	fi
43
+
44
+	specialize "${path}"
45
+    done
46
+}
47
+
48
+specialize_paths() {
49
+    local path=""
50
+    status=0
51
+
52
+    while read path; do
53
+	specialize "${path}"
54
+	if [ $? -ne 0 ]; then
55
+	    status=1
56
+	fi
57
+    done
58
+
59
+    return "${status}"
60
+}
61
+
62
+while getopts T opt; do
63
+    case $opt in
64
+    T)
65
+	INPUT_FORMAT="transcript"
66
+	;;
67
+
68
+    *)
69
+	usage
70
+	;;
71
+	
72
+    esac
73
+done
74
+shift $((OPTIND - 1))
75
+
76
+if [ x"${INPUT_FORMAT}" = x"transcript" ]; then
77
+    specialize_transcript
78
+else
79
+    specialize_paths
80
+fi
81
+
82
+exit $?
(-)/root/radmind.new/files/patch-fsdiff.c (-251 lines)
Lines 1-251 Link Here
1
--- ./fsdiff.c.orig	2010-12-13 04:42:49.000000000 +0100
2
+++ ./fsdiff.c	2014-06-29 12:15:04.245544128 +0200
3
@@ -249,6 +249,144 @@
4
     return;
5
 }
6
 
7
+    static char *
8
+canonicalized_path( char *path )
9
+{
10
+    int			len;
11
+    static char		cpath[ MAXPATHLEN ];
12
+
13
+    if ( path == NULL ) {
14
+	return( NULL );
15
+    }
16
+
17
+    len = strlen( path );
18
+    if ( len >= sizeof( cpath )) {
19
+	fprintf( stderr, "fsdiff: path too long: %s\n", path );
20
+	exit( 2 );
21
+    }
22
+    strcpy( cpath, path );
23
+
24
+    /* Clip trailing '/' */
25
+    if (( len > 1 ) && ( cpath[ len - 1 ] == '/' )) {
26
+	cpath[ len - 1 ] = '\0';
27
+	len--;
28
+    }
29
+
30
+    /*
31
+     * If prefix doesn't contain a directory, canonicalize it by prepending a
32
+     * "./".  This allow paths to be dynamically converted between relative and
33
+     * absolute paths without breaking sort order.
34
+     */
35
+    switch( cpath[ 0 ] ) {
36
+    case '/':
37
+        break;
38
+
39
+    case '.':
40
+	/* Don't rewrite '.' or paths starting with './' */
41
+	if ( len == 1 || cpath[ 1 ] == '/' ) {
42
+	    break;
43
+	}
44
+
45
+    default:
46
+	if ( len + 2 >= sizeof( cpath )) {
47
+	    fprintf( stderr, "fsdiff: path too long: ./%s\n", cpath );
48
+	    exit( 2 );
49
+	}
50
+	memmove( cpath + 2, cpath, len );
51
+	cpath[ 0 ] = '.'; cpath[ 1 ] = '/';
52
+
53
+        break;
54
+    }
55
+
56
+    /*
57
+     * Determine if called with relative or absolute pathing.  Path is relative
58
+     * if it's just '.' or starts with './'.  File names that start with a '.'
59
+     * are absolute.
60
+     */
61
+    if ( cpath[ 0 ] == '.' ) {
62
+	if ( len == 1 ) {
63
+	    tran_format = T_RELATIVE;
64
+	} else if ( cpath[ 1 ] == '/' ) {
65
+	    tran_format = T_RELATIVE;
66
+	} else {
67
+	    tran_format = T_ABSOLUTE;
68
+	}
69
+    } else {
70
+	tran_format = T_ABSOLUTE;
71
+    }
72
+
73
+    return( cpath );
74
+}
75
+
76
+    static void
77
+fsdiff( char *path, char *kfile, int start, int finish, int pdel ) 
78
+{
79
+    struct applefileinfo	afinfo;
80
+    struct stat			st;
81
+    char			type;
82
+    char			lpath[ MAXPATHLEN ];
83
+    int				len;
84
+
85
+    if (( dotfd = open( ".", O_RDONLY, 0 )) < 0 ) {
86
+	perror( "OOPS!" );
87
+	exit( 2 );
88
+    }
89
+
90
+    if ( skip && strcmp( path, "-" ) == 0 ) {
91
+	/* leave excludes in place */
92
+	skip = skip & ~T_SKIP_EXCLUDES;
93
+
94
+	path_prefix = "/";
95
+	transcript_init( kfile, K_CLIENT );
96
+
97
+	/* run -1 against every line we get from stdin */
98
+	while ( fgets( lpath, sizeof( lpath ), stdin ) != NULL ) {
99
+	    len = strlen( lpath );
100
+	    if ( lpath[ len - 1 ] != '\n' ) {
101
+		fprintf( stderr, "fsdiff: fgets: line too long\n" );
102
+		exit( 2 );
103
+	    }
104
+	    lpath[ len - 1 ] = '\0';
105
+	    path = canonicalized_path( lpath );
106
+
107
+	    if ( radstat( path, &st, &type, &afinfo ) != 0 ) {
108
+		if ( errno != ENOENT ) {
109
+		    perror( lpath );
110
+		    exit( 2 );
111
+		}
112
+
113
+		fprintf( stderr, "Warning: %s: %s\n", path, strerror( errno ));
114
+		continue;
115
+	    }
116
+	    (void)transcript( path, &st, &type, &afinfo, pdel );
117
+	}
118
+	if ( ferror( stdin )) {
119
+	    perror( "fgets" );
120
+	    exit( 2 );
121
+	}
122
+    } else {
123
+	path_prefix = canonicalized_path( path );
124
+
125
+	/* initialize the transcripts */
126
+	transcript_init( kfile, K_CLIENT );
127
+
128
+	if ( radstat( path_prefix, &st, &type, &afinfo ) != 0 ) {
129
+	    perror( path_prefix );
130
+	    exit( 2 );
131
+	}
132
+
133
+	fs_walk( path_prefix, &st, &type, &afinfo, start, finish, pdel );
134
+    }
135
+
136
+    if ( finish > 0 ) {
137
+	printf( "%%%d\n", ( int )finish );
138
+    }
139
+
140
+    /* free the transcripts */
141
+    transcript_free( );
142
+    hardlink_free( );
143
+}
144
+
145
     int
146
 main( int argc, char **argv ) 
147
 {
148
@@ -258,9 +396,6 @@
149
     int 		c, len, edit_path_change = 0;
150
     int 		errflag = 0, use_outfile = 0;
151
     int			finish = 0;
152
-    struct stat		st;
153
-    char		type, buf[ MAXPATHLEN ];
154
-    struct applefileinfo	afinfo;
155
 
156
     edit_path = CREATABLE;
157
     cksum = 0;
158
@@ -300,7 +435,7 @@
159
 	    break;
160
 
161
 	case '1':
162
-	    skip = 1;
163
+	    skip = T_SKIP_ALL;
164
 	case 'C':
165
 	    edit_path_change++;
166
 	    edit_path = CREATABLE;
167
@@ -347,82 +482,13 @@
168
     }
169
 
170
     if ( errflag || ( argc - optind != 1 )) {
171
-	fprintf( stderr, "usage: %s { -C | -A | -1 } [ -IVW ] ", argv[ 0 ] );
172
+	fprintf( stderr, "usage: %s { -C | -A | -1 } " "[ -IVW ] ", argv[ 0 ] );
173
 	fprintf( stderr, "[ -K command ] " );
174
 	fprintf( stderr, "[ -c checksum ] [ -o file [ -%% ] ] path\n" );
175
 	exit ( 2 );
176
     }
177
 
178
-    path_prefix = argv[ optind ];
179
-    len = strlen( path_prefix );
180
-
181
-    /* Clip trailing '/' */
182
-    if (( len > 1 ) && ( path_prefix[ len - 1 ] == '/' )) {
183
-	path_prefix[ len - 1 ] = '\0';
184
-	len--;
185
-    }
186
-
187
-    /* If path_prefix doesn't contain a directory, canonicalize it by
188
-     * prepending a "./".  This allow paths to be dynamically converted between
189
-     * relative and absolute paths without breaking sort order.
190
-     */
191
-    switch( path_prefix[ 0 ] ) {
192
-    case '/':
193
-        break;
194
-
195
-    case '.':
196
-	/* Don't rewrite '.' or paths starting with './' */
197
-	if (( len == 1 ) || (  path_prefix[ 1 ] == '/' )) {
198
-	    break;
199
-	}
200
-    default:
201
-        if ( snprintf( buf, sizeof( buf ), "./%s",
202
-                path_prefix ) >= MAXPATHLEN ) {
203
-            fprintf( stderr, "path too long\n" );
204
-            exit( 2 );
205
-        }
206
-	path_prefix = buf;
207
-        break;
208
-    }
209
-
210
-    /* Determine if called with relative or absolute pathing.  Path is relative
211
-     * if it's just '.' or starts with './'.  File names that start with a '.'
212
-     * are absolute.
213
-     */
214
-    if ( path_prefix[ 0 ] == '.' ) {
215
-	if ( len == 1 ) {
216
-	    tran_format = T_RELATIVE;
217
-	} else if ( path_prefix[ 1 ] == '/' ) {
218
-	    tran_format = T_RELATIVE;
219
-	} else {
220
-	    tran_format = T_ABSOLUTE;
221
-	}
222
-    } else {
223
-	tran_format = T_ABSOLUTE;
224
-    }
225
-
226
-    if ( radstat( path_prefix, &st, &type, &afinfo ) != 0 ) {
227
-	perror( path_prefix );
228
-	exit( 2 );
229
-    }
230
-
231
-    if (( dotfd = open( ".", O_RDONLY, 0 )) < 0 ) {
232
-	perror( "OOPS!" );
233
-	exit( 2 );
234
-    }
235
-
236
-    /* initialize the transcripts */
237
-    transcript_init( kfile, K_CLIENT );
238
-
239
-    fs_walk( path_prefix, &st, &type, &afinfo, 0, finish, 0 );
240
-
241
-    if ( finish > 0 ) {
242
-	printf( "%%%d\n", ( int )finish );
243
-    }
244
-
245
-    /* free the transcripts */
246
-    transcript_free( );
247
-    hardlink_free( );
248
+    fsdiff( argv[ optind ], kfile, 0, finish, 0 );
249
 
250
     /* close the output file */     
251
     fclose( outtran );
(-)/root/radmind.new/files/patch-ktcheck.c (-20 lines)
Lines 1-20 Link Here
1
--- ./ktcheck.c.orig	2010-12-13 04:42:49.000000000 +0100
2
+++ ./ktcheck.c	2014-06-29 12:15:04.245544128 +0200
3
@@ -459,7 +459,7 @@
4
 	perror( "Incorrect number of arguments\n" );
5
 	return( 2 );
6
     }
7
-    times.modtime = atoi( targv[ 5 ] );
8
+    times.modtime = strtotimet( targv[ 5 ], NULL, 10 );
9
     times.actime = time( NULL );
10
 
11
     if (( stat( path, &st )) != 0 ) {
12
@@ -506,7 +506,7 @@
13
 		needupdate = 1;
14
 	    }
15
 	} else {
16
-	    if ( atoi( targv[ 5 ] ) != (int)st.st_mtime )  {
17
+	    if ( strtotimet( targv[ 5 ], NULL, 10 ) != st.st_mtime )  {
18
 		needupdate = 1;
19
 	    }
20
 	}
(-)/root/radmind.new/files/patch-lapply.c (-52 lines)
Lines 1-52 Link Here
1
--- ./lapply.c.orig	2010-12-13 04:42:49.000000000 +0100
2
+++ ./lapply.c	2014-06-29 12:15:04.246544121 +0200
3
@@ -651,27 +651,37 @@
4
 filechecklist:
5
 		if ( head == NULL ) {
6
 		    if ( unlink( path ) != 0 ) {
7
-			perror( path );
8
-			goto error2;
9
-		    }
10
-		    if ( !quiet && !showprogress ) {
11
-			printf( "%s: deleted\n", path );
12
-		    }
13
-		    if ( showprogress ) {
14
-			progressupdate( PROGRESSUNIT, path );
15
-		    }
16
-		} else {
17
-		    if ( ischildcase( path, head->path, case_sensitive )) {
18
-			if ( unlink( path ) != 0 ) {
19
+			if ( !force || errno != ENOENT ) {
20
 			    perror( path );
21
 			    goto error2;
22
 			}
23
+			fprintf( stderr, "Warning: failed to remove %s: %s\n",
24
+				path, strerror( errno ));
25
+		    } else {
26
 			if ( !quiet && !showprogress ) {
27
 			    printf( "%s: deleted\n", path );
28
 			}
29
 			if ( showprogress ) {
30
 			    progressupdate( PROGRESSUNIT, path );
31
 			}
32
+		    }
33
+		} else {
34
+		    if ( ischildcase( path, head->path, case_sensitive )) {
35
+			if ( unlink( path ) != 0 ) {
36
+			    if ( !force || errno != ENOENT ) {
37
+				perror( path );
38
+				goto error2;
39
+			    }
40
+			    fprintf( stderr, "Warning: failed to remove %s: "
41
+				    "%s\n", path, strerror( errno ));
42
+			} else {
43
+			    if ( !quiet && !showprogress ) {
44
+				printf( "%s: deleted\n", path );
45
+			    }
46
+			    if ( showprogress ) {
47
+				progressupdate( PROGRESSUNIT, path );
48
+			    }
49
+			}
50
 		    } else {
51
 			/* remove head */
52
 			if ( rmdir( head->path ) != 0 ) {
(-)/root/radmind.new/files/patch-largefile.h (-18 lines)
Lines 1-18 Link Here
1
--- ./largefile.h.orig	2010-12-13 04:42:49.000000000 +0100
2
+++ ./largefile.h	2014-06-29 12:15:04.246544121 +0200
3
@@ -18,3 +18,15 @@
4
 #define strtoofft(x,y,z)	(strtol((x),(y),(z)))
5
 #define PRIofft			"l"
6
 #endif
7
+
8
+#if SIZEOF_TIME_T == 8
9
+    #ifdef HAVE_STRTOLL
10
+    #define strtotimet(x,y,z)	(strtoll((x),(y),(z)))
11
+    #else /* !HAVE_STRTOLL */
12
+    #define strtotimet(x,y,z)	(strtol((x),(y),(z)))
13
+    #endif /* HAVE_STRTOLL */
14
+    #define PRItimet		"ll"
15
+#else /* SIZEOF_TIME_T != 8 */
16
+    #define strtotimet(x,y,z)	(strtol((x),(y),(z)))
17
+    #define PRItimet		"l"
18
+#endif /* SIZEOF_TIME_T */
(-)/root/radmind.new/files/patch-lcksum.c (-35 lines)
Lines 1-35 Link Here
1
--- ./lcksum.c.orig	2010-12-13 04:42:49.000000000 +0100
2
+++ ./lcksum.c	2014-06-29 12:15:04.247544144 +0200
3
@@ -434,7 +434,7 @@
4
 		/* Check to see if checksum is listed in transcript */
5
 		if ( strcmp( targv[ 7 ], "-" ) != 0) {
6
 		    /* use mtime from server */
7
-		    fprintf( ufs, "%s %-37s %4s %5s %5s %9ld "
8
+		    fprintf( ufs, "%s %-37s %4s %5s %5s %9" PRItimet "d "
9
 			    "%7" PRIofft "d %s\n",
10
 			targv[ 0 ], targv[ 1 ], targv[ 2 ], targv[ 3 ],
11
 			targv[ 4 ], st.st_mtime, st.st_size, lcksum );
12
@@ -457,6 +457,12 @@
13
 	}
14
 	free( line );
15
     }
16
+    if ( fclose( f ) != 0 ) {
17
+	fprintf( stderr, "%s: fclose failed: %s\n", path, strerror( errno ));
18
+	cleanup( updatetran, upath );
19
+	exit( 2 );
20
+    }
21
+
22
     if ( showprogress ) {
23
 	progressupdate( bytes, "" );
24
     }
25
@@ -496,6 +502,10 @@
26
 badline:
27
     exitval = 1;
28
 
29
+    if ( fclose( f ) != 0 ) {
30
+	fprintf( stderr, "%s: fclose failed: %s\n", path, strerror( errno ));
31
+    }
32
+
33
     if ( checkall ) {
34
 	goto done;
35
     } else {
(-)/root/radmind.new/files/patch-Makefile.in (-98 lines)
Lines 1-98 Link Here
1
--- Makefile.in.orig	2010-12-13 04:43:49.000000000 +0100
2
+++ Makefile.in	2014-06-29 13:32:18.069225436 +0200
3
@@ -204,37 +204,37 @@
4
 radmind : libsnet/libsnet.la ${RADMIND_OBJ} Makefile
5
 	${CC} ${CFLAGS} -o radmind ${RADMIND_OBJ} ${LDFLAGS}
6
 
7
-fsdiff : ${FSDIFF_OBJ}
8
+fsdiff : libsnet/libsnet.la ${FSDIFF_OBJ}
9
 	${CC} ${CFLAGS} -o fsdiff ${FSDIFF_OBJ} ${LDFLAGS}
10
 
11
-ktcheck: ${KTCHECK_OBJ}
12
+ktcheck: libsnet/libsnet.la ${KTCHECK_OBJ}
13
 	${CC} ${CFLAGS} -o ktcheck ${KTCHECK_OBJ} ${LDFLAGS}
14
 
15
-lapply: ${LAPPLY_OBJ}
16
+lapply: libsnet/libsnet.la ${LAPPLY_OBJ}
17
 	${CC} ${CFLAGS} -o lapply ${LAPPLY_OBJ} ${LDFLAGS}
18
 
19
-lcksum: ${LCKSUM_OBJ}
20
+lcksum: libsnet/libsnet.la ${LCKSUM_OBJ}
21
 	${CC} ${CFLAGS} -o lcksum ${LCKSUM_OBJ} ${LDFLAGS}
22
 
23
-lcreate: ${LCREATE_OBJ}
24
+lcreate: libsnet/libsnet.la ${LCREATE_OBJ}
25
 	${CC} ${CFLAGS} -o lcreate ${LCREATE_OBJ} ${LDFLAGS}
26
 
27
-lmerge: ${LMERGE_OBJ}
28
+lmerge: libsnet/libsnet.la ${LMERGE_OBJ}
29
 	${CC} ${CFLAGS} -o lmerge ${LMERGE_OBJ} ${LDFLAGS}
30
 
31
-lfdiff: ${LFDIFF_OBJ}
32
+lfdiff: libsnet/libsnet.la ${LFDIFF_OBJ}
33
 	${CC} ${CFLAGS} -o lfdiff ${LFDIFF_OBJ} ${LDFLAGS}
34
 
35
-repo : ${REPO_OBJ}
36
+repo: libsnet/libsnet.la ${REPO_OBJ}
37
 	${CC} ${CFLAGS} -o repo ${REPO_OBJ} ${LDFLAGS}
38
 
39
 t2pkg: ${T2PKG_OBJ}
40
 	${CC} ${CFLAGS} -o t2pkg ${T2PKG_OBJ} ${LDFLAGS}
41
 
42
-twhich: ${TWHICH_OBJ}
43
+twhich: libsnet/libsnet.la ${TWHICH_OBJ}
44
 	${CC} ${CFLAGS} -o twhich ${TWHICH_OBJ} ${LDFLAGS}
45
 
46
-lsort: ${LSORT_OBJ}
47
+lsort: libsnet/libsnet.la ${LSORT_OBJ}
48
 	${CC} ${CFLAGS} -o lsort ${LSORT_OBJ} ${LDFLAGS}
49
 
50
 FRC :
51
@@ -259,7 +259,7 @@
52
 	(cd .. && tar cvfz ${DISTDIR}.tar.gz ${DISTDIR})
53
 
54
 rash : FRC
55
-	-mkdir tmp
56
+	-mkdir -p tmp
57
 	sed -e 's@_RADMIND_HOST@${RADMIND_HOST}@g' \
58
 	    -e 's@_RADMIND_AUTHLEVEL@${RADMIND_AUTHLEVEL}@g' \
59
 	    -e 's@_RADMIND_PREAPPLY@${PREAPPLYDIR}@g' \
60
@@ -273,8 +273,7 @@
61
 	    ${srcdir}/ra.sh > tmp/ra.sh; 
62
 
63
 man : FRC
64
-	-mkdir tmp
65
-	-mkdir tmp/man
66
+	-mkdir -p tmp/man
67
 	pwd
68
 	for i in ${MANTARGETS}; do \
69
 	    sed -e 's@_RADMIND_PATH@${RADMINDDIR}@g'  \
70
@@ -290,23 +289,22 @@
71
 install	: all man rash
72
 	-mkdir -p ${DESTDIR}/${exec_prefix}
73
 	-mkdir -p ${DESTDIR}/${SBINDIR}
74
-	${INSTALL} -m 0755 -c radmind ${DESTDIR}/${SBINDIR}/
75
+	${INSTALL} -s -m 0755 -c radmind ${DESTDIR}/${SBINDIR}/
76
 	-mkdir -p ${DESTDIR}/${BINDIR}
77
 	for i in ${BINTARGETS}; do \
78
-	    ${INSTALL} -m 0755 -c $$i ${DESTDIR}/${BINDIR}/; \
79
+	    ${INSTALL} -s -m 0755 -c $$i ${DESTDIR}/${BINDIR}/; \
80
 	done
81
 	${INSTALL} -m 0755 -c tmp/ra.sh ${DESTDIR}/${BINDIR}/
82
 	-mkdir -p ${DESTDIR}/${prefix}
83
-	-mkdir -p ${DESTDIR}/${MANDIR}
84
-	-mkdir ${DESTDIR}/${MANDIR}/man1
85
+	-mkdir -p ${DESTDIR}/${MANDIR}/man1
86
 	for i in ${MAN1TARGETS}; do \
87
 	    ${INSTALL} -m 0644 -c tmp/man/$$i ${DESTDIR}/${MANDIR}/man1/; \
88
 	done
89
-	-mkdir ${DESTDIR}/${MANDIR}/man5
90
+	-mkdir -p ${DESTDIR}/${MANDIR}/man5
91
 	for i in ${MAN5TARGETS}; do \
92
 	    ${INSTALL} -m 0644 -c tmp/man/$$i ${DESTDIR}/${MANDIR}/man5/; \
93
 	done
94
-	-mkdir ${DESTDIR}/${MANDIR}/man8
95
+	-mkdir -p ${DESTDIR}/${MANDIR}/man8
96
 	 for i in ${MAN8TARGETS}; do \
97
 	    ${INSTALL} -m 0644 -c tmp/man/$$i ${DESTDIR}/${MANDIR}/man8/; \
98
 	done
(-)/root/radmind.new/files/patch-man__lcreate.1 (-15 lines)
Lines 1-15 Link Here
1
--- ./man/lcreate.1.orig	2010-12-13 04:50:53.000000000 +0100
2
+++ ./man/lcreate.1	2014-06-29 12:15:04.247544144 +0200
3
@@ -45,12 +45,6 @@
4
 .sp
5
 If the -n option is given, no files or transcripts are uploaded.  Instead,
6
 .B lcreate
7
-verifies that all files exist in the filesystem and have
8
-the same size as listed in the transcript.  If used with the -c option,
9
-checksums are also verified.
10
-.sp
11
-If the -n option is given, no files or transcripts are uploaded.  Instead,
12
-.B lcreate
13
 uses 
14
 .BR access (2)
15
 to verify that all files in the transcript exist in the
(-)/root/radmind.new/files/patch-man__rash.1 (-38 lines)
Lines 1-38 Link Here
1
--- ./man/rash.1.orig	2010-12-13 04:50:53.000000000 +0100
2
+++ ./man/rash.1	2014-06-29 12:15:04.247544144 +0200
3
@@ -11,6 +11,10 @@
4
 |
5
 .B -q
6
 ] [
7
+.BR \-C\  "generate"
8
+|
9
+.BI \-C\  checksum
10
+] [
11
 .B \-D
12
 .I workingdir
13
 ] [
14
@@ -120,6 +124,24 @@
15
 .B \-c
16
 use sha1 checksums.
17
 .TP 19
18
+.BR \-C\  "generate"
19
+Print a sha1 checksum of the difference transcript of applied changes. For use with
20
+.IR auto ,
21
+.IR force
22
+or
23
+.IR update .
24
+.TP 19
25
+.BI \-C\  checksum
26
+In
27
+.I auto
28
+mode, exit with an error if the checksum of the difference transcript to be applied does not match
29
+.IR checksum .
30
+In
31
+.I update
32
+or
33
+.I force
34
+mode, warn if the two do not match.
35
+.TP 19
36
 .BI \-D\  workingdir
37
 change to
38
 .I workingdir
(-)/root/radmind.new/files/patch-mkdirs.c (-13 lines)
Lines 1-13 Link Here
1
--- ./mkdirs.c.orig	2010-12-13 04:42:49.000000000 +0100
2
+++ ./mkdirs.c	2014-06-29 12:15:04.247544144 +0200
3
@@ -37,7 +37,9 @@
4
 	if ( mkdir( path, 0777 ) == 0 ) {
5
 	    break;
6
 	}
7
-	if ( errno != ENOENT ) {
8
+	if ( errno == EEXIST ) {
9
+	    break;
10
+	} else if ( errno != ENOENT ) {
11
 	    return( -1 );
12
 	}
13
 	q = p;
(-)/root/radmind.new/files/patch-ra.sh (-139 lines)
Lines 1-139 Link Here
1
--- ./ra.sh.orig	2010-12-13 04:42:49.000000000 +0100
2
+++ ./ra.sh	2014-06-29 12:15:04.248542975 +0200
3
@@ -91,7 +91,7 @@
4
 }
5
 
6
 usage() {
7
-    $ECHO "Usage:	$0 [ -ctV ] [ -D working-directory ] [ -h server ] [ -p port ] [ -w authlevel ] { trip | update | create | auto | force | checkout | checkin } [ /path/or/file ]" >&2
8
+    $ECHO "Usage:	$0 [ -cIltV ] [ -% | -q ] [ -C \"generate\" | -C <checksum> ] [ -D working-directory ] [ -h server ] [ -p port ] [ -w authlevel ] { trip | update | create | auto | force | checkout | checkin } [ /path/or/file ]" >&2
9
     exit 1
10
 }
11
 
12
@@ -128,6 +128,38 @@
13
     fi
14
 }
15
 
16
+cksum_generate() {
17
+    if [ -n "$FSDIFF_CHECKSUM" ]; then
18
+	FTMP_CHECKSUM=`openssl sha1 ${FTMP} | awk '{ print $2 }'`
19
+    fi
20
+}
21
+
22
+cksum_compare() {
23
+    if [ -n "$FSDIFF_CHECKSUM" -a \
24
+	    "$FSDIFF_CHECKSUM" != "generate" -a \
25
+	    "$FSDIFF_CHECKSUM" != "$FTMP_CHECKSUM" ]; then
26
+	return 1
27
+    fi
28
+
29
+    return 0
30
+}
31
+
32
+cksum_print() {
33
+    if [ -n "$FSDIFF_CHECKSUM" ]; then
34
+	$ECHO "Difference transcript checksum: $FTMP_CHECKSUM"
35
+    fi
36
+}
37
+
38
+cksum_mismatch() {
39
+    if [ -n "$FSDIFF_CHECKSUM" ]; then
40
+	$ECHO
41
+	$ECHO "**** Difference transcript checksum mismatch!"
42
+	$ECHO "****	Expected: $FSDIFF_CHECKSUM"
43
+	$ECHO "****	Actual:   $FTMP_CHECKSUM"
44
+	#ECHO
45
+    fi
46
+}
47
+
48
 update() {
49
     opt="$1"
50
     kopt=
51
@@ -211,6 +243,11 @@
52
     fi
53
     if [ x"${opt}" = x"interactive" ]; then
54
 	while [ 1 ]; do
55
+	    cksum_generate
56
+	    if ! cksum_compare; then
57
+		cksum_mismatch
58
+	    fi
59
+
60
 	    if [ x"${can_edit}" = x"yes" ]; then
61
 		$ECHO -n "(e)dit difference transcript, "
62
 	    fi
63
@@ -248,7 +285,8 @@
64
 		
65
     lapply ${CASE} ${PROGRESS} ${NETOPTS} ${CHECKSUM} ${FTMP}
66
     case "$?" in
67
-    0)	;;
68
+    0)	cksum_print
69
+	;;
70
 
71
     *)  if [ x"$opt" = x"hook" ]; then
72
 	    $ECHO -n "Applying changes failed, trying again "
73
@@ -284,7 +322,7 @@
74
     . "${DEFAULTS}"
75
 fi
76
 
77
-while getopts %cD:h:Ilp:qr:tU:Vw: opt; do
78
+while getopts %C:cD:h:Ilp:qr:tU:Vw: opt; do
79
     case $opt in
80
     %)  PROGRESS="-%"
81
 	FPROGRESS="-%"
82
@@ -293,6 +331,13 @@
83
     q)  PROGRESS="-q"
84
 	;;
85
 
86
+    C)	FSDIFF_CHECKSUM="$OPTARG"
87
+	if ! type openssl >/dev/null 2>&1; then
88
+	    $ECHO "-C requires openssl, but no openssl found in PATH $PATH"
89
+	    cleanup_and_exit
90
+	fi
91
+	;;
92
+
93
     c)	CHECKSUM="-csha1"
94
 	;;
95
 
96
@@ -524,6 +569,14 @@
97
 		cleanup
98
 		exit 1
99
 	    fi
100
+
101
+	    cksum_generate
102
+	    if ! cksum_compare; then
103
+		$ECHO "Auto failure: `hostname`: difference cksum mismatch" 
104
+		cksum_mismatch
105
+		cleanup_and_exit
106
+	    fi
107
+
108
 	    dopreapply ${FTMP}
109
 	    if [ -s ${FTMP} ]; then
110
 		lapply ${NETOPTS} ${CASE} ${PROGRESS} \
111
@@ -532,6 +585,7 @@
112
 		0)
113
 		    $ECHO Auto update: `hostname`
114
 		    cat ${FTMP}
115
+		    cksum_print
116
 		    dopostapply ${FTMP}
117
 		    cleanup
118
 		    break
119
@@ -588,14 +642,17 @@
120
 	exit 0
121
     fi
122
     
123
+    cksum_generate
124
+    cksum_compare || cksum_mismatch
125
     dopreapply ${FTMP}
126
     lapply ${CASE} ${PROGRESS} ${NETOPTS} ${CHECKSUM} ${FTMP}
127
     case "$?" in
128
-    0)	;;
129
+    0)	cksum_print
130
+	;;
131
 
132
     *)	cleanup
133
-	    exit $?
134
-	    ;;
135
+	exit $?
136
+	;;
137
     esac
138
     dopostapply ${FTMP}
139
     
(-)/root/radmind.new/files/patch-README (-46 lines)
Lines 1-46 Link Here
1
--- ./README.orig	2010-12-13 04:42:49.000000000 +0100
2
+++ ./README	2014-06-29 12:15:04.242543988 +0200
3
@@ -72,25 +72,25 @@
4
   % "env CPPFLAGS=-I/usr/kerberos/include ./configure"
5
 
6
 -----------------
7
-Building from CVS
8
+Building from git
9
 -----------------
10
 The Radmind Development Team occasionally asks for help testing a new feature
11
 or bug fix. The best way to assist is to download the source code from the
12
-CVS repository and build it manually. The following steps will result in
13
-a build from CVS.
14
+git repository and build it manually. The following steps will result in
15
+a build from git.
16
 
17
-1) Download the source from CVS:
18
+1) Download the source from git:
19
 
20
-cvs -d :pserver:anonymous@radmind.cvs.sourceforge.net:/cvsroot/radmind \
21
-	checkout radmind
22
+    git clone git://radmind.git.sourceforge.net/gitroot/radmind/radmind
23
 
24
 2) Move into the new radmind directory:
25
 
26
-cd radmind
27
+    cd radmind
28
 
29
-3) Download libsnet[1], the network library Radmind uses:
30
+3) Checkout all required submodules [1]:
31
 
32
-sh bin/getsnet
33
+    git submodule init
34
+    git submodule update
35
 
36
 4) Follow steps 2 and 3 from "More detailed instructions" for building, above.
37
 
38
@@ -115,4 +115,7 @@
39
 ----------
40
 References
41
 ----------
42
-[1]: http://sourceforge.net/projects/libsnet
43
+[1]: Current submodules:
44
+
45
+    * libsnet, a networking library with TLS support
46
+	http://sourceforge.net/projects/libsnet
(-)/root/radmind.new/files/patch-t2pkg.c (-46 lines)
Lines 1-46 Link Here
1
--- ./t2pkg.c.orig	2010-12-13 04:42:49.000000000 +0100
2
+++ ./t2pkg.c	2014-06-29 12:15:04.248542975 +0200
3
@@ -38,6 +38,7 @@
4
 extern off_t	lsize;
5
 extern char	*version;
6
 
7
+int		tran_format = -1;
8
 int		cksum = 0;
9
 int		force = 0;
10
 int		case_sensitive = 1;
11
@@ -718,31 +719,23 @@
12
 	}
13
 
14
 	/* create the destination path */
15
-	if ( snprintf( tmp, MAXPATHLEN, "%s/%s", dstdir, t->t_pinfo.pi_name )
16
+	if ( snprintf( dst, MAXPATHLEN, "%s/%s", dstdir, t->t_pinfo.pi_name )
17
 		>= MAXPATHLEN ) {
18
 	    fprintf( stderr, "%s/%s: path too long\n", dstdir,
19
 			t->t_pinfo.pi_name );
20
 	    exit( 2 );
21
 	}
22
-	if ( mkdirs( tmp ) < 0 ) {
23
-	    fprintf( stderr, "mkdirs %s: %s\n", tmp, strerror( errno ));
24
-	}
25
-	if ( realpath( tmp, dst ) == NULL ) {
26
-	    fprintf( stderr, "realpath %s: %s\n", tmp, strerror( errno ));
27
-	    exit( 2 );
28
+	if ( mkdirs( dst ) < 0 ) {
29
+	    fprintf( stderr, "mkdirs %s: %s\n", dst, strerror( errno ));
30
 	}
31
 
32
 	/* and the source path */
33
-	if ( snprintf( tmp, MAXPATHLEN, "%s/%s", root, t->t_pinfo.pi_name )
34
+	if ( snprintf( src, MAXPATHLEN, "%s/%s", root, t->t_pinfo.pi_name )
35
 		>= MAXPATHLEN ) {
36
 	    fprintf( stderr, "%s/%s: path too long\n", dstdir,
37
 			t->t_pinfo.pi_name );
38
 	    exit( 2 );
39
 	}
40
-	if ( realpath( tmp, src ) == NULL ) {
41
-	    fprintf( stderr, "realpath %s: %s\n", tmp, strerror( errno ));
42
-	    exit( 2 );
43
-	}
44
 
45
 	if ( local_update( t, dst, src, where ) != 0 ) {
46
 	    /* XXX is this really a good idea? */
(-)/root/radmind.new/files/patch-transcript.c (-133 lines)
Lines 1-133 Link Here
1
--- ./transcript.c.orig	2010-12-13 04:42:49.000000000 +0100
2
+++ ./transcript.c	2014-06-29 12:15:04.249543651 +0200
3
@@ -45,7 +45,7 @@
4
 
5
 char				*path_prefix = NULL;
6
 int				edit_path;
7
-int				skip;
8
+int				skip = 0;
9
 int				cksum;
10
 int				fs_minus;
11
 int				exclude_warnings = 0;
12
@@ -271,7 +271,7 @@
13
 	tran->t_pinfo.pi_stat.st_mode = strtol( argv[ 2 ], NULL, 8 );
14
 	tran->t_pinfo.pi_stat.st_uid = atoi( argv[ 3 ] );
15
 	tran->t_pinfo.pi_stat.st_gid = atoi( argv[ 4 ] );
16
-	tran->t_pinfo.pi_stat.st_mtime = atoi( argv[ 5 ] );
17
+	tran->t_pinfo.pi_stat.st_mtime = strtotimet( argv[ 5 ], NULL, 10 );
18
 	tran->t_pinfo.pi_stat.st_size = strtoofft( argv[ 6 ], NULL, 10 );
19
 	if ( tran->t_type != T_NEGATIVE ) {
20
 	    if (( cksum ) && ( strcmp( "-", argv [ 7 ] ) == 0  )) {
21
@@ -436,12 +436,13 @@
22
 	 * but the corresponding transcript is negative, hence, retain
23
 	 * the file system's mtime.  Woof!
24
 	 */
25
-	fprintf( outtran, "%c %-37s\t%.4lo %5d %5d %9d %7" PRIofft "d %s\n",
26
+	fprintf( outtran, "%c %-37s\t%.4lo %5d %5d %9" PRItimet "d "
27
+			  "%7" PRIofft "d %s\n",
28
 		cur->pi_type, epath,
29
 		(unsigned long)( T_MODE & cur->pi_stat.st_mode ), 
30
 		(int)cur->pi_stat.st_uid, (int)cur->pi_stat.st_gid,
31
 		( flag == PR_STATUS_NEG ) ?
32
-			(int)fs->pi_stat.st_mtime : (int)cur->pi_stat.st_mtime,
33
+			fs->pi_stat.st_mtime : cur->pi_stat.st_mtime,
34
 		cur->pi_stat.st_size, cur->pi_cksum_b64 );
35
 	break;
36
 
37
@@ -723,7 +724,7 @@
38
 	    if ( begin_tran->t_type != T_SPECIAL &&
39
 		    t_exclude( begin_tran->t_pinfo.pi_name )) {
40
 		if ( exclude_warnings ) {
41
-		    fprintf( stderr, "Warning: excluding %s\n",
42
+		    printf( "#! Warning: excluding %s\n",
43
 				begin_tran->t_pinfo.pi_name );
44
 		}
45
 		transcript_parse( begin_tran );
46
@@ -769,7 +770,7 @@
47
 	    if ( list_size( special_list ) <= 0
48
 		    || list_check( special_list, path ) == 0 ) {
49
 		if ( exclude_warnings ) {
50
-		    fprintf( stderr, "Warning: excluding %s\n", path );
51
+		    printf( "#! Warning: excluding %s\n", path );
52
 		}
53
 
54
 		/* move the transcripts ahead */
55
@@ -949,7 +950,7 @@
56
      */
57
     t_new( T_NULL, NULL, NULL, NULL );
58
 
59
-    if ( skip ) {
60
+    if ( skip == T_SKIP_ALL ) {
61
 	return;
62
     }
63
 
64
@@ -985,15 +986,17 @@
65
 	exit( 2 );
66
     }
67
 
68
-    if (( list_size( special_list ) > 0 ) && ( location == K_CLIENT )) {
69
-	/* open the special transcript if there were any special files */
70
-	if ( strlen( kdir ) + strlen( special ) + 2 > MAXPATHLEN ) {
71
-	    fprintf( stderr, 
72
-		    "special path too long: %s%s\n", kdir, special );
73
-	    exit( 2 );
74
+    if ( !( skip & T_SKIP_SPECIAL )) {
75
+	if (( list_size( special_list ) > 0 ) && ( location == K_CLIENT )) {
76
+	    /* open the special transcript if there were any special files */
77
+	    if ( strlen( kdir ) + strlen( special ) + 2 > MAXPATHLEN ) {
78
+		fprintf( stderr, 
79
+			"special path too long: %s%s\n", kdir, special );
80
+		exit( 2 );
81
+	    }
82
+	    sprintf( fullpath, "%s%s", kdir, special );
83
+	    t_new( T_SPECIAL, fullpath, special, "special" );
84
 	}
85
-	sprintf( fullpath, "%s%s", kdir, special );
86
-	t_new( T_SPECIAL, fullpath, special, "special" );
87
     }
88
 
89
     if ( tran_head->t_type == T_NULL  && edit_path == APPLICABLE ) {
90
@@ -1108,6 +1111,10 @@
91
 	    break;
92
 
93
 	case 'n':				/* negative */
94
+	    if ( skip & T_SKIP_NEGATIVE ) {
95
+		break;
96
+	    }
97
+
98
 	    if ( minus ) { 
99
 		t_remove( T_NEGATIVE, av[ 1 ] );
100
 	    } else {
101
@@ -1116,6 +1123,10 @@
102
 	    break;
103
 
104
 	case 'p':				/* positive */
105
+	    if ( skip & T_SKIP_POSITIVE ) {
106
+		break;
107
+	    }
108
+
109
 	    if ( minus ) {
110
 		t_remove( T_POSITIVE, av[ 1 ] );
111
 	    } else {
112
@@ -1124,6 +1135,10 @@
113
 	    break;
114
 
115
 	case 'x':				/* exclude */
116
+	    if ( skip & T_SKIP_EXCLUDES ) {
117
+		break;
118
+	    }
119
+
120
 	    if (( d_pattern = decode( av[ 1 ] )) == NULL ) {
121
 		fprintf( stderr, "%s: line %d: decode buffer too small\n",
122
 		    kfile, linenum );
123
@@ -1149,6 +1164,10 @@
124
 	    break;
125
 
126
 	case 's':				/* special */
127
+	    if ( skip & T_SKIP_SPECIAL ) {
128
+		break;
129
+	    }
130
+
131
 	    path = av[ 1 ];
132
 
133
 	    /* Convert path to match transcript type */
(-)/root/radmind.new/files/patch-transcript.h (-17 lines)
Lines 1-17 Link Here
1
--- ./transcript.h.orig	2010-12-13 04:42:49.000000000 +0100
2
+++ ./transcript.h	2014-06-29 12:15:04.249543651 +0200
3
@@ -39,6 +39,14 @@
4
 extern FILE		*outtran;
5
 extern char		*path_prefix;
6
 
7
+
8
+#define T_SKIP_POSITIVE		(1 << 1)
9
+#define T_SKIP_NEGATIVE		(1 << 2)
10
+#define T_SKIP_SPECIAL		(1 << 3)
11
+#define T_SKIP_EXCLUDES		(1 << 4)
12
+#define	T_SKIP_ALL		(T_SKIP_POSITIVE | T_SKIP_NEGATIVE | \
13
+				 T_SKIP_SPECIAL | T_SKIP_EXCLUDES)
14
+
15
 struct pathinfo {
16
     char			pi_type;
17
     int				pi_minus;
(-)/root/radmind.new/files/patch-update.c (-19 lines)
Lines 1-19 Link Here
1
--- ./update.c.orig	2010-12-13 04:42:49.000000000 +0100
2
+++ ./update.c	2014-06-29 12:15:04.249543651 +0200
3
@@ -26,6 +26,7 @@
4
 #include "update.h"
5
 #include "code.h"
6
 #include "radstat.h"
7
+#include "largefile.h"
8
 #include "transcript.h"
9
 #include "progress.h"
10
 #include "mkdirs.h"
11
@@ -73,7 +74,7 @@
12
 
13
 	mode = strtol( targv[ 2 ], (char **)NULL, 8 );
14
 
15
-	times.modtime = atoi( targv[ 5 ] );
16
+	times.modtime = strtotimet( targv[ 5 ], NULL, 10 );
17
 	if ( times.modtime != st->st_mtime ) {
18
 	    times.actime = st->st_atime;
19
 	    if ( utime( path, &times ) != 0 ) {
(-)/root/radmind.new/Makefile (-4 / +4 lines)
Lines 2-11 Link Here
2
# $FreeBSD: head/sysutils/radmind/Makefile 436247 2017-03-15 14:45:30Z mat $
2
# $FreeBSD: head/sysutils/radmind/Makefile 436247 2017-03-15 14:45:30Z mat $
3
3
4
PORTNAME=	radmind
4
PORTNAME=	radmind
5
PORTVERSION=	1.14.1
5
PORTVERSION=	1.15.1
6
PORTREVISION=	2014052201
6
PORTREVISION=	2019101801
7
CATEGORIES=	sysutils
7
CATEGORIES=	sysutils
8
MASTER_SITES=	SF/${PORTNAME}/${PORTNAME}/${PORTNAME}-${PORTVERSION}
8
MASTER_SITES=	https://github.com/voretaq7/${PORTNAME}/releases/download/${PORTNAME}-${PORTVERSION}/
9
9
10
MAINTAINER=	mikeg@bsd-box.net
10
MAINTAINER=	mikeg@bsd-box.net
11
COMMENT=	Utility for administering filesystem changes
11
COMMENT=	Utility for administering filesystem changes
Lines 31-37 Link Here
31
PLIST_SUB=	RADMIND_BASE_DIR=${RADMIND_BASE_DIR:S@/@@} RADMINUSER=${RADMINUSER}
31
PLIST_SUB=	RADMIND_BASE_DIR=${RADMIND_BASE_DIR:S@/@@} RADMINUSER=${RADMINUSER}
32
SUB_FILES+=	pkg-install pkg-message
32
SUB_FILES+=	pkg-install pkg-message
33
33
34
DOCS=		COPYRIGHT README SPEC
34
DOCS=		COPYRIGHT SPEC README.md
35
35
36
OPTIONS_DEFINE=	DOCS
36
OPTIONS_DEFINE=	DOCS
37
IGNORE_TIMESTAMPS_DESC=	Add '-t' option to fsdiff
37
IGNORE_TIMESTAMPS_DESC=	Add '-t' option to fsdiff
(-)/root/radmind.new/pkg-plist (-1 / +1 lines)
Lines 24-30 Link Here
24
man/man5/applefile.5.gz
24
man/man5/applefile.5.gz
25
man/man8/radmind.8.gz
25
man/man8/radmind.8.gz
26
%%PORTDOCS%%%%DOCSDIR%%/COPYRIGHT
26
%%PORTDOCS%%%%DOCSDIR%%/COPYRIGHT
27
%%PORTDOCS%%%%DOCSDIR%%/README
27
%%PORTDOCS%%%%DOCSDIR%%/README.md
28
%%PORTDOCS%%%%DOCSDIR%%/SPEC
28
%%PORTDOCS%%%%DOCSDIR%%/SPEC
29
@sample(,,700) /%%RADMIND_BASE_DIR%%/config.sample
29
@sample(,,700) /%%RADMIND_BASE_DIR%%/config.sample
30
@owner %%RADMINUSER%%
30
@owner %%RADMINUSER%%

Return to bug 232219