Hello community, here is the log from the commit of package ncpfs checked in at Fri May 18 00:03:00 CEST 2007. -------- --- ncpfs/ncpfs.changes 2007-02-07 13:32:14.000000000 +0100 +++ /mounts/work_src_done/STABLE/ncpfs/ncpfs.changes 2007-05-17 21:14:25.000000000 +0200 @@ -1,0 +2,7 @@ +Thu May 17 21:11:16 CEST 2007 - olh@suse.de + +- update to hg revision 458 + new nwsalvage tool + misc small fixes + +------------------------------------------------------------------- Old: ---- ncpfs.gcc4.patch ncpfs._PutFilterFirstPass.patch ncpfs.uninialized.patch New: ---- ncpfs-hg-commit-403.patch ncpfs-hg-commit-404.patch ncpfs-hg-commit-405.patch ncpfs-hg-commit-406.patch ncpfs-hg-commit-407.patch ncpfs-hg-commit-408.patch ncpfs-hg-commit-409.patch ncpfs-hg-commit-410.patch ncpfs-hg-commit-411.patch ncpfs-hg-commit-412.patch ncpfs-hg-commit-413.patch ncpfs-hg-commit-414.patch ncpfs-hg-commit-415.patch ncpfs-hg-commit-416.patch ncpfs-hg-commit-417.patch ncpfs-hg-commit-419.patch ncpfs-hg-commit-420.patch ncpfs-hg-commit-421.patch ncpfs-hg-commit-422.patch ncpfs-hg-commit-423.patch ncpfs-hg-commit-424.patch ncpfs-hg-commit-425.patch ncpfs-hg-commit-426.patch ncpfs-hg-commit-427.patch ncpfs-hg-commit-428.patch ncpfs-hg-commit-429.patch ncpfs-hg-commit-430.patch ncpfs-hg-commit-431.patch ncpfs-hg-commit-432.patch ncpfs-hg-commit-433.patch ncpfs-hg-commit-434.patch ncpfs-hg-commit-435.patch ncpfs-hg-commit-436.patch ncpfs-hg-commit-437.patch ncpfs-hg-commit-438.patch ncpfs-hg-commit-439.patch ncpfs-hg-commit-440.patch ncpfs-hg-commit-441.patch ncpfs-hg-commit-442.patch ncpfs-hg-commit-443.patch ncpfs-hg-commit-444.patch ncpfs-hg-commit-445.patch ncpfs-hg-commit-446.patch ncpfs-hg-commit-447.patch ncpfs-hg-commit-448.patch ncpfs-hg-commit-449.patch ncpfs-hg-commit-450.patch ncpfs-hg-commit-451.patch ncpfs-hg-commit-452.patch ncpfs-hg-commit-453.patch ncpfs-hg-commit-454.patch ncpfs-hg-commit-455.patch ncpfs-hg-commit-456.patch ncpfs-hg-commit-457.patch ncpfs-hg-commit-458.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ ncpfs.spec ++++++ --- /var/tmp/diff_new_pack.s15681/_old 2007-05-18 00:01:14.000000000 +0200 +++ /var/tmp/diff_new_pack.s15681/_new 2007-05-18 00:01:14.000000000 +0200 @@ -16,7 +16,7 @@ Group: Productivity/Networking/Novell Autoreqprov: on Version: 2.2.6 -Release: 47 +Release: 62 PreReq: %insserv_prereq %fillup_prereq BuildRoot: %{_tmppath}/%{name}-%{version}-build Summary: Tools for Accessing Novell File Systems @@ -26,12 +26,64 @@ Source11: ncpfs-ipxmount.sysconfig Source12: ncpfs-example.tar.bz2 Source20: cups-novell.pl -Patch0: ncpfs.gcc4.patch -Patch1: ncpfs.uninialized.patch -Patch2: ncpfs.LDFLAGS.patch -Patch3: ncpfs.pam_ncp_auth.syslog.patch -Patch4: ncpfs._PutFilterFirstPass.patch -Patch5: ncpfs.offsetof.patch +Patch403: ncpfs-hg-commit-403.patch +Patch404: ncpfs-hg-commit-404.patch +Patch405: ncpfs-hg-commit-405.patch +Patch406: ncpfs-hg-commit-406.patch +Patch407: ncpfs-hg-commit-407.patch +Patch408: ncpfs-hg-commit-408.patch +Patch409: ncpfs-hg-commit-409.patch +Patch410: ncpfs-hg-commit-410.patch +Patch411: ncpfs-hg-commit-411.patch +Patch412: ncpfs-hg-commit-412.patch +Patch413: ncpfs-hg-commit-413.patch +Patch414: ncpfs-hg-commit-414.patch +Patch415: ncpfs-hg-commit-415.patch +Patch416: ncpfs-hg-commit-416.patch +Patch417: ncpfs-hg-commit-417.patch +Patch419: ncpfs-hg-commit-419.patch +Patch420: ncpfs-hg-commit-420.patch +Patch421: ncpfs-hg-commit-421.patch +Patch422: ncpfs-hg-commit-422.patch +Patch423: ncpfs-hg-commit-423.patch +Patch424: ncpfs-hg-commit-424.patch +Patch425: ncpfs-hg-commit-425.patch +Patch426: ncpfs-hg-commit-426.patch +Patch427: ncpfs-hg-commit-427.patch +Patch428: ncpfs-hg-commit-428.patch +Patch429: ncpfs-hg-commit-429.patch +Patch430: ncpfs-hg-commit-430.patch +Patch431: ncpfs-hg-commit-431.patch +Patch432: ncpfs-hg-commit-432.patch +Patch433: ncpfs-hg-commit-433.patch +Patch434: ncpfs-hg-commit-434.patch +Patch435: ncpfs-hg-commit-435.patch +Patch436: ncpfs-hg-commit-436.patch +Patch437: ncpfs-hg-commit-437.patch +Patch438: ncpfs-hg-commit-438.patch +Patch439: ncpfs-hg-commit-439.patch +Patch440: ncpfs-hg-commit-440.patch +Patch441: ncpfs-hg-commit-441.patch +Patch442: ncpfs-hg-commit-442.patch +Patch443: ncpfs-hg-commit-443.patch +Patch444: ncpfs-hg-commit-444.patch +Patch445: ncpfs-hg-commit-445.patch +Patch446: ncpfs-hg-commit-446.patch +Patch447: ncpfs-hg-commit-447.patch +Patch448: ncpfs-hg-commit-448.patch +Patch449: ncpfs-hg-commit-449.patch +Patch450: ncpfs-hg-commit-450.patch +Patch451: ncpfs-hg-commit-451.patch +Patch452: ncpfs-hg-commit-452.patch +Patch453: ncpfs-hg-commit-453.patch +Patch454: ncpfs-hg-commit-454.patch +Patch455: ncpfs-hg-commit-455.patch +Patch456: ncpfs-hg-commit-456.patch +Patch457: ncpfs-hg-commit-457.patch +Patch458: ncpfs-hg-commit-458.patch +Patch1002: ncpfs.LDFLAGS.patch +Patch1003: ncpfs.pam_ncp_auth.syslog.patch +Patch1005: ncpfs.offsetof.patch %description With this program, you can mount Netware server file systems under @@ -65,12 +117,65 @@ %prep %setup -q -%patch0 -p1 -%patch1 -p1 -%patch2 -p1 -%patch3 -p1 -%patch4 -p1 -%patch5 -p1 +%patch403 -p1 +%patch404 -p1 +%patch405 -p1 +%patch406 -p1 +%patch407 -p1 +%patch408 -p1 +%patch409 -p1 +%patch410 -p1 +%patch411 -p1 +%patch412 -p1 +%patch413 -p1 +%patch414 -p1 +%patch415 -p1 +%patch416 -p1 +%patch417 -p1 +%patch419 -p1 +%patch420 -p1 +%patch421 -p1 +%patch422 -p1 +%patch423 -p1 +%patch424 -p1 +%patch425 -p1 +%patch426 -p1 +%patch427 -p1 +%patch428 -p1 +%patch429 -p1 +%patch430 -p1 +%patch431 -p1 +%patch432 -p1 +%patch433 -p1 +%patch434 -p1 +%patch435 -p1 +%patch436 -p1 +%patch437 -p1 +%patch438 -p1 +%patch439 -p1 +%patch440 -p1 +%patch441 -p1 +%patch442 -p1 +%patch443 -p1 +%patch444 -p1 +%patch445 -p1 +%patch446 -p1 +%patch447 -p1 +%patch448 -p1 +%patch449 -p1 +%patch450 -p1 +%patch451 -p1 +%patch452 -p1 +%patch453 -p1 +%patch454 -p1 +%patch455 -p1 +%patch456 -p1 +%patch457 -p1 +%patch458 -p1 +# +%patch1002 -p1 +%patch1003 -p1 +%patch1005 -p1 tar xfvj %{SOURCE12} if [ "$UID" = 0 ] ; then chown -R 0:0 . ; fi @@ -150,12 +255,14 @@ /usr/bin/nwfsinfo /usr/bin/nwfstime /usr/bin/nwgrant +/usr/bin/nwlistsalvage /usr/bin/nwpasswd /usr/bin/nwpjmv /usr/bin/nwpqjob /usr/bin/nwpurge /usr/bin/nwrevoke /usr/bin/nwrights +/usr/bin/nwsalvage /usr/bin/nwtrustee /usr/bin/nwtrustee2 /usr/bin/nwuserlist @@ -175,7 +282,11 @@ %{_libdir}/libncp.a %{_libdir}/libncp.so -%changelog -n ncpfs +%changelog +* Thu May 17 2007 - olh@suse.de +- update to hg revision 458 + new nwsalvage tool + misc small fixes * Wed Feb 07 2007 - olh@suse.de - add Hungarian translation for ncpfs (242603) * Sat Apr 29 2006 - olh@suse.de ++++++ ncpfs-hg-commit-403.patch ++++++ changeset: 403:08f41478a208 user: Petr Vandrovec <petr@vandrovec.name> date: Sun Apr 10 10:36:35 2005 +0000 files: man/ncpmount.8 description: Change charset from iso-8859-1 to iso8859-1 in ncpmount manpage. diff -r 722e35906cab -r 08f41478a208 man/ncpmount.8 --- a/man/ncpmount.8 Thu Jan 27 16:35:36 2005 +0000 +++ b/man/ncpmount.8 Sun Apr 10 10:36:35 2005 +0000 @@ -282,7 +282,7 @@ You can specify character translation ru You can specify character translation rules for converting names from unicode to your desktop (it works together with \fB-p\fP). .I iocharset -is charset name, for example \fIiso-8859-1\fP. +is charset name, for example \fIiso8859-1\fP. .RE .B -p ++++++ ncpfs-hg-commit-404.patch ++++++ ++++ 691 lines (skipped) ++++++ ncpfs-hg-commit-405.patch ++++++ changeset: 405:8aededcd3e6a user: Scott Bentley <bentleys@hhangus.com> date: Sun May 22 23:35:00 2005 +0000 files: man/Makefile.in man/nwlistsalvage.1 man/nwsalvage.1 description: Add nwsalvage and nwlistsalvage manpages. diff -r fc77f4249198 -r 8aededcd3e6a man/Makefile.in --- a/man/Makefile.in Wed May 11 20:46:55 2005 +0000 +++ b/man/Makefile.in Sun May 22 23:35:00 2005 +0000 @@ -16,7 +16,8 @@ MAN1 := nprint.1 nsend.1 nwauth.1 nwbols MAN1 := nprint.1 nsend.1 nwauth.1 nwbols.1 nwboprops.1 nwbpset.1 \ nwbpvalues.1 nwdir.1 nwfsinfo.1 nwfstime.1 nwpasswd.1 nwpurge.1 \ nwrights.1 nwsfind.1 nwtrustee.1 nwuserlist.1 nwvolinfo.1 pqlist.1 \ - nwpqjob.1 pqstat.1 pserver.1 slist.1 nwpjmv.1 + nwpqjob.1 pqstat.1 pserver.1 slist.1 nwpjmv.1 \ + nwsalvage.1 nwlistsalvage.1 MAN3 := $(notdir $(wildcard ${this_srcdir}/*.3ncp)) MAN5 := nwclient.5 MAN8 := nwbocreate.8 nwborm.8 nwbpadd.8 nwbpcreate.8 nwbprm.8 nwfsctrl.8 \ diff -r fc77f4249198 -r 8aededcd3e6a man/nwlistsalvage.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/man/nwlistsalvage.1 Sun May 22 23:35:00 2005 +0000 @@ -0,0 +1,49 @@ +.TH NWLISTSALVAGE 1 11/05/2005 nwlistsalvage nwlistsalvage +.SH NAME +nwlistsalvage +.SH SYNOPSIS +.B nwlistsalvage +[ \fB-h\fP ] [ \fB-n\fP \fInamespace\fP ] [ \fB-v\fP ] \fBdirectory\fP + +.SH DESCRIPTION +.B nwlistsalvage +lists all salvageable files in the specified NetWare directory. + +.SH OPTIONS + +.B -h +.RS 3 +Print out a short help text. +.RE + +.B -n +.RS 3 +Specify a different NetWare file namespace. Possible options include DOS, +MAC, NFS, FTAM, LONG. Default is LONG. +.RE + +.B -v +.RS 3 +List verbose file information. +.RE + +.B directory +.RS 3 +The directory to scan for salvageable files. Current +working directory is used by default. You have to specify path in +Linux format, not in NetWare format. +.RE + +.SH EXAMPLES + +nwlistsalvage /mnt/NetWare/server/volume/directory/ + +This example will return the file-type, file-id (see \fBnwsalvage\fP) +and file-name of all salvageable files found in /mnt/NetWare/server/volume/directory/ + +.SH AUTHORS +nwlistsalvage was written by Scott Bentley. See the Changes file of ncpfs +for other contributors. + +.SH SEE ALSO +nwsalvage diff -r fc77f4249198 -r 8aededcd3e6a man/nwsalvage.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/man/nwsalvage.1 Sun May 22 23:35:00 2005 +0000 @@ -0,0 +1,54 @@ +.TH NWSALVAGE 1 11/05/2005 nwsalvage nwsalvage +.SH NAME +nwsalvage +.SH SYNOPSIS +.B nwsalvage +[ \fB-h\fP ] [ \fB-s\fP ] [ \fB-n\fP \fInamespace\fP ] [ \fBdirectory\fP ] [ \fBfile_id\fP ] + +.SH DESCRIPTION +.B nwsalvage +recovers a file from the specified NetWare directory. + +.SH OPTIONS + +.B -h +.RS 3 +Print out a short help text. +.RE + +.B -n +.RS 3 +Specify a different NetWare file namespace. Possible options include DOS, +MAC, NFS, FTAM, LONG. Default is LONG. +.RE + +.B -s +.RS 3 +Silent mode +.RE + +.B directory +.RS 3 +The directory from which the file to be salvaged was deleted. Current +working directory is used by default. You have to specify path in +Linux format, not in NetWare format. +.RE + +.B file_id +.RS 3 +The numeric file identifier specifying the file you want to salvage. +This number is obtained from \fBnwlistsalvage\fP. + +.SH EXAMPLES + +nwsalvage /mnt/NetWare/server/volume/directory/ 123456 + +With this example, the file identified by 123456 deleted from the +directory /mnt/NetWare/server/volume/directory/ will be recovered. + +.SH AUTHORS +nwsalvage was written by Scott Bentley. See the Changes file of ncpfs +for other contributors. + +.SH SEE ALSO +nwlistsalvage ++++++ ncpfs-hg-commit-406.patch ++++++ changeset: 406:6af6a89be103 user: Scott Bentley <bentleys@hhangus.com> date: Sun May 22 23:37:08 2005 +0000 files: util/nwsalvage.c description: Do not use absolute path in nwsalvage. Salvage limits filename to 256 characters. diff -r 8aededcd3e6a -r 6af6a89be103 util/nwsalvage.c --- a/util/nwsalvage.c Sun May 22 23:35:00 2005 +0000 +++ b/util/nwsalvage.c Sun May 22 23:37:08 2005 +0000 @@ -23,7 +23,6 @@ */ #include <stdlib.h> -#include <string.h> #include <ncp/nwcalls.h> #include <unistd.h> @@ -58,15 +57,8 @@ static void process_salvage(struct ncp_c static void process_salvage(struct ncp_conn* conn, int volume, u_int32_t directory_id, int file_id) { struct ncp_deleted_file info; int found; - char dirname[1024]; - char filename[1024]; - char name[1024]; - - if (!ncp_ns_get_full_name(conn, g_nwns, g_nwns, - 1, volume, directory_id, NULL, 0, - dirname, sizeof(dirname))) { - } - strcat(dirname,"/"); + char oldfilename[256]; + char newfilename[256]; NWCCODE err; @@ -74,31 +66,29 @@ static void process_salvage(struct ncp_c info.seq = -1; while (!ncp_ns_scan_salvageable_file(conn, g_nwns, 1, volume, directory_id, NULL, 0, - &info, filename, sizeof(filename))){ - - strcpy(name,dirname); - strcat(name,filename); + &info, oldfilename, sizeof(oldfilename))) { if (info.seq == file_id) { + strcpy(newfilename, oldfilename); found++; - if ((err = ncp_ns_salvage_file(conn, g_nwns, &info, name)) != 0) { + if ((err = ncp_ns_salvage_file(conn, g_nwns, &info, newfilename)) != 0) { if (!g_silent) { if (err == 0x89FE) { printf(_("%8s%d -- failed (File already exists, or path inaccessible)\n"), "", info.seq); } else { - printf(_("%8s%d %s -- failed (%s)\n"), "", info.seq, name, strnwerror(err)); + printf(_("%8s%d %s -- failed (%s)\n"), "", info.seq, newfilename, strnwerror(err)); } } } else { if (!g_silent) { - printf(_("%8s%d %s -- salvaged \n"), "", info.seq, name); + printf(_("%8s%d %s -- salvaged \n"), "", info.seq, newfilename); } } break; } } if (!found) { - printf(_("%8sFile with scan ID '%d' was not found in directory '%s'."), "", file_id, dirname); + printf(_("%8sFile with scan ID '%d' was not found."), "", file_id); } printf("\n"); } @@ -121,7 +111,7 @@ int main(int argc, char* argv[]) { case '?': case ':':break; case 'h':usage(); exit(2); - case 's':g_silent=1; + case 's':g_silent = 1; break; case 'n': opt_n = argv[optind++]; ++++++ ncpfs-hg-commit-407.patch ++++++ changeset: 407:8a41f32f7288 user: Scott Bentley <bentleys@hhangus.com> date: Sun May 22 23:50:08 2005 +0000 files: util/nwsalvage.c description: Add `-r' option for renaming file while salvaging it. diff -r 6af6a89be103 -r 8a41f32f7288 util/nwsalvage.c --- a/util/nwsalvage.c Sun May 22 23:37:08 2005 +0000 +++ b/util/nwsalvage.c Sun May 22 23:50:08 2005 +0000 @@ -35,14 +35,15 @@ static void usage(void) { "\n" "-h Print this help text.\n" "-s Silent mode.\n" -"-n <namespace> Namespace for accessing files\n" +"-n <namespace> Namespace for accessing files.\n" " DOS\n" " LONG - Default\n" " MAC\n" " FTAM\n" " NFS\n" +"-r <newname> Rename the salvaged file. 255 chars max." "\n" -"directory Directory in which salvageable file(s) resides.\n" +"directory Directory in which salvageable file resides.\n" " Default is current directory.\n" "\n" "file_id The file identified by file_id will be salvaged.\n" @@ -52,13 +53,14 @@ static void usage(void) { } static int g_silent = 0; +static int g_rename = 0; +static char* g_newname; static int g_nwns = NW_NS_LONG; static void process_salvage(struct ncp_conn* conn, int volume, u_int32_t directory_id, int file_id) { struct ncp_deleted_file info; int found; - char oldfilename[256]; - char newfilename[256]; + char filename[256]; NWCCODE err; @@ -66,22 +68,26 @@ static void process_salvage(struct ncp_c info.seq = -1; while (!ncp_ns_scan_salvageable_file(conn, g_nwns, 1, volume, directory_id, NULL, 0, - &info, oldfilename, sizeof(oldfilename))) { + &info, filename, sizeof(filename))) { if (info.seq == file_id) { - strcpy(newfilename, oldfilename); found++; - if ((err = ncp_ns_salvage_file(conn, g_nwns, &info, newfilename)) != 0) { + + if (g_rename) { + strcpy(filename, g_newname); + } + + if ((err = ncp_ns_salvage_file(conn, g_nwns, &info, filename)) != 0) { if (!g_silent) { if (err == 0x89FE) { printf(_("%8s%d -- failed (File already exists, or path inaccessible)\n"), "", info.seq); } else { - printf(_("%8s%d %s -- failed (%s)\n"), "", info.seq, newfilename, strnwerror(err)); + printf(_("%8s%d %s -- failed (%s)\n"), "", info.seq, filename, strnwerror(err)); } } } else { if (!g_silent) { - printf(_("%8s%d %s -- salvaged \n"), "", info.seq, newfilename); + printf(_("%8s%d %s -- salvaged \n"), "", info.seq, filename); } } break; @@ -101,12 +107,13 @@ int main(int argc, char* argv[]) { int err; int c; char* opt_n; + char* opt_r; setlocale(LC_ALL, ""); bindtextdomain(NCPFS_PACKAGE, LOCALEDIR); textdomain(NCPFS_PACKAGE); - while ((c = getopt(argc, argv, "hsn")) != -1) { + while ((c = getopt(argc, argv, "hsnr")) != -1) { switch (c) { case '?': case ':':break; @@ -130,6 +137,15 @@ int main(int argc, char* argv[]) { exit(1); } break; + case 'r': + opt_r = argv[optind++]; + if (strlen(opt_r) > 255 || strlen(opt_r) < 1) { + fprintf(stderr, _("Filename for option '-%c' has invalid length."), c); + exit(1); + } + g_rename = 1; + g_newname = opt_r; + break; default: fprintf(stderr, _("Unexpected option `-%c'\n"), c); break; } ++++++ ncpfs-hg-commit-408.patch ++++++ changeset: 408:3ad605e1e151 user: Petr Vandrovec <petr@vandrovec.name> date: Sat May 28 13:36:26 2005 +0000 files: contrib/php/php_auth_nds.c description: There are no localized strings in php_auth_nds, so no need for including <libintl.h>. diff -r 8a41f32f7288 -r 3ad605e1e151 contrib/php/php_auth_nds.c --- a/contrib/php/php_auth_nds.c Sun May 22 23:50:08 2005 +0000 +++ b/contrib/php/php_auth_nds.c Sat May 28 13:36:26 2005 +0000 @@ -110,8 +110,6 @@ for more examples see /contrib/php/site #include <wchar.h> #include <string.h> #include <syslog.h> -#include <libintl.h> -#define _(X) gettext(X) static int is_member_of_group_bind( char* errstr,NWCONN_HANDLE conn,const char* user,const char* group) { int err; ++++++ ncpfs-hg-commit-409.patch ++++++ changeset: 409:0cc3f7f08de0 user: Petr Vandrovec <petr@vandrovec.name> date: Sat May 28 13:38:37 2005 +0000 files: mkinstalldirs description: New mkinstalldirs. diff -r 3ad605e1e151 -r 0cc3f7f08de0 mkinstalldirs --- a/mkinstalldirs Sat May 28 13:36:26 2005 +0000 +++ b/mkinstalldirs Sat May 28 13:38:37 2005 +0000 @@ -1,40 +1,150 @@ #! /bin/sh # mkinstalldirs --- make directory hierarchy -# Author: Noah Friedman <friedman@prep.ai.mit.edu> + +scriptversion=2004-02-15.20 + +# Original author: Noah Friedman <friedman@prep.ai.mit.edu> # Created: 1993-05-16 -# Public domain - -# $Id: mkinstalldirs,v 1.13 1999/01/05 03:18:55 bje Exp $ +# Public domain. +# +# This file is maintained in Automake, please report +# bugs to <bug-automake@gnu.org> or send patches to +# <automake-patches@gnu.org>. errstatus=0 +dirmode="" + +usage="\ +Usage: mkinstalldirs [-h] [--help] [--version] [-m MODE] DIR ... + +Create each directory DIR (with mode MODE, if specified), including all +leading file name components. + +Report bugs to <bug-automake@gnu.org>." + +# process command line arguments +while test $# -gt 0 ; do + case $1 in + -h | --help | --h*) # -h for help + echo "$usage" + exit 0 + ;; + -m) # -m PERM arg + shift + test $# -eq 0 && { echo "$usage" 1>&2; exit 1; } + dirmode=$1 + shift + ;; + --version) + echo "$0 $scriptversion" + exit 0 + ;; + --) # stop option processing + shift + break + ;; + -*) # unknown option + echo "$usage" 1>&2 + exit 1 + ;; + *) # first non-opt arg + break + ;; + esac +done for file do - set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` - shift + if test -d "$file"; then + shift + else + break + fi +done - pathcomp= - for d - do - pathcomp="$pathcomp$d" - case "$pathcomp" in - -* ) pathcomp=./$pathcomp ;; - esac +case $# in + 0) exit 0 ;; +esac - if test ! -d "$pathcomp"; then - echo "mkdir $pathcomp" +# Solaris 8's mkdir -p isn't thread-safe. If you mkdir -p a/b and +# mkdir -p a/c at the same time, both will detect that a is missing, +# one will create a, then the other will try to create a and die with +# a "File exists" error. This is a problem when calling mkinstalldirs +# from a parallel make. We use --version in the probe to restrict +# ourselves to GNU mkdir, which is thread-safe. +case $dirmode in + '') + if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then + echo "mkdir -p -- $*" + exec mkdir -p -- "$@" + else + # On NextStep and OpenStep, the `mkdir' command does not + # recognize any option. It will interpret all options as + # directories to create, and then abort because `.' already + # exists. + test -d ./-p && rmdir ./-p + test -d ./--version && rmdir ./--version + fi + ;; + *) + if mkdir -m "$dirmode" -p --version . >/dev/null 2>&1 && + test ! -d ./--version; then + echo "mkdir -m $dirmode -p -- $*" + exec mkdir -m "$dirmode" -p -- "$@" + else + # Clean up after NextStep and OpenStep mkdir. + for d in ./-m ./-p ./--version "./$dirmode"; + do + test -d $d && rmdir $d + done + fi + ;; +esac - mkdir "$pathcomp" || lasterr=$? +for file +do + set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` + shift - if test ! -d "$pathcomp"; then - errstatus=$lasterr - fi - fi + pathcomp= + for d + do + pathcomp="$pathcomp$d" + case $pathcomp in + -*) pathcomp=./$pathcomp ;; + esac - pathcomp="$pathcomp/" - done + if test ! -d "$pathcomp"; then + echo "mkdir $pathcomp" + + mkdir "$pathcomp" || lasterr=$? + + if test ! -d "$pathcomp"; then + errstatus=$lasterr + else + if test ! -z "$dirmode"; then + echo "chmod $dirmode $pathcomp" + lasterr="" + chmod "$dirmode" "$pathcomp" || lasterr=$? + + if test ! -z "$lasterr"; then + errstatus=$lasterr + fi + fi + fi + fi + + pathcomp="$pathcomp/" + done done exit $errstatus -# mkinstalldirs ends here +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-end: "$" +# End: ++++++ ncpfs-hg-commit-410.patch ++++++ changeset: 410:4216c218ee44 user: Petr Vandrovec <petr@vandrovec.name> date: Sat May 28 13:40:15 2005 +0000 files: include/ncp/ncplib.h description: Prefer off_t over __off_t unless _FILE_OFFSET_BITS=64 is defined. Needed for building on Darwin. diff -r 0cc3f7f08de0 -r 4216c218ee44 include/ncp/ncplib.h --- a/include/ncp/ncplib.h Sat May 28 13:38:37 2005 +0000 +++ b/include/ncp/ncplib.h Sat May 28 13:40:15 2005 +0000 @@ -94,6 +94,13 @@ typedef enum NET_ADDRESS_TYPE { NT_URL = 13, NT_COUNT = 14 } NET_ADDRESS_TYPE; + +#if !defined(_FILE_OFFSET_BITS) || _FILE_OFFSET_BITS != 64 +typedef off_t ncp_off_t; +#else +/* Maintain unchanged ABI - these functions use 32bit off_t... */ +typedef __off_t ncp_off_t; +#endif #ifdef SWIG /* ncp_off64_t is defined to double by Perl interface */ @@ -872,11 +879,11 @@ long #ifdef SWIG long ncp_read(NWCONN_HANDLE conn, const char fileHandle[6], - __off_t offset, size_t count, char *RETBUFFER_LENPREV); + ncp_off_t offset, size_t count, char *RETBUFFER_LENPREV); long ncp_write(NWCONN_HANDLE conn, const char fileHandle[6], - __off_t offset, size_t IGNORE, const char *STRING_LENPREV); + ncp_off_t offset, size_t IGNORE, const char *STRING_LENPREV); long ncp_copy_file(NWCONN_HANDLE conn, @@ -889,11 +896,11 @@ long #else long ncp_read(NWCONN_HANDLE conn, const char fileHandle[6], - __off_t offset, size_t count, char *target); + ncp_off_t offset, size_t count, char *target); long ncp_write(NWCONN_HANDLE conn, const char fileHandle[6], - __off_t offset, size_t count, const char *source); + ncp_off_t offset, size_t count, const char *source); NWCCODE ncp_read64(NWCONN_HANDLE conn, const char fileHandle[6], ncp_off64_t offset, size_t count, void *target, size_t *bytesread); ++++++ ncpfs-hg-commit-411.patch ++++++ ++++ 11057 lines (skipped) ++++++ ncpfs-hg-commit-412.patch ++++++ changeset: 412:b4b6191b3d97 user: Petr Vandrovec <petr@vandrovec.name> date: Sat May 28 13:46:29 2005 +0000 files: lib/nwclient.c description: Define ENOPKG error as ENOSYS if ENOPKG does not exist. Needed for Darwin. diff -r e04165992166 -r b4b6191b3d97 lib/nwclient.c --- a/lib/nwclient.c Sat May 28 13:45:22 2005 +0000 +++ b/lib/nwclient.c Sat May 28 13:46:29 2005 +0000 @@ -88,6 +88,10 @@ #endif #include <pwd.h> #include <sys/stat.h> + +#ifndef ENOPKG +#define ENOPKG ENOSYS +#endif /*should be in ndslib.h ?*/ #define NWE_BIND_NO_SUCH_PROP NWE_NCP_NOT_SUPPORTED ++++++ ncpfs-hg-commit-413.patch ++++++ changeset: 413:94680aa0251a user: Petr Vandrovec <petr@vandrovec.name> date: Sat May 28 13:47:31 2005 +0000 files: lib/rdn.c description: Do not include <sys/mman.h> in lib/rdn.h. It is not needed there. diff -r b4b6191b3d97 -r 94680aa0251a lib/rdn.c --- a/lib/rdn.c Sat May 28 13:46:29 2005 +0000 +++ b/lib/rdn.c Sat May 28 13:47:31 2005 +0000 @@ -30,8 +30,6 @@ #include <stdlib.h> #include <errno.h> #include <string.h> - -#include <sys/mman.h> #include "nwnet_i.h" #include "ncplib_i.h" ++++++ ncpfs-hg-commit-414.patch ++++++ changeset: 414:5e027b02f28c user: Petr Vandrovec <petr@vandrovec.name> date: Sat May 28 13:49:58 2005 +0000 files: lib/resolve.c description: Properly wrap sockaddr_ipx accesses with NCP_IPX_SUPPORT and sockaddr_in with NCP_IN_SUPPORT. Needed on IPX-less architectures. diff -r 94680aa0251a -r 5e027b02f28c lib/resolve.c --- a/lib/resolve.c Sat May 28 13:47:31 2005 +0000 +++ b/lib/resolve.c Sat May 28 13:49:58 2005 +0000 @@ -875,7 +875,9 @@ NWCCODE ncp_find_server_addr(const char err = NWCCGetConnInfo(conn, NWCC_INFO_TRAN_ADDR, sizeof(ta), &ta); if (!err) { - if (ta.type == NT_IPX) { + switch (ta.type) { +#ifdef NCP_IPX_SUPPORT + case NT_IPX: { struct sockaddr_ipx* ipx = (struct sockaddr_ipx*)addr; if (len < sizeof(*ipx)) { @@ -887,7 +889,12 @@ NWCCODE ncp_find_server_addr(const char memcpy(&ipx->sipx_port, buffer + 10, 2); ipx->sipx_type = 0x11; } - } else if (ta.type == NT_UDP || ta.type == NT_TCP) { + break; + } +#endif +#ifdef NCP_IN_SUPPORT + case NT_UDP: + case NT_TCP: { struct sockaddr_in* in = (struct sockaddr_in*)addr; if (len < sizeof(*in)) { @@ -897,8 +904,12 @@ NWCCODE ncp_find_server_addr(const char memcpy(&in->sin_addr.s_addr, buffer + 2, 4); memcpy(&in->sin_port, buffer, 2); } - } else { + break; + } +#endif + default: err = EINVAL; + break; } if (!err) { err = NWGetFileServerName(conn, sname); ++++++ ncpfs-hg-commit-415.patch ++++++ changeset: 415:005801e1fd28 user: Petr Vandrovec <petr@vandrovec.name> date: Sat May 28 15:07:13 2005 +0000 files: include/private/list.h lib/ncplib.c lib/nwnet.c description: Rename LIST_HEAD to NCP_LIST_HEAD. LIST_HEAD exists on Darwin. diff -r 5e027b02f28c -r 005801e1fd28 include/private/list.h --- a/include/private/list.h Sat May 28 13:49:58 2005 +0000 +++ b/include/private/list.h Sat May 28 15:07:13 2005 +0000 @@ -16,10 +16,10 @@ struct list_head { struct list_head *next, *prev; }; -#define LIST_HEAD(name) \ +#define NCP_LIST_HEAD(name) \ struct list_head name = { &name, &name } -#define INIT_LIST_HEAD(ptr) do { \ +#define NCP_INIT_LIST_HEAD(ptr) do { \ (ptr)->next = (ptr); (ptr)->prev = (ptr); \ } while (0) @@ -64,7 +64,7 @@ static __inline__ void list_del(struct l static __inline__ void list_del(struct list_head *entry) { __list_del(entry->prev, entry->next); - INIT_LIST_HEAD(entry); + NCP_INIT_LIST_HEAD(entry); } static __inline__ int list_empty(struct list_head *head) diff -r 5e027b02f28c -r 005801e1fd28 lib/ncplib.c --- a/lib/ncplib.c Sat May 28 13:49:58 2005 +0000 +++ b/lib/ncplib.c Sat May 28 15:07:13 2005 +0000 @@ -194,7 +194,7 @@ int in_options = 0; #endif static ncpt_mutex_t conn_lock = NCPT_MUTEX_INITIALIZER; -static LIST_HEAD(conn_list); +static NCP_LIST_HEAD(conn_list); ncpt_mutex_t nds_ring_lock = NCPT_MUTEX_INITIALIZER; /* return number of bytes in packet */ @@ -775,9 +775,9 @@ static struct ncp_conn *ncp_alloc_conn(v memset(conn, 0, sizeof(*conn)); ncpt_atomic_set(&conn->use_count, 1); ncpt_atomic_set(&conn->store_count, 0); - INIT_LIST_HEAD(&conn->nds_ring); + NCP_INIT_LIST_HEAD(&conn->nds_ring); // conn->nds_conn = NULL; - INIT_LIST_HEAD(&conn->conn_ring); + NCP_INIT_LIST_HEAD(&conn->conn_ring); ncpt_mutex_init(&conn->buffer_mutex); ncpt_mutex_init(&conn->serverInfo.mutex); // conn->serverInfo.valid = 0; diff -r 5e027b02f28c -r 005801e1fd28 lib/nwnet.c --- a/lib/nwnet.c Sat May 28 13:49:58 2005 +0000 +++ b/lib/nwnet.c Sat May 28 15:07:13 2005 +0000 @@ -943,8 +943,8 @@ static NWDSCCODE __NWDSCreateDSConnectio memset(tmp, 0, sizeof(*tmp)); tmp->dck.tree_name = NULL; - INIT_LIST_HEAD(&tmp->contexts); - INIT_LIST_HEAD(&tmp->conns); + NCP_INIT_LIST_HEAD(&tmp->contexts); + NCP_INIT_LIST_HEAD(&tmp->conns); *dsh = tmp; return 0; } @@ -1172,7 +1172,7 @@ NWDSCCODE NWDSCreateContextHandle(NWDSCo return ERR_NOT_ENOUGH_MEMORY; } memset(tmp, 0, sizeof(*tmp)); - INIT_LIST_HEAD(&tmp->context_ring); + NCP_INIT_LIST_HEAD(&tmp->context_ring); tmp->dck.flags = DCV_DEREF_ALIASES | DCV_XLATE_STRINGS | DCV_CANONICALIZE_NAMES; tmp->dck.name_form = 0; tmp->dck.last_connection.conn = NULL; @@ -1237,7 +1237,7 @@ NWDSCCODE NWDSDuplicateContextHandleInt( return ERR_NOT_ENOUGH_MEMORY; memset(tmp, 0, sizeof(*tmp)); - INIT_LIST_HEAD(&tmp->context_ring); + NCP_INIT_LIST_HEAD(&tmp->context_ring); /* return typed absolute names */ tmp->dck.flags = srcctx->dck.flags & ~(DCV_CANONICALIZE_NAMES | DCV_TYPELESS_NAMES); tmp->dck.name_form = srcctx->dck.name_form; ++++++ ncpfs-hg-commit-416.patch ++++++ changeset: 416:48879aeab0b6 user: Petr Vandrovec <petr@vandrovec.name> date: Sat May 28 15:42:43 2005 +0000 files: configure.ac lib/ds/filter.c lib/ds/iterhandle.c lib/ds/request.c lib/ds/search.c lib/ds/setkeys.c lib/fs/eas.c lib/fs/filelock.c lib/ncpext.c lib/ncplib.c lib/ncplib_i.h lib/nwcalls.c lib/nwtime.c lib/queue.c lib/rdn.c description: Add support for SO_NOSIGPIPE (Darwin) in addition to MSG_NOSIGNAL. diff -r 005801e1fd28 -r 48879aeab0b6 configure.ac --- a/configure.ac Sat May 28 15:07:13 2005 +0000 +++ b/configure.ac Sat May 28 15:42:43 2005 +0000 @@ -495,6 +495,38 @@ else socklen_t="typedef $ncp_cv_socklen_t socklen_t;" fi AC_SUBST(socklen_t) + +AC_CACHE_CHECK(whether SO_NOSIGPIPE exists, + ncp_cv_so_nosigpipe, + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[[#include <sys/types.h> +#include <sys/socket.h>]]], + [[[int s; + int o = 0; + s = socket(0, 0, 0); + setsockopt(s, SOL_SOCKET, SO_NOSIGPIPE, &o, sizeof(o))]]])], + [ncp_cv_so_nosigpipe="yes"], + [ncp_cv_so_nosigpipe="no"] + ) +) +if test "$ncp_cv_so_nosigpipe" = "yes" +then + AC_DEFINE(HAVE_SO_NOSIGPIPE, 1, [Define when SO_NOSIGPIPE exists]) +fi + +AC_CACHE_CHECK(whether MSG_NOSIGNAL exists, + ncp_cv_msg_nosignal, + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[[#include <sys/types.h> +#include <sys/socket.h> +struct msghdr msg;]]], + [[[sendmsg(0, &msg, MSG_NOSIGNAL)]]])], + [ncp_cv_msg_nosignal="yes"], + [ncp_cv_msg_nosignal="no"] + ) +) +if test "$ncp_cv_msg_nosignal" = "yes" +then + AC_DEFINE(HAVE_MSG_NOSIGNAL, 1, [Define when MSG_NOSIGNAL exists]) +fi dnl UNICODE AC_CHECK_TYPE([wchar_t], , [AC_DEFINE([wchar_t], [unsigned int], [Define to 'unsigned int' if wchar_t is not defined.])]) diff -r 005801e1fd28 -r 48879aeab0b6 lib/ds/filter.c --- a/lib/ds/filter.c Sat May 28 15:07:13 2005 +0000 +++ b/lib/ds/filter.c Sat May 28 15:42:43 2005 +0000 @@ -26,6 +26,8 @@ Fix coredumps, endless loops and so on in NWDSPutFilter. */ + +#include "config.h" #include <stddef.h> #include <stdlib.h> diff -r 005801e1fd28 -r 48879aeab0b6 lib/ds/iterhandle.c --- a/lib/ds/iterhandle.c Sat May 28 15:07:13 2005 +0000 +++ b/lib/ds/iterhandle.c Sat May 28 15:42:43 2005 +0000 @@ -22,6 +22,8 @@ Initial release. */ + +#include "config.h" #include "iterhandle.h" diff -r 005801e1fd28 -r 48879aeab0b6 lib/ds/request.c --- a/lib/ds/request.c Sat May 28 15:07:13 2005 +0000 +++ b/lib/ds/request.c Sat May 28 15:42:43 2005 +0000 @@ -22,6 +22,8 @@ Initial release */ + +#include "config.h" #include <stddef.h> #include <stdlib.h> diff -r 005801e1fd28 -r 48879aeab0b6 lib/ds/search.c --- a/lib/ds/search.c Sat May 28 15:07:13 2005 +0000 +++ b/lib/ds/search.c Sat May 28 15:42:43 2005 +0000 @@ -32,6 +32,8 @@ to NWDSSearch. */ + +#include "config.h" #include <stddef.h> #include <stdlib.h> diff -r 005801e1fd28 -r 48879aeab0b6 lib/ds/setkeys.c --- a/lib/ds/setkeys.c Sat May 28 15:07:13 2005 +0000 +++ b/lib/ds/setkeys.c Sat May 28 15:42:43 2005 +0000 @@ -35,6 +35,8 @@ Modified nds_login to use unaliased name in NWDSSetKeys. */ + +#include "config.h" #include <stddef.h> #include <stdlib.h> diff -r 005801e1fd28 -r 48879aeab0b6 lib/fs/eas.c --- a/lib/fs/eas.c Sat May 28 15:07:13 2005 +0000 +++ b/lib/fs/eas.c Sat May 28 15:42:43 2005 +0000 @@ -23,6 +23,7 @@ */ +#include "config.h" #include <ncp/eas.h> #include "ncplib_i.h" diff -r 005801e1fd28 -r 48879aeab0b6 lib/fs/filelock.c --- a/lib/fs/filelock.c Sat May 28 15:07:13 2005 +0000 +++ b/lib/fs/filelock.c Sat May 28 15:42:43 2005 +0000 @@ -23,6 +23,7 @@ */ +#include "config.h" #include "ncplib_i.h" #include <ncp/nwnet.h> diff -r 005801e1fd28 -r 48879aeab0b6 lib/ncpext.c --- a/lib/ncpext.c Sat May 28 15:07:13 2005 +0000 +++ b/lib/ncpext.c Sat May 28 15:42:43 2005 +0000 @@ -22,6 +22,8 @@ Initial version. */ + +#include "config.h" #include <ncp/nwcalls.h> #include <ncp/nwnet.h> diff -r 005801e1fd28 -r 48879aeab0b6 lib/ncplib.c --- a/lib/ncplib.c Sat May 28 15:07:13 2005 +0000 +++ b/lib/ncplib.c Sat May 28 15:42:43 2005 +0000 @@ -460,6 +460,18 @@ restart: return 0; } +int +ncp_fd_nosigpipe(UNUSED(int fd)) +{ +#ifdef HAVE_SO_NOSIGPIPE + static const int one = 1; + + return setsockopt(fd, SOL_SOCKET, SO_NOSIGPIPE, &one, sizeof(one)); +#else + return 0; +#endif +} + #ifdef CONFIG_NATIVE_IPX static int exec_nwsfind(const char* request[]) { @@ -521,8 +533,11 @@ ipx_make_reachable_rip(const struct sock memset(&rip, 0, sizeof(rip)); sock = socket(PF_IPX, SOCK_DGRAM, IPXPROTO_IPX); - if (sock == -1) { + return errno; + } + if (ncp_fd_nosigpipe(sock)) { + close(sock); return errno; } opt = 1; @@ -1291,7 +1306,16 @@ ncp_connect_ipx_addr(struct ncp_conn *co if ((ncp_sock = socket(PF_IPX, SOCK_DGRAM, IPXPROTO_IPX)) == -1) { return errno; } + if (ncp_fd_nosigpipe(ncp_sock)) { + close(ncp_sock); + return errno; + } if ((wdog_sock = socket(PF_IPX, SOCK_DGRAM, IPXPROTO_IPX)) == -1) { + close(ncp_sock); + return errno; + } + if (ncp_fd_nosigpipe(wdog_sock)) { + close(wdog_sock); close(ncp_sock); return errno; } @@ -1385,6 +1409,10 @@ ncp_connect_in_addr(struct ncp_conn *con if ((ncp_sock = socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP)) == -1) { return errno; } + if (ncp_fd_nosigpipe(ncp_sock)) { + close(ncp_sock); + return errno; + } addr.sin_family = AF_INET; addr.sin_port = htons(0x0); addr.sin_addr.s_addr = INADDR_ANY; @@ -1444,6 +1472,10 @@ ncp_connect_tcp_addr(struct ncp_conn *co if ((ncp_sock = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP)) == -1) { return errno; } + if (ncp_fd_nosigpipe(ncp_sock)) { + close(ncp_sock); + return errno; + } addr.sin_family = AF_INET; addr.sin_port = htons(0x0); addr.sin_addr.s_addr = INADDR_ANY; @@ -1503,6 +1535,10 @@ ncp_connect_un_addr(struct ncp_conn *con conn->verbose = 0; if ((fd = socket(PF_UNIX, SOCK_DGRAM, 0)) == -1) { + return errno; + } + if (ncp_fd_nosigpipe(fd)) { + close(fd); return errno; } addr.sun_family = AF_UNIX; diff -r 005801e1fd28 -r 48879aeab0b6 lib/ncplib_i.h --- a/lib/ncplib_i.h Sat May 28 15:07:13 2005 +0000 +++ b/lib/ncplib_i.h Sat May 28 15:42:43 2005 +0000 @@ -62,6 +62,10 @@ extern "C" { #include "private/ncp_fs.h" #include <string.h> + +#ifndef HAVE_MSG_NOSIGNAL +#define MSG_NOSIGNAL 0 +#endif #define UNUSED(x) x __attribute__((unused)) @@ -328,6 +332,8 @@ static inline NWCCODE x_recv(int sock, v NWCCODE __NWReadFileServerInfo(struct ncp_conn* conn); +int ncp_fd_nosigpipe(int fd); + #ifdef __cplusplus } #endif diff -r 005801e1fd28 -r 48879aeab0b6 lib/nwcalls.c --- a/lib/nwcalls.c Sat May 28 15:07:13 2005 +0000 +++ b/lib/nwcalls.c Sat May 28 15:42:43 2005 +0000 @@ -343,6 +343,10 @@ retryLoop:; } fd = socket(PF_UNIX, SOCK_STREAM, 0); if (fd < 0) { + goto errquit; + } + if (ncp_fd_nosigpipe(fd)) { + close(fd); goto errquit; } sunlen = offsetof(struct sockaddr_un, sun_path) + sprintf(sun.sun_path, "%cncpfs.permanent.mount.%lu", 0, diff -r 005801e1fd28 -r 48879aeab0b6 lib/nwtime.c --- a/lib/nwtime.c Sat May 28 15:07:13 2005 +0000 +++ b/lib/nwtime.c Sat May 28 15:42:43 2005 +0000 @@ -22,6 +22,8 @@ Initial version - NWGetFileServerUTCTime moved from nwcalls.c. */ + +#include "config.h" #include <errno.h> #include <string.h> diff -r 005801e1fd28 -r 48879aeab0b6 lib/queue.c --- a/lib/queue.c Sat May 28 15:07:13 2005 +0000 +++ b/lib/queue.c Sat May 28 15:42:43 2005 +0000 @@ -29,6 +29,8 @@ 1.00 1999, November 20 Petr Vandrovec <vandrove@vc.cvut.cz> Added license. */ + +#include "config.h" #include "ncplib_i.h" diff -r 005801e1fd28 -r 48879aeab0b6 lib/rdn.c --- a/lib/rdn.c Sat May 28 15:07:13 2005 +0000 +++ b/lib/rdn.c Sat May 28 15:42:43 2005 +0000 @@ -25,6 +25,8 @@ DN length check in __NWDSExtractRDN and NWDSRemoveAllTypesW */ + +#include "config.h" #include <stddef.h> #include <stdlib.h> ++++++ ncpfs-hg-commit-417.patch ++++++ ++++ 7568 lines (skipped) ++++++ ncpfs-hg-commit-419.patch ++++++ changeset: 419:56ca340a8425 user: Petr Vandrovec <petr@vandrovec.name> date: Sat May 28 18:48:12 2005 +0000 files: sutil/Makefile.in util/Makefile.in description: Link utils with LIBICONV in addition to INTLLIBS... diff -r 9bf8cc97936c -r 56ca340a8425 sutil/Makefile.in --- a/sutil/Makefile.in Sat May 28 15:48:03 2005 +0000 +++ b/sutil/Makefile.in Sat May 28 18:48:12 2005 +0000 @@ -13,7 +13,7 @@ USE_KERNEL = @USE_KERNEL@ USE_KERNEL = @USE_KERNEL@ NDS_SUPPORT = @NDS_SUPPORT@ -LIBS = @INTLLIBS@ @LIBS@ +LIBS = @INTLLIBS@ @LIBICONV@ @LIBS@ # environ in ncpmount CCFLAGS += -D_GNU_SOURCE diff -r 9bf8cc97936c -r 56ca340a8425 util/Makefile.in --- a/util/Makefile.in Sat May 28 15:48:03 2005 +0000 +++ b/util/Makefile.in Sat May 28 18:48:12 2005 +0000 @@ -14,7 +14,7 @@ NDS_SUPPORT = @NDS_SUPPORT@ NDS_SUPPORT = @NDS_SUPPORT@ MOUNT2 = @MOUNT2@ -LIBS = @INTLLIBS@ @LIBS@ +LIBS = @INTLLIBS@ @LIBICONV@ @LIBS@ O_OTHER = dsqueue.o O_USERUTILS = slist.o pqlist.o nwfsinfo.o pserver.o nprint.o nsend.o \ ++++++ ncpfs-hg-commit-420.patch ++++++ changeset: 420:c7f1c54278c9 user: Petr Vandrovec <petr@vandrovec.name> date: Sat May 28 18:54:50 2005 +0000 files: sutil/Makefile.in description: Fix build failure while building with --disable-kernel. diff -r 56ca340a8425 -r c7f1c54278c9 sutil/Makefile.in --- a/sutil/Makefile.in Sat May 28 18:48:12 2005 +0000 +++ b/sutil/Makefile.in Sat May 28 18:54:50 2005 +0000 @@ -36,9 +36,6 @@ CFLAGS_ncpmap.o = -DNCPMAP=1 -DMAKE_NCPL CFLAGS_ncpmap.o = -DNCPMAP=1 -DMAKE_NCPLIB CFLAGS_ncplogin.o = -DMAKE_NCPLIB CFLAGS_ncpm_common.o = -DNWMSG=\"$(sbindir)/nwmsg\" -LDFLAGS_ncpmount = ncpm_common.o mount_login.o -LDFLAGS_ncplogin = ncpm_common.o mount_login.o -LDFLAGS_ncpmap = ncpm_common.o .PHONY : all install install-dev dep clean mrproper distclean .PHONY : default @@ -68,6 +65,10 @@ install-dev: | sed 's,\($*\)\.o[ :]*,\1.o \1.do \1.to $@ : ,g' > $@; \ [ -s $@ ] || rm -f $@ +ncpmount: ncpm_common.o mount_login.o +ncplogin: ncpm_common.o mount_login.o +ncpmap: ncpm_common.o + ncpmap.o: %.o: ncplogin.c $(CC) $(CFLAGS) $(CCFLAGS) $(CFLAGS_$@) -o $@ -c $< @@ -84,8 +85,8 @@ ncpm_common.d mount_login.d: %.d: %.c | sed 's,\($*\)\.o[ :]*,\1.o \1.do \1.to $@ : ,g' > $@; \ [ -s $@ ] || rm -f $@ -$(UTILS): %: %.o ../lib/libncp.a ncpm_common.o mount_login.o - $(CC) @GC_SECTIONS@-o $@ $(addsuffix .o,$@) $(LDFLAGS_$@) ../lib/libncp.a ${LIBS} +$(UTILS): %: %.o ../lib/libncp.a + $(CC) @GC_SECTIONS@-o $@ $^ ${LIBS} ../lib/libncp.a: make -C ../lib libncp.a ++++++ ncpfs-hg-commit-421.patch ++++++ changeset: 421:50351d213ba9 user: Petr Vandrovec <petr@vandrovec.name> date: Sat May 28 18:57:50 2005 +0000 files: Make.rules.in lib/Makefile.in description: Perform ranlib on static library after build. diff -r c7f1c54278c9 -r 50351d213ba9 Make.rules.in --- a/Make.rules.in Sat May 28 18:54:50 2005 +0000 +++ b/Make.rules.in Sat May 28 18:57:50 2005 +0000 @@ -2,6 +2,7 @@ INSTALL := @INSTALL@ INSTALL := @INSTALL@ INSTALL_DATA := @INSTALL_DATA@ CC := @CC@ +RANLIB := @RANLIB@ prefix := @prefix@ exec_prefix := @exec_prefix@ diff -r c7f1c54278c9 -r 50351d213ba9 lib/Makefile.in --- a/lib/Makefile.in Sat May 28 18:54:50 2005 +0000 +++ b/lib/Makefile.in Sat May 28 18:57:50 2005 +0000 @@ -130,6 +130,7 @@ install_static: $(STATIC_NCPLIB_BIN) $(STATIC_NCPLIB): $(STATIC_O_OBJ) ar r $@ $(STATIC_O_OBJ) + $(RANLIB) $@ ifeq ($(NEED_DEP),yes) include $(STATIC_O_OBJ:.o=.d) ++++++ ncpfs-hg-commit-422.patch ++++++ changeset: 422:bda42d4b9cf1 user: Petr Vandrovec <petr@vandrovec.name> date: Sat May 28 19:21:17 2005 +0000 files: Make.rules.in Makefile.in configure configure.ac contrib/tcl-utils/Makefile.in contrib/tknwmsg/Makefile.in lib/Makefile.in util/Makefile.in description: Add support for disabling build of shared library with --disable-shared. diff -r 50351d213ba9 -r bda42d4b9cf1 Make.rules.in --- a/Make.rules.in Sat May 28 18:57:50 2005 +0000 +++ b/Make.rules.in Sat May 28 19:21:17 2005 +0000 @@ -48,6 +48,7 @@ CCFLAGS := $(CFLAGS_DEFINES) $(CFLAGS_OP # directory where the dynamic library resides to the environment # variable LD_LIBRARY_PATH HAVE_ELF := @ELF_TARGET@ +BUILD_SHARED := @BUILD_SHARED@ VERSION_SOLIB := 2.3.0 VERSION_SONAME := 2.3 diff -r 50351d213ba9 -r bda42d4b9cf1 Makefile.in --- a/Makefile.in Sat May 28 18:57:50 2005 +0000 +++ b/Makefile.in Sat May 28 19:21:17 2005 +0000 @@ -19,11 +19,11 @@ CLEAN_SUBDIRS := lib sutil util man intl contrib/testing/pp contrib/tests contrib/libtrace contrib/nss64 \ contrib/tcl-utils contrib/php contrib/pam -export INCLUDES VERSION HAVE_ELF CFLAGS +export INCLUDES VERSION BUILD_SHARED CFLAGS all: set -e; for i in $(EXECSUBDIRS); do make -C $$i all; done - @if [ "$(HAVE_ELF)" = yes ] ;\ + @if [ "$(BUILD_SHARED)" = yes ] ;\ then \ echo ; echo ; echo ;\ echo Please add \'`pwd`/lib\' to the environment ; \ diff -r 50351d213ba9 -r bda42d4b9cf1 configure --- a/configure Sat May 28 18:57:50 2005 +0000 +++ b/configure Sat May 28 19:21:17 2005 +0000 @@ -313,7 +313,7 @@ ac_includes_default="\ #endif" ac_subdirs_all="$ac_subdirs_all contrib/php" -ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS CC_WARNINGS build build_cpu build_vendor build_os host host_cpu host_vendor host_os SET_MAKE CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA LN_S PACKAGE VERSION MKINSTALLDIRS USE_NLS MSGFMT GMSGFMT XGETTEXT MSGMERGE CPP EGREP GLIBC2 RANLIB ac_ct_RANLIB ALLOCA GLIBC21 INTL_MACOSX_LIBS HAVE_POSIX_PRINTF HAVE_ASPRINTF HAVE_SNPRINTF HAVE_WPRINTF LIBICONV LTLIBICONV INTLBISON BUILD_INCLUDED_LIBINTL USE_INCLUDED_LIBINTL CATOBJEXT DATADIRNAME INSTOBJEXT GENCAT INTLOBJS INTL_LIBTOOL_SUFFIX_PREFIX INTLLIBS LIBINTL LTLIBINTL POSUB localedir ncp_ipx_headers_1 ncp_ipx_headers_2 ncp_ipx_defsiocprotoprivate ncp_ipx_defsiocaipx ncp_sys_mount_h ncp_linux_fs_h ncp_net_if_h ncp_net_route_h ncp_if_ether_support ncp_sys_select_h stdint_types socklen_t wchar_h LIB_PAM_SECURITY php_found REENTRANT_CFLAGS ncphost ELF_TARGET VERSIONED_LINK ncp_in_support ncp_ipx_support NDS_SUPPORT SIGNATURES MOUNT2 MOUNT3 USE_KERNEL ADDON_SUBDIRS ADDON_DEV_SUBDIRS FFUNCTION_SECTIONS GC_SECTIONS subdirs LIBOBJS LTLIBOBJS' +ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS CC_WARNINGS build build_cpu build_vendor build_os host host_cpu host_vendor host_os SET_MAKE CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA LN_S PACKAGE VERSION MKINSTALLDIRS USE_NLS MSGFMT GMSGFMT XGETTEXT MSGMERGE CPP EGREP GLIBC2 RANLIB ac_ct_RANLIB ALLOCA GLIBC21 INTL_MACOSX_LIBS HAVE_POSIX_PRINTF HAVE_ASPRINTF HAVE_SNPRINTF HAVE_WPRINTF LIBICONV LTLIBICONV INTLBISON BUILD_INCLUDED_LIBINTL USE_INCLUDED_LIBINTL CATOBJEXT DATADIRNAME INSTOBJEXT GENCAT INTLOBJS INTL_LIBTOOL_SUFFIX_PREFIX INTLLIBS LIBINTL LTLIBINTL POSUB localedir ncp_ipx_headers_1 ncp_ipx_headers_2 ncp_ipx_defsiocprotoprivate ncp_ipx_defsiocaipx ncp_sys_mount_h ncp_linux_fs_h ncp_net_if_h ncp_net_route_h ncp_if_ether_support ncp_sys_select_h stdint_types socklen_t wchar_h LIB_PAM_SECURITY php_found REENTRANT_CFLAGS ncphost ELF_TARGET VERSIONED_LINK ncp_in_support ncp_ipx_support NDS_SUPPORT SIGNATURES MOUNT2 MOUNT3 USE_KERNEL ADDON_SUBDIRS ADDON_DEV_SUBDIRS FFUNCTION_SECTIONS GC_SECTIONS BUILD_SHARED subdirs LIBOBJS LTLIBOBJS' ac_subst_files='' # Initialize some variables set by options. @@ -864,6 +864,7 @@ Optional Features: --disable-reentrant do not compile threading support into library --disable-versions do not use version symbols in library --disable-function-sections do not use -ffunction-sections for static libraries + --disable-shared disable build/use of shared libncp --enable-trace enable trace of ncp calls --enable-ncp-debug enable builtin debugging support --disable-nls do not use Native Language Support @@ -1432,6 +1433,12 @@ fi; # Check whether --enable-function_sections or --disable-function_sections was given. if test "${enable_function_sections+set}" = set; then enableval="$enable_function_sections" + +fi; + +# Check whether --enable-shared or --disable-shared was given. +if test "${enable_shared+set}" = set; then + enableval="$enable_shared" fi; @@ -14049,6 +14056,16 @@ ELF_TARGET="$ncp_cv_elf_target" ELF_TARGET="$ncp_cv_elf_target" +BUILD_SHARED="$ELF_TARGET" +if test "$enable_shared" = "no" +then + BUILD_SHARED="no" +fi +if test "$enable_shared" = "yes" +then + BUILD_SHARED="yes" +fi + FFUNCTION_SECTIONS="" GC_SECTIONS="" if test "$function_sections" = "yes" @@ -14174,6 +14191,7 @@ fi ADDON_SUBDIRS="$ADDON_SUBDIRS $ADDON_DEV_SUBDIRS" + @@ -14944,6 +14962,7 @@ s,@ADDON_DEV_SUBDIRS@,$ADDON_DEV_SUBDIRS s,@ADDON_DEV_SUBDIRS@,$ADDON_DEV_SUBDIRS,;t t s,@FFUNCTION_SECTIONS@,$FFUNCTION_SECTIONS,;t t s,@GC_SECTIONS@,$GC_SECTIONS,;t t +s,@BUILD_SHARED@,$BUILD_SHARED,;t t s,@subdirs@,$subdirs,;t t s,@LIBOBJS@,$LIBOBJS,;t t s,@LTLIBOBJS@,$LTLIBOBJS,;t t diff -r 50351d213ba9 -r bda42d4b9cf1 configure.ac --- a/configure.ac Sat May 28 18:57:50 2005 +0000 +++ b/configure.ac Sat May 28 19:21:17 2005 +0000 @@ -50,6 +50,9 @@ AC_ARG_ENABLE(versions, AC_ARG_ENABLE(function_sections, [ --disable-function-sections do not use -ffunction-sections for static libraries]) + +AC_ARG_ENABLE(shared, +[ --disable-shared disable build/use of shared libncp]) AC_ARG_ENABLE(trace, [ --enable-trace enable trace of ncp calls]) @@ -892,6 +895,16 @@ ELF_TARGET="$ncp_cv_elf_target" ELF_TARGET="$ncp_cv_elf_target" AC_SUBST(ELF_TARGET) +BUILD_SHARED="$ELF_TARGET" +if test "$enable_shared" = "no" +then + BUILD_SHARED="no" +fi +if test "$enable_shared" = "yes" +then + BUILD_SHARED="yes" +fi + FFUNCTION_SECTIONS="" GC_SECTIONS="" if test "$function_sections" = "yes" @@ -999,6 +1012,7 @@ AC_SUBST(ADDON_DEV_SUBDIRS) AC_SUBST(ADDON_DEV_SUBDIRS) AC_SUBST(FFUNCTION_SECTIONS) AC_SUBST(GC_SECTIONS) +AC_SUBST(BUILD_SHARED) AC_CONFIG_FILES([ Make.rules diff -r 50351d213ba9 -r bda42d4b9cf1 contrib/tcl-utils/Makefile.in --- a/contrib/tcl-utils/Makefile.in Sat May 28 18:57:50 2005 +0000 +++ b/contrib/tcl-utils/Makefile.in Sat May 28 19:21:17 2005 +0000 @@ -26,7 +26,7 @@ SBINUTILS = $(O_SBINUTILS:%.o=%) UTILS = $(USERUTILS) $(SBINUTILS) -ifeq ($(HAVE_ELF),yes) +ifeq ($(BUILD_SHARED),yes) NCP_LIB := libncp.so else NCP_LIB := libncp.a diff -r 50351d213ba9 -r bda42d4b9cf1 contrib/tknwmsg/Makefile.in --- a/contrib/tknwmsg/Makefile.in Sat May 28 18:57:50 2005 +0000 +++ b/contrib/tknwmsg/Makefile.in Sat May 28 19:21:17 2005 +0000 @@ -19,7 +19,7 @@ SBINUTILS = $(O_SBINUTILS:%.o=%) UTILS = $(USERUTILS) $(SBINUTILS) -ifeq ($(HAVE_ELF),yes) +ifeq ($(BUILD_SHARED),yes) NCP_LIB = libncp.so NCPLIB_DIR = ../../lib LIBDEP = $(NCPLIB_DIR)/$(NCP_LIB) diff -r 50351d213ba9 -r bda42d4b9cf1 lib/Makefile.in --- a/lib/Makefile.in Sat May 28 18:57:50 2005 +0000 +++ b/lib/Makefile.in Sat May 28 19:21:17 2005 +0000 @@ -63,9 +63,14 @@ SHARED_CFLAGS := $(CFLAGS) $(CCFLAGS) .PHONY : all dep install install-dev clean mrproper distclean .PHONY : install_shared install_static install_static_su + +ifeq ($(BUILD_SHARED),yes) all: $(STATIC_NCPLIB) $(SHARED_NCPLIB) - install: install_shared +else +all: $(STATIC_NCPLIB) +install: +endif %.d: %.c set -e; $(CC) -M $(STATIC_CFLAGS) $(CFLAGS_$(@:.d=.o)) $(BASE_CFLAGS) $< \ diff -r 50351d213ba9 -r bda42d4b9cf1 util/Makefile.in --- a/util/Makefile.in Sat May 28 18:57:50 2005 +0000 +++ b/util/Makefile.in Sat May 28 19:21:17 2005 +0000 @@ -37,7 +37,7 @@ SBINUTILS = $(O_SBINUTILS:%.o=%) UTILS = $(USERUTILS) $(SBINUTILS) ncptest -ifeq ($(HAVE_ELF),yes) +ifeq ($(BUILD_SHARED),yes) NCP_LIB = libncp.so NCPLIB_DIR = ../lib LIBDEP = $(NCPLIB_DIR)/$(NCP_LIB) ++++++ ncpfs-hg-commit-423.patch ++++++ changeset: 423:bef6bf5896d3 user: Petr Vandrovec <petr@vandrovec.name> date: Sat May 28 19:42:20 2005 +0000 files: Make.rules.in configure configure.ac contrib/pam/Makefile.in contrib/tcl-utils/Makefile.in contrib/tknwmsg/Makefile.in lib/Makefile.in sutil/Makefile.in util/Makefile.in description: Do not hardwire library .a/.so extension. diff -r bda42d4b9cf1 -r bef6bf5896d3 Make.rules.in --- a/Make.rules.in Sat May 28 19:21:17 2005 +0000 +++ b/Make.rules.in Sat May 28 19:42:20 2005 +0000 @@ -50,6 +50,9 @@ HAVE_ELF := @ELF_TARGET@ HAVE_ELF := @ELF_TARGET@ BUILD_SHARED := @BUILD_SHARED@ +libext := @libext@ +shlibext := @shlibext@ + VERSION_SOLIB := 2.3.0 VERSION_SONAME := 2.3 diff -r bda42d4b9cf1 -r bef6bf5896d3 configure --- a/configure Sat May 28 19:21:17 2005 +0000 +++ b/configure Sat May 28 19:42:20 2005 +0000 @@ -313,7 +313,7 @@ ac_includes_default="\ #endif" ac_subdirs_all="$ac_subdirs_all contrib/php" -ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS CC_WARNINGS build build_cpu build_vendor build_os host host_cpu host_vendor host_os SET_MAKE CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA LN_S PACKAGE VERSION MKINSTALLDIRS USE_NLS MSGFMT GMSGFMT XGETTEXT MSGMERGE CPP EGREP GLIBC2 RANLIB ac_ct_RANLIB ALLOCA GLIBC21 INTL_MACOSX_LIBS HAVE_POSIX_PRINTF HAVE_ASPRINTF HAVE_SNPRINTF HAVE_WPRINTF LIBICONV LTLIBICONV INTLBISON BUILD_INCLUDED_LIBINTL USE_INCLUDED_LIBINTL CATOBJEXT DATADIRNAME INSTOBJEXT GENCAT INTLOBJS INTL_LIBTOOL_SUFFIX_PREFIX INTLLIBS LIBINTL LTLIBINTL POSUB localedir ncp_ipx_headers_1 ncp_ipx_headers_2 ncp_ipx_defsiocprotoprivate ncp_ipx_defsiocaipx ncp_sys_mount_h ncp_linux_fs_h ncp_net_if_h ncp_net_route_h ncp_if_ether_support ncp_sys_select_h stdint_types socklen_t wchar_h LIB_PAM_SECURITY php_found REENTRANT_CFLAGS ncphost ELF_TARGET VERSIONED_LINK ncp_in_support ncp_ipx_support NDS_SUPPORT SIGNATURES MOUNT2 MOUNT3 USE_KERNEL ADDON_SUBDIRS ADDON_DEV_SUBDIRS FFUNCTION_SECTIONS GC_SECTIONS BUILD_SHARED subdirs LIBOBJS LTLIBOBJS' +ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS CC_WARNINGS build build_cpu build_vendor build_os host host_cpu host_vendor host_os SET_MAKE CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA LN_S PACKAGE VERSION MKINSTALLDIRS USE_NLS MSGFMT GMSGFMT XGETTEXT MSGMERGE CPP EGREP GLIBC2 RANLIB ac_ct_RANLIB ALLOCA GLIBC21 INTL_MACOSX_LIBS HAVE_POSIX_PRINTF HAVE_ASPRINTF HAVE_SNPRINTF HAVE_WPRINTF LIBICONV LTLIBICONV INTLBISON BUILD_INCLUDED_LIBINTL USE_INCLUDED_LIBINTL CATOBJEXT DATADIRNAME INSTOBJEXT GENCAT INTLOBJS INTL_LIBTOOL_SUFFIX_PREFIX INTLLIBS LIBINTL LTLIBINTL POSUB localedir ncp_ipx_headers_1 ncp_ipx_headers_2 ncp_ipx_defsiocprotoprivate ncp_ipx_defsiocaipx ncp_sys_mount_h ncp_linux_fs_h ncp_net_if_h ncp_net_route_h ncp_if_ether_support ncp_sys_select_h stdint_types socklen_t wchar_h LIB_PAM_SECURITY php_found REENTRANT_CFLAGS ncphost ELF_TARGET VERSIONED_LINK ncp_in_support ncp_ipx_support NDS_SUPPORT SIGNATURES MOUNT2 MOUNT3 USE_KERNEL ADDON_SUBDIRS ADDON_DEV_SUBDIRS FFUNCTION_SECTIONS GC_SECTIONS BUILD_SHARED shlibext libext subdirs LIBOBJS LTLIBOBJS' ac_subst_files='' # Initialize some variables set by options. @@ -14106,6 +14106,39 @@ then GC_SECTIONS="-Wl,--gc-sections " fi + + + echo "$as_me:$LINENO: checking for shared library run path origin" >&5 +echo $ECHO_N "checking for shared library run path origin... $ECHO_C" >&6 +if test "${acl_cv_rpath+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \ + ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh + . ./conftest.sh + rm -f ./conftest.sh + acl_cv_rpath=done + +fi +echo "$as_me:$LINENO: result: $acl_cv_rpath" >&5 +echo "${ECHO_T}$acl_cv_rpath" >&6 + wl="$acl_cv_wl" + libext="$acl_cv_libext" + shlibext="$acl_cv_shlibext" + hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec" + hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator" + hardcode_direct="$acl_cv_hardcode_direct" + hardcode_minus_L="$acl_cv_hardcode_minus_L" + # Check whether --enable-rpath or --disable-rpath was given. +if test "${enable_rpath+set}" = set; then + enableval="$enable_rpath" + : +else + enable_rpath=yes +fi; + + if test "$VERSIONED_LINK" = "yes" then echo "$as_me:$LINENO: checking for working versioned link" >&5 @@ -14126,7 +14159,7 @@ void lsym(void) { }; void lsym(void) { }; void gsym(void) { }; EOF - if ${CC} -shared -Wl,-version-script=conftest.vers -o conftest.so conftest.c -lc >/dev/null 2>&1 + if ${CC} -shared -Wl,-version-script=conftest.vers -o conftest.${shlibext} conftest.c -lc >/dev/null 2>&1 then ncp_cv_versioned_link=yes fi @@ -14134,7 +14167,7 @@ fi fi echo "$as_me:$LINENO: result: $ncp_cv_versioned_link" >&5 echo "${ECHO_T}$ncp_cv_versioned_link" >&6 - rm -f conftest.c conftest.vers conftest.so + rm -f conftest.c conftest.vers conftest.${shlibext} if test "$ncp_cv_versioned_link" = "no" then if test "$versions_forced" = "yes" @@ -14191,6 +14224,8 @@ fi ADDON_SUBDIRS="$ADDON_SUBDIRS $ADDON_DEV_SUBDIRS" + + @@ -14963,6 +14998,8 @@ s,@FFUNCTION_SECTIONS@,$FFUNCTION_SECTIO s,@FFUNCTION_SECTIONS@,$FFUNCTION_SECTIONS,;t t s,@GC_SECTIONS@,$GC_SECTIONS,;t t s,@BUILD_SHARED@,$BUILD_SHARED,;t t +s,@shlibext@,$shlibext,;t t +s,@libext@,$libext,;t t s,@subdirs@,$subdirs,;t t s,@LIBOBJS@,$LIBOBJS,;t t s,@LTLIBOBJS@,$LTLIBOBJS,;t t diff -r bda42d4b9cf1 -r bef6bf5896d3 configure.ac --- a/configure.ac Sat May 28 19:21:17 2005 +0000 +++ b/configure.ac Sat May 28 19:42:20 2005 +0000 @@ -937,6 +937,8 @@ then GC_SECTIONS="-Wl,--gc-sections " fi +AC_LIB_RPATH + if test "$VERSIONED_LINK" = "yes" then AC_CACHE_CHECK(for working versioned link, @@ -954,12 +956,12 @@ void lsym(void) { }; void lsym(void) { }; void gsym(void) { }; EOF - if ${CC} -shared -Wl,-version-script=conftest.vers -o conftest.so conftest.c -lc >/dev/null 2>&1 + if ${CC} -shared -Wl,-version-script=conftest.vers -o conftest.${shlibext} conftest.c -lc >/dev/null 2>&1 then ncp_cv_versioned_link=yes fi] ) - rm -f conftest.c conftest.vers conftest.so + rm -f conftest.c conftest.vers conftest.${shlibext} if test "$ncp_cv_versioned_link" = "no" then if test "$versions_forced" = "yes" @@ -1013,6 +1015,8 @@ AC_SUBST(FFUNCTION_SECTIONS) AC_SUBST(FFUNCTION_SECTIONS) AC_SUBST(GC_SECTIONS) AC_SUBST(BUILD_SHARED) +AC_SUBST(shlibext) +AC_SUBST(libext) AC_CONFIG_FILES([ Make.rules diff -r bda42d4b9cf1 -r bef6bf5896d3 contrib/pam/Makefile.in --- a/contrib/pam/Makefile.in Sat May 28 19:21:17 2005 +0000 +++ b/contrib/pam/Makefile.in Sat May 28 19:42:20 2005 +0000 @@ -10,10 +10,10 @@ LIBS = @INTLLIBS@ @LIBS@ LIBS = @INTLLIBS@ @LIBS@ LIB_PAM_SECURITY = @LIB_PAM_SECURITY@ -NCP_LIB = libncp.so +NCP_LIB = libncp.$(shlibext) NCPLIB_DIR = ../../lib -PAM_LIBRARY = pam_ncp_auth.so +PAM_LIBRARY = pam_ncp_auth.$(shlibext) PAM_OBJECTS = pam_ncp_auth.do support.do CFLAGS_pam_ncp_auth.do := -DNCPMOUNT_PATH=\"$(bindir)/ncpmount\" -DNCPUMOUNT_PATH=\"$(bindir)/ncpumount\" diff -r bda42d4b9cf1 -r bef6bf5896d3 contrib/tcl-utils/Makefile.in --- a/contrib/tcl-utils/Makefile.in Sat May 28 19:21:17 2005 +0000 +++ b/contrib/tcl-utils/Makefile.in Sat May 28 19:42:20 2005 +0000 @@ -27,9 +27,9 @@ UTILS = $(USERUTILS) $(SBINUTILS) UTILS = $(USERUTILS) $(SBINUTILS) ifeq ($(BUILD_SHARED),yes) -NCP_LIB := libncp.so +NCP_LIB := libncp.$(shlibext) else -NCP_LIB := libncp.a +NCP_LIB := libncp.$(libext) endif NCPLIB_DIR := ${top_builddir}/lib LIBDEP := $(NCPLIB_DIR)/$(NCP_LIB) @@ -49,11 +49,11 @@ install: all install-dev: -${NCPLIB_DIR}/libncp.a: - make -C ${NCPLIB_DIR} libncp.a +${NCPLIB_DIR}/libncp.$(libext): + make -C ${NCPLIB_DIR} libncp.$(libext) -${NCPLIB_DIR}/libncp.so: - make -C ${NCPLIB_DIR} libncp.so +${NCPLIB_DIR}/libncp.$(shlibext): + make -C ${NCPLIB_DIR} libncp.$(shlibext) $(O_USERUTILS) $(O_SBINUTILS) $(O_OTHER): %.o: %.c $(CC) $(CFLAGS) $(CCFLAGS) $(CFLAGS_$@) -o $@ -c $< diff -r bda42d4b9cf1 -r bef6bf5896d3 contrib/tknwmsg/Makefile.in --- a/contrib/tknwmsg/Makefile.in Sat May 28 19:21:17 2005 +0000 +++ b/contrib/tknwmsg/Makefile.in Sat May 28 19:42:20 2005 +0000 @@ -20,14 +20,12 @@ UTILS = $(USERUTILS) $(SBINUTILS) UTILS = $(USERUTILS) $(SBINUTILS) ifeq ($(BUILD_SHARED),yes) -NCP_LIB = libncp.so -NCPLIB_DIR = ../../lib +NCP_LIB = libncp.$(shlibext) +else +NCP_LIB = libncp.$(libext) +endif +NCPLIB_DIR = $(top_builddir)/lib LIBDEP = $(NCPLIB_DIR)/$(NCP_LIB) -else -NCP_LIB = libncp.a -NCPLIB_DIR = ../../lib -LIBDEP = $(NCPLIB_DIR)/$(NCP_LIB) -endif .PHONY : all install install-dev dep clean mrproper distclean .PHONY : default @@ -46,11 +44,11 @@ install: all install-dev: -../../lib/libncp.a: - make -C ../../lib libncp.a +../../lib/libncp.$(libext): + make -C ../../lib libncp.$(libext) -../../lib/libncp.so: - make -C ../../lib libncp.so +../../lib/libncp.$(shlibext): + make -C ../../lib libncp.$(shlibext) $(O_USERUTILS) $(O_SBINUTILS): %.o: %.c $(CC) $(CFLAGS) $(CCFLAGS) -o $@ -c $< diff -r bda42d4b9cf1 -r bef6bf5896d3 lib/Makefile.in --- a/lib/Makefile.in Sat May 28 19:21:17 2005 +0000 +++ b/lib/Makefile.in Sat May 28 19:42:20 2005 +0000 @@ -14,10 +14,10 @@ REENTRANT_CFLAGS := @REENTRANT_CFLAGS@ REENTRANT_CFLAGS := @REENTRANT_CFLAGS@ VERSIONED_LINK := @VERSIONED_LINK@ -SHARED_NCPLIB := libncp.so +SHARED_NCPLIB := libncp.$(shlibext) SHARED_NCPLIB_BIN := $(SHARED_NCPLIB).$(VERSION_SOLIB) SHARED_NCPLIB_SONAME := $(SHARED_NCPLIB).$(VERSION_SONAME) -STATIC_NCPLIB := libncp.a +STATIC_NCPLIB := libncp.$(libext) STATIC_NCPLIB_BIN := $(STATIC_NCPLIB) CCFLAGS += -I. @@ -93,7 +93,7 @@ dep: clean: rm -f *.o *.do *.to *~ ds/*.o ds/*.do ds/*.to ds/*~ fs/*.o fs/*.do fs/*.to fs/*~ - rm -f libncp.a libncp.so* libncpsu.* + rm -f $(STATIC_NCPLIB) libncp.$(shlibext)* mrproper: clean rm -f $(UTILS) $(DISTFILE) *.d fs/*.d ds/*.d diff -r bda42d4b9cf1 -r bef6bf5896d3 sutil/Makefile.in --- a/sutil/Makefile.in Sat May 28 19:21:17 2005 +0000 +++ b/sutil/Makefile.in Sat May 28 19:42:20 2005 +0000 @@ -85,11 +85,11 @@ ncpm_common.d mount_login.d: %.d: %.c | sed 's,\($*\)\.o[ :]*,\1.o \1.do \1.to $@ : ,g' > $@; \ [ -s $@ ] || rm -f $@ -$(UTILS): %: %.o ../lib/libncp.a +$(UTILS): %: %.o ../lib/libncp.$(libext) $(CC) @GC_SECTIONS@-o $@ $^ ${LIBS} -../lib/libncp.a: - make -C ../lib libncp.a +../lib/libncp.$(libext): + make -C ../lib libncp.$(libext) dep: diff -r bda42d4b9cf1 -r bef6bf5896d3 util/Makefile.in --- a/util/Makefile.in Sat May 28 19:21:17 2005 +0000 +++ b/util/Makefile.in Sat May 28 19:42:20 2005 +0000 @@ -38,14 +38,12 @@ UTILS = $(USERUTILS) $(SBINUTILS) ncptes UTILS = $(USERUTILS) $(SBINUTILS) ncptest ifeq ($(BUILD_SHARED),yes) -NCP_LIB = libncp.so +NCP_LIB = libncp.$(shlibext) +else +NCP_LIB = libncp.$(libext) +endif NCPLIB_DIR = ../lib LIBDEP = $(NCPLIB_DIR)/$(NCP_LIB) -else -NCP_LIB = libncp.a -NCPLIB_DIR = ../lib -LIBDEP = $(NCPLIB_DIR)/$(NCP_LIB) -endif CFLAGS_ncopy.o = -D_GNU_SOURCE ADDOBJS_pqstat = dsqueue.o @@ -76,11 +74,11 @@ endif install-dev: -../lib/libncp.a: - make -C ../lib libncp.a +../lib/libncp.$(libext): + make -C $(NCPLIB_DIR) libncp.$(libext) -../lib/libncp.so: - make -C ../lib libncp.so +../lib/libncp.$(shlibext): + make -C $(NCPLIB_DIR) libncp.$(shlibext) $(O_USERUTILS) $(O_SBINUTILS) $(O_OTHER) ncptest.o: %.o: %.c $(CC) $(CFLAGS) $(CCFLAGS) $(CFLAGS_$@) -o $@ -c $< ++++++ ncpfs-hg-commit-424.patch ++++++ changeset: 424:81e0853d48a9 user: Petr Vandrovec <petr@vandrovec.name> date: Sat May 28 19:59:35 2005 +0000 files: include/ncp/kernel/types.h.in description: Use stdint.h when possible. Fixes problems on Darwin. diff -r bef6bf5896d3 -r 81e0853d48a9 include/ncp/kernel/types.h.in --- a/include/ncp/kernel/types.h.in Sat May 28 19:42:20 2005 +0000 +++ b/include/ncp/kernel/types.h.in Sat May 28 19:59:35 2005 +0000 @@ -7,6 +7,9 @@ @ncp_in_support@ @ncp_ipx_support@ +#if @stdint_types@ +#include <stdint.h> +#else /* FIXME: What about configure?! */ #ifndef __BIT_TYPES_DEFINED__ #define __BIT_TYPES_DEFINED__ 1 @@ -26,6 +29,7 @@ typedef signed long long int64_t; #endif #endif /* __BIT_TYPES_DEFINED__ */ +#endif #if @USE_KERNEL@ ++++++ ncpfs-hg-commit-425.patch ++++++ ++++ 2802 lines (skipped) ++++++ ncpfs-hg-commit-426.patch ++++++ changeset: 426:08cd551d8c1c user: Petr Vandrovec <petr@vandrovec.name> date: Sun Jun 05 14:23:57 2005 +0000 files: include/ncp/ipxlib.h include/ncp/kernel/ncp.h include/ncp/ncplib.h ipx-1.0/Samples/rip.c ipx-1.0/Samples/sap.c ipx-1.0/ipx_cmd.c ipxdump/ipxparse.c lib/ncplib.c description: Add __attribute__((packed)) at structure level too. Darwin's gcc-3.3 needs that, otherwise it (at least) adds one byte to ncp_request_header, completely mangling sent packet. diff -r 8341fcd1dc86 -r 08cd551d8c1c include/ncp/ipxlib.h --- a/include/ncp/ipxlib.h Sat May 28 20:02:00 2005 +0000 +++ b/include/ncp/ipxlib.h Sun Jun 05 14:23:57 2005 +0000 @@ -73,7 +73,7 @@ struct sap_server_ident #endif IPXPort server_port __attribute__((packed)); u_int16_t intermediate_network __attribute__((packed)); -}; +} __attribute__((packed)); #define IPX_RIP_REQUEST (0x1) #define IPX_RIP_RESPONSE (0x2) @@ -82,13 +82,13 @@ struct ipx_rt_def { u_int32_t network __attribute__((packed)); u_int16_t hops __attribute__((packed)); u_int16_t ticks __attribute__((packed)); -}; +} __attribute__((packed)); struct ipx_rip_packet { u_int16_t operation __attribute__((packed)); struct ipx_rt_def rt[1] __attribute__((packed)); -}; +} __attribute__((packed)); #ifdef SWIG #define IPX_BROADCAST_NODE "\xff\xff\xff\xff\xff\xff" diff -r 8341fcd1dc86 -r 08cd551d8c1c include/ncp/kernel/ncp.h --- a/include/ncp/kernel/ncp.h Sat May 28 20:02:00 2005 +0000 +++ b/include/ncp/kernel/ncp.h Sun Jun 05 14:23:57 2005 +0000 @@ -59,7 +59,7 @@ struct ncp_request_header { u_int8_t conn_high __attribute__((packed)); u_int8_t function __attribute__((packed)); u_int8_t data[0] __attribute__((packed)); -}; +} __attribute__((packed)); #define NCP_REPLY (0x3333) #define NCP_POSITIVE_ACK (0x9999) @@ -73,7 +73,7 @@ struct ncp_reply_header { u_int8_t completion_code __attribute__((packed)); u_int8_t connection_state __attribute__((packed)); u_int8_t data[0] __attribute__((packed)); -}; +} __attribute__((packed)); #define NCP_VOLNAME_LEN (16) #define NCP_NUMBER_OF_VOLUMES (64) @@ -232,7 +232,7 @@ struct nw_info_struct { u_int32_t NSCreator __attribute__((packed)); u_int8_t nameLen __attribute__((packed)); u_int8_t entryName[256] __attribute__((packed)); -}; +} __attribute__((packed)); #endif /* modify mask - use with MODIFY_DOS_INFO structure */ @@ -265,7 +265,7 @@ struct nw_modify_dos_info { u_int16_t inheritanceGrantMask __attribute__((packed)); u_int16_t inheritanceRevokeMask __attribute__((packed)); u_int32_t maximumSpace __attribute__((packed)); -}; +} __attribute__((packed)); #ifdef SWIG struct nw_file_info { @@ -284,13 +284,13 @@ struct nw_file_info { u_int32_t server_file_handle __attribute__((packed)); u_int8_t open_create_action __attribute__((packed)); u_int8_t file_handle[6] __attribute__((packed)); -}; +} __attribute__((packed)); #endif struct nw_search_sequence { u_int8_t volNumber __attribute__((packed)); u_int32_t dirBase __attribute__((packed)); u_int32_t sequence __attribute__((packed)); -}; +} __attribute__((packed)); #endif /* _LINUX_NCP_H */ diff -r 8341fcd1dc86 -r 08cd551d8c1c include/ncp/ncplib.h --- a/include/ncp/ncplib.h Sat May 28 20:02:00 2005 +0000 +++ b/include/ncp/ncplib.h Sun Jun 05 14:23:57 2005 +0000 @@ -492,7 +492,7 @@ struct ncp_file_server_info u_int8_t RestrictionLevel __attribute__((packed)); u_int8_t InternetBridge __attribute__((packed)); u_int8_t Reserved[60] __attribute__((packed)); -}; +} __attribute__((packed)); #endif struct ncp_file_server_info_2 { @@ -607,7 +607,7 @@ struct ncp_station_addr u_int8_t Node[6] __attribute__((packed)); #endif u_int16_t Socket __attribute__((packed)); -}; +} __attribute__((packed)); struct ncp_prop_login_control { @@ -640,7 +640,7 @@ struct ncp_prop_login_control u_int16_t BadLoginCount __attribute__((packed)); u_int32_t BadLoginCountDown __attribute__((packed)); struct ncp_station_addr LastIntruder __attribute__((packed)); -}; +} __attribute__((packed)); NWCCODE NWReadPropertyValue(NWCONN_HANDLE conn, const char *objName, NWObjectType objType, const char *propertyName, diff -r 8341fcd1dc86 -r 08cd551d8c1c ipx-1.0/Samples/rip.c --- a/ipx-1.0/Samples/rip.c Sat May 28 20:02:00 2005 +0000 +++ b/ipx-1.0/Samples/rip.c Sun Jun 05 14:23:57 2005 +0000 @@ -5,7 +5,7 @@ struct rip_data u_int32_t rip_net __attribute__((packed)); u_int16_t rip_hops __attribute__((packed)); u_int16_t rip_ticks __attribute__((packed)); -}; +} __attribute__((packed)); int main(int argc, char **argv) diff -r 8341fcd1dc86 -r 08cd551d8c1c ipx-1.0/Samples/sap.c --- a/ipx-1.0/Samples/sap.c Sat May 28 20:02:00 2005 +0000 +++ b/ipx-1.0/Samples/sap.c Sun Jun 05 14:23:57 2005 +0000 @@ -8,7 +8,7 @@ struct sap_data u_int8_t sap_node[6] __attribute__((packed)); u_int16_t sap_sock __attribute__((packed)); u_int16_t sap_hops __attribute__((packed)); -}; +} __attribute__((packed)); int main(int argc, char **argv) diff -r 8341fcd1dc86 -r 08cd551d8c1c ipx-1.0/ipx_cmd.c --- a/ipx-1.0/ipx_cmd.c Sat May 28 20:02:00 2005 +0000 +++ b/ipx-1.0/ipx_cmd.c Sun Jun 05 14:23:57 2005 +0000 @@ -66,8 +66,8 @@ struct { u_int8_t dst[6] __attribute__((packed)); u_int8_t src[6] __attribute__((packed)); u_int16_t type __attribute__((packed)); - u_int8_t ipx[16384]; - } buffer; + u_int8_t ipx[16384] __attribute__((packed)); + } __attribute__((packed)) buffer; static int getiflist(int fd, struct ifconf* ifc) { int i; diff -r 8341fcd1dc86 -r 08cd551d8c1c ipxdump/ipxparse.c --- a/ipxdump/ipxparse.c Sat May 28 20:02:00 2005 +0000 +++ b/ipxdump/ipxparse.c Sun Jun 05 14:23:57 2005 +0000 @@ -60,7 +60,7 @@ struct ipx_address IPXNet net __attribute__((packed)); IPXNode node __attribute__((packed)); IPXPort sock __attribute__((packed)); -}; +} __attribute__((packed)); struct ipx_packet { @@ -77,7 +77,7 @@ struct ipx_packet #define IPX_TYPE_PPROP 0x14 /* complicated flood fill brdcast [Not supported] */ struct ipx_address ipx_dest __attribute__((packed)); struct ipx_address ipx_source __attribute__((packed)); -}; +} __attribute__((packed)); #define NCP_ALLOC_SLOT_REQUEST (0x1111) #define NCP_REQUEST (0x2222) @@ -92,7 +92,7 @@ struct ncp_request_header u_int8_t conn_high __attribute__((packed)); u_int8_t function __attribute__((packed)); u_int8_t data[0] __attribute__((packed)); -}; +} __attribute__((packed)); #define NCP_REPLY (0x3333) #define NCP_POSITIVE_ACK (0x9999) @@ -107,7 +107,7 @@ struct ncp_reply_header u_int8_t completion_code __attribute__((packed)); u_int8_t connection_state __attribute__((packed)); u_int8_t data[0] __attribute__((packed)); -}; +} __attribute__((packed)); #define NCP_BURST_PACKET (0x7777) @@ -126,7 +126,7 @@ struct ncp_burst_header u_int32_t data_offset __attribute__((packed)); u_int16_t data_bytes __attribute__((packed)); u_int16_t missing_frags __attribute__((packed)); -}; +} __attribute__((packed)); void handle_ipx(unsigned char *buf, int length, char *frame, int no); void handle_ncp(struct sockaddr_ipx *source, @@ -149,7 +149,7 @@ typedef struct saps u_int8_t serverName[SAP_MAX_SERVER_NAME_LENGTH] __attribute__((packed)); struct ipx_address serverAddress __attribute__((packed)); u_int16_t serverHops __attribute__((packed)); /* NBO */ -} +} __attribute__((packed)) SAPS; /* General Service/Nearest Server Response SAP packet */ @@ -160,14 +160,14 @@ union sap_packet { u_int16_t sapOperation __attribute__((packed)); u_int16_t serverType __attribute__((packed)); - } + } __attribute__((packed)) query; struct sap_response { u_int16_t sapOperation __attribute__((packed)); /* each SAP can has a max of SAP_MAX_SAPS_PER_PACKET packets */ SAPS sap[SAP_MAX_SAPS_PER_PACKET] __attribute__((packed)); - } + } __attribute__((packed)) response; }; @@ -356,7 +356,7 @@ handle_burst(struct sockaddr_ipx *source u_int8_t reserved[8] __attribute__((packed)); u_int32_t file_offset __attribute__((packed)); u_int32_t number_of_bytes __attribute__((packed)); - } + } __attribute__((packed)) *brq = (struct ncp_burst_request *) rq; printf("Assuming Burst Request:\n"); diff -r 8341fcd1dc86 -r 08cd551d8c1c lib/ncplib.c --- a/lib/ncplib.c Sat May 28 20:02:00 2005 +0000 +++ b/lib/ncplib.c Sun Jun 05 14:23:57 2005 +0000 @@ -2627,7 +2627,7 @@ struct nw_time_buffer u_int8_t minute __attribute__((packed)); u_int8_t second __attribute__((packed)); u_int8_t wday __attribute__((packed)); -}; +} __attribute__((packed)); static time_t nw_to_ctime(struct nw_time_buffer *source) ++++++ ncpfs-hg-commit-427.patch ++++++ changeset: 427:225fa587c2d8 user: Petr Vandrovec <petr@vandrovec.name> date: Sun Jun 05 14:35:13 2005 +0000 files: ipx-1.0/Samples/rip.c ipx-1.0/Samples/sap.c description: Fix problems in ipx samples when packet with zero or 1 byte received. diff -r 08cd551d8c1c -r 225fa587c2d8 ipx-1.0/Samples/rip.c --- a/ipx-1.0/Samples/rip.c Sun Jun 05 14:23:57 2005 +0000 +++ b/ipx-1.0/Samples/rip.c Sun Jun 05 14:35:13 2005 +0000 @@ -36,6 +36,8 @@ main(int argc, char **argv) } while (1) { + size_t rclen; + len = sizeof(sipx); result = recvfrom(s, msg, sizeof(msg), 0, (struct sockaddr *) &sipx, &len); @@ -44,8 +46,12 @@ main(int argc, char **argv) perror("IPX: recvfrom"); exit(-1); } + if (result < 2) { + fprintf(stderr, "Received packet is too short to be RIP packet (%d bytes)\n", result); + continue; + } + rclen = result - 2; bptr = msg; - result -= 2; printf("RIP packet from: %08X:%02X%02X%02X%02X%02X%02X\n", (u_int32_t)htonl(sipx.sipx_network), sipx.sipx_node[0], sipx.sipx_node[1], @@ -53,11 +59,11 @@ main(int argc, char **argv) sipx.sipx_node[6], sipx.sipx_node[5]); bptr += 2; rp = (struct rip_data *) bptr; - while (result >= sizeof(struct rip_data)) + while (rclen >= sizeof(struct rip_data)) { printf("\tNET: %08X HOPS: %d\n", (u_int32_t)ntohl(rp->rip_net), ntohs(rp->rip_hops)); - result -= sizeof(struct rip_data); + rclen -= sizeof(struct rip_data); rp++; } } diff -r 08cd551d8c1c -r 225fa587c2d8 ipx-1.0/Samples/sap.c --- a/ipx-1.0/Samples/sap.c Sun Jun 05 14:23:57 2005 +0000 +++ b/ipx-1.0/Samples/sap.c Sun Jun 05 14:35:13 2005 +0000 @@ -47,6 +47,8 @@ main(int argc, char **argv) } while (1) { + size_t rclen; + len = 1024; result = recvfrom(s, msg, sizeof(msg), 0, (struct sockaddr *) &sipx, &len); @@ -55,16 +57,20 @@ main(int argc, char **argv) perror("IPX: recvfrom: "); exit(-1); } + if (result < 2) { + fprintf(stderr, "Received packet is too short to be SAP packet (%d bytes)\n", result); + continue; + } + rclen = result - 2; bptr = msg; - result -= 2; printf("SAP: OP is %x %x\n", bptr[0], bptr[1]); - printf("Length is %d\n", result); + printf("Length is %u\n", rclen); if (bptr[1] != 2) continue; bptr += 2; sp = (struct sap_data *) bptr; - while (result >= sizeof(struct sap_data)) + while (rclen >= sizeof(struct sap_data)) { int i; @@ -83,7 +89,7 @@ main(int argc, char **argv) sp->sap_node[4], sp->sap_node[5], ntohs(sp->sap_sock)); - result -= sizeof(struct sap_data); + rclen -= sizeof(struct sap_data); sp++; } } ++++++ ncpfs-hg-commit-428.patch ++++++ changeset: 428:cccdaf2ce097 user: Petr Vandrovec <petr@vandrovec.name> date: Sun Jun 05 14:35:46 2005 +0000 files: ipx-1.0/Samples/samples.h description: Include <stdlib.h> into samples, to get rid of warning about exit() not having a prototype. diff -r 225fa587c2d8 -r cccdaf2ce097 ipx-1.0/Samples/samples.h --- a/ipx-1.0/Samples/samples.h Sun Jun 05 14:35:13 2005 +0000 +++ b/ipx-1.0/Samples/samples.h Sun Jun 05 14:35:46 2005 +0000 @@ -1,4 +1,5 @@ #include <stdio.h> +#include <stdlib.h> #include <sys/types.h> #include <ncp/kernel/ipx.h> #include <netinet/in.h> ++++++ ncpfs-hg-commit-429.patch ++++++ changeset: 429:776dc4052e39 user: Petr Vandrovec <petr@vandrovec.name> date: Sun Jun 05 14:36:28 2005 +0000 files: ipxdump/ipxparse.c description: Remove warnings about shadowing variables in ipxparse. Also add __attribute__((packed)) into ipxparse as needed. diff -r cccdaf2ce097 -r 776dc4052e39 ipxdump/ipxparse.c --- a/ipxdump/ipxparse.c Sun Jun 05 14:35:46 2005 +0000 +++ b/ipxdump/ipxparse.c Sun Jun 05 14:36:28 2005 +0000 @@ -636,43 +636,43 @@ handle_ncp(struct sockaddr_ipx *source, { struct INPUT { - u_int16_t proposed_max_size; - u_int8_t security_flag; - } - *i = (struct INPUT *) data; + u_int16_t proposed_max_size __attribute__((packed)); + u_int8_t security_flag __attribute__((packed)); + } __attribute__((packed)) + *d = (struct INPUT *) data; printf("fn: %-3d\n", rq->function); printf("Get Big Packet NCP Max Packet Size\n"); printf("proposed_max_size: %x\n", - ntohs(i->proposed_max_size)); + ntohs(d->proposed_max_size)); printf("security_flag: %x\n", - i->security_flag); + d->security_flag); break; } case 101: { struct INPUT { - u_int32_t local_conn_id; - u_int32_t local_max_packet_size; - u_int16_t local_target_socket; - u_int32_t local_max_send_size; - u_int32_t local_max_recv_size; - } - *i = (struct INPUT *) data; + u_int32_t local_conn_id __attribute__((packed)); + u_int32_t local_max_packet_size __attribute__((packed)); + u_int16_t local_target_socket __attribute__((packed)); + u_int32_t local_max_send_size __attribute__((packed)); + u_int32_t local_max_recv_size __attribute__((packed)); + } __attribute__((packed)) + *d = (struct INPUT *) data; printf("fn: %-3d\n", rq->function); printf("Packet Burst Connection Request\n"); printf("local_conn_id: %x\n", - (u_int32_t)ntohl(i->local_conn_id)); + (u_int32_t)ntohl(d->local_conn_id)); printf("local_max_packet_size: %x\n", - (u_int32_t)ntohl(i->local_max_packet_size)); + (u_int32_t)ntohl(d->local_max_packet_size)); printf("local_target_socket: %x\n", - (u_int32_t)ntohl(i->local_target_socket)); + (u_int32_t)ntohl(d->local_target_socket)); printf("local_max_send_size: %x\n", - (u_int32_t)ntohl(i->local_max_send_size)); + (u_int32_t)ntohl(d->local_max_send_size)); printf("local_max_recv_size: %x\n", - (u_int32_t)ntohl(i->local_max_recv_size)); + (u_int32_t)ntohl(d->local_max_recv_size)); } break; case 104: @@ -700,26 +700,26 @@ handle_ncp(struct sockaddr_ipx *source, { struct INPUT { - u_int8_t subfunction_code; - u_int32_t fragger_handle; - u_int32_t max_fragment_size; - u_int32_t message_size; - u_int32_t fragment_flag; - u_int32_t verb; - } - *i = (struct INPUT *) data; + u_int8_t subfunction_code __attribute__((packed)); + u_int32_t fragger_handle __attribute__((packed)); + u_int32_t max_fragment_size __attribute__((packed)); + u_int32_t message_size __attribute__((packed)); + u_int32_t fragment_flag __attribute__((packed)); + u_int32_t verb __attribute__((packed)); + } __attribute__((packed)) + *d = (struct INPUT *) data; printf("Send NDS Fragment Request/Reply\n"); printf("fragger_handle: %lx\n", - (unsigned long) i->fragger_handle); + (unsigned long) d->fragger_handle); printf("max_fragment_size: %lx\n", - (unsigned long) i->max_fragment_size); + (unsigned long) d->max_fragment_size); printf("message_size: %lx\n", - (unsigned long) i->message_size); + (unsigned long) d->message_size); printf("fragment_flag: %lx\n", - (unsigned long) i->fragment_flag); - printf("verb: %d\n", i->verb); - - switch (i->verb) + (unsigned long) d->fragment_flag); + printf("verb: %d\n", d->verb); + + switch (d->verb) { case 1: printf("Resolve Name\n"); @@ -1001,9 +1001,9 @@ handle_ncp(struct sockaddr_ipx *source, { struct XDATA { - u_int8_t new_directory_handle; - u_int8_t access_rights_mask; - } + u_int8_t new_directory_handle __attribute__((packed)); + u_int8_t access_rights_mask __attribute__((packed)); + } __attribute__((packed)) *x = (struct XDATA *) data; printf("new_directory_handle: %x\n", x->new_directory_handle); @@ -1021,10 +1021,10 @@ handle_ncp(struct sockaddr_ipx *source, { struct XDATA { - u_int16_t accepted_max_size; - u_int16_t echo_socket; - u_int8_t security_flag; - } + u_int16_t accepted_max_size __attribute__((packed)); + u_int16_t echo_socket __attribute__((packed)); + u_int8_t security_flag __attribute__((packed)); + } __attribute__((packed)) *x = (struct XDATA *) data; printf("accepted_max_size: %x\n", ntohs(x->accepted_max_size)); @@ -1038,9 +1038,9 @@ handle_ncp(struct sockaddr_ipx *source, { struct XDATA { - u_int8_t completion_code; - u_int32_t remote_target_id; - u_int32_t remote_max_packet_size; + u_int8_t completion_code __attribute__((packed)); + u_int32_t remote_target_id __attribute__((packed)); + u_int32_t remote_max_packet_size __attribute__((packed)); } *x = (struct XDATA *) data; printf("completion_code: %x\n", ++++++ ncpfs-hg-commit-430.patch ++++++ changeset: 430:3fc1f5c9c744 user: Petr Vandrovec <petr@vandrovec.name> date: Sun Jun 05 21:25:42 2005 +0000 files: lib/ncplib.c description: Set tm_isdst to -1 (unknown DST state) when converting date/time from NetWare to Unix format. It should give better results when DST is active. diff -r 776dc4052e39 -r 3fc1f5c9c744 lib/ncplib.c --- a/lib/ncplib.c Sun Jun 05 14:36:28 2005 +0000 +++ b/lib/ncplib.c Sun Jun 05 21:25:42 2005 +0000 @@ -2641,6 +2641,7 @@ nw_to_ctime(struct nw_time_buffer *sourc u_time.tm_mday = source->day; u_time.tm_mon = source->month - 1; u_time.tm_year = source->year; + u_time.tm_isdst = -1; if (u_time.tm_year < 80) { u_time.tm_year += 100; ++++++ ncpfs-hg-commit-431.patch ++++++ ++++ 2957 lines (skipped) ++++++ ncpfs-hg-commit-432.patch ++++++ changeset: 432:93a411983bcc user: Petr Vandrovec <petr@vandrovec.name> date: Sun Jul 03 20:34:45 2005 +0100 files: contrib/php/libtool description: Regenerate php's libtool with gcc instead of gcc-4.0 diff -r 06020cf028e1 -r 93a411983bcc contrib/php/libtool --- a/contrib/php/libtool Sat Jun 11 19:59:00 2005 +0000 +++ b/contrib/php/libtool Sun Jul 03 20:34:45 2005 +0100 @@ -76,10 +76,10 @@ AR_FLAGS="cru" AR_FLAGS="cru" # A C compiler. -LTCC="gcc-4.0" +LTCC="gcc" # A language-specific compiler. -CC="gcc-4.0" +CC="gcc" # Is the compiler the GNU C compiler? with_gcc=yes @@ -316,11 +316,10 @@ link_all_deplibs=unknown link_all_deplibs=unknown # Compile-time system search path for libraries -sys_lib_search_path_spec=" /usr/lib/gcc/i486-linux/4.0.1/ /usr/lib/gcc/i486-linux/4.0.1/ /usr/lib/gcc/i486-linux/4.0.1/../../../../i486-linux/lib/i486-linux/4.0.1/ /usr/lib/gcc/i486-linux/4.0.1/../../../../i486-linux/lib/ /usr/lib/gcc/i486-linux/4.0.1/../../../i486-linux/4.0.1/ /usr/lib/gcc/i486-linux/4.0.1/../../../ /lib/i486-linux/4.0.1/ /lib/ /usr/lib/i486-linux/4.0.1/ /usr/lib/" +sys_lib_search_path_spec=" /usr/lib/gcc-lib/i486-linux-gnu/3.3.6/ /usr/lib/gcc/i486-linux-gnu/3.3.6/ /usr/lib/gcc-lib/i486-linux-gnu/3.3.6/../../../../i486-linux-gnu/lib/i486-linux-gnu/3.3.6/ /usr/lib/gcc-lib/i486-linux-gnu/3.3.6/../../../../i486-linux-gnu/lib/ /usr/lib/gcc-lib/i486-linux-gnu/3.3.6/../../../i486-linux-gnu/3.3.6/ /usr/lib/gcc-lib/i486-linux-gnu/3.3.6/../../../ /lib/i486-linux-gnu/3.3.6/ /lib/ /usr/lib/i486-linux-gnu/3.3.6/ /usr/lib/" # Run-time system search path for libraries sys_lib_dlsearch_path_spec="/lib /usr/lib /usr/X11R6/lib - /usr/lib/libc5-compat /lib/libc5-compat /usr/i486-linuxlibc1/lib @@ -6740,7 +6739,7 @@ AR_FLAGS="cru" AR_FLAGS="cru" # A C compiler. -LTCC="gcc-4.0" +LTCC="gcc" # A language-specific compiler. CC="g++" @@ -6881,11 +6880,11 @@ striplib="strip --strip-unneeded" # Dependencies to place before the objects being linked to create a # shared library. -predep_objects="/usr/lib/gcc-lib/i486-linux/3.3.6/../../../crti.o /usr/lib/gcc-lib/i486-linux/3.3.6/crtbeginS.o" +predep_objects="/usr/lib/gcc-lib/i486-linux-gnu/3.3.6/../../../crti.o /usr/lib/gcc-lib/i486-linux-gnu/3.3.6/crtbeginS.o" # Dependencies to place after the objects being linked to create a # shared library. -postdep_objects="/usr/lib/gcc-lib/i486-linux/3.3.6/crtendS.o /usr/lib/gcc-lib/i486-linux/3.3.6/../../../crtn.o" +postdep_objects="/usr/lib/gcc-lib/i486-linux-gnu/3.3.6/crtendS.o /usr/lib/gcc-lib/i486-linux-gnu/3.3.6/../../../crtn.o" # Dependencies to place before the objects being linked to create a # shared library. @@ -6897,7 +6896,7 @@ postdeps="-lstdc++ -lm -lgcc_s -lc -lgcc # The library search path used internally by the compiler when linking # a shared library. -compiler_lib_search_path="-L/usr/lib/gcc-lib/i486-linux/3.3.6 -L/usr/lib/gcc-lib/i486-linux/3.3.6/../../.." +compiler_lib_search_path="-L/usr/lib/gcc-lib/i486-linux-gnu/3.3.6 -L/usr/lib/gcc-lib/i486-linux-gnu/3.3.6/../../.." # Method to check whether dependent libraries are shared objects. deplibs_check_method="pass_all" @@ -6977,11 +6976,10 @@ link_all_deplibs=unknown link_all_deplibs=unknown # Compile-time system search path for libraries -sys_lib_search_path_spec=" /usr/lib/gcc-lib/i486-linux/3.3.6/ /usr/lib/gcc/i486-linux/3.3.6/ /usr/lib/gcc-lib/i486-linux/3.3.6/../../../../i486-linux/lib/i486-linux/3.3.6/ /usr/lib/gcc-lib/i486-linux/3.3.6/../../../../i486-linux/lib/ /usr/lib/gcc-lib/i486-linux/3.3.6/../../../i486-linux/3.3.6/ /usr/lib/gcc-lib/i486-linux/3.3.6/../../../ /lib/i486-linux/3.3.6/ /lib/ /usr/lib/i486-linux/3.3.6/ /usr/lib/" +sys_lib_search_path_spec=" /usr/lib/gcc-lib/i486-linux-gnu/3.3.6/ /usr/lib/gcc/i486-linux-gnu/3.3.6/ /usr/lib/gcc-lib/i486-linux-gnu/3.3.6/../../../../i486-linux-gnu/lib/i486-linux-gnu/3.3.6/ /usr/lib/gcc-lib/i486-linux-gnu/3.3.6/../../../../i486-linux-gnu/lib/ /usr/lib/gcc-lib/i486-linux-gnu/3.3.6/../../../i486-linux-gnu/3.3.6/ /usr/lib/gcc-lib/i486-linux-gnu/3.3.6/../../../ /lib/i486-linux-gnu/3.3.6/ /lib/ /usr/lib/i486-linux-gnu/3.3.6/ /usr/lib/" # Run-time system search path for libraries sys_lib_dlsearch_path_spec="/lib /usr/lib /usr/X11R6/lib - /usr/lib/libc5-compat /lib/libc5-compat /usr/i486-linuxlibc1/lib ++++++ ncpfs-hg-commit-433.patch ++++++ changeset: 433:6a7c398b04a7 user: Petr Vandrovec <petr@vandrovec.name> date: Sun Jul 03 20:36:50 2005 +0100 files: .hgignore description: Switch from BitKeeper to Mercurial. Get rid of BitKeeper config files, and introduce Mercurial's .hgignore. diff -r 93a411983bcc -r 6a7c398b04a7 .hgignore --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/.hgignore Sun Jul 03 20:36:50 2005 +0100 @@ -0,0 +1,179 @@ +\.a$ +\.d$ +\.do$ +\.la$ +\.lo$ +\.o$ +\.so$ +^Make\.rules$ +^Makefile$ +^autom4te.cache/ +^config\.log$ +^config\.status$ +^contrib/pam/Makefile$ +^contrib/php/Makefile$ +^contrib/php/Makefile\.in$ +^contrib/php/\.deps$ +^contrib/php/\.libs/ +^contrib/php/config\.h$ +^contrib/php/config\.log$ +^contrib/php/config\.nice$ +^contrib/php/config\.status$ +^contrib/php/config_vars\.mk$ +^contrib/php/libs\.mk$ +^contrib/php/php_auth_nds\.slo$ +^contrib/tcl-utils/Makefile$ +^contrib/testing/Makefile$ +^contrib/testing/abbrev$ +^contrib/testing/canon$ +^contrib/testing/chgpwd$ +^contrib/testing/cmpattr$ +^contrib/testing/copyauth$ +^contrib/testing/dirlimit$ +^contrib/testing/dirlist2$ +^contrib/testing/dssearch$ +^contrib/testing/dsstream$ +^contrib/testing/eaops$ +^contrib/testing/effright$ +^contrib/testing/fileinfo$ +^contrib/testing/large$ +^contrib/testing/lic$ +^contrib/testing/mkattr$ +^contrib/testing/mkclass$ +^contrib/testing/mkfile$ +^contrib/testing/mkobj$ +^contrib/testing/modclass$ +^contrib/testing/modobj$ +^contrib/testing/mvobj$ +^contrib/testing/nfssetinfo$ +^contrib/testing/nsfileinfo$ +^contrib/testing/nwbcast$ +^contrib/testing/nwdsgethost$ +^contrib/testing/nwdsgetstat$ +^contrib/testing/nwdsgetvi$ +^contrib/testing/nwdslist$ +^contrib/testing/nwdspartjoin$ +^contrib/testing/nwdspartlist$ +^contrib/testing/nwdspartrm$ +^contrib/testing/nwdspartsplit$ +^contrib/testing/nwdsresetstat$ +^contrib/testing/nwgettime$ +^contrib/testing/partroot$ +^contrib/testing/physlock$ +^contrib/testing/pp/Makefile$ +^contrib/testing/pp/bcastmd$ +^contrib/testing/pp/getconn_addr$ +^contrib/testing/pp/getsynt$ +^contrib/testing/pp/nwc_next_object$ +^contrib/testing/pp/nwgetconnlist$ +^contrib/testing/pp/nwwhoami$ +^contrib/testing/pp/open_conn_by_name$ +^contrib/testing/pp/readsdef$ +^contrib/testing/pp/readsynt$ +^contrib/testing/pp/return_block_of_tree$ +^contrib/testing/pp/scantree$ +^contrib/testing/pp/scanvolr$ +^contrib/testing/pp/semaphor$ +^contrib/testing/pp/treelist$ +^contrib/testing/pp/vlist$ +^contrib/testing/pp/volres$ +^contrib/testing/readaddr$ +^contrib/testing/readadef$ +^contrib/testing/readattr$ +^contrib/testing/readcc$ +^contrib/testing/readcls$ +^contrib/testing/readsynt$ +^contrib/testing/reloadds$ +^contrib/testing/renobj$ +^contrib/testing/replops$ +^contrib/testing/resint$ +^contrib/testing/resolve$ +^contrib/testing/rmattr$ +^contrib/testing/rmclass$ +^contrib/testing/rmobj$ +^contrib/testing/schsync$ +^contrib/testing/semaphore$ +^contrib/testing/setkeys$ +^contrib/testing/time$ +^contrib/testing/timegv$ +^contrib/testing/timeinfo$ +^contrib/testing/verpwd$ +^contrib/testing/verunix$ +^contrib/testing/vollist$ +^contrib/testing/wcsmbs-tst1$ +^contrib/tests/Makefile$ +^contrib/tknwmsg/Makefile$ +^include/config\.h$ +^include/ncp/ext/socket\.h$ +^include/ncp/ext/stdint\.h$ +^include/ncp/kernel/fs\.h$ +^include/ncp/kernel/if\.h$ +^include/ncp/kernel/ipx\.h$ +^include/ncp/kernel/route\.h$ +^include/ncp/kernel/types\.h$ +^include/ncp/nwnet\.h$ +^intl/Makefile$ +^ipx-1\.0/.*\.gz$ +^ipx-1\.0/Makefile$ +^ipx-1\.0/Samples/Makefile$ +^ipx-1\.0/Samples/ipxrcv$ +^ipx-1\.0/Samples/ipxsend$ +^ipx-1\.0/Samples/rip$ +^ipx-1\.0/Samples/sap$ +^ipx-1\.0/ipx_cmd$ +^ipx-1\.0/ipx_configure$ +^ipx-1\.0/ipx_interface$ +^ipx-1\.0/ipx_internal_net$ +^ipx-1\.0/ipx_route$ +^ipxdump/Makefile$ +^lib/Makefile$ +^lib/libncp\.so\..*$ +^man/.*\.gz$ +^man/Makefile$ +^po/Makefile$ +^po/Makefile\.in$ +^po/POTFILES$ +^sutil/Makefile$ +^sutil/ncplogin$ +^sutil/ncpmap$ +^sutil/ncpmount$ +^sutil/ncpumount$ +^sutil/nwsfind$ +^util/Makefile$ +^util/ncopy$ +^util/ncptest$ +^util/nprint$ +^util/nsend$ +^util/nwauth$ +^util/nwbocreate$ +^util/nwbols$ +^util/nwboprops$ +^util/nwborm$ +^util/nwbpadd$ +^util/nwbpcreate$ +^util/nwbprm$ +^util/nwbpset$ +^util/nwbpvalues$ +^util/nwdir$ +^util/nwdpvalues$ +^util/nwfsctrl$ +^util/nwfsinfo$ +^util/nwfstime$ +^util/nwgrant$ +^util/nwlistsalvage$ +^util/nwmsg$ +^util/nwpasswd$ +^util/nwpjmv$ +^util/nwpqjob$ +^util/nwpurge$ +^util/nwrevoke$ +^util/nwrights$ +^util/nwsalvage$ +^util/nwtrustee$ +^util/nwtrustee2$ +^util/nwuserlist$ +^util/nwvolinfo$ +^util/pqlist$ +^util/pqstat$ +^util/pserver$ +^util/slist$ ++++++ ncpfs-hg-commit-434.patch ++++++ changeset: 434:5eb60dbc36bd user: Petr Vandrovec <petr@vandrovec.name> date: Sun Jul 03 21:43:04 2005 +0100 files: include/ncp/ncplib.h description: Fix compilation with gcc 3.1 and older - no always_inline attribute available. diff -r 6a7c398b04a7 -r 5eb60dbc36bd include/ncp/ncplib.h --- a/include/ncp/ncplib.h Sun Jul 03 20:36:50 2005 +0100 +++ b/include/ncp/ncplib.h Sun Jul 03 21:43:04 2005 +0100 @@ -181,7 +181,10 @@ DSET_HL(void * buf, int pos, dword val) DSET_LH(buf, pos, htonl(val)); } -static inline __attribute__((always_inline)) void +static inline void +#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 2) +__attribute__((always_inline)) +#endif QSET_HL(void * buf, int pos, u_int64_t val) { DSET_HL(buf, pos, val >> 32); DSET_HL(buf, pos + 4, val); ++++++ ncpfs-hg-commit-435.patch ++++++ changeset: 435:12722b2b7268 user: Petr Vandrovec <petr@vandrovec.name> date: Sun Jul 03 21:44:37 2005 +0100 files: util/nwauth.c description: Rename daemon to daemon_auth in util/nwauth.c Fix a warning in nwauth.c build that global daemon() function is shadowed by daemon variable in nwauth.c. diff -r 5eb60dbc36bd -r 12722b2b7268 util/nwauth.c --- a/util/nwauth.c Sun Jul 03 21:43:04 2005 +0100 +++ b/util/nwauth.c Sun Jul 03 21:44:37 2005 +0100 @@ -82,7 +82,7 @@ main(int argc, char *argv[]) char *str; int opt; - int daemon = 0; + int daemon_auth = 0; setlocale(LC_ALL, ""); bindtextdomain(NCPFS_PACKAGE, LOCALEDIR); @@ -114,7 +114,7 @@ main(int argc, char *argv[]) #endif break; case 'D': - daemon = 1; + daemon_auth = 1; break; case 'h': case '?': @@ -127,7 +127,7 @@ main(int argc, char *argv[]) } err = ncp_find_conn_spec3(server, object_name, "", - 1, daemon ? ~0U : getuid(), 0, &spec); + 1, daemon_auth ? ~0U : getuid(), 0, &spec); if (err) { ++++++ ncpfs-hg-commit-436.patch ++++++ ++++ 2931 lines (skipped) ++++++ ncpfs-hg-commit-437.patch ++++++ ++++ 3065 lines (skipped) ++++++ ncpfs-hg-commit-438.patch ++++++ changeset: 438:e635f8099d50 user: Petr Vandrovec <petr@vandrovec.name> date: Sun Jul 03 22:46:56 2005 +0100 files: po/cs.gmo po/cs.po description: Fix typo in Czech translations. diff -r 06067530cbec -r e635f8099d50 po/cs.gmo Binary file po/cs.gmo has changed diff -r 06067530cbec -r e635f8099d50 po/cs.po --- a/po/cs.po Sun Jul 03 21:50:24 2005 +0100 +++ b/po/cs.po Sun Jul 03 22:46:56 2005 +0100 @@ -2137,7 +2137,7 @@ msgstr "chyba při vytváření\n" #: util/ncptest.c:134 #, c-format msgid "dealloc error\n" -msgstr "chyba při dealokaci" +msgstr "chyba při dealokaci\n" #: util/ncptest.c:137 #, c-format ++++++ ncpfs-hg-commit-439.patch ++++++ changeset: 439:0ba24cdb345c user: Petr Vandrovec <petr@vandrovec.name> date: Sun Jul 03 23:57:27 2005 +0100 files: lib/ndslib.c description: Convert some unsigned char* to const unsigned char* in lib/ndslib.c. Constify some pointers in the RSA computations, so we do not see any ugly warnings during build. diff -r e635f8099d50 -r 0ba24cdb345c lib/ndslib.c --- a/lib/ndslib.c Sun Jul 03 22:46:56 2005 +0100 +++ b/lib/ndslib.c Sun Jul 03 23:57:27 2005 +0100 @@ -233,7 +233,7 @@ static void fillrandom(nuint8 *buf, size } #endif -static int countbits_l(unsigned char *buf, int bufsize) { +static int countbits_l(const unsigned char *buf, int bufsize) { unsigned char b; while ((--bufsize) && (!buf[bufsize])); @@ -253,7 +253,7 @@ static void copyfill(void *outbuf, int o static char keyprefix[] = {1, 0, 0, 0, 3, 0, 1, 0}; -static int initkey(const unsigned char *key, unsigned char **keyptr, size_t *keylen) { /* 1=ok, 0=err */ +static int initkey(const unsigned char *key, const unsigned char **keyptr, size_t *keylen) { /* 1=ok, 0=err */ if (!memcmp(key, keyprefix, 8)) { if (keylen) *keylen = WVAL_LH(key, 8); if (keyptr) *keyptr = key + 10; @@ -263,14 +263,14 @@ static int initkey(const unsigned char * } static void clearkey(unsigned char *key) { - unsigned char *keyptr; + const unsigned char *keyptr; size_t keylen; if (initkey(key, &keyptr, &keylen)) memset(key, 0, keylen + 10); } -static int findchunk(const unsigned char *keyptr, size_t keylen, const char *chunk, unsigned char **chunkptr) { +static int findchunk(const unsigned char *keyptr, size_t keylen, const char *chunk, const unsigned char **chunkptr) { const unsigned char *p; if ((p = keyptr)) { @@ -278,7 +278,7 @@ static int findchunk(const unsigned char if ((p[0] != chunk[0]) || (p[1] != chunk[1])) { p += 4 + p[2] + p[3]; } else { - if (chunkptr) *chunkptr = (unsigned char*)p + 4; + if (chunkptr) *chunkptr = p + 4; return p[2] + p[3]; } } @@ -332,7 +332,7 @@ static void dumpkey(const nuint8 *key, s static int checkkey(const unsigned char *key) { /* 0 - wrong key, != 0 - key ok */ unsigned char temp[8]; - unsigned char *keyptr, *p; + const unsigned char *keyptr, *p; size_t keylen; if ((initkey(key, &keyptr, &keylen)) && @@ -350,12 +350,12 @@ static ncpt_mutex_t mpilock = NCPT_MUTEX static ncpt_mutex_t mpilock = NCPT_MUTEX_INITIALIZER; static long modexpkey(const unsigned char *s_key, unsigned char *buf, unsigned char *outbuf, int bufsize) { - unsigned char *s_keyptr; + const unsigned char *s_keyptr; size_t s_keylen; int i, nbits, nblocksize; int err = -1; unitptr nmod, nexp, nin, nout; - unsigned char *p; + const unsigned char *p; nmod = nexp = nin = nout = NULL; @@ -402,7 +402,7 @@ end1: /* ctx must be in WCHAR_T mode, without DCV_CANONICALIZE_NAMES */ static NWDSCCODE get_public_key(NWDSContextHandle ctx, const wchar_t* objname, nuint8 **key) { - unsigned char *keybuf, *kptr; + const unsigned char *keybuf, *kptr; NWDSCCODE err; size_t keylen, ofs, klen; Octet_String_T* ost; @@ -420,12 +420,14 @@ static NWDSCCODE get_public_key(NWDSCont goto err_exit; } if (key) { - if (!(kptr = malloc(klen + 10))) { + unsigned char *kbuf; + + if (!(kbuf = malloc(klen + 10))) { err = ENOMEM; goto err_exit; } - memcpy(kptr, keybuf + ofs, klen + 10); - *key = kptr; + memcpy(kbuf, keybuf + ofs, klen + 10); + *key = kbuf; } err = 0; err_exit: @@ -1073,7 +1075,8 @@ err_exit: static unsigned char *allocfillchunk(const unsigned char *keyptr, int keylen, const char *chunk, int destsize) { - unsigned char *p, *p2; + const unsigned char *p; + unsigned char *p2; int i; i = findchunk(keyptr, keylen, chunk, &p); @@ -1108,7 +1111,7 @@ static NWDSCCODE gen_auth_data( const nuint8* authid, nuint8 *loginstrc, int loginstrc_len) { - nuint8 *keyptr; + const unsigned char *keyptr; size_t keylen; int i, j; int nbits, nblocksize, nbytes, nblocksize_nw; @@ -1117,6 +1120,7 @@ static NWDSCCODE gen_auth_data( unitptr n_key_dp, n_key_dq; unitptr up, up2; unitptr randbuf; + const unsigned char *pkey; nuint8 *p; nuint8 *tempbuf; nuint8 hashbuf[0x42]; @@ -1127,12 +1131,12 @@ static NWDSCCODE gen_auth_data( ISRPrint("Initkey failed\n"); return ERR_INVALID_SERVER_RESPONSE; } - i = findchunk(keyptr, keylen, "NN", &p); - if (!p) { + i = findchunk(keyptr, keylen, "NN", &pkey); + if (!pkey) { ISRPrint("NN chunk not found\n"); return ERR_INVALID_SERVER_RESPONSE; } - nbits = countbits_l(p, i); + nbits = countbits_l(pkey, i); nbytes = (nbits + 7) >> 3; nmask = (unsigned char)(255 >> (8 - (nbits & 7))); /* we really want (x + 31) & ~15... I'm sorry, but Novell thinks that way */ @@ -1828,7 +1832,7 @@ NWDSCCODE __NWGenerateKeyPair( void* privkey, size_t* privkey_len ) { - nuint8 def_exp[] = { 1, 0, 1}; + static const nuint8 def_exp[] = { 1, 0, 1}; struct keyparam kp; NWDSCCODE err; size_t bits; ++++++ ncpfs-hg-commit-440.patch ++++++ changeset: 440:7f46ab032bd8 user: Petr Vandrovec <petr@vandrovec.name> date: Mon Jul 04 00:01:49 2005 +0100 files: lib/ndslib.c lib/ndslib_i.h description: Rename exp argument to n_exp in ndslib. Rename exp to n_exp (and exp_len to n_exp_len) to get rid of warning that exp argument shadows exp() mathematic function. Although we do not use exp() function anywhere, it is gcc builtin internal, and exists in the namespace since compilation start. diff -r 0ba24cdb345c -r 7f46ab032bd8 lib/ndslib.c --- a/lib/ndslib.c Sun Jul 03 23:57:27 2005 +0100 +++ b/lib/ndslib.c Mon Jul 04 00:01:49 2005 +0100 @@ -1825,8 +1825,8 @@ static int ComputeKey(struct keyparam *k NWDSCCODE __NWGenerateKeyPair( size_t key_len, - const void* exp, - size_t exp_len, + const void* n_exp, + size_t n_exp_len, void* pubkey, size_t* pubkey_len, void* privkey, @@ -1839,19 +1839,19 @@ NWDSCCODE __NWGenerateKeyPair( size_t words; /* netware native units */ if (!pubkey || !pubkey_len || !privkey || !privkey_len) return -2; - if (!key_len || !exp || !exp_len) { - exp = def_exp; - exp_len = sizeof(def_exp); + if (!key_len || !n_exp || !n_exp_len) { + n_exp = def_exp; + n_exp_len = sizeof(def_exp); key_len = 420; /* well, at least 620 does work too */ } else { - if ((key_len > 760) || (key_len < 256) || (key_len & 1) || (exp_len > 16)) { + if ((key_len > 760) || (key_len < 256) || (key_len & 1) || (n_exp_len > 16)) { return NWE_PARAM_INVALID; } } memset(&kp, 0, sizeof(kp)); kp.BA = 48; kp.BL = key_len; - memcpy(kp.n_exp, exp, exp_len); + memcpy(kp.n_exp, n_exp, n_exp_len); ncpt_mutex_lock(&mpilock); set_precision(bits2units(kp.BL) + SLOP_BITS); if ((countbits(kp.n_exp) > kp.BL) || !(kp.n_exp[0] & 1)) { diff -r 0ba24cdb345c -r 7f46ab032bd8 lib/ndslib_i.h --- a/lib/ndslib_i.h Sun Jul 03 23:57:27 2005 +0100 +++ b/lib/ndslib_i.h Mon Jul 04 00:01:49 2005 +0100 @@ -38,7 +38,7 @@ NWDSCCODE NWDSGetKeys(NWDSContextHandle /* ctx must be in wchar_t mode */ NWDSCCODE __NWDSGetPublicKeyFromConnection(NWDSContextHandle ctx, NWCONN_HANDLE conn, nuint8 **skey); -NWDSCCODE __NWGenerateKeyPair(size_t key_len, const void* exp, size_t exp_len, +NWDSCCODE __NWGenerateKeyPair(size_t key_len, const void* n_exp, size_t n_exp_len, void* pubkey, size_t* pubkey_len, void* privkey, size_t* privkey_len); NWDSCCODE __NWEncryptWithSK(const void* hashsrc, size_t hashsrclen, ++++++ ncpfs-hg-commit-441.patch ++++++ ++++ 977 lines (skipped) ++++++ ncpfs-hg-commit-442.patch ++++++ changeset: 442:093f842dbd98 user: Petr Vandrovec <petr@vandrovec.name> date: Mon Jul 11 00:44:36 2005 +0100 files: include/ncp/ipxlib.h lib/resolve.c description: Fix few remaining unsigned char pointer <-> signed char pointer conversion warnings. diff -r fbfcfbb3c88d -r 093f842dbd98 include/ncp/ipxlib.h --- a/include/ncp/ipxlib.h Mon Jul 11 00:42:47 2005 +0100 +++ b/include/ncp/ipxlib.h Mon Jul 11 00:44:36 2005 +0100 @@ -94,8 +94,8 @@ struct ipx_rip_packet #define IPX_BROADCAST_NODE "\xff\xff\xff\xff\xff\xff" #define IPX_THIS_NODE "\0\0\0\0\0\0" #else -#define IPX_BROADCAST_NODE ("\xff\xff\xff\xff\xff\xff") -#define IPX_THIS_NODE ("\0\0\0\0\0\0") +#define IPX_BROADCAST_NODE ((const u_int8_t*)"\xff\xff\xff\xff\xff\xff") +#define IPX_THIS_NODE ((const u_int8_t*)"\0\0\0\0\0\0") #endif #define IPX_THIS_NET (0) diff -r fbfcfbb3c88d -r 093f842dbd98 lib/resolve.c --- a/lib/resolve.c Mon Jul 11 00:42:47 2005 +0100 +++ b/lib/resolve.c Mon Jul 11 00:44:36 2005 +0100 @@ -429,13 +429,13 @@ static void sap_report(int fd, const str } } -static int sap_name_cmp(const unsigned char *my, const unsigned char *net, size_t cmplen) { +static int sap_name_cmp(const unsigned char *my, const char *net, size_t cmplen) { if (memcmp(my, net, cmplen)) { size_t ln; /* If it is exact match, allow trailing spaces and garbage after terminating zero. */ - ln = strnlen(my, cmplen); + ln = strnlen((const char*)my, cmplen); if (memcmp(my, net, ln)) { return 1; } @@ -635,7 +635,7 @@ static NWCCODE sap_start(void **prh, UNU if (ln >= NW_MAX_SERVER_NAME_LEN) { return ENAMETOOLONG; } - memcpy_toupper(sap_request + 4, name, ln); + memcpy_toupper((char*)sap_request + 4, name, ln); if (ln < 48) { memset(sap_request + 4 + ln, 0, 48 - ln); } @@ -650,7 +650,7 @@ static NWCCODE sap_start(void **prh, UNU if (ln >= NW_MAX_SERVER_NAME_LEN) { return ENAMETOOLONG; } - memcpy_toupper(sap_request + 4, name, ln); + memcpy_toupper((char*)sap_request + 4, name, ln); if (ln <= 32) { if (ln < 32) { memset(sap_request + 4 + ln, '_', 32 - ln); ++++++ ncpfs-hg-commit-443.patch ++++++ changeset: 443:c943b66ae2f6 user: vana@ppc.vc.cvut.cz date: Mon Jul 11 02:35:19 2005 +0100 files: util/nwfsinfo.c util/nwfstime.c description: Use NWGetFileServerUTCTime() instead of ncp_get_file_server_time() in nwfsinfo and nwfstime. Fixes problems when server is in different timezone than client (on NW3.x old ncp_get_file_server_time is still used). diff -r 093f842dbd98 -r c943b66ae2f6 util/nwfsinfo.c --- a/util/nwfsinfo.c Mon Jul 11 00:44:36 2005 +0100 +++ b/util/nwfsinfo.c Mon Jul 11 02:35:19 2005 +0100 @@ -33,6 +33,7 @@ #include <string.h> #include <ncp/nwcalls.h> #include <ncp/nwfse.h> +#include <ncp/nwnet.h> #include "private/libintl.h" #define _(X) gettext(X) @@ -175,8 +176,14 @@ main(int argc, char **argv) { time_t t; int err2; - - err2 = ncp_get_file_server_time(conn, &t); + nuint32 sec; + + err2 = __NWGetFileServerUTCTime(conn, &sec, NULL, NULL, NULL, NULL, NULL, NULL); + if (err2) { + err2 = ncp_get_file_server_time(conn, &t); + } else { + t = sec; + } if (err2) { fprintf(stderr, "%s: %s\n", _("could not get server time"), strnwerror(err2)); diff -r 093f842dbd98 -r c943b66ae2f6 util/nwfstime.c --- a/util/nwfstime.c Mon Jul 11 00:44:36 2005 +0100 +++ b/util/nwfstime.c Mon Jul 11 02:35:19 2005 +0100 @@ -33,7 +33,7 @@ #include <unistd.h> #include <sys/time.h> -#include <ncp/ncplib.h> +#include <ncp/nwnet.h> #include "private/libintl.h" #define _(X) gettext(X) @@ -124,32 +124,51 @@ main(int argc, char **argv) ncp_close(conn); return 1; } - } else - { int offset; - time_t last; + } else { + unsigned int offset; + nuint32 sec, xsec; - if ((err = ncp_get_file_server_time(conn, &t)) != 0) - { - get_error: com_err(argv[0], err, _("when getting file server time")); - ncp_close(conn); - return 1; + err = __NWGetFileServerUTCTime(conn, &sec, &xsec, NULL, NULL, NULL, NULL, NULL); + if (err != 0) { + if ((err = ncp_get_file_server_time(conn, &t)) != 0) { + get_error: com_err(argv[0], err, _("when getting file server time")); + ncp_close(conn); + return 1; + } + if (accurate) { + time_t last; + + do { + if ((err = ncp_get_file_server_time(conn, &last)) != 0) + goto get_error; + } while (last == t); + t = last; + offset = 0; /* we can read the time 1000s of times a second */ + } else { + offset = 500000; /* if no accurate measure, then assume offset of 500ms */ + } + } else { + if (accurate) { + nuint32 last; + + do { + offset = (xsec * 1000000ULL) >> 32; + if (offset > 100) { + usleep(1000000 - offset); + } + if ((err = __NWGetFileServerUTCTime(conn, &last, &xsec, NULL, NULL, NULL, NULL, NULL)) != 0) { + goto get_error; + } + } while (last == sec); + t = last; + } else { + t = sec; + } + offset = (xsec * 1000000ULL) >> 32; } - - if(accurate) - { - do - { if ((err = ncp_get_file_server_time(conn, &last)) != 0) - goto get_error; - } while(last==t); - t=last; - offset=0; /* we can read the time 1000s of times a second */ - } - else - offset=500; /* if no accurate measure, then assume offset of 500ms */ - - if(get) - { timeval.tv_sec = t; - timeval.tv_usec = offset*1000; + if (get) { + timeval.tv_sec = t; + timeval.tv_usec = offset; settimeofday(&timeval, NULL); } { ++++++ ncpfs-hg-commit-444.patch ++++++ changeset: 444:34ddb26e48fa user: vana@ppc.vc.cvut.cz date: Mon Jul 11 02:36:37 2005 +0100 files: lib/ncplib.c description: Fix ncpfs against NW3.x servers. It was not possible to reuse existing connection as connection to NW3.x server was never marked as authenticated. diff -r c943b66ae2f6 -r 34ddb26e48fa lib/ncplib.c --- a/lib/ncplib.c Mon Jul 11 02:35:19 2005 +0100 +++ b/lib/ncplib.c Mon Jul 11 02:36:37 2005 +0100 @@ -1946,9 +1946,14 @@ static int ncp_do_open_fd(int fd, struct #ifdef SIGNATURES ncp_sign_init_perm(result); #endif - if (!ncp_get_private_key(result, NULL, &klen)) { - if (klen > 10) { - result->connState |= CONNECTION_AUTHENTICATED; + if (!ncp_get_private_key(result, NULL, &klen) && klen > 10) { + result->connState |= CONNECTION_AUTHENTICATED; + } else { + nuint8 level; + NWCCODE err = NWGetBinderyAccessLevel(result, &level, NULL); + + if (err == 0 && level != 0) { + result->connState |= CONNECTION_AUTHENTICATED | CONNECTION_LICENSED; } } result->bcast_state = NWCC_BCAST_PERMIT_UNKNOWN; ++++++ ncpfs-hg-commit-445.patch ++++++ changeset: 445:66c5f4287bbb user: Petr Vandrovec <petr@vandrovec.name> date: Sat Jul 23 21:58:13 2005 +0100 files: lib/strops.c description: Improve ncp_str_to_perms - now it accepts both [RFA] and RFA, and you can use both nothing, space and '-' for flags which are not set. diff -r 34ddb26e48fa -r 66c5f4287bbb lib/strops.c --- a/lib/strops.c Mon Jul 11 02:36:37 2005 +0100 +++ b/lib/strops.c Sat Jul 23 21:58:13 2005 +0100 @@ -44,6 +44,7 @@ #include <string.h> #include <stdarg.h> +#include <ctype.h> #include "private/libintl.h" #define _(X) dgettext(NCPFS_PACKAGE, (X)) @@ -419,56 +420,79 @@ char* ncp_perms_to_str(char r[11], const } /* The following function converts a rights string of format [SRWCEMFA] - into an integer. It will tolerate spaces, lower case and repeated - letters, even if this takes the length well over 10 characters, but - must be terminated with square brackets. If such a string containing - spaces is given as a command line option it will have to be quoted. */ + or SRWCEMFA into an integer. It will tolerate spaces, lower case and + repeated letters, even if this takes the length well over 10 characters. + For unset rights you can use spaces or dashes. For no rights you can + use either empty string, '-' or '[]' (or their combination, '[-]' or '[ ]'). */ int ncp_str_to_perms(const char *r, u_int16_t *rights) { u_int16_t result = 0; - - if (*r == '[') { - do { - ++r; - switch (*r) { - case ' ' : - case ']' : - break; - case 's' : - case 'S' : - result |= NCP_PERM_SUPER; break; - case 'r' : - case 'R' : - result |= NCP_PERM_READ; break; - case 'w' : - case 'W' : - result |= NCP_PERM_WRITE; break; - case 'c' : - case 'C' : - result |= NCP_PERM_CREATE; break; - case 'e' : - case 'E' : - result |= NCP_PERM_DELETE; break; - case 'm' : - case 'M' : - result |= NCP_PERM_MODIFY; break; - case 'f' : - case 'F' : - result |= NCP_PERM_SEARCH; break; - case 'a' : - case 'A' : - result |= NCP_PERM_OWNER; break; - default : + int state = 0; + + while (*r) { + int c = *r++; + + c = toupper(c); + if (isspace(c)) { + continue; + } + switch (c) { + case '[': + if (state != 0) { return -1; - } - } while (*r != ']'); - /* Now to be generous and ignore trailing spaces */ - do { ++r; } while (*r == ' '); - if (*r == '\0') { - *rights = result; - return 0; + } + state = 2; + continue; + case ']': + if (state != 2 && state != 3) { + return -1; + } + state = 4; + continue; + case '-': + break; + case 'S': + result |= NCP_PERM_SUPER; + break; + case 'R': + result |= NCP_PERM_READ; + break; + case 'W': + result |= NCP_PERM_WRITE; + break; + case 'C': + result |= NCP_PERM_CREATE; + break; + case 'E': + result |= NCP_PERM_DELETE; + break; + case 'M': + result |= NCP_PERM_MODIFY; + break; + case 'F': + result |= NCP_PERM_SEARCH; + break; + case 'A': + result |= NCP_PERM_OWNER; + break; + default: + return -1; } + state |= 1; + } + /* These states are illegal: + state == 2 => [ + state == 3 => [SRWCEMFA + state == 5 => [SRWCEMFA]SRW + These states are allowed: + state == 0 => <whitespaces only> + state == 1 => SRWCEMFA + state == 4 => [SRWCEMFA] + */ + if (state == 0 || state == 1 || state == 4) { + *rights = result; + return 0; } return -1; } ++++++ ncpfs-hg-commit-446.patch ++++++ changeset: 446:07b8031b5209 user: Petr Vandrovec <petr@vandrovec.name> date: Sat Jul 23 22:22:26 2005 +0100 files: man/nwgrant.8 man/nwrevoke.8 util/nwgrant.c util/nwrevoke.c description: Add ability to specify object by its ID to nwgrant and nwrevoke. To make long story short, upgrade from Netware5 to Netware6 kindly converted all rights granted to [Public] to rights granted to non-existant object with ID 0xFFFFFFFF. And patched nwrevoke was only tool willing to remove them. diff -r 66c5f4287bbb -r 07b8031b5209 man/nwgrant.8 --- a/man/nwgrant.8 Sat Jul 23 21:58:13 2005 +0100 +++ b/man/nwgrant.8 Sat Jul 23 22:22:26 2005 +0100 @@ -2,42 +2,17 @@ .SH NAME nwgrant \- Add Trustee Rights to a directory .SH SYNOPSIS -.B nwgrant -[ -.B -h -] [ -.B -S -.I server -] [ -.B -U -.I user name -] [ -.B -P -.I password -| -.B -n -] [ -.B -C -] [ -.B -o -.I object name -] [ -.B -t -.I type -] [ -.B -r -.I rights -] -.B file/directory +\fBnwgrant\fP [ \fB-h\fP ] [ \fB-S\fP \fIserver\fP ] +[ \fB-U\fP \fIuser name\fP ] [ \fB-P\fP \fIpassword\fP | \fB-n\fP ] +[ \fB-C\fP ] [ \fB-o\fP \fIobject name\fP | \fB-O\fP \fIobject id\fP ] +[ \fB-t\fP \fItype\fP ] [ \fB-r\fP \fIrights\fP ] \fBfile/directory\fP .SH DESCRIPTION .B nwgrant adds the specified bindery object with the corresponding trustee rights to the directory. -.B nwgrant -looks up the file -.I $HOME/.nwclient +\fBnwgrant\fP looks up the file \fI$HOME/.nwclient\fP to find a file server, a user name and possibly a password. See nwclient(5) for more information. Please note that the access permissions of $HOME/.nwclient MUST be 600 for security reasons. @@ -68,10 +43,7 @@ is the user name to use for login. .I password .RS 3 .B password -is the password to use for login. If neither -.B -n -nor -.B -P +is the password to use for login. If neither \fB-n\fP nor \fB-P\fP are given, and the user has no open connection to the server, nwgrant prompts for a password. .RE @@ -96,11 +68,16 @@ The name of the object to be added as tr The name of the object to be added as trustee. .RE +.B -O +.I object id +.RS 3 +The id of the object to be added as trustee. +.RE + .B -t .I object type .RS 3 -The type of the object. -.I Object type +The type of the object. \fIObject type\fP must be specified as a decimal value. Common values are 1 for user objects, 2 for group objects and 3 for print queues. Other values are allowed, but are usually used for specialized applications. If you @@ -111,18 +88,13 @@ NDS name. .B -r .I rights .RS 3 -You must tell -.B nwgrant -which rights it should grant to the bindery object. -The new rights for the object is specified by -.I rights, +You must tell \fBnwgrant\fP which rights it should grant to the bindery +object. The new rights for the object is specified by \fIrights\fP, which can be either a hexadecimal number representing the sum of all the individual rights to be granted or a string containing characters -representing each right. If rights are represented in string format -then the string must be bounded with square brackets. Characters -within the brackets may be in any order and in either case. Spaces are -allowed between the brackets - in which case the entire string should be -quoted. +representing each right. Characters within the brackets may be in +any order and in either case. Spaces are allowed between the +brackets - in which case the entire string should be quoted. Hexadecimal and character values for the rights are shown in this table: 00 = no access diff -r 66c5f4287bbb -r 07b8031b5209 man/nwrevoke.8 --- a/man/nwrevoke.8 Sat Jul 23 21:58:13 2005 +0100 +++ b/man/nwrevoke.8 Sat Jul 23 22:22:26 2005 +0100 @@ -2,33 +2,10 @@ .SH NAME nwrevoke \- Revoke a Trustee Right from a directory .SH SYNOPSIS -.B nwrevoke -[ -.B -h -] [ -.B -S -.I server -] [ -.B -U -.I user name -] [ -.B -P -.I password -| -.B -n -] [ -.B -C -] [ -.B -o -.I object name -] [ -.B -t -.I type -] [ -.B -r -.I rights -] -.B file/directory +\fBnwrevoke\fP [ \fB-h\fP ] [ \fB-S\fP \fIserver\fP ] +[ \fB-U\fP \fIuser name\fP ] [ \fB-P\fP \fIpassword\fP | \fB-n\fP ] +[ \fB-C\fP ] [ \fB-o\fP \fIobject name\fP | \fB-O\fP \fIobject ID\fP ] +[ \fB-t\fP \fItype\fP ] \fBfile/directory\fP .SH DESCRIPTION .B nwrevoke @@ -80,7 +57,12 @@ this conversion by \fB-C\fP. \fB-o\fP \fIobject name\fP .RS 3 -The name of the object to be added as trustee. +The name of the object to be revoked as trustee. +.RE + +\fB-O\fP \fIobject ID\fP +.RS 3 +The ID of the object to be revoked as trustee. .RE \fB-t\fP \fIobject type\fP diff -r 66c5f4287bbb -r 07b8031b5209 util/nwgrant.c --- a/util/nwgrant.c Sat Jul 23 21:58:13 2005 +0100 +++ b/util/nwgrant.c Sat Jul 23 22:22:26 2005 +0100 @@ -46,6 +46,7 @@ #include <unistd.h> #include <stdlib.h> #include <string.h> +#include <ctype.h> #include "private/libintl.h" #define _(X) gettext(X) @@ -73,6 +74,7 @@ help(void) "\n" "-o object_name Name of object added as trustee\n" "-t type Object type (decimal value)\n" + "-O object_id Object identifier\n" "-r rights Rights mask (see manual page)\n" "\n" "directory\n" @@ -85,7 +87,6 @@ main(int argc, char *argv[]) struct ncp_conn *conn; char *object_name = NULL; int object_type = -1; - struct ncp_bindery_object o; u_int16_t rights = ~0; int perr = 0; const char *path = NULL; @@ -98,6 +99,8 @@ main(int argc, char *argv[]) int enclen; TRUSTEE_INFO tstinfo; NWCCODE nwerr; + NWObjectID object_id; + int object_id_valid = 0; setlocale(LC_ALL, ""); bindtextdomain(NCPFS_PACKAGE, LOCALEDIR); @@ -109,10 +112,14 @@ main(int argc, char *argv[]) { useConn = 1; } - while ((opt = getopt(argc, argv, "h?o:t:r:")) != EOF) + while ((opt = getopt(argc, argv, "h?O:o:t:r:")) != EOF) { switch (opt) { + case 'O': + object_id = strtoul(optarg, NULL, 0); + object_id_valid = 1; + break; case 'o': object_name = optarg; str_upper(object_name); @@ -121,10 +128,14 @@ main(int argc, char *argv[]) object_type = atoi(optarg); break; case 'r': - if (*optarg == '[') { - perr = ncp_str_to_perms(optarg, &rights); - } else { - rights = strtol(optarg, NULL, 16); + perr = ncp_str_to_perms(optarg, &rights); + if (perr) { + char* end; + + rights = strtol(optarg, &end, 16); + if (!*end || isspace(*end)) { + perr = 0; + } } break; case 'h': @@ -137,12 +148,6 @@ main(int argc, char *argv[]) } } - if (object_name == NULL) - { - fprintf(stderr, _("%s: You must specify an object name\n"), - argv[0]); - goto finished; - } if (perr < 0) { fprintf(stderr, _("%s: You must give a valid rights string\n"), @@ -181,7 +186,13 @@ main(int argc, char *argv[]) path = volume; } - if (object_type < 0) { + if (object_id_valid) { + /* nothing */ + } else if (object_name == NULL) { + fprintf(stderr, _("%s: You must specify an object name\n"), + argv[0]); + goto finished; + } else if (object_type < 0) { #ifdef NDS_SUPPORT u_int32_t flags; NWDSContextHandle ctx; @@ -201,7 +212,7 @@ failDS:; flags |= DCV_XLATE_STRINGS | DCV_TYPELESS_NAMES; NWDSSetContext(ctx, DCK_FLAGS, &flags); } - nwerr = NWDSMapNameToID(ctx, conn, object_name, &o.object_id); + nwerr = NWDSMapNameToID(ctx, conn, object_name, &object_id); if (nwerr) { goto failDS; } @@ -212,12 +223,15 @@ failDS:; goto finished; #endif } else { + struct ncp_bindery_object o; + if ((nwerr = ncp_get_bindery_object_id(conn, object_type, object_name, &o)) != 0) { fprintf(stderr, _("%s: Could not find object %s: %s\n"), progname, object_name, strnwerror(nwerr)); goto finished; } + object_id = o.object_id; } enclen = ncp_path_to_NW_format(path, encpath, sizeof(encpath)); if (enclen < 0) { @@ -225,7 +239,7 @@ failDS:; progname, strerror(-enclen)); goto finished; } - tstinfo.objectID = o.object_id; + tstinfo.objectID = object_id; tstinfo.objectRights = rights; nwerr = ncp_ns_trustee_add(conn, NW_NS_DOS, SA_ALL, NCP_DIRSTYLE_NOHANDLE, 0, 0, encpath, enclen, &tstinfo, 1, ~0); diff -r 66c5f4287bbb -r 07b8031b5209 util/nwrevoke.c --- a/util/nwrevoke.c Sat Jul 23 21:58:13 2005 +0100 +++ b/util/nwrevoke.c Sat Jul 23 22:22:26 2005 +0100 @@ -65,6 +65,7 @@ help(void) "\n" "-o object_name Name of object removed as trustee\n" "-t type Object type (decimal value)\n" + "-O object_id Object identifier\n" "\n" "file/directory\n" "\n")); @@ -76,7 +77,6 @@ main(int argc, char *argv[]) struct ncp_conn *conn; char *object_name = NULL; int object_type = -1; - struct ncp_bindery_object o; const char *path = NULL; long err; int result = 1; @@ -87,6 +87,8 @@ main(int argc, char *argv[]) TRUSTEE_INFO tstinfo; int useConn = 0; NWDSCCODE nwerr; + NWObjectID object_id; + int object_id_valid = 0; setlocale(LC_ALL, ""); bindtextdomain(NCPFS_PACKAGE, LOCALEDIR); @@ -98,10 +100,14 @@ main(int argc, char *argv[]) { useConn = 1; } - while ((opt = getopt(argc, argv, "h?o:t:")) != EOF) + while ((opt = getopt(argc, argv, "h?o:t:O:")) != EOF) { switch (opt) { + case 'O': + object_id = strtoul(optarg, NULL, 0); + object_id_valid = 1; + break; case 'o': object_name = optarg; str_upper(object_name); @@ -119,12 +125,6 @@ main(int argc, char *argv[]) } } - if (object_name == NULL) - { - fprintf(stderr, _("%s: You must specify an object name\n"), - argv[0]); - goto finished; - } if (!useConn) { if (optind != argc - 1) { @@ -150,7 +150,13 @@ main(int argc, char *argv[]) strcat(volume, directory); path = volume; } - if (object_type < 0) { + if (object_id_valid) { + /* nothing */ + } else if (object_name == NULL) { + fprintf(stderr, _("%s: You must specify an object name\n"), + argv[0]); + goto finished; + } else if (object_type < 0) { #ifdef NDS_SUPPORT u_int32_t flags; NWDSContextHandle ctx; @@ -170,7 +176,7 @@ failDS:; if (!NWDSGetContext(ctx, DCK_FLAGS, &flags)) { flags |= DCV_XLATE_STRINGS | DCV_TYPELESS_NAMES; } - nwerr = NWDSMapNameToID(ctx, conn, object_name, &o.object_id); + nwerr = NWDSMapNameToID(ctx, conn, object_name, &object_id); if (nwerr) { NWDSFreeContext(ctx); goto failDS; @@ -182,19 +188,22 @@ failDS:; goto finished; #endif } else { + struct ncp_bindery_object o; + nwerr = ncp_get_bindery_object_id(conn, object_type, object_name, &o); if (nwerr != 0) { fprintf(stderr, _("%s: Could not find object %s: %s\n"), progname, object_name, strnwerror(nwerr)); goto finished; } + object_id = o.object_id; } enclen = ncp_path_to_NW_format(path, encpath, sizeof(encpath)); if (enclen < 0) { fprintf(stderr, _("%s: Invalid path: %s\n"), progname, strerror(-enclen)); goto finished; } - tstinfo.objectID = o.object_id; + tstinfo.objectID = object_id; tstinfo.objectRights = 0; nwerr = ncp_ns_trustee_del(conn, NW_NS_DOS, 0xFF, 0, 0, encpath, enclen, &tstinfo, 1); ++++++ ncpfs-hg-commit-447.patch ++++++ changeset: 447:3143e61fb504 user: Petr Vandrovec <petr@vandrovec.name> date: Thu Sep 29 23:06:24 2005 +0200 files: util/pserver.c description: Store ncp_read's result in ssize_t, otherwise errors returned from ncp_read are treated as large positive integers. Somehow ncp_read returns an error at the end of file on NetWare 6.5SP4. Also log these errors to the syslog. diff -r 07b8031b5209 -r 3143e61fb504 util/pserver.c --- a/util/pserver.c Sat Jul 23 22:22:26 2005 +0100 +++ b/util/pserver.c Thu Sep 29 23:06:24 2005 +0200 @@ -248,7 +248,7 @@ poll_queue(struct nw_queue *q) { /* parent */ char buf[1024]; - size_t result; + ssize_t result; off_t offset = 0; close(fd[0]); /* close read end */ @@ -257,9 +257,16 @@ poll_queue(struct nw_queue *q) sizeof(buf), buf)) > 0) { offset += result; - if (write(fd[1], buf, result) != (int)result) + if (write(fd[1], buf, result) != result) { goto fail; + } + } + if (result < 0) { + if (result == -1) { + syslog(LOG_ERR, _("ncp_read: unknown error\n")); + } else { + syslog(LOG_ERR, _("ncp_read: %m\n")); } } ++++++ ncpfs-hg-commit-448.patch ++++++ ++++ 4136 lines (skipped) ++++++ ncpfs-hg-commit-449.patch ++++++ changeset: 449:20cdebe39580 user: Petr Vandrovec <petr@vandrovec.name> date: Sun Oct 16 02:44:08 2005 +0200 files: contrib/ncp_nss_lib/Makefile description: Update 'make clean' rule in ncp_nss_lib to remove all build products. diff -r 1a8455ed3290 -r 20cdebe39580 contrib/ncp_nss_lib/Makefile --- a/contrib/ncp_nss_lib/Makefile Sun Oct 16 02:40:25 2005 +0200 +++ b/contrib/ncp_nss_lib/Makefile Sun Oct 16 02:44:08 2005 +0200 @@ -87,7 +87,7 @@ dep: dep: clean: - rm -f *.o *.do *.to *~ + rm -f *.o *.do *.to $(SHARED_NSSLIB) $(SHARED_NSSLIB_BIN) $(UTILS1) *~ mrproper: clean rm -f $(UTILS) $(DISTFILE) ++++++ ncpfs-hg-commit-450.patch ++++++ changeset: 450:f18f9f05b9b8 user: Petr Vandrovec <petr@vandrovec.name> date: Sun Oct 16 02:52:35 2005 +0200 files: .hgignore contrib/ncp_nss_lib/Makefile contrib/ncp_nss_lib/nss_cfgfile.c description: Get ncp_nss_lib to build with gcc4.0. Also fix build process - libnss_ncp.so is needed for development, libnss_ncp.so.2 is soname, and libnss_ncp.so.2.3 is library version. diff -r 20cdebe39580 -r f18f9f05b9b8 .hgignore --- a/.hgignore Sun Oct 16 02:44:08 2005 +0200 +++ b/.hgignore Sun Oct 16 02:52:35 2005 +0200 @@ -10,7 +10,7 @@ ^autom4te.cache/ ^config\.log$ ^config\.status$ -^contrib/ncp_nss_lib/libnss_ncp\.so\.2$ +^contrib/ncp_nss_lib/libnss_ncp\.so\. ^contrib/ncp_nss_lib/test_ncp_nss$ ^contrib/pam/Makefile$ ^contrib/php/Makefile$ diff -r 20cdebe39580 -r f18f9f05b9b8 contrib/ncp_nss_lib/Makefile --- a/contrib/ncp_nss_lib/Makefile Sun Oct 16 02:44:08 2005 +0200 +++ b/contrib/ncp_nss_lib/Makefile Sun Oct 16 02:52:35 2005 +0200 @@ -8,8 +8,8 @@ this_srcdir = ${top_srcdir}/lib include ${top_builddir}/Make.rules -VERSION_SOLIB := 2 -VERSION_SONAME := 2.3 +VERSION_SOLIB := 2.3 +VERSION_SONAME := 2 vpath %.c ${this_srcdir} @@ -80,8 +80,8 @@ install: install_shared $(O_UTILS1) $(O_TMP1): %.o: %.c $(CC) $(CCFLAGS) $(CFLAGS) $(CFLAGS_$@) -o $@ -c $< -$(UTILS1):: %: %.o $(O_TMP1) - $(CC) $(LDFLAGS) $(CFLAGS) -o $@ $(addsuffix .o,$@) $(OBJS_$@) -L$(top_builddir)/lib -lnss_ncp -lncp $(LDFLAGS_$@) +$(UTILS1):: %: %.o $(O_TMP1) $(SHARED_NSSLIB) + $(CC) $(LDFLAGS) $(CFLAGS) -o $@ $(addsuffix .o,$@) $(OBJS_$@) -L. -lnss_ncp -L$(top_builddir)/lib -lncp $(LDFLAGS_$@) dep: @@ -100,8 +100,11 @@ install_shared: $(SHARED_NCPLIB_BIN) -ldconfig -$(SHARED_NSSLIB): $(SHARED_NSSLIB_BIN) +$(SHARED_NSSLIB): $(SHARED_NSSLIB_SONAME) rm -f $@ + ln -sf $< $@ + +$(SHARED_NSSLIB_SONAME): $(SHARED_NSSLIB_BIN) ln -sf $< $@ $(SHARED_NSSLIB_BIN): $(SHARED_O_OBJ) ${this_srcdir}/libncp.vers diff -r 20cdebe39580 -r f18f9f05b9b8 contrib/ncp_nss_lib/nss_cfgfile.c --- a/contrib/ncp_nss_lib/nss_cfgfile.c Sun Oct 16 02:44:08 2005 +0200 +++ b/contrib/ncp_nss_lib/nss_cfgfile.c Sun Oct 16 02:52:35 2005 +0200 @@ -175,13 +175,13 @@ static int process_line (char* cptr, str } *eptr = 0; if (ptr->isNum) { - (int *)*ptr->value_ptr=strtoul (sptr,&errPtr,0); + *(int**)ptr->value_ptr=strtoul (sptr,&errPtr,0); ptr->found= ((*sptr) && !(*errPtr)); //not empty and no error } else { if (eptr>sptr) { // do not take an empty string value char *v=strdup(sptr); if (v) { - (char*) *ptr->value_ptr=v; + *(char**)ptr->value_ptr=v; ptr->found= TRUE; }else return 1; @@ -201,11 +201,11 @@ static int fix_conf (struct check *resul return 1; } if (ptr->isNum) { - (int *)*ptr->value_ptr=strtoul (ptr->defValue,NULL,0); + *(int**)ptr->value_ptr=strtoul (ptr->defValue,NULL,0); }else { char * v=strdup(ptr->defValue); if (v) - (char*) *ptr->value_ptr=v; + *(char**)ptr->value_ptr=v; else return 1; } ++++++ ncpfs-hg-commit-451.patch ++++++ changeset: 451:4d7bb63d7050 user: Petr Vandrovec <petr@vandrovec.name> date: Sun Oct 16 04:07:06 2005 +0200 files: contrib/ncp_nss_lib/nss_cfgfile.c contrib/ncp_nss_lib/nss_cfgfile.h contrib/ncp_nss_lib/nss_ncp.c contrib/ncp_nss_lib/nss_ncp.h contrib/ncp_nss_lib/test_ncp_nss.c description: Fix warnings in the nss module. Tweak some functions to not take useless arguments. Fix some bugs where long ints are printed by %d... diff -r f18f9f05b9b8 -r 4d7bb63d7050 contrib/ncp_nss_lib/nss_cfgfile.c --- a/contrib/ncp_nss_lib/nss_cfgfile.c Sun Oct 16 02:52:35 2005 +0200 +++ b/contrib/ncp_nss_lib/nss_cfgfile.c Sun Oct 16 04:07:06 2005 +0200 @@ -40,6 +40,7 @@ #include <sys/syslog.h> #include "nss_cfgfile.h" +#include "nss_ncp.h" // temporary define (waiting for a better Makefile) #define GLOBALCFGFILE "/etc/ncpfs.conf" #ifndef GLOBALCFGFILE @@ -49,7 +50,7 @@ // #define DEBUG 1 -static struct nss_ncp_conf* alloc_nss_ncp_conf (){ +static struct nss_ncp_conf* alloc_nss_ncp_conf (void){ struct nss_ncp_conf * conf; conf= (struct nss_ncp_conf *)malloc(sizeof(*conf)); @@ -61,7 +62,7 @@ static struct nss_ncp_conf* alloc_nss_nc void free_nss_ncp_conf (struct nss_ncp_conf *conf){ #define FREEFIELD(x) do if (conf->x) {free(conf->x) ; conf->x=NULL;} while (0); - if (conf && conf !=&defConf) { + if (conf) { FREEFIELD(server); FREEFIELD(startCtx); FREEFIELD(ctrlGroup); @@ -107,7 +108,7 @@ struct check { const char *option; /* configuration option */ int mandatory; /* can be empty or null */ int found; /*set to TRUE if found in cfg file */ - void ** value_ptr; /* temporary storage place */ + char ** value_ptr; /* temporary storage place */ int isNum; /* 1 is numeric, 0 is string*/ const char* defValue; }; @@ -120,10 +121,10 @@ void printResults (const char * infos,st for (ptr=results; ptr->option; ptr++) { if (ptr->isNum) printf ("option=%s mandatory=%d found=%d value=%d isNum=%d defvalue=%s\n", - ptr->option,ptr->mandatory,ptr->found,(int*)*ptr->value_ptr,ptr->isNum,ptr->defValue); + ptr->option,ptr->mandatory,ptr->found,*(int**)ptr->value_ptr,ptr->isNum,ptr->defValue); else printf ("option=%s mandatory=%d found=%d value=%s isNum=%d defvalue=%s\n", - ptr->option,ptr->mandatory,ptr->found,(char*)*ptr->value_ptr,ptr->isNum,ptr->defValue); + ptr->option,ptr->mandatory,ptr->found,*ptr->value_ptr,ptr->isNum,ptr->defValue); } } @@ -175,13 +176,13 @@ static int process_line (char* cptr, str } *eptr = 0; if (ptr->isNum) { - *(int**)ptr->value_ptr=strtoul (sptr,&errPtr,0); + *(int*)ptr->value_ptr=strtoul (sptr,&errPtr,0); ptr->found= ((*sptr) && !(*errPtr)); //not empty and no error } else { if (eptr>sptr) { // do not take an empty string value char *v=strdup(sptr); if (v) { - *(char**)ptr->value_ptr=v; + *ptr->value_ptr=v; ptr->found= TRUE; }else return 1; @@ -201,11 +202,11 @@ static int fix_conf (struct check *resul return 1; } if (ptr->isNum) { - *(int**)ptr->value_ptr=strtoul (ptr->defValue,NULL,0); + *(int*)ptr->value_ptr=strtoul (ptr->defValue,NULL,0); }else { char * v=strdup(ptr->defValue); if (v) - *(char**)ptr->value_ptr=v; + *ptr->value_ptr=v; else return 1; } @@ -223,22 +224,21 @@ static struct nss_ncp_conf *read_conf_fi if (!conf) return NULL; { - struct nss_ncp_conf * pconf=conf; struct check check_confs[] = { /*option mandat found value_ptr isNum defValue */ - {"debug", FALSE,FALSE,(void**)&conf->debug, TRUE, "0"}, - {"useTree", FALSE,FALSE,(void**)&conf->useTree, TRUE, "0"}, - {"server", TRUE,FALSE, (void**)&conf->server, FALSE, ""}, - {"startCtx", FALSE,FALSE,(void**)&conf->startCtx, FALSE, ""}, - {"ctrlGroup", FALSE,FALSE,(void**)&conf->ctrlGroup, FALSE, ""}, - {"defGid", FALSE,FALSE,(void**)&conf->defGid, TRUE, "100"}, - {"defShell", FALSE,FALSE,(void**)&conf->defShell, FALSE, "/bin/bash"}, - {"fallbackUid", FALSE,FALSE,(void**)&conf->fallbackUid, TRUE, "-1"}, - {"fallbackGid", FALSE,FALSE,(void**)&conf->fallbackGid, TRUE, "-1"}, - {"doPasswd", FALSE,FALSE,(void**)&conf->doPassword, TRUE, "0"}, - {"doGroup", FALSE,FALSE,(void**)&conf->doGroup, TRUE, "0"}, - {"doShadow", FALSE,FALSE,(void**)&conf->doShadow, TRUE, "0"}, - {NULL , FALSE,FALSE,NULL, FALSE, NULL} + {"debug", FALSE,FALSE,(char**)&conf->debug, TRUE, "0"}, + {"useTree", FALSE,FALSE,(char**)&conf->useTree, TRUE, "0"}, + {"server", TRUE, FALSE, &conf->server, FALSE, ""}, + {"startCtx", FALSE,FALSE, &conf->startCtx, FALSE, ""}, + {"ctrlGroup", FALSE,FALSE, &conf->ctrlGroup, FALSE, ""}, + {"defGid", FALSE,FALSE,(char**)&conf->defGid, TRUE, "100"}, + {"defShell", FALSE,FALSE, &conf->defShell, FALSE, "/bin/bash"}, + {"fallbackUid", FALSE,FALSE,(char**)&conf->fallbackUid, TRUE, "-1"}, + {"fallbackGid", FALSE,FALSE,(char**)&conf->fallbackGid, TRUE, "-1"}, + {"doPasswd", FALSE,FALSE,(char**)&conf->doPassword, TRUE, "0"}, + {"doGroup", FALSE,FALSE,(char**)&conf->doGroup, TRUE, "0"}, + {"doShadow", FALSE,FALSE,(char**)&conf->doShadow, TRUE, "0"}, + {NULL , FALSE,FALSE, NULL, FALSE, NULL} }; char cfgline[16384]; @@ -259,7 +259,6 @@ static struct nss_ncp_conf *read_conf_fi cptr++; if (*cptr != '[') continue; -sstart:; if (strncasecmp(++cptr, mySection, seclen)) continue; if (cptr[seclen] != ']') @@ -299,7 +298,6 @@ ssend: return conf; } -error: #ifdef DEBUG printResults("after reading CFG error",check_confs); #endif @@ -310,14 +308,12 @@ error: } -struct nss_ncp_conf * parse_conf (char * confFile) { - +struct nss_ncp_conf* parse_conf(void) { struct cfgFile *cfg; struct nss_ncp_conf *conf; #ifdef DEBUG printf("entering parse_conf\n"); #endif - //return &defConf; cfg = cfgOpenFile(GLOBALCFGFILE, FALSE); if (!cfg) return NULL; diff -r f18f9f05b9b8 -r 4d7bb63d7050 contrib/ncp_nss_lib/nss_cfgfile.h --- a/contrib/ncp_nss_lib/nss_cfgfile.h Sun Oct 16 02:52:35 2005 +0200 +++ b/contrib/ncp_nss_lib/nss_cfgfile.h Sun Oct 16 04:07:06 2005 +0200 @@ -20,11 +20,7 @@ struct nss_ncp_conf { int doShadow; // if 0, will return immediarly NSS_STATUS_UNAVAILABLE even if ncp is listed in /etc/nsswitch.conf }; - - -static struct nss_ncp_conf defConf ={0,TRUE,"INSA_ROOT","[Root]",NULL,100,"/bin/bash",-1,-1,TRUE,TRUE,TRUE}; - -struct nss_ncp_conf * parse_conf (char * confFile); -void free_nss_ncp_conf (struct nss_ncp_conf *conf); +struct nss_ncp_conf* parse_conf(void); +void free_nss_ncp_conf(struct nss_ncp_conf *conf); #endif diff -r f18f9f05b9b8 -r 4d7bb63d7050 contrib/ncp_nss_lib/nss_ncp.c --- a/contrib/ncp_nss_lib/nss_ncp.c Sun Oct 16 02:52:35 2005 +0200 +++ b/contrib/ncp_nss_lib/nss_ncp.c Sun Oct 16 04:07:06 2005 +0200 @@ -77,7 +77,7 @@ #include "nss_cfgfile.h" // only if logfile has been opened by nss API functions (debug mode) -void trace (int debugMode,int err,const char * format,... ) { +static void trace (int debugMode,int err,const char * format,... ) { va_list args; if (debugMode) { va_start(args,format); @@ -219,7 +219,7 @@ static int fix_nw_user_info (struct nw_u return 1; } }else { - ui->uid== (uid_t)-1; // unable to read CN (NDS browse rights not set) , skip it ! + ui->uid = (uid_t)-1; // unable to read CN (NDS browse rights not set) , skip it ! } return 0; } @@ -343,7 +343,7 @@ static int fix_nw_group_info (struct nw_ } } }else { - gi->gid== (gid_t)-1; // unable to read CN (NDS browse rights not set) , skip it ! + gi->gid = (gid_t)-1; // unable to read CN (NDS browse rights not set) , skip it ! } return 0; } @@ -514,7 +514,7 @@ static int fix_nw_shadow_info (struct nw } }else { - si->uid== (uid_t)-1; // unable to read CN (NDS browse rights not set) , skip it ! + si->uid = (uid_t)-1; // unable to read CN (NDS browse rights not set) , skip it ! } return 0; } @@ -564,7 +564,7 @@ outnomem: static void print_nw_shadow_info (struct nw_shadow_info si){ - printf("%s[%d]:%s:%d:%d:%d:%d:%d:%d:%d\n",si.cn,si.uid,si.passwd,si.lstchg,si.sp_min,si.sp_max,si.sp_warn,si.sp_inact,si.sp_expire,si.sp_flag); + printf("%s[%d]:%s:%ld:%ld:%ld:%ld:%ld:%ld:%ld\n",si.cn,si.uid,si.passwd,si.lstchg,si.sp_min,si.sp_max,si.sp_warn,si.sp_inact,si.sp_expire,si.sp_flag); } static void print_shadow (struct spwd spw){ @@ -579,8 +579,8 @@ struct nw_user_group_info { uid_t uid; gid_t* groups; size_t used; - size_t alloc; - int qflag; + size_t alloc; + int qflag; }; @@ -614,7 +614,7 @@ static int fix_nw_user_group_info (struc if (ui->uid== (uid_t)-1) ui->uid=conf->fallbackUid; }else { - ui->uid== (uid_t)-1; // unable to read CN (NDS browse rights not set) , skip it ! + ui->uid = (uid_t)-1; // unable to read CN (NDS browse rights not set) , skip it ! } return 0; } @@ -628,11 +628,11 @@ static enum nss_status nw_user_group_inf long int *size, gid_t * groups,long int limit,int *errnop,struct nss_ncp_conf * conf) { if (ui.uid != (uid_t)-1) { - int i; - for (i=0; i<ui.used; i++) { + size_t i; + for (i=0; i < ui.used; i++) { gid_t gid=ui.groups[i]; if (gid != group) { // group number to skip - if (*start == *size) + if (*start == *size) { if (limit <=0) { // no more space, realloc if permitted (limit <=0) gid_t* ngroups=realloc(groups, 2* *size * sizeof(*groups)); if (!ngroups) { @@ -642,6 +642,7 @@ static enum nss_status nw_user_group_inf *size *=2; }else // no reallocation permitted, leave returning found groups so far break; + } groups[*start]=gid; *start +=1; if (*start ==limit) { @@ -663,7 +664,7 @@ outnomem: } static void print_nw_user_group_info (struct nw_user_group_info ui){ - int i; + size_t i; printf("%s:%d:%d:%d:",ui.cn,ui.uid,ui.used,ui.alloc); for (i=0;i <ui.used;i++) @@ -672,8 +673,8 @@ static void print_nw_user_group_info (st } static void print_user_groups(gid_t * groups, long int start, long int size){ - int i; - printf("start=%d size=%d\n",start,size); + long int i; + printf("start=%ld size=%ld\n",start,size); for (i=0; i<start; i++) printf("%d ",groups[i]); printf("\n"); @@ -1018,9 +1019,7 @@ static NWDSCCODE nds_user_location2(NWDS static NWDSCCODE nds_user_location2(NWDSContextHandle ctx, const void *val, void *arg){ struct nw_user_info *ui = (struct nw_user_info *) arg; const char *pt = (const char *) val; - char *v; int n; - int err; trace(ui->qflag,LOG_NOTICE, "start of NW location got %s\n ", pt); @@ -1318,9 +1317,7 @@ static NWDSCCODE nds_shadow_location(NWD struct nw_shadow_info *si = (struct nw_shadow_info *) arg; const char *pt = (const char *) val; - char *v; int n; - int err; trace(si->qflag & QF_DEBUG,LOG_NOTICE, "shadow: start of NW location got %s\n ", pt); @@ -1434,10 +1431,7 @@ static NWDSCCODE nds_user_location3(NWDS static NWDSCCODE nds_user_location3(NWDSContextHandle ctx, const void *val, void *arg){ struct nw_user_group_info *ui = (struct nw_user_group_info *) arg; const char *pt = (const char *) val; - char *v; int n; - int err; - trace(ui->qflag & QF_DEBUG,LOG_NOTICE, "start of NW location got %s\n ", pt); @@ -1814,7 +1808,6 @@ getgroupmembers(NWDSContextHandle *conte { ATTR_MEMBERS, nds_get_group_members, SYN_MEMBERS}, { NULL, NULL, SYN_UNKNOWN }}; - NWDSCCODE err; trace(conf->debug, LOG_NOTICE,"entering getgroupmembers for group %s",groupName); ccode=CreateContextAndConn ( context,conn,conf); if (ccode) @@ -1834,12 +1827,12 @@ static struct ObjectList* ndsShadows=NUL // description of a NDS class to be searched by getentbyxx struct class_info { - char * className; - char * nds8Attribute; //name of ID attribute in NDS8 - char * LID1; // markers in L attribute for ID (U: or G:) - char * LID2; // markers in L attribute for ID (u: or g:), may be in lower case - char * LAlias1;// markers in L attribute for alias (N:) - char * LAlias2; // markers in L attribute for alias (n:) may be in lower case + const char * className; + const char * nds8Attribute; // name of ID attribute in NDS8 + const char * LID1; // markers in L attribute for ID (U: or G:) + const char * LID2; // markers in L attribute for ID (u: or g:), may be in lower case + const char * LAlias1; // markers in L attribute for alias (N:) + const char * LAlias2; // markers in L attribute for alias (n:) may be in lower case }; @@ -1879,17 +1872,12 @@ static NWDSCCODE getentbyxx( NWDSContextHandle context; NWCONN_HANDLE conn; NWDSCCODE ccode; - nint32 iterationHandle= NO_MORE_ITERATIONS; // to be set as such at Exit4 - nint32 countObjectsSearched; - nuint32 objCntr,attrCntr,valCntr; + nuint32 iterationHandle = NO_MORE_ITERATIONS; // to be set as such at Exit4 + nuint32 countObjectsSearched; + nuint32 objCntr; nuint32 objCount; nuint32 attrCount; char objectName[MAX_DN_CHARS+1]; - char attrName[MAX_SCHEMA_NAME_CHARS+1]; - nuint32 attrValCount; - nuint32 syntaxID; - nuint32 attrValSize; - char* attrVal; // buffers pBuf_T searchFilter=NULL; // search filter @@ -2259,14 +2247,14 @@ static NWDSCCODE getentbyxx( } } trace(conf->debug, LOG_NOTICE,"callback return OK"); - } while ((nuint32)iterationHandle != NO_MORE_ITERATIONS); + } while (iterationHandle != NO_MORE_ITERATIONS); trace(conf->debug, LOG_NOTICE,"End of iteration attrNamesOK"); Exit4: - if ((nuint32)iterationHandle != NO_MORE_ITERATIONS){ + if (iterationHandle != NO_MORE_ITERATIONS){ NWDSCCODE ccode2; - if (ccode2=NWDSCloseIteration(context,iterationHandle,DSV_SEARCH)) { + if ((ccode2=NWDSCloseIteration(context,iterationHandle,DSV_SEARCH)) != 0) { traceForce(conf->debug,LOG_WARNING,"NWDSCloseIteration returned: %d\n", ccode2); } } @@ -2291,7 +2279,6 @@ Exit3: }else if (retConn) *retConn=conn; -Exit2: if (ccode || !retContext) { NWDSCCODE ccode2=NWDSFreeContext(context); trace(conf->debug, LOG_NOTICE,"Freeing context"); @@ -2300,7 +2287,6 @@ Exit2: }else if (retContext) *retContext=context; -Exit1: trace(conf->debug, LOG_NOTICE,"Leaving ..."); return ccode; } @@ -2417,7 +2403,7 @@ enum nss_status _nss_ncp_initgroups (con struct nw_user_group_info inf; NWDSCCODE err; - struct nss_ncp_conf *conf= parse_conf(CNF_FILE); + struct nss_ncp_conf* conf = parse_conf(); if (!conf || !conf->doGroup) return NSS_STATUS_UNAVAIL; @@ -2460,7 +2446,7 @@ enum nss_status _nss_ncp_getpwnam_r (con struct nw_user_info inf; NWDSCCODE err; - struct nss_ncp_conf *conf= parse_conf(CNF_FILE); + struct nss_ncp_conf* conf = parse_conf(); if (!conf || !conf->doPassword) return NSS_STATUS_UNAVAIL; @@ -2503,7 +2489,7 @@ enum nss_status _nss_ncp_getpwuid_r (uid struct nw_user_info inf; NWDSCCODE err; - struct nss_ncp_conf *conf= parse_conf(CNF_FILE); + struct nss_ncp_conf* conf = parse_conf(); if (!conf || !conf->doPassword) return NSS_STATUS_UNAVAIL; @@ -2546,7 +2532,7 @@ enum nss_status _nss_ncp_getgrnam_r (con struct nw_group_info inf; NWDSCCODE err; - struct nss_ncp_conf *conf= parse_conf(CNF_FILE); + struct nss_ncp_conf* conf = parse_conf(); if (!conf || !conf->doGroup) return NSS_STATUS_UNAVAIL; @@ -2588,7 +2574,7 @@ enum nss_status _nss_ncp_getspnam_r (con char *buffer, size_t buflen,int * errnop) { struct nw_shadow_info inf; NWDSCCODE err; - struct nss_ncp_conf *conf= parse_conf(CNF_FILE); + struct nss_ncp_conf* conf = parse_conf(); if (!conf || !conf->doShadow) return NSS_STATUS_UNAVAIL; @@ -2631,7 +2617,7 @@ enum nss_status _nss_ncp_getgrgid_r (gid char * buffer, size_t buflen, int * errnop) { struct nw_group_info inf; NWDSCCODE err; - struct nss_ncp_conf *conf= parse_conf(CNF_FILE); + struct nss_ncp_conf* conf = parse_conf(); if (!conf || !conf->doGroup) return NSS_STATUS_UNAVAIL; @@ -2673,7 +2659,7 @@ enum nss_status _nss_ncp_setpwent(void) NWDSContextHandle context; NWCONN_HANDLE conn; NWDSCCODE ccode; - struct nss_ncp_conf *conf= parse_conf(CNF_FILE); + struct nss_ncp_conf* conf = parse_conf(); if (!conf || !conf->doPassword) return NSS_STATUS_UNAVAIL; @@ -2715,7 +2701,7 @@ enum nss_status _nss_ncp_setgrent(void) NWDSContextHandle context; NWCONN_HANDLE conn; enum nss_status ccode; - struct nss_ncp_conf *conf= parse_conf(CNF_FILE); + struct nss_ncp_conf* conf = parse_conf(); if (!conf || !conf->doGroup) return NSS_STATUS_UNAVAIL; @@ -2753,7 +2739,7 @@ enum nss_status _nss_ncp_setspent (void) NWDSContextHandle context; NWCONN_HANDLE conn; NWDSCCODE ccode; - struct nss_ncp_conf *conf= parse_conf(CNF_FILE); + struct nss_ncp_conf* conf = parse_conf(); if (!conf || !conf->doShadow) return NSS_STATUS_UNAVAIL; diff -r f18f9f05b9b8 -r 4d7bb63d7050 contrib/ncp_nss_lib/nss_ncp.h --- a/contrib/ncp_nss_lib/nss_ncp.h Sun Oct 16 02:52:35 2005 +0200 +++ b/contrib/ncp_nss_lib/nss_ncp.h Sun Oct 16 04:07:06 2005 +0200 @@ -121,6 +121,7 @@ +void traceForce(int debugMode, int err, const char* format, ...); /******************************* NSS API ***************************************/ diff -r f18f9f05b9b8 -r 4d7bb63d7050 contrib/ncp_nss_lib/test_ncp_nss.c --- a/contrib/ncp_nss_lib/test_ncp_nss.c Sun Oct 16 02:52:35 2005 +0200 +++ b/contrib/ncp_nss_lib/test_ncp_nss.c Sun Oct 16 04:07:06 2005 +0200 @@ -67,6 +67,7 @@ #include "nss_cfgfile.h" +static struct nss_ncp_conf defConf ={0, TRUE, NULL, NULL, NULL, 100, NULL, -1, -1, TRUE, TRUE, TRUE}; /**************** TESTING ******************/ @@ -94,13 +95,13 @@ static void print_shadow (struct spwd sp static void print_user_groups(gid_t * groups, long int start, long int size){ int i; - printf("start=%d size=%d\n",start,size); + printf("start=%ld size=%ld\n",start,size); for (i=0; i<start; i++) printf("%d ",groups[i]); printf("\n"); } -void give_details_on_user_groups(gid_t *groups, long int start){ +static void give_details_on_user_groups(gid_t *groups, long int start){ struct group grp; char buffer[65000]; long int i; @@ -148,11 +149,6 @@ static void help(void) exit (1); } -static void error ( char * s) { - printf (_("\n%s\n"),s); - exit (1); -} - /************************************************************************* ** main */ @@ -174,7 +170,6 @@ int main (int argc, char** argv) { struct passwd pwd; struct group grp; struct spwd spw; - enum nss_status err; progname = argv[0]; while ((opt = getopt(argc, argv, "h?u:n:g:i:s:m:T:B:C:O:f:UGSD2")) != EOF) @@ -263,7 +258,7 @@ int main (int argc, char** argv) { } } - if (userId != -1) { + if (userId != (uid_t)-1) { printf ("searching in passwd for uid %d\n",userId); if ( _nss_ncp_getpwuid_r (userId, &pwd,buffer,sizeof(buffer),&errno)==NSS_STATUS_SUCCESS) print_passwd(pwd); @@ -284,7 +279,7 @@ int main (int argc, char** argv) { } } - if (groupId != -1) { + if (groupId != (gid_t)-1) { printf ("searching in group for gid %d\n",groupId); if ( _nss_ncp_getgrgid_r (groupId, &grp,buffer,sizeof(buffer),&errno)==NSS_STATUS_SUCCESS) print_group(grp); ++++++ ncpfs-hg-commit-452.patch ++++++ changeset: 452:b2ec015c1689 user: Petr Vandrovec <petr@vandrovec.name> date: Sun Oct 16 04:14:27 2005 +0200 files: contrib/ncp_nss_lib/nss_ncp.c description: Use %zd format when printing size_t arguments. Revealed on 64bit host. diff -r 4d7bb63d7050 -r b2ec015c1689 contrib/ncp_nss_lib/nss_ncp.c --- a/contrib/ncp_nss_lib/nss_ncp.c Sun Oct 16 04:07:06 2005 +0200 +++ b/contrib/ncp_nss_lib/nss_ncp.c Sun Oct 16 04:14:27 2005 +0200 @@ -666,7 +666,7 @@ static void print_nw_user_group_info (st static void print_nw_user_group_info (struct nw_user_group_info ui){ size_t i; - printf("%s:%d:%d:%d:",ui.cn,ui.uid,ui.used,ui.alloc); + printf("%s:%d:%zd:%zd:",ui.cn,ui.uid,ui.used,ui.alloc); for (i=0;i <ui.used;i++) printf("%d ",ui.groups[i]); printf("\n"); @@ -1754,15 +1754,15 @@ static void print_nodes(struct TreeNode* if (n) { print_nodes(n->left,crlf); if (crlf) - printf ("%s [%d]\n",n->name,n->cnt); + printf ("%s [%zd]\n",n->name,n->cnt); else - printf ("%s [%d]",n->name,n->cnt); + printf ("%s [%zd]",n->name,n->cnt); print_nodes(n->right,crlf); } } static void print_tree(struct ObjectList* t, int crlf) { - printf("total:%d unique:%d\n",t->totalObjects,t->uniqueObjects); + printf("total:%zd unique:%zd\n",t->totalObjects,t->uniqueObjects); print_nodes (t->first,crlf); } ++++++ ncpfs-hg-commit-453.patch ++++++ changeset: 453:329b32c7d8a6 user: Petr Vandrovec <petr@vandrovec.name> date: Thu Apr 13 19:59:28 2006 +0200 files: lib/ndslib.c description: Fix nds_beginauth2 on Fedora nds_beginauth2 was aliging pointer to be multiple of 4 bytes, instead of aligning offset from start of buffer to the pointer to be multiple of 4 bytes. This was not problem before, as buffer itself was 4 byte aligned, but Fedora's compiler has options which can misalign it... See https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=186683. diff -r b2ec015c1689 -r 329b32c7d8a6 lib/ndslib.c --- a/lib/ndslib.c Sun Oct 16 04:14:27 2005 +0200 +++ b/lib/ndslib.c Thu Apr 13 19:59:28 2006 +0200 @@ -1026,7 +1026,8 @@ static NWDSCCODE nds_beginauth2( goto err_exit; } copyfill(n_temp, n1, p, n3a); - p = (void*)(((unsigned long)k1end + 3) & ~3); + /* align p to the first 4 byte boundary beyond k1end */ + p = k1end + ((p - k1end) & 3); err = modexpkey(s_key, n_temp, n_temp, n1); if (err) { ISRPrint("modexpkey failed\n"); ++++++ ncpfs-hg-commit-454.patch ++++++ changeset: 454:7783da47228e user: Petr Vandrovec <petr@vandrovec.name> date: Thu Apr 13 22:53:06 2006 +0200 files: include/ncp/ipxlib.h include/ncp/kernel/ncp.h include/ncp/ncp.h include/ncp/ncplib.h ipx-1.0/ipx_cmd.c lib/ncplib.c description: gcc-4.1 does not like packed characters/character arrays gcc-4.1 does not like when element which itself is aligned at 1 byte is tagged again with __attribute__((packed)). So let's remove this attribute, it should not break older gcc... diff -r 329b32c7d8a6 -r 7783da47228e include/ncp/ipxlib.h --- a/include/ncp/ipxlib.h Thu Apr 13 19:59:28 2006 +0200 +++ b/include/ncp/ipxlib.h Thu Apr 13 22:53:06 2006 +0200 @@ -64,12 +64,12 @@ struct sap_server_ident struct sap_server_ident { u_int16_t server_type __attribute__((packed)); - char server_name[48] __attribute__((packed)); + char server_name[48]; IPXNet server_network __attribute__((packed)); #ifdef SWIG u_int8_t server_node[6] __attribute__((packed)); #else - IPXNode server_node __attribute__((packed)); + IPXNode server_node; #endif IPXPort server_port __attribute__((packed)); u_int16_t intermediate_network __attribute__((packed)); @@ -87,7 +87,7 @@ struct ipx_rip_packet struct ipx_rip_packet { u_int16_t operation __attribute__((packed)); - struct ipx_rt_def rt[1] __attribute__((packed)); + struct ipx_rt_def rt[1]; } __attribute__((packed)); #ifdef SWIG diff -r 329b32c7d8a6 -r 7783da47228e include/ncp/kernel/ncp.h --- a/include/ncp/kernel/ncp.h Thu Apr 13 19:59:28 2006 +0200 +++ b/include/ncp/kernel/ncp.h Thu Apr 13 22:53:06 2006 +0200 @@ -53,12 +53,12 @@ struct ncp_request_header { u_int16_t type __attribute__((packed)); - u_int8_t sequence __attribute__((packed)); - u_int8_t conn_low __attribute__((packed)); - u_int8_t task __attribute__((packed)); - u_int8_t conn_high __attribute__((packed)); - u_int8_t function __attribute__((packed)); - u_int8_t data[0] __attribute__((packed)); + u_int8_t sequence; + u_int8_t conn_low; + u_int8_t task; + u_int8_t conn_high; + u_int8_t function; + u_int8_t data[0]; } __attribute__((packed)); #define NCP_REPLY (0x3333) @@ -66,13 +66,13 @@ struct ncp_request_header { struct ncp_reply_header { u_int16_t type __attribute__((packed)); - u_int8_t sequence __attribute__((packed)); - u_int8_t conn_low __attribute__((packed)); - u_int8_t task __attribute__((packed)); - u_int8_t conn_high __attribute__((packed)); - u_int8_t completion_code __attribute__((packed)); - u_int8_t connection_state __attribute__((packed)); - u_int8_t data[0] __attribute__((packed)); + u_int8_t sequence; + u_int8_t conn_low; + u_int8_t task; + u_int8_t conn_high; + u_int8_t completion_code; + u_int8_t connection_state; + u_int8_t data[0]; } __attribute__((packed)); #define NCP_VOLNAME_LEN (16) @@ -230,8 +230,8 @@ struct nw_info_struct { u_int32_t EAKeyCount __attribute__((packed)); u_int32_t EAKeySize __attribute__((packed)); u_int32_t NSCreator __attribute__((packed)); - u_int8_t nameLen __attribute__((packed)); - u_int8_t entryName[256] __attribute__((packed)); + u_int8_t nameLen; + u_int8_t entryName[256]; } __attribute__((packed)); #endif @@ -282,13 +282,13 @@ struct nw_file_info { int opened; int access; u_int32_t server_file_handle __attribute__((packed)); - u_int8_t open_create_action __attribute__((packed)); - u_int8_t file_handle[6] __attribute__((packed)); + u_int8_t open_create_action; + u_int8_t file_handle[6]; } __attribute__((packed)); #endif struct nw_search_sequence { - u_int8_t volNumber __attribute__((packed)); + u_int8_t volNumber; u_int32_t dirBase __attribute__((packed)); u_int32_t sequence __attribute__((packed)); } __attribute__((packed)); diff -r 329b32c7d8a6 -r 7783da47228e include/ncp/ncp.h --- a/include/ncp/ncp.h Thu Apr 13 19:59:28 2006 +0200 +++ b/include/ncp/ncp.h Thu Apr 13 22:53:06 2006 +0200 @@ -95,7 +95,7 @@ struct prop_net_address { #ifdef SWIG fixedArray node[IPX_NODE_LEN]; #else - u_int8_t node[IPX_NODE_LEN] __attribute__((packed)); + u_int8_t node[IPX_NODE_LEN]; #endif u_int16_t port __attribute__((packed)); }; @@ -163,20 +163,20 @@ struct nw_queue_job_entry { u_int32_t ClientTask __attribute__((packed)); u_int32_t ClientObjectID __attribute__((packed)); u_int32_t TargetServerID __attribute__((packed)); - u_int8_t TargetExecTime[6] __attribute__((packed)); - u_int8_t JobEntryTime[6] __attribute__((packed)); + u_int8_t TargetExecTime[6]; + u_int8_t JobEntryTime[6]; u_int32_t JobNumber __attribute__((packed)); u_int16_t JobType __attribute__((packed)); u_int16_t JobPosition __attribute__((packed)); u_int16_t JobControlFlags __attribute__((packed)); - u_int8_t FileNameLen __attribute__((packed)); - char JobFileName[13] __attribute__((packed)); + u_int8_t FileNameLen; + char JobFileName[13]; u_int32_t JobFileHandle __attribute__((packed)); u_int32_t ServerStation __attribute__((packed)); u_int32_t ServerTaskNumber __attribute__((packed)); u_int32_t ServerObjectID __attribute__((packed)); - char JobTextDescription[50] __attribute__((packed)); - char ClientRecordArea[152] __attribute__((packed)); + char JobTextDescription[50]; + char ClientRecordArea[152]; }; struct queue_job { @@ -217,18 +217,18 @@ struct print_job_record { }; #else struct print_job_record { - u_int8_t Version __attribute__((packed)); - u_int8_t TabSize __attribute__((packed)); + u_int8_t Version; + u_int8_t TabSize; u_int16_t Copies __attribute__((packed)); u_int16_t CtrlFlags __attribute__((packed)); u_int16_t Lines __attribute__((packed)); u_int16_t Rows __attribute__((packed)); - char FormName[16] __attribute__((packed)); - u_int8_t Reserved[6] __attribute__((packed)); - char BannerName[13] __attribute__((packed)); - char FnameBanner[13] __attribute__((packed)); - char FnameHeader[14] __attribute__((packed)); - char Path[80] __attribute__((packed)); + char FormName[16]; + u_int8_t Reserved[6]; + char BannerName[13]; + char FnameBanner[13]; + char FnameHeader[14]; + char Path[80]; }; #endif diff -r 329b32c7d8a6 -r 7783da47228e include/ncp/ncplib.h --- a/include/ncp/ncplib.h Thu Apr 13 19:59:28 2006 +0200 +++ b/include/ncp/ncplib.h Thu Apr 13 22:53:06 2006 +0200 @@ -477,24 +477,24 @@ struct ncp_file_server_info #else struct ncp_file_server_info { - char ServerName[48] __attribute__((packed)); - u_int8_t FileServiceVersion __attribute__((packed)); - u_int8_t FileServiceSubVersion __attribute__((packed)); + char ServerName[48]; + u_int8_t FileServiceVersion; + u_int8_t FileServiceSubVersion; u_int16_t MaximumServiceConnections __attribute__((packed)); u_int16_t ConnectionsInUse __attribute__((packed)); u_int16_t NumberMountedVolumes __attribute__((packed)); - u_int8_t Revision __attribute__((packed)); - u_int8_t SFTLevel __attribute__((packed)); - u_int8_t TTSLevel __attribute__((packed)); + u_int8_t Revision; + u_int8_t SFTLevel; + u_int8_t TTSLevel; u_int16_t MaxConnectionsEverUsed __attribute__((packed)); - u_int8_t AccountVersion __attribute__((packed)); - u_int8_t VAPVersion __attribute__((packed)); - u_int8_t QueueVersion __attribute__((packed)); - u_int8_t PrintVersion __attribute__((packed)); - u_int8_t VirtualConsoleVersion __attribute__((packed)); - u_int8_t RestrictionLevel __attribute__((packed)); - u_int8_t InternetBridge __attribute__((packed)); - u_int8_t Reserved[60] __attribute__((packed)); + u_int8_t AccountVersion; + u_int8_t VAPVersion; + u_int8_t QueueVersion; + u_int8_t PrintVersion; + u_int8_t VirtualConsoleVersion; + u_int8_t RestrictionLevel; + u_int8_t InternetBridge; + u_int8_t Reserved[60]; } __attribute__((packed)); #endif @@ -607,7 +607,7 @@ struct ncp_station_addr #ifdef SWIG fixedArray Node[6]; #else - u_int8_t Node[6] __attribute__((packed)); + u_int8_t Node[6]; #endif u_int16_t Socket __attribute__((packed)); } __attribute__((packed)); @@ -617,32 +617,32 @@ struct ncp_prop_login_control #ifdef SWIG fixedArray AccountExpireDate[3]; #else - u_int8_t AccountExpireDate[3] __attribute__((packed)); + u_int8_t AccountExpireDate[3]; #endif - u_int8_t Disabled __attribute__((packed)); + u_int8_t Disabled; #ifdef SWIG fixedArray PasswordExpireDate[3]; #else - u_int8_t PasswordExpireDate[3] __attribute__((packed)); + u_int8_t PasswordExpireDate[3]; #endif - u_int8_t GraceLogins __attribute__((packed)); + u_int8_t GraceLogins; u_int16_t PasswordExpireInterval __attribute__((packed)); - u_int8_t MaxGraceLogins __attribute__((packed)); - u_int8_t MinPasswordLength __attribute__((packed)); + u_int8_t MaxGraceLogins; + u_int8_t MinPasswordLength; u_int16_t MaxConnections __attribute__((packed)); #ifdef SWIG fixedArray ConnectionTimeMask[42] __attribute__((packed)); fixedArray LastLogin[6] __attribute__((packed)); #else - u_int8_t ConnectionTimeMask[42] __attribute__((packed)); - u_int8_t LastLogin[6] __attribute__((packed)); + u_int8_t ConnectionTimeMask[42]; + u_int8_t LastLogin[6]; #endif - u_int8_t RestrictionMask __attribute__((packed)); - u_int8_t reserved __attribute__((packed)); + u_int8_t RestrictionMask; + u_int8_t reserved; u_int32_t MaxDiskUsage __attribute__((packed)); u_int16_t BadLoginCount __attribute__((packed)); u_int32_t BadLoginCountDown __attribute__((packed)); - struct ncp_station_addr LastIntruder __attribute__((packed)); + struct ncp_station_addr LastIntruder; } __attribute__((packed)); NWCCODE NWReadPropertyValue(NWCONN_HANDLE conn, const char *objName, diff -r 329b32c7d8a6 -r 7783da47228e ipx-1.0/ipx_cmd.c --- a/ipx-1.0/ipx_cmd.c Thu Apr 13 19:59:28 2006 +0200 +++ b/ipx-1.0/ipx_cmd.c Thu Apr 13 22:53:06 2006 +0200 @@ -63,10 +63,10 @@ /* we are doing EthernetII... Any objections? */ struct { u_int16_t unknown __attribute__((packed)); - u_int8_t dst[6] __attribute__((packed)); - u_int8_t src[6] __attribute__((packed)); + u_int8_t dst[6]; + u_int8_t src[6]; u_int16_t type __attribute__((packed)); - u_int8_t ipx[16384] __attribute__((packed)); + u_int8_t ipx[16384]; } __attribute__((packed)) buffer; static int getiflist(int fd, struct ifconf* ifc) { diff -r 329b32c7d8a6 -r 7783da47228e lib/ncplib.c --- a/lib/ncplib.c Thu Apr 13 19:59:28 2006 +0200 +++ b/lib/ncplib.c Thu Apr 13 22:53:06 2006 +0200 @@ -2627,13 +2627,13 @@ ncp_request(struct ncp_conn *conn, int f struct nw_time_buffer { - u_int8_t year __attribute__((packed)); - u_int8_t month __attribute__((packed)); - u_int8_t day __attribute__((packed)); - u_int8_t hour __attribute__((packed)); - u_int8_t minute __attribute__((packed)); - u_int8_t second __attribute__((packed)); - u_int8_t wday __attribute__((packed)); + u_int8_t year; + u_int8_t month; + u_int8_t day; + u_int8_t hour; + u_int8_t minute; + u_int8_t second; + u_int8_t wday; } __attribute__((packed)); static time_t ++++++ ncpfs-hg-commit-455.patch ++++++ changeset: 455:69f23e25cc66 user: Petr Vandrovec <petr@vandrovec.name> date: Sat Apr 15 04:25:06 2006 +0200 files: lib/ds/filter.c lib/nwnet.c util/nwdir.c description: Fix some more gcc-4.1 warnings gcc-4.1 is even more stupid than gcc-4.0 was when it comes to uninitialized variables - if function either returns an error, or returns success and modifies its argument, you can be almost 100% sure that gcc-4.1 will tag this with warning if you call some other function between this one, before you'll test function's return value. Just crap, probably it is time to disable all warnings, as they are more than useless. diff -r 7783da47228e -r 69f23e25cc66 lib/ds/filter.c --- a/lib/ds/filter.c Thu Apr 13 22:53:06 2006 +0200 +++ b/lib/ds/filter.c Sat Apr 15 04:25:06 2006 +0200 @@ -303,7 +303,7 @@ static void _PutFilterFirstPass( } else { /* different operand: go to next node in created chain */ - last_q = (struct _filter_node**)&q->value; + last_q = (struct _filter_node**)(void*)&q->value; q = q->value; } } diff -r 7783da47228e -r 69f23e25cc66 lib/nwnet.c --- a/lib/nwnet.c Thu Apr 13 22:53:06 2006 +0200 +++ b/lib/nwnet.c Sat Apr 15 04:25:06 2006 +0200 @@ -1696,7 +1696,7 @@ restartLoop:; NWCONN_HANDLE conn = list_entry(current, struct ncp_conn, nds_ring); NWObjectCount connaddresses; nuint8* conndata; - NWCCODE err2; + NWDSCCODE err2; /* compare addresses */ ncpt_mutex_unlock(&nds_ring_lock); @@ -2808,6 +2808,8 @@ static NWDSCCODE NWDSGetAttrVal_OBJECT_A if (err) return err; err = NWDSBufGetLE32(buffer, &priv); + if (err) + return err; oacl->privileges = priv; return err; } @@ -4149,6 +4151,8 @@ NWDSCCODE NWDSGetServerName(NWDSContextH if (err) return err; err = NWDSBufGetLE32(buffer, &le32); + if (err) + return err; if (partcount) *partcount = le32; return 0; diff -r 7783da47228e -r 69f23e25cc66 util/nwdir.c --- a/util/nwdir.c Thu Apr 13 22:53:06 2006 +0200 +++ b/util/nwdir.c Sat Apr 15 04:25:06 2006 +0200 @@ -521,7 +521,9 @@ static void dumpit(NWCONN_HANDLE conn, c err = NWNSGetEffectiveRights(conn, dir.volNumber, dir.DosDirNum, &eff); - eff32 = eff; + if (!err) { + eff32 = eff; + } } printf(_(" Effective: ")); if (err) { ++++++ ncpfs-hg-commit-456.patch ++++++ changeset: 456:260a30abdb81 user: Petr Vandrovec <petr@vandrovec.name> date: Sat Apr 15 04:41:06 2006 +0200 files: contrib/ncp_nss_lib/nss_cfgfile.c contrib/ncp_nss_lib/nss_cfgfile.h description: Fix nss_ncp strict aliasing problems It is bad idea to convert pointer to integer to pointer to char pointer, and in addition this is also unnecessary. And removal of this typecast revealed that we believe that 'int' and 'gid_t' and 'uid_t' have same width. This is unreasonable assumption, I personally remember time when uid_t was 16bit, while int was 32bit... diff -r 69f23e25cc66 -r 260a30abdb81 contrib/ncp_nss_lib/nss_cfgfile.c --- a/contrib/ncp_nss_lib/nss_cfgfile.c Sat Apr 15 04:25:06 2006 +0200 +++ b/contrib/ncp_nss_lib/nss_cfgfile.c Sat Apr 15 04:41:06 2006 +0200 @@ -108,9 +108,9 @@ struct check { const char *option; /* configuration option */ int mandatory; /* can be empty or null */ int found; /*set to TRUE if found in cfg file */ - char ** value_ptr; /* temporary storage place */ - int isNum; /* 1 is numeric, 0 is string*/ - const char* defValue; + char ** char_ptr; /* where to store string value */ + int * int_ptr; /* where to store integer value */ + const char* defValue; /* default value */ }; @@ -119,12 +119,12 @@ void printResults (const char * infos,st struct check* ptr; printf ("%s\n",infos); for (ptr=results; ptr->option; ptr++) { - if (ptr->isNum) - printf ("option=%s mandatory=%d found=%d value=%d isNum=%d defvalue=%s\n", - ptr->option,ptr->mandatory,ptr->found,*(int**)ptr->value_ptr,ptr->isNum,ptr->defValue); + if (ptr->int_ptr) + printf ("option=%s mandatory=%d found=%d value=%d defvalue=%s\n", + ptr->option,ptr->mandatory,ptr->found,*ptr->int_ptr,ptr->defValue); else - printf ("option=%s mandatory=%d found=%d value=%s isNum=%d defvalue=%s\n", - ptr->option,ptr->mandatory,ptr->found,*ptr->value_ptr,ptr->isNum,ptr->defValue); + printf ("option=%s mandatory=%d found=%d value=%s defvalue=%s\n", + ptr->option,ptr->mandatory,ptr->found,*ptr->char_ptr,ptr->defValue); } } @@ -175,14 +175,14 @@ static int process_line (char* cptr, str eptr++; } *eptr = 0; - if (ptr->isNum) { - *(int*)ptr->value_ptr=strtoul (sptr,&errPtr,0); + if (ptr->int_ptr) { + *ptr->int_ptr=strtoul (sptr,&errPtr,0); ptr->found= ((*sptr) && !(*errPtr)); //not empty and no error } else { if (eptr>sptr) { // do not take an empty string value char *v=strdup(sptr); if (v) { - *ptr->value_ptr=v; + *ptr->char_ptr=v; ptr->found= TRUE; }else return 1; @@ -201,12 +201,12 @@ static int fix_conf (struct check *resul traceForce(0,LOG_ERR, "ncp_nss aborting :missing mandatory information '%s=' in config file %s ",ptr->option,GLOBALCFGFILE); return 1; } - if (ptr->isNum) { - *(int*)ptr->value_ptr=strtoul (ptr->defValue,NULL,0); + if (ptr->int_ptr) { + *ptr->int_ptr=strtoul (ptr->defValue,NULL,0); }else { char * v=strdup(ptr->defValue); if (v) - *ptr->value_ptr=v; + *ptr->char_ptr=v; else return 1; } @@ -225,20 +225,20 @@ static struct nss_ncp_conf *read_conf_fi return NULL; { struct check check_confs[] = { - /*option mandat found value_ptr isNum defValue */ - {"debug", FALSE,FALSE,(char**)&conf->debug, TRUE, "0"}, - {"useTree", FALSE,FALSE,(char**)&conf->useTree, TRUE, "0"}, - {"server", TRUE, FALSE, &conf->server, FALSE, ""}, - {"startCtx", FALSE,FALSE, &conf->startCtx, FALSE, ""}, - {"ctrlGroup", FALSE,FALSE, &conf->ctrlGroup, FALSE, ""}, - {"defGid", FALSE,FALSE,(char**)&conf->defGid, TRUE, "100"}, - {"defShell", FALSE,FALSE, &conf->defShell, FALSE, "/bin/bash"}, - {"fallbackUid", FALSE,FALSE,(char**)&conf->fallbackUid, TRUE, "-1"}, - {"fallbackGid", FALSE,FALSE,(char**)&conf->fallbackGid, TRUE, "-1"}, - {"doPasswd", FALSE,FALSE,(char**)&conf->doPassword, TRUE, "0"}, - {"doGroup", FALSE,FALSE,(char**)&conf->doGroup, TRUE, "0"}, - {"doShadow", FALSE,FALSE,(char**)&conf->doShadow, TRUE, "0"}, - {NULL , FALSE,FALSE, NULL, FALSE, NULL} + /*option mandat found char_ptr int_ptr defValue */ + {"debug", FALSE,FALSE, NULL, &conf->debug, "0"}, + {"useTree", FALSE,FALSE, NULL, &conf->useTree, "0"}, + {"server", TRUE, FALSE, &conf->server, NULL, ""}, + {"startCtx", FALSE,FALSE, &conf->startCtx, NULL, ""}, + {"ctrlGroup", FALSE,FALSE, &conf->ctrlGroup, NULL, ""}, + {"defGid", FALSE,FALSE, NULL, &conf->defGid, "100"}, + {"defShell", FALSE,FALSE, &conf->defShell, NULL, "/bin/bash"}, + {"fallbackUid", FALSE,FALSE, NULL, &conf->fallbackUid, "-1"}, + {"fallbackGid", FALSE,FALSE, NULL, &conf->fallbackGid, "-1"}, + {"doPasswd", FALSE,FALSE, NULL, &conf->doPassword, "0"}, + {"doGroup", FALSE,FALSE, NULL, &conf->doGroup, "0"}, + {"doShadow", FALSE,FALSE, NULL, &conf->doShadow, "0"}, + {NULL , FALSE,FALSE, NULL, NULL, NULL} }; char cfgline[16384]; diff -r 69f23e25cc66 -r 260a30abdb81 contrib/ncp_nss_lib/nss_cfgfile.h --- a/contrib/ncp_nss_lib/nss_cfgfile.h Sat Apr 15 04:25:06 2006 +0200 +++ b/contrib/ncp_nss_lib/nss_cfgfile.h Sat Apr 15 04:41:06 2006 +0200 @@ -11,10 +11,10 @@ struct nss_ncp_conf { char * server; // name of server or tree char * startCtx; // start searching is this context (and below) char * ctrlGroup; // limit search to members of this NDS group for passwd and shadow - gid_t defGid; // if no primary group found in NDS use this value + int defGid; // if no primary group found in NDS use this value char * defShell; // if no shell found in NDS use this value - uid_t fallbackUid; // if no UID found in NDS use this one (-1= skip user, NFS_NOBODY= use this UID) - gid_t fallbackGid; // if no GID found in NDS use this one (-1= skip group, NFS_NOBODY= use this GID) + int fallbackUid; // if no UID found in NDS use this one (-1= skip user, NFS_NOBODY= use this UID) + int fallbackGid; // if no GID found in NDS use this one (-1= skip group, NFS_NOBODY= use this GID) int doPassword; // if 0, will return immediarly NSS_STATUS_UNAVAILABLE even if ncp is listed in /etc/nsswitch.conf int doGroup; // if 0, will return immediarly NSS_STATUS_UNAVAILABLE even if ncp is listed in /etc/nsswitch.conf int doShadow; // if 0, will return immediarly NSS_STATUS_UNAVAILABLE even if ncp is listed in /etc/nsswitch.conf ++++++ ncpfs-hg-commit-457.patch ++++++ changeset: 457:0e4dca2d0b0d user: Petr Vandrovec <petr@vandrovec.name> date: Sat Apr 15 05:02:48 2006 +0200 files: contrib/ncp_nss_lib/nss_cfgfile.c description: Fix nss_cfgfile.c formatting Fix nss_cfgfile.c formatting a bit. And make some constant arguments constant. diff -r 260a30abdb81 -r 0e4dca2d0b0d contrib/ncp_nss_lib/nss_cfgfile.c --- a/contrib/ncp_nss_lib/nss_cfgfile.c Sat Apr 15 04:41:06 2006 +0200 +++ b/contrib/ncp_nss_lib/nss_cfgfile.c Sat Apr 15 05:02:48 2006 +0200 @@ -50,18 +50,22 @@ // #define DEBUG 1 -static struct nss_ncp_conf* alloc_nss_ncp_conf (void){ +static struct nss_ncp_conf* +alloc_nss_ncp_conf(void) +{ struct nss_ncp_conf * conf; - conf= (struct nss_ncp_conf *)malloc(sizeof(*conf)); + conf = malloc(sizeof(*conf)); if (!conf) return NULL; return conf; } -void free_nss_ncp_conf (struct nss_ncp_conf *conf){ -#define FREEFIELD(x) do if (conf->x) {free(conf->x) ; conf->x=NULL;} while (0); +void +free_nss_ncp_conf(struct nss_ncp_conf *conf) +{ +#define FREEFIELD(x) do if (conf->x) { free(conf->x); conf->x = NULL; } while (0); if (conf) { FREEFIELD(server); FREEFIELD(startCtx); @@ -77,12 +81,13 @@ struct cfgFile { FILE* file; }; -static struct cfgFile* cfgOpenFile( - const char* path, - int writeRequired) { +static struct cfgFile* +cfgOpenFile(const char* path, + int writeRequired) +{ struct cfgFile* cfg; - cfg = (struct cfgFile*)malloc(sizeof(*cfg)); + cfg = malloc(sizeof(*cfg)); if (cfg) { cfg->file = fopen(path, writeRequired ? "r+" : "r"); if (cfg->file) { @@ -95,8 +100,9 @@ static struct cfgFile* cfgOpenFile( return cfg; } -static void cfgClose( - struct cfgFile* cfg) { +static void +cfgClose(struct cfgFile* cfg) +{ ncpt_mutex_lock(&cfg->mutex); fclose(cfg->file); ncpt_mutex_destroy(&cfg->mutex); @@ -105,46 +111,52 @@ static void cfgClose( struct check { - const char *option; /* configuration option */ - int mandatory; /* can be empty or null */ - int found; /*set to TRUE if found in cfg file */ - char ** char_ptr; /* where to store string value */ - int * int_ptr; /* where to store integer value */ - const char* defValue; /* default value */ + const char *option; /* configuration option */ + int mandatory; /* can be empty or null */ + int found; /* set to TRUE if found in cfg file */ + char **char_ptr; /* where to store string value */ + int *int_ptr; /* where to store integer value */ + const char *defValue; /* default value */ }; #ifdef DEBUG -void printResults (const char * infos,struct check * results) { - struct check* ptr; - printf ("%s\n",infos); - for (ptr=results; ptr->option; ptr++) { +void +printResults(const char *infos, const struct check *results) +{ + const struct check *ptr; + + printf ("%s\n", infos); + for (ptr = results; ptr->option; ptr++) { if (ptr->int_ptr) printf ("option=%s mandatory=%d found=%d value=%d defvalue=%s\n", - ptr->option,ptr->mandatory,ptr->found,*ptr->int_ptr,ptr->defValue); + ptr->option, ptr->mandatory, ptr->found, *ptr->int_ptr, ptr->defValue); else printf ("option=%s mandatory=%d found=%d value=%s defvalue=%s\n", - ptr->option,ptr->mandatory,ptr->found,*ptr->char_ptr,ptr->defValue); - } - -} - -void printConf (const char* infos,struct nss_ncp_conf * conf) { - printf ("%s\n",infos); - printf ("debug=%d useTree=%d server=%s startCtx=%s ctrlGroup=%s defGid=%d defShell=%s fallbackUid=%d fallbackGid=%d " + ptr->option, ptr->mandatory, ptr->found, *ptr->char_ptr, ptr->defValue); + } + +} + +void +printConf(const char *infos, const struct nss_ncp_conf *conf) +{ + printf ("%s\n", infos); + printf ("debug=%d useTree=%d server=%s startCtx=%s ctrlGroup=%s defGid=%u defShell=%s fallbackUid=%u fallbackGid=%u " "doPassword=%d doGroup=%d doShadow=%d\n", - conf->debug,conf->useTree,conf->server,conf->startCtx, - conf->ctrlGroup,conf->defGid,conf->defShell,conf->fallbackUid,conf->fallbackGid, - conf->doPassword,conf->doGroup,conf->doShadow); -} -#endif - - -static int process_line (char* cptr, struct check *ptr) { - - char* sptr; // start of real value - char* eptr; // end of real value - char* errPtr; // err + conf->debug, conf->useTree, conf->server, conf->startCtx, + conf->ctrlGroup, conf->defGid, conf->defShell, conf->fallbackUid, conf->fallbackGid, + conf->doPassword, conf->doGroup, conf->doShadow); +} +#endif + + +static int +process_line(const char *cptr, struct check *ptr) +{ + + const char* sptr; // start of real value + const char* eptr; // end of real value char ec; char cc; @@ -163,8 +175,8 @@ static int process_line (char* cptr, str ec = *cptr++; else ec = 0; - sptr=cptr; - eptr=cptr; + sptr = cptr; + eptr = cptr; while ((cc = *cptr++) != 0) { if (cc == '\n') break; @@ -174,39 +186,43 @@ static int process_line (char* cptr, str break; eptr++; } - *eptr = 0; - if (ptr->int_ptr) { - *ptr->int_ptr=strtoul (sptr,&errPtr,0); - ptr->found= ((*sptr) && !(*errPtr)); //not empty and no error - } else { - if (eptr>sptr) { // do not take an empty string value - char *v=strdup(sptr); + if (eptr != sptr) { + if (ptr->int_ptr) { + char* errPtr; // err + + *ptr->int_ptr = strtoul(sptr, &errPtr, 0); + ptr->found = errPtr == eptr; + } else { + char *v = malloc(eptr - sptr + 1); if (v) { - *ptr->char_ptr=v; - ptr->found= TRUE; - }else + memcpy(v, sptr, eptr - sptr); + v[eptr - sptr] = 0; + *ptr->char_ptr = v; + ptr->found = TRUE; + } else return 1; } } - return 0; } -static int fix_conf (struct check *results) { +static int +fix_conf(struct check *results) +{ struct check* ptr; - for (ptr=results; ptr->option; ptr++) { - if (! ptr->found) { - if (ptr->mandatory) { - traceForce(0,LOG_ERR, "ncp_nss aborting :missing mandatory information '%s=' in config file %s ",ptr->option,GLOBALCFGFILE); + for (ptr = results; ptr->option; ptr++) { + if (!ptr->found) { + if (ptr->mandatory) { + traceForce(0, LOG_ERR, "ncp_nss aborting :missing mandatory information '%s=' in config file %s", ptr->option, GLOBALCFGFILE); return 1; } if (ptr->int_ptr) { - *ptr->int_ptr=strtoul (ptr->defValue,NULL,0); - }else { - char * v=strdup(ptr->defValue); + *ptr->int_ptr = strtoul(ptr->defValue, NULL, 0); + } else { + char *v = strdup(ptr->defValue); if (v) - *ptr->char_ptr=v; + *ptr->char_ptr = v; else return 1; } @@ -216,38 +232,38 @@ static int fix_conf (struct check *resul } -static struct nss_ncp_conf *read_conf_file( const char * mySection, struct cfgFile *cfg) { - +static struct nss_ncp_conf * +read_conf_file(const char * mySection, struct cfgFile *cfg) +{ struct nss_ncp_conf *conf; - conf=alloc_nss_ncp_conf (); + conf = alloc_nss_ncp_conf(); if (!conf) return NULL; { struct check check_confs[] = { - /*option mandat found char_ptr int_ptr defValue */ - {"debug", FALSE,FALSE, NULL, &conf->debug, "0"}, - {"useTree", FALSE,FALSE, NULL, &conf->useTree, "0"}, - {"server", TRUE, FALSE, &conf->server, NULL, ""}, - {"startCtx", FALSE,FALSE, &conf->startCtx, NULL, ""}, - {"ctrlGroup", FALSE,FALSE, &conf->ctrlGroup, NULL, ""}, - {"defGid", FALSE,FALSE, NULL, &conf->defGid, "100"}, - {"defShell", FALSE,FALSE, &conf->defShell, NULL, "/bin/bash"}, - {"fallbackUid", FALSE,FALSE, NULL, &conf->fallbackUid, "-1"}, - {"fallbackGid", FALSE,FALSE, NULL, &conf->fallbackGid, "-1"}, - {"doPasswd", FALSE,FALSE, NULL, &conf->doPassword, "0"}, - {"doGroup", FALSE,FALSE, NULL, &conf->doGroup, "0"}, - {"doShadow", FALSE,FALSE, NULL, &conf->doShadow, "0"}, - {NULL , FALSE,FALSE, NULL, NULL, NULL} + /*option mandati found char_ptr int_ptr defValue */ + {"debug", FALSE, FALSE, NULL, &conf->debug, "0"}, + {"useTree", FALSE, FALSE, NULL, &conf->useTree, "0"}, + {"server", TRUE, FALSE, &conf->server, NULL, ""}, + {"startCtx", FALSE, FALSE, &conf->startCtx, NULL, ""}, + {"ctrlGroup", FALSE, FALSE, &conf->ctrlGroup, NULL, ""}, + {"defGid", FALSE, FALSE, NULL, &conf->defGid, "100"}, + {"defShell", FALSE, FALSE, &conf->defShell, NULL, "/bin/bash"}, + {"fallbackUid", FALSE, FALSE, NULL, &conf->fallbackUid, "-1"}, + {"fallbackGid", FALSE, FALSE, NULL, &conf->fallbackGid, "-1"}, + {"doPasswd", FALSE, FALSE, NULL, &conf->doPassword, "0"}, + {"doGroup", FALSE, FALSE, NULL, &conf->doGroup, "0"}, + {"doShadow", FALSE, FALSE, NULL, &conf->doShadow, "0"}, + {NULL, FALSE, FALSE, NULL, NULL, NULL} }; char cfgline[16384]; size_t seclen = strlen(mySection); - #ifdef DEBUG // DO NOT DO IT A a second call (using test_ncp_nss -2) coredump !!! -// printResults("before reading CFG",check_confs); +// printResults("before reading CFG", check_confs); #endif ncpt_mutex_lock(&cfg->mutex); //rewind(cfg->file); @@ -270,13 +286,13 @@ static struct nss_ncp_conf *read_conf_fi cptr++; if (!*cptr) continue; //empty line - if (*cptr == '[') // start of another section + if (*cptr == '[') // start of another section goto ssend; - for (ptr=check_confs; ptr->option; ptr++) { - size_t keylen=strlen(ptr->option); - if (!strncasecmp(cptr, ptr->option,keylen)) { + for (ptr = check_confs; ptr->option; ptr++) { + size_t keylen = strlen(ptr->option); + if (!strncasecmp(cptr, ptr->option, keylen)) { cptr += keylen; - process_line (cptr,ptr); + process_line(cptr, ptr); } } } @@ -284,22 +300,22 @@ static struct nss_ncp_conf *read_conf_fi ssend: #ifdef DEBUG - printResults("after reading CFG no error",check_confs); -#endif -#ifdef DEBUG - printConf("before fixing ",conf); -#endif - - if (!fix_conf (check_confs)) { // fill in missing values with default, -#ifdef DEBUG - printConf("after fixing ",conf); + printResults("after reading CFG no error", check_confs); +#endif +#ifdef DEBUG + printConf("before fixing ", conf); +#endif + + if (!fix_conf (check_confs)) { // fill in missing values with default, +#ifdef DEBUG + printConf("after fixing ", conf); #endif ncpt_mutex_unlock(&cfg->mutex); return conf; } #ifdef DEBUG - printResults("after reading CFG error",check_confs); + printResults("after reading CFG error", check_confs); #endif ncpt_mutex_unlock(&cfg->mutex); free_nss_ncp_conf(conf); @@ -308,7 +324,9 @@ ssend: } -struct nss_ncp_conf* parse_conf(void) { +struct nss_ncp_conf* +parse_conf(void) +{ struct cfgFile *cfg; struct nss_ncp_conf *conf; #ifdef DEBUG @@ -317,11 +335,11 @@ struct nss_ncp_conf* parse_conf(void) { cfg = cfgOpenFile(GLOBALCFGFILE, FALSE); if (!cfg) return NULL; - conf=read_conf_file(NSS_SECTION,cfg); + conf = read_conf_file(NSS_SECTION, cfg); cfgClose(cfg); #ifdef DEBUG if (conf) - printConf("final value ",conf); + printConf("final value ", conf); #endif return conf; ++++++ ncpfs-hg-commit-458.patch ++++++ changeset: 458:92f2133262a8 parent: 455:69f23e25cc66 user: Rodrigo Rubira Branco <rrbranco@br.ibm.com> date: Wed Jun 21 23:24:15 2006 +0200 files: man/Makefile.in man/ncplogin.8 man/ncpmap.8 description: Add ncpmap and ncplogin manpages Provide manpages for ncpmap and ncplogin. diff -r 69f23e25cc66 -r 92f2133262a8 man/Makefile.in --- a/man/Makefile.in Sat Apr 15 04:25:06 2006 +0200 +++ b/man/Makefile.in Wed Jun 21 23:24:15 2006 +0200 @@ -24,7 +24,7 @@ MAN8 := nwbocreate.8 nwborm.8 nwbpadd.8 nwgrant.8 nwrevoke.8 ifeq ($(USE_KERNEL),1) MAN1 += ncopy.1 -MAN8 += ncpmount.8 ncpumount.8 +MAN8 += ncpmount.8 ncpumount.8 ncplogin.8 ncpmap.8 endif MAN8 += nwmsg.8 diff -r 69f23e25cc66 -r 92f2133262a8 man/ncplogin.8 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/man/ncplogin.8 Wed Jun 21 23:24:15 2006 +0200 @@ -0,0 +1,104 @@ +.\" Copyright (c) International Business Machines Corp., 2006 +.\" +.\" This file is distributed in the hope that it will be useful, +.\" but WITHOUT ANY WARRANTY; without even the implied warranty of +.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See +.\" the GNU General Public License for more details. +.\" +.\" You should have received a copy of the GNU General Public License +.\" along with this file; if not, write to the Free Software +.\" Foundation, Inc., 59 Temple Place, Suite 330, Boston, +.\" MA 02111-1307 USA +.\" +.\" HISTORY: +.\" 2006-06-01, created by Rodrigo Rubira Branco <rrbranco@br.ibm.com> +.TH ncplogin 8 "Jun, 01 2006" "NCPFS" "NCPFS" +.SH NAME +ncplogin \- establishes identity to the Netware server or tree +.SH SYNOPSIS +.nf +.fam C +\fBncplogin [OPTIONS]\fP +.fam T +.fi +.SH DESCRIPTION +\fBncplogin\fP and \fBncpmap\fP provide a way for you to split the ncpmount operation into halves, with \fBncplogin\fP establishing your identity to the server or tree. \fBncpmap\fP mounts it later. +.SH OPTIONS +.B -T tree +Tree name to be used. + +.B -S server +Server name to be used. The -S and -T options are mutually exclusive. + +\fB-X name_ctx\fP +Default name context to be used. + +\fB-E\fP +Echoes the value of final mount_point. + +\fB-U username\fP +Username sent to server. + +\fB-u uid\fP +Uid given the mounted files. + +\fB-g gid\fP +Gid given the mounted files. + +\fB-c uid\fP +Uid to identify the connection on which to mount. Only appropriate for root. + +\fB-C\fP +Do not convert password to uppercase. + +\fB-P password\fP +Use this password. + +\fB-n\fP +Do not use any password. +If neither -P nor -n is given, you are asked for a password. + +\fB-f mode\fP +Permission given the files, in octal notation. + +\fB-d mode\fP +Permission given the directories, in octal notation. + +\fB-t time_out\fP +Time, in 1/100s of a second, to wait for an answer from the server. Default is 60. + +\fB-r retry_count\fP +Number of retry attempts. Default is 5. + +\fB-s\fP +Enable renaming and deletion of read-only files. + +\fB-h\fP +Print the help text. + +\fB-v\fP +Print ncpfs version number. + +\fB-i level\fP +Signature level. 0 = never, 1 = supported, 2 = preferred, 3 = required. + +\fB-N os2,nfs\fP +Do not use the specified namespaces on mounted volume. + +\fB-y charset\fP +Character set used for input and display. + +\fB-p codepage\fP +Codepage used on volume, including letters "cp." + +\fB-B bcast\fP +Broadcast mode. 0 = all 1 = console 2 = none. Default is all. + +\fB-l\fP +Autocreate mounting point if needed in /mnt/ncp/SERVER/VOLUME. +.SH SECURITY +\fBncplogin\fP must be setuid to permit non-root users use of it. In these cases, mounting ncpfs will enforce nodev and nosetuid mount options. +.SH SEE ALSO +\fBncpmap\fP(1), \fBncpmount\fP(8) +.SH AUTHOR +Manpage written by Rodrigo Rubira Branco <rrbranco@br.ibm.com> with help from Petr Vandrovec <petr@vandrovec.name>. diff -r 69f23e25cc66 -r 92f2133262a8 man/ncpmap.8 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/man/ncpmap.8 Wed Jun 21 23:24:15 2006 +0200 @@ -0,0 +1,94 @@ +.\" Copyright (c) International Business Machines Corp., 2006 +.\" +.\" This file is distributed in the hope that it will be useful, +.\" but WITHOUT ANY WARRANTY; without even the implied warranty of +.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See +.\" the GNU General Public License for more details. +.\" +.\" You should have received a copy of the GNU General Public License +.\" along with this file; if not, write to the Free Software +.\" Foundation, Inc., 59 Temple Place, Suite 330, Boston, +.\" MA 02111-1307 USA +.\" +.\" HISTORY: +.\" 2006-06-01, created by Rodrigo Rubira Branco <rrbranco@br.ibm.com> +.TH ncpmap 8 "Jun, 01 2006" "NCPFS" "NCPFS" +.SH NAME +ncpmap \- mounts some resource from Netware server or tree previously connected with ncplogin +.SH SYNOPSIS +.nf +.fam C +\fBncpmap [OPTIONS] [-a] [mount-point]\fP +.fam T +.fi +.SH DESCRIPTION +\fBncplogin\fP and \fBncpmap\fP provide a way to split the ncpmount operation into halves, with \fBncpmap\fP mounting the resource previously authenticated with \fBncplogin\fP. +.SH OPTIONS +\fBmount_point\fP is optional if you specify the -a option. + +\fB-T tree\fP +Tree name to be used. + +\fB-S server\fP +Server name to be used. The -T and -S options are mutually exclusive. + +\fB-X name_ctx\fP +Default name context to be used. + +\fB-E\fP +Echo value of final mount_point. + +\fB-V volume\fP +Volume to mount. This must be in binary format if -S server, or in NDS format if -T tree. + +\fB-R path\fP +Path in volume to "map root." + +\fB-f mode\fP +Permission given the files, in octal notation. + +\fB-d mode\fP +Permission given the directories, in octal notation. + +\fB-t time_out\fP +Waiting time, in 1/100s of a second, to wait for an answer from the server. Default is 60. + +\fB-r retry_count\fP +Number of retry attempts. Default is 5. + +\fB-s\fP +Enable renaming or deletion of read-only files. + +\fB-h\fP +Print help text. + +\fB-v\fP +Print ncpfs version number. + +\fB-i level\fP +Signature level. 0 = never, 1 = supported, 2 = preferred, and 3 = required. + +\fB-N os2,nfs\fP +Do not use specified namespaces on mounted volume. + +\fB-y charset\fP +Character set used for input and display. + +\fB-p codepage\fP +Codepage used on volume, including letters "cp." + +\fB-B bcast\fP +Broadcast mode. 0 = all, 1 = console, and 2 = none. Default is all. + +\fB-a\fP +Autocreate mounting point if needed in ~/ncp/SERVER/VOLUME. + +\fB-l\fP +Autocreate mounting point if needed in /mnt/ncp/SERVER/VOLUME. + +.SH SECURITY +\fBncpmap\fP must be setuid to permit non-root users use of it. In these cases, it will enforce nodev and nosetuid mount options. +.SH SEE ALSO +\fBncplogin\fP(1), \fBncpmount\fP(8) +.SH AUTHOR +Manpage written by Rodrigo Rubira Branco <rrbranco@br.ibm.com> with Petr Vandrovec <petr@vandrovec.name>. ++++++ ncpfs.LDFLAGS.patch ++++++ --- /var/tmp/diff_new_pack.s15681/_old 2007-05-18 00:01:18.000000000 +0200 +++ /var/tmp/diff_new_pack.s15681/_new 2007-05-18 00:01:18.000000000 +0200 @@ -1,11 +1,10 @@ - sutil/Makefile.in | 3 ++- - 3 files changed, 4 insertions(+), 3 deletions(-) + lib/Makefile.in | 5 +++-- + sutil/Makefile.in | 11 +++++++---- + 2 files changed, 10 insertions(+), 6 deletions(-) -Index: ncpfs-2.2.6/sutil/Makefile.in -================================================================================ ---- ncpfs-2.2.6/lib/Makefile.in +--- ncpfs-2.2.6.orig/lib/Makefile.in +++ ncpfs-2.2.6/lib/Makefile.in -@@ -21,6 +21,7 @@ +@@ -21,6 +21,7 @@ STATIC_NCPLIB := libncp.$(libext) STATIC_NCPLIB_BIN := $(STATIC_NCPLIB) CCFLAGS += -I. @@ -13,7 +12,7 @@ PIC_FLAGS := -fPIC NWCOMPAT := 1 -@@ -57,7 +58,7 @@ +@@ -57,7 +58,7 @@ NDS_CFLAGS := $(BASE_CFLAGS) -DPORTABLE CFLAGS_ncplib.o := -DNWSFIND=\"$(bindir)/nwsfind\" CFLAGS_cfgfile.o := -DGLOBALCFGFILE=\"$(sysconfdir)/ncpfs.conf\" @@ -22,7 +21,7 @@ SHARED_CFLAGS := $(CFLAGS) $(CCFLAGS) $(REENTRANT_CFLAGS) $(PIC_FLAGS) $(SHARED_VLINK_CFLAGS) .PHONY : all dep install install-dev clean mrproper distclean -@@ -122,7 +123,7 @@ +@@ -127,7 +128,7 @@ $(SHARED_NCPLIB): $(SHARED_NCPLIB_BIN) ln -sf $< $@ $(SHARED_NCPLIB_BIN): $(SHARED_O_OBJ) ${this_srcdir}/libncp.vers @@ -31,9 +30,9 @@ install_static: $(STATIC_NCPLIB_BIN) $(INSTALL) -d $(DESTDIR)$(libadir) ---- ncpfs-2.2.6/sutil/Makefile.in +--- ncpfs-2.2.6.orig/sutil/Makefile.in +++ ncpfs-2.2.6/sutil/Makefile.in -@@ -18,6 +18,9 @@ +@@ -18,6 +18,9 @@ LIBS = @INTLLIBS@ @LIBICONV@ @LIBS@ # environ in ncpmount CCFLAGS += -D_GNU_SOURCE @@ -43,7 +42,7 @@ O_UTILS := nwsfind.o ifeq ($(USE_KERNEL),1) O_UTILS += ncpmount.o ncpumount.o -@@ -61,7 +64,7 @@ +@@ -58,7 +61,7 @@ endif install-dev: $(O_UTILS): %.o: %.c @@ -52,8 +51,8 @@ $(O_UTILS:.o=.d): %.d: %.c set -e; $(CC) -M $(CFLAGS) $(CCFLAGS) $(CFLAGS_$(@:.d=.o)) $< \ -@@ -69,7 +72,7 @@ - [ -s $@ ] || rm -f $@ +@@ -70,7 +73,7 @@ ncplogin: ncpm_common.o mount_login.o + ncpmap: ncpm_common.o ncpmap.o: %.o: ncplogin.c - $(CC) $(CFLAGS) $(CCFLAGS) $(CFLAGS_$@) -o $@ -c $< @@ -61,7 +60,7 @@ ncpmap.d: %.d: ncplogin.c set -e; $(CC) -M $(CFLAGS) $(CCFLAGS) $(CFLAGS_$(@:.d=.o)) $< \ -@@ -77,7 +80,7 @@ +@@ -78,7 +81,7 @@ ncpmap.d: %.d: ncplogin.c [ -s $@ ] || rm -f $@ ncpm_common.o mount_login.o: %.o: %.c @@ -70,12 +69,12 @@ ncpm_common.d mount_login.d: %.d: %.c set -e; $(CC) -M $(CFLAGS) $(CCFLAGS) $(CFLAGS_$(@:.d=.o)) $< \ -@@ -85,7 +88,7 @@ +@@ -86,7 +89,7 @@ ncpm_common.d mount_login.d: %.d: %.c [ -s $@ ] || rm -f $@ - $(UTILS): %: %.o ../lib/libncp.a ncpm_common.o mount_login.o -- $(CC) @GC_SECTIONS@-o $@ $(addsuffix .o,$@) $(LDFLAGS_$@) ../lib/libncp.a ${LIBS} -+ $(CC) @GC_SECTIONS@-o $@ $(addsuffix .o,$@) $(PIE_LDFLAGS) $(LDFLAGS_$@) ../lib/libncp.a ${LIBS} + $(UTILS): %: %.o ../lib/libncp.$(libext) +- $(CC) @GC_SECTIONS@-o $@ $^ ${LIBS} ++ $(CC) @GC_SECTIONS@-o $@ $^ $(PIE_LDFLAGS) ${LIBS} - ../lib/libncp.a: - make -C ../lib libncp.a + ../lib/libncp.$(libext): + make -C ../lib libncp.$(libext) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org
participants (1)
-
root@Hilbert.suse.de