Compare commits

..

1 Commits
v0.15 ... v0.16

Author SHA1 Message Date
ncpfs archive import
5753870858 Import ncpfs 0.16 2026-04-28 20:39:57 +02:00
35 changed files with 462 additions and 106 deletions

BIN
.downloads/ncpfs-0.16.tgz Normal file

Binary file not shown.

20
BUGS
View File

@@ -5,12 +5,12 @@ But there are really problems that might be fixed in the future.
-------------------------------------------------------------------------------
'df' returns 0:
Free disk space is distributed among the volumes in NetWare. df is
only able to report one number per mounted filesystem. As connections
are quite expensive for NetWare (with lwared that might change ...), I
rejected the alternative to mount only a single volume for a unix
mount point. So I simply return 0.
'df' returns 0: Free disk space is distributed among the volumes in
NetWare. df is only able to report one number per mounted
filesystem. As connections are quite expensive for NetWare (with
mars_nwe and lwared that might change ...), I rejected the alternative
to mount only a single volume for a unix mount point. So I simply
return 0.
-------------------------------------------------------------------------------
@@ -20,11 +20,3 @@ like
Nov 25 16:09:08 lx01 kernel: alloc_skb called nonatomically from interrupt 0000002e
These are a bit annoying, but completely harmless.
-------------------------------------------------------------------------------
ncpfs has a problem with NetWare 4.1, when files are created. I think
NW4.1 does not like some of the creation mode bits. If somebody with
access to a NW4.1 server could compile the kernel module for 1.2 with
-DDEBUG_NCP=2, and send me the syslog output gzipped/uuencoded, I
might find out more about that problem.

11
Changes
View File

@@ -1,6 +1,17 @@
I only began this file with ncpfs-0.12. If you're interested in older
versions, you can find them on linux01.gwdg.de:/pub/ncpfs/old.
ncpfs-0.15 -> ncpfs-0.16
- Included ipx-1.0, made available by Greg Page <greg@caldera.com>,
Caldera
- Made -n work for password-less accounts. Thanks to Alexander Jolk
<jolk@ap-pc513b.physik.uni-karlsruhe.de>.
- Fixed the kerneld support.
- Fixed the NetWare 4.1 problem. Many thanks to
Chatchai JANTARAPRIM <chat@ratree.psu.ac.th> and
hitesh.soneji@industry.net for their patience.
ncpfs-0.14 -> ncpfs-0.15
- A bug fixed that made normal mounting impossible. It was too late

View File

@@ -2,13 +2,12 @@
# Makefile for the linux ncp-filesystem routines.
#
# KERNEL = 1.2
VERSION = 0.16
TOPDIR = $(shell pwd)
BINDIR = /usr/local/bin
INTERM_BINDIR = $(TOPDIR)/bin
SUBDIRS = util ipx-0.75 man
SUBDIRS = util ipx-1.0 man
#
# The following 2 lines are for those who use Kernel version 1.2.x.
@@ -23,7 +22,7 @@ SUBDIRS = util ipx-0.75 man
# uncomment this (kerneld is in linux since about 1.3.57):
# KERNELD = -DHAVE_KERNELD
export INCLUDES BINDIR INTERM_BINDIR KERNELD
export INCLUDES BINDIR INTERM_BINDIR KERNELD VERSION
all:
for i in $(SUBDIRS); do make -C $$i; done
@@ -41,7 +40,7 @@ clean:
rm -f `find . -type f -name '*.out' -print`
for i in $(SUBDIRS); do make -C $$i clean; done
realclean: clean
mrproper: clean
rm -fr $(INTERM_BINDIR)/* ncpfs.tgz
make -C util realclean
@@ -55,7 +54,7 @@ dist: tgz
make dep
make all
tgz: realclean
tgz: mrproper
(cd ..; \
tar cvf - $(SRCDIR) | \
gzip -9 > $(DISTFILE); \

3
README
View File

@@ -1,6 +1,7 @@
This is ncpfs, a free NetWare client filesystem for Linux. Besides
some little utilities it also contains nprint, which enables you to
print on NetWare print queues.
print on NetWare print queues. The opposite side, pserver, is also
provided.
INSTALLATION

9
ipx-1.0/COPYING Normal file
View File

@@ -0,0 +1,9 @@
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the original work is
properly attributed to Greg Page and Caldera, Inc.
Neither the name of Greg Page nor Caldera, Inc. may be used to
endorse or promote products derived from this software without
specific prior written permission.
This software is provided by Greg Page and Caldera, Inc. "AS IS"
and without any express or implied warranties.

24
ipx-1.0/Gregs.Makefile Normal file
View File

@@ -0,0 +1,24 @@
CFLAGS = -O2 -Wall
UTILS = ipx_configure ipx_interface ipx_internal_net ipx_route
all: $(UTILS)
clean:
rm -f $(UTILS) *.o rip sap ipxrcv ipxsend
install: $(UTILS)
for i in $(UTILS); \
do \
install --strip $$i /sbin; \
install $$i.8 /usr/man/man8; \
done
install init.ipx /etc/rc.d/init.d/ipx
install -m 0644 config.ipx /etc/sysconfig/ipx
rm -f /etc/rc.d/rc2.d/S15ipx
ln -sf /etc/rc.d/init.d/ipx /etc/rc.d/rc2.d/S15ipx
rm -f /etc/rc.d/rc3.d/S15ipx
ln -sf /etc/rc.d/init.d/ipx /etc/rc.d/rc3.d/S15ipx
rm -f /etc/rc.d/rc5.d/S15ipx
ln -sf /etc/rc.d/init.d/ipx /etc/rc.d/rc5.d/S15ipx
rm -f /etc/rc.d/rc6.d/K55ipx
ln -sf /etc/rc.d/init.d/ipx /etc/rc.d/rc6.d/K55ipx

View File

@@ -5,16 +5,16 @@ UTILS = $(INTERM_BINDIR)/ipx_configure $(INTERM_BINDIR)/ipx_interface \
all: $(UTILS)
$(INTERM_BINDIR)/ipx_configure: ipx_configure.o
$(CC) -s -o $(INTERM_BINDIR)/ipx_configure ipx_configure.o
$(CC) -o $(INTERM_BINDIR)/ipx_configure ipx_configure.o
$(INTERM_BINDIR)/ipx_interface: ipx_interface.o
$(CC) -s -o $(INTERM_BINDIR)/ipx_interface ipx_interface.o
$(CC) -o $(INTERM_BINDIR)/ipx_interface ipx_interface.o
$(INTERM_BINDIR)/ipx_internal_net: ipx_internal_net.o
$(CC) -s -o $(INTERM_BINDIR)/ipx_internal_net ipx_internal_net.o
$(CC) -o $(INTERM_BINDIR)/ipx_internal_net ipx_internal_net.o
$(INTERM_BINDIR)/ipx_route: ipx_route.o
$(CC) -s -o $(INTERM_BINDIR)/ipx_route ipx_route.o
$(CC) -o $(INTERM_BINDIR)/ipx_route ipx_route.o
dep:
$(CPP) -M $(INCLUDES) *.c > .depend
@@ -25,6 +25,6 @@ clean:
install: $(UTILS)
for i in $(UTILS); \
do \
install --strip $$i $(BINDIR); \
install $$i $(BINDIR); \
done

View File

@@ -47,7 +47,7 @@ This program is used to read/write two configuration parameters:
By default, these are both turned off.
The following are sample IPX programs:
The following are sample IPX programs (found in directory Samples):
ipxrcv.c and ipxsend.c
ipxsend will send a single packet to an instance of ipxrcv running on the

View File

@@ -51,7 +51,7 @@ main(int argc, char **argv)
htonl(sipx.sipx_network),
sipx.sipx_node[0], sipx.sipx_node[1],
sipx.sipx_node[2], sipx.sipx_node[3],
sipx.sipx_node[4], sipx.sipx_node[5]);
sipx.sipx_node[6], sipx.sipx_node[5]);
bptr += 2;
rp = (struct rip_data *) bptr;
while (result >= sizeof(struct rip_data)) {

7
ipx-1.0/config.ipx Normal file
View File

@@ -0,0 +1,7 @@
IPX_AUTO_PRIMARY=on
IPX_AUTO_INTERFACE=on
IPX_CONFIGURED=no
IPX_DEVICE=eth0
IPX_FRAME=802.2
IPX_INTERNAL_NET=no
IPX_NETNUM=0

41
ipx-1.0/init.ipx Normal file
View File

@@ -0,0 +1,41 @@
#!/bin/sh
#
# ipx Bring up/down IPX networking
#
# Source function library.
. /etc/rc.d/init.d/functions
. /etc/sysconfig/network
. /etc/sysconfig/ipx
# Check that networking is up.
[ ${NETWORKING} = "no" ] && exit 0
# See how we were called.
case "$1" in
start)
if [ ${IPX_CONFIGURED} = "yes" ]; then
if [ ${IPX_INTERNAL_NET} = "yes" ]; then
/sbin/ipx_internal_net add ${IPX_NETNUM}
else
/sbin/ipx_interface add -p ${IPX_DEVICE} \
${IPX_FRAME} ${IPX_NETNUM}
fi
fi
ipx_configure \
--auto_primary=${IPX_AUTO_PRIMARY} \
--auto_interface=${IPX_AUTO_INTERFACE}
touch /var/lock/subsys/ipx
;;
stop)
ipx_configure --auto_primary=off --auto_interface=off
ipx_interface delall
rm -f /var/lock/subsys/ipx
;;
*)
echo "Usage: network {start|stop}"
exit 1
esac
exit 0

View File

@@ -1,3 +1,8 @@
/* Copyright (c) 1995-1996 Caldera, Inc. All Rights Reserved.
*
* See file COPYING for details.
*/
#include <stdio.h>
#include <unistd.h>
#include <ctype.h>

View File

@@ -1,3 +1,8 @@
/* Copyright (c) 1995-1996 Caldera, Inc. All Rights Reserved.
*
* See file COPYING for details.
*/
#include <stdio.h>
#include <ctype.h>
#include <errno.h>
@@ -19,7 +24,8 @@ usage(void)
{
fprintf(stderr, "Usage: %s add [-p] device frame_type [net_number]\n\
Usage: %s del device frame_type\n\
Usage: %s check device frame_type\n", progname, progname, progname);
Usage: %s delall\n\
Usage: %s check device frame_type\n", progname, progname, progname, progname);
exit(-1);
}
@@ -28,6 +34,9 @@ struct frame_type {
unsigned char ft_val;
} frame_types[] = {
{"802.2", IPX_FRAME_8022},
#ifdef IPX_FRAME_TR_8022
{"802.2TR", IPX_FRAME_TR_8022},
#endif
{"802.3", IPX_FRAME_8023},
{"SNAP", IPX_FRAME_SNAP},
{"EtherII", IPX_FRAME_ETHERII}
@@ -162,6 +171,76 @@ ipx_add_interface(int argc, char **argv)
exit(-1);
}
int
ipx_delall_interface(int argc, char **argv)
{
struct sockaddr_ipx *sipx = (struct sockaddr_ipx *)&id.ifr_addr;
int s;
int result;
char errmsg[80];
char buffer[80];
char device[20];
char frame_type[20];
int fti;
FILE *fp;
s = socket(AF_IPX, SOCK_DGRAM, AF_IPX);
if (s < 0) {
sprintf(errmsg, "%s: socket", progname);
perror(errmsg);
exit(-1);
}
fp = fopen("/proc/net/ipx_interface", "r");
if (fp == NULL) {
fprintf(stderr,
"%s: Unable to open \"/proc/net/ipx_interface.\"\n",
progname);
exit(-1);
}
fgets(buffer, 80, fp);
while (fscanf(fp, "%s %s %s %s %s", buffer, buffer, buffer,
device, frame_type) == 5) {
sipx->sipx_network = 0L;
if (strcasecmp(device, "Internal") == 0) {
sipx->sipx_special = IPX_INTERNAL;
} else {
sipx->sipx_special = IPX_SPECIAL_NONE;
strcpy(id.ifr_name, device);
fti = lookup_frame_type(frame_type);
if (fti < 0) continue;
sipx->sipx_type = frame_types[fti].ft_val;
}
sipx->sipx_action = IPX_DLTITF;
sipx->sipx_family = AF_IPX;
result = ioctl(s, SIOCSIFADDR, &id);
if (result == 0) continue;
switch (errno) {
case EPROTONOSUPPORT:
fprintf(stderr, "%s: Invalid frame type (%s).\n",
progname, frame_type);
break;
case ENODEV:
fprintf(stderr, "%s: No such device (%s).\n",
progname, device);
break;
case EINVAL:
fprintf(stderr, "%s: No such IPX interface %s %s.\n",
progname, device, frame_type);
break;
default:
sprintf(errmsg, "%s: ioctl", progname);
perror(errmsg);
break;
}
}
exit(0);
}
int
ipx_del_interface(int argc, char **argv)
{
@@ -176,6 +255,7 @@ ipx_del_interface(int argc, char **argv)
}
sipx->sipx_network = 0L;
sipx->sipx_special = IPX_SPECIAL_NONE;
strcpy(id.ifr_name, argv[1]);
fti = lookup_frame_type(argv[2]);
if (fti < 0)
@@ -289,6 +369,10 @@ main(int argc, char **argv)
for (i = 1; i < (argc-1); i++)
argv[i] = argv[i+1];
ipx_add_interface(argc-1, argv);
} else if (strncasecmp(argv[1], "delall", 6) == 0) {
for (i = 1; i < (argc-1); i++)
argv[i] = argv[i+1];
ipx_delall_interface(argc-1, argv);
} else if (strncasecmp(argv[1], "del", 3) == 0) {
for (i = 1; i < (argc-1); i++)
argv[i] = argv[i+1];

View File

@@ -1,3 +1,8 @@
/* Copyright (c) 1995-1996 Caldera, Inc. All Rights Reserved.
*
* See file COPYING for details.
*/
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>

View File

@@ -1,3 +1,8 @@
/* Copyright (c) 1995-1996 Caldera, Inc. All Rights Reserved.
*
* See file COPYING for details.
*/
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>

View File

@@ -3,7 +3,7 @@
#
CFLAGS = -Wall -Wstrict-prototypes -O2 -DMODULE -fomit-frame-pointer \
$(INCLUDES) \
$(INCLUDES) -DNCPFS_VERSION=\"$(VERSION)\"\
# -DDEBUG_NCP=1 -DDEBUG_NCP_MALLOC
# -DDEBUG_NCP_MALLOC

View File

@@ -797,7 +797,8 @@ ncp_create(struct inode *dir, const char *name, int len, int mode,
if (ncp_open_create_file_or_subdir(NCP_SERVER(dir),
NCP_ISTRUCT(dir), _name,
OC_MODE_CREATE|OC_MODE_OPEN,
OC_MODE_CREATE|OC_MODE_OPEN|
OC_MODE_REPLACE,
0, AR_READ|AR_WRITE,
&finfo) != 0)
{
@@ -895,7 +896,7 @@ ncp_rmdir(struct inode *dir, const char *name, int len)
}
else
{
error = -EINVAL;
error = -EACCES;
}
}
iput(dir);
@@ -932,7 +933,7 @@ ncp_unlink(struct inode *dir, const char *name, int len)
}
else
{
error = -EINVAL;
error = -EACCES;
}
}
iput(dir);

View File

@@ -510,6 +510,7 @@ init_module( void)
ncp_init_dir_cache();
register_filesystem(&ncp_fs_type);
printk("ncpfs version %s loaded\n", NCPFS_VERSION);
return 0;
}

View File

@@ -417,12 +417,18 @@ ncp_open_create_file_or_subdir(struct ncp_server *server,
struct nw_file_info *target)
{
int result;
__u16 search_attribs = 0x0006;
if ((create_attributes & aDIR) != 0)
{
search_attribs |= 0x8000;
}
ncp_init_request(server);
ncp_add_byte(server, 1); /* subfunction */
ncp_add_byte(server, 0); /* dos name space */
ncp_add_byte(server, open_create_mode);
ncp_add_word(server, 0x8006);
ncp_add_word(server, search_attribs);
ncp_add_dword(server, RIM_ALL);
ncp_add_dword(server, create_attributes);
/* The desired acc rights seem to be the inherited rights mask

View File

@@ -1,6 +1,6 @@
.TH IPX_CONFIGURE 8 "IPX Utilities" "Caldera, Inc."
.SH NAME
ipx_configure \- display/configure IPX behavior
ipx_configure \- query/configure IPX behavior
.SH SYNOPSIS
.B ipx_configure
[\-\-help]
@@ -8,7 +8,7 @@ ipx_configure \- display/configure IPX behavior
[\-\-auto_primary=[on|off]]
.SH DESCRIPTION
.B ipx_configure
displays or configures IPX behavior with respect to automatic IPX
queries or configures IPX behavior with respect to automatic IPX
interface detection. IPX can be configured to automatically create
interfaces as they are detected. It can also be configured to
automatically select a primary interface when none is explicitly
@@ -23,20 +23,15 @@ arguments is described in the section
.SS OPTIONS
.TP
.I "\-\-auto_interface=[on|off]"
This argument enables or disables the feature that will automatically detect
whether IPX is use on a network interface. If
.B on
and IPX packets are seen on an interface that interface will be automatically
flagged as an IPX interface. The default setting is
.B off.
This argument either turns on or off the behavior of automatically creating
interfaces.
.TP
.I "\-\-auto_primary=[on|off]"
This argument enables or disables the feature that will automatically select
which IPX interface will be the primary IPX interface. The default setting is
.B off.
This argument either turns on or off the behavior of automatically selecting
a primary interface.
.TP
.I "\-\-help"
Displays summarised usage instructions.
Print out information about utility.
.SH FILES
.I /proc/net/ipx_interface
.SH BUGS

View File

@@ -1,6 +1,6 @@
.TH IPX_INTERFACE 8 "IPX Utilities" "Caldera, Inc."
.SH NAME
ipx_interface \- add, delete, or display IPX interface configuration.
ipx_interface \- add, delete, or display an IPX interface
.SH SYNOPSIS
.B ipx_interface
add [-p] device frame_type [network number]
@@ -9,17 +9,20 @@ add [-p] device frame_type [network number]
del device frame_type
.LP
.B ipx_interface
delall
.LP
.B ipx_interface
check device frame_type
.LP
.B ipx_interface
help
.SH DESCRIPTION
.B ipx_interface
adds, deletes, or displays the configuration of the specified IPX interface.
adds, deletes, or displays IPX interfaces depending on the option selected.
.P
An IPX interface is the item to which IPX sockets are bound.
An IPX interface has an associated IPX Network Number, a physical device
and frame type. A sample IPX Interface might look like:
An IPX interface corresponds to an IPX Network Number which corresponds
to a physical device and frame type. A sample IPX Interface would be:
.LP
Network Number: 0x00ABCDEF
.LP
@@ -35,21 +38,25 @@ or default interface.
.I add
This option is used to create an IPX interface. If the
.B -p
flag is used, the interface is flagged as the
.B PRIMARY
interface. The IPX network number may optionally be specified. If it is not
specified it is set to 0 which indicates it should be automatically detected
by analysis of the existing IPX traffic on the network.
flag is used, the interface is made
.B
PRIMARY.
The network number can be optionally assigned. If it is not assigned, it
is set to 0 which indicates it should be detected from the traffic on the
network.
.TP
.I del
This option is used to delete an IPX interface.
.TP
.I delall
This option is used to delete all IPX interfaces.
.TP
.I check
This option is used to display the network number associated with a specified
device and frame type combination.
This option is used to display the device, frame type, and network number
of an IPX interface.
.TP
.I help
This option displays summarised usage instructions.
This option displays information about the utility.
.SH FILES
.I /proc/net/ipx_interface /proc/net/ipx_route
.SH BUGS

View File

@@ -1,6 +1,6 @@
.TH IPX_ROUTE 8 "IPX Utilities" "Caldera, Inc."
.SH NAME
ipx_route \- add or delete an IPX route.
ipx_route \- add or delete IPX route
.SH SYNOPSIS
.B ipx_route
add target_network router_network router_node
@@ -10,11 +10,11 @@ del target_network
.SH DESCRIPTION
.B ipx_route
adds or deletes an IPX route.
The kernel IPX software stores only one route to any target network.
The kernel IPX stores only one route per target network at a time.
.SS OPTIONS
.TP
.I add
This option is used to configure a route to a target network.
This option is used to set up the route to a target network.
.TP
.I del
This option is used to delete the route to a target network.

View File

@@ -33,7 +33,9 @@ ncpmount \- mount all volumes of a specified Novell fileserver.
] [
.B -d
.I dir mode
]
] [
.B -v
]
mount-point
.SH DESCRIPTION
@@ -186,6 +188,11 @@ can very well choose a file mode that tells that you have. This
certainly cannot override the restrictions imposed by the server.
.RE
.B -v
.RS 3
Print ncpfs version number
.RE
.SH NOTES
You must configure the IPX subsystem before ncpmount will work.
It is especially important that there is a route to the internal network

View File

@@ -1,17 +0,0 @@
Begin3
Title: ncpfs
Version: 0.15
Entered-date: 10. February 1996
Description: With ncpfs you can mount volumes of your novell
server under Linux. You need kernel 1.2.x or
1.3.54 and above. ncpfs does NOT work with any 1.3.x
kernel below 1.3.54.
Keywords: filesystem kernel ncp novell netware
Author: lendecke@namu01.gwdg.de (Volker Lendecke)
Maintained-by: lendecke@namu01.gwdg.de (Volker Lendecke)
Primary-site: linux01.gwdg.de:/pub/ncpfs
Alternate-site: sunsite.unc.edu:/pub/system/Filesystems/
~70k ncpfs-0.15.tgz
~ 1k ncpfs-0.15.lsm
Copying-policy: GPL
End

19
ncpfs-0.16.lsm Normal file
View File

@@ -0,0 +1,19 @@
Begin3
Title: ncpfs
Version: 0.16
Entered-date: 21. February 1996
Description: With ncpfs you can mount volumes of your netware
server under Linux. You can also print to netware
print queues and spool netware print queues to the
Linux printing system. You need kernel 1.2.x or
1.3.54 and above. ncpfs does NOT work with any 1.3.x
kernel below 1.3.54.
Keywords: filesystem ncp novell netware printing
Author: lendecke@namu01.gwdg.de (Volker Lendecke)
Maintained-by: lendecke@namu01.gwdg.de (Volker Lendecke)
Primary-site: linux01.gwdg.de:/pub/ncpfs
Alternate-site: sunsite.unc.edu:/pub/system/Filesystems/
~73k ncpfs-0.16.tgz
~ 1k ncpfs-0.16.lsm
Copying-policy: GPL
End

View File

@@ -6,8 +6,8 @@ UTIL_EXECS = ncpmount ncpumount nprint slist pqlist fsinfo pserver
UTILS = $(addprefix $(INTERM_BINDIR)/,$(UTIL_EXECS))
UIDUTILS = ncpmount ncpumount
#CFLAGS = -Wall $(INCLUDES) $(KERNELD) -g
CFLAGS = -Wall $(INCLUDES) $(KERNELD) -O2
#CFLAGS = -Wall $(INCLUDES) $(KERNELD) -g -DNCPFS_VERSION=\"$(VERSION)\"
CFLAGS = -Wall $(INCLUDES) $(KERNELD) -O2 -DNCPFS_VERSION=\"$(VERSION)\"
CC = gcc
all: $(UTILS) ncptest

View File

@@ -1237,35 +1237,36 @@ ncp_find_conn_spec(const char *server, const char *user, const char *password,
}
fclose(nwc);
}
}
if (strlen(spec.user) == 0)
if (strlen(spec.user) == 0)
{
return &spec;
}
if (strlen(spec.password) == 0)
{
char *password;
if (!(isatty(0) && isatty(1)))
{
return &spec;
return NULL;
}
printf("Logging into %s as %s\n",
spec.server, spec.user);
if (strlen(spec.password) == 0)
password = getpass("Password: ");
if (strlen(password) > sizeof(spec.password))
{
char *password;
if (!(isatty(0) && isatty(1)))
{
return NULL;
}
printf("Logging into %s as %s\n",
spec.server, spec.user);
password = getpass("Password: ");
if (strlen(password) > sizeof(spec.password))
{
return NULL;
}
strcpy(spec.password, password);
return NULL;
}
else
strcpy(spec.password, password);
}
else
{
if (strcmp(spec.password, NWC_NOPASSWORD) == 0)
{
if (strcmp(spec.password, NWC_NOPASSWORD) == 0)
{
*spec.password = '\0';
}
*spec.password = '\0';
}
}
@@ -1349,6 +1350,7 @@ ncp_initialize_as(struct ncp_conn *conn,
{
return -1;
}
password = NWC_NOPASSWORD;
continue;
}
i += 1;
@@ -2739,3 +2741,68 @@ ncp_write(struct ncp_conn *conn, const char *file_id,
}
return already_written;
}
int
ncp_get_broadcast_message(struct ncp_conn *conn, char message[256])
{
int result;
int length;
ncp_init_request_s(conn, 1);
if ((result = ncp_request(conn, 21)) != 0)
{
ncp_unlock_conn(conn);
return result;
}
length = ncp_reply_byte(conn, 0);
message[length] = 0;
memcpy(message, ncp_reply_data(conn, 1), length);
ncp_unlock_conn(conn);
return 0;
}
int
ncp_dealloc_dir_handle(struct ncp_conn *conn, __u8 dir_handle)
{
int result;
ncp_init_request_s(conn, 20);
ncp_add_byte(conn, dir_handle);
if ((result = ncp_request(conn, 22)) != 0)
{
ncp_unlock_conn(conn);
return result;
}
ncp_unlock_conn(conn);
return 0;
}
int
ncp_alloc_short_dir_handle(struct ncp_conn *conn,
struct nw_info_struct *dir,
word alloc_mode,
byte *target)
{
int result;
ncp_init_request(conn);
ncp_add_byte(conn, 12); /* subfunction */
ncp_add_byte(conn, 0); /* dos name space */
ncp_add_byte(conn, 0); /* reserved */
ncp_add_word(conn, htons(alloc_mode));
ncp_add_handle_path(conn, dir->volNumber, dir->DosDirNum,
1, NULL);
if ((result = ncp_request(conn, 87)) != 0)
{
ncp_unlock_conn(conn);
return result;
}
*target = ncp_reply_byte(conn, 0);
ncp_unlock_conn(conn);
return result;
}

View File

@@ -328,4 +328,20 @@ int
ncp_abort_servicing_job(struct ncp_conn *conn, __u32 queue_id,
__u32 job_number);
int
ncp_get_broadcast_message(struct ncp_conn *conn, char message[256]);
int
ncp_dealloc_dir_handle(struct ncp_conn *conn, __u8 dir_handle);
#define NCP_ALLOC_PERMANENT (0x0000)
#define NCP_ALLOC_TEMPORARY (0x0001)
#define NCP_ALLOC_SPECIAL (0x0002)
int
ncp_alloc_short_dir_handle(struct ncp_conn *conn,
struct nw_info_struct *dir,
__u16 alloc_mode,
__u8 *target);
#endif /* _NCPLIB_H */

View File

@@ -191,10 +191,11 @@ main(int argc, char *argv[])
umask(um);
data.file_mode = (S_IRWXU|S_IRWXG|S_IRWXO) & ~um;
data.dir_mode = 0;
data.flags |= NCP_MOUNT_SOFT;
upcase_password = 1;
while ((opt = getopt (argc, argv, "CS:U:c:u:g:f:d:P:nh")) != EOF)
while ((opt = getopt (argc, argv, "CS:U:c:u:g:f:d:P:nhv")) != EOF)
{
switch (opt)
{
@@ -290,6 +291,9 @@ main(int argc, char *argv[])
case 'h':
help();
exit(1);
case 'v':
fprintf(stderr, "ncpfs version %s\n", NCPFS_VERSION);
exit(1);
default:
usage();
return -1;
@@ -423,6 +427,31 @@ main(int argc, char *argv[])
exit(1);
}
#if NCP_MOUNT_VERSION>1
data.message_fd = socket(AF_IPX, SOCK_DGRAM, PF_IPX);
if (data.message_fd == -1)
{
fprintf(stderr, "could not open message socket: %s\n",
strerror(errno));
exit(1);
}
addr.sipx_port = htons(ntohs(addr.sipx_port) + 1);
if (bind(data.message_fd, (struct sockaddr *)&addr,sizeof(addr)) == -1)
{
fprintf(stderr, "bind(message_sock, ): %s\n",
strerror(errno));
exit(1);
}
if (strlen(mount_point) < sizeof(data.mount_point))
{
strcpy(data.mount_point, mount_point);
}
#endif
flags = MS_MGC_VAL;
data.time_out = 20;
@@ -518,5 +547,6 @@ help(void)
" If neither -P nor -n are given, you are\n"
" asked for a password.\n"
"-h print this help text\n"
"-v print ncpfs version number\n"
"\n");
}

View File

@@ -147,6 +147,47 @@ test_connlist(struct ncp_conn *conn)
return;
}
void
test_create(struct ncp_conn *conn)
{
struct nw_info_struct sys;
struct nw_info_struct me;
__u8 dir_handle;
struct ncp_file_info new_file;
if (ncp_do_lookup(conn, NULL, "SYS", &sys) != 0)
{
printf("lookup error\n");
return;
}
if (ncp_do_lookup(conn, &sys, "ME", &me) != 0)
{
printf("lookup public error\n");
return;
}
if (ncp_alloc_short_dir_handle(conn, &me, NCP_ALLOC_TEMPORARY,
&dir_handle) != 0)
{
printf("alloc_dir_handle error\n");
return;
}
if (ncp_create_file(conn, dir_handle, "BLUB.TXT", 0,
&new_file) != 0)
{
printf("create error\n");
return;
}
if (ncp_dealloc_dir_handle(conn, dir_handle) != 0)
{
printf("dealloc error\n");
return;
}
}
int
main(int argc, char *argv[])
{
@@ -158,7 +199,7 @@ main(int argc, char *argv[])
return 1;
}
test_connlist(&conn);
test_create(&conn);
ncp_close(&conn);
return 0;
}

View File

@@ -62,7 +62,7 @@ main(int argc, char **argv)
{
found = 1;
printf("%-52s", q.object_name);
printf("%08x\n", q.object_id);
printf("%08X\n", q.object_id);
}
if ((found == 0) && (isatty(1)))