more-freelance-symlinks-20041028
authorJeffrey Altman <jaltman@mit.edu>
Thu, 28 Oct 2004 17:37:52 +0000 (17:37 +0000)
committerJeffrey Altman <jaltman@secure-endpoints.com>
Thu, 28 Oct 2004 17:37:52 +0000 (17:37 +0000)
 * Fix Find Cell By Name pioctl call to return a name "Freelance.Local.Root"
   for the fake root.afs volume.  This allows the IsPathInAfs() type
   functions to succeed for \\AFS\all

 * Add missing dialog template for Explorer Shell Extension Symlink->Add
   operation

 * Increase the acceptable length of the link destination path in the
   Add Symlink dialog box support code.

 * Fix up some missing prototypes

src/WINNT/afsd/NTMakefile
src/WINNT/afsd/afsd_init.c
src/WINNT/afsd/cm_freelance.h
src/WINNT/afsd/cm_ioctl.c
src/WINNT/client_exp/lang/en_US/afs_shl_ext.rc
src/WINNT/client_exp/make_symbolic_link_dlg.cpp

index 7f325ed..4797139 100644 (file)
@@ -339,26 +339,26 @@ AFSD_EXEFILE = $(EXEDIR)\afsd.exe
 AFSD_SDKLIBS =\
        largeint.lib \
        netapi32.lib \
-    dnsapi.lib mpr.lib \
+        dnsapi.lib mpr.lib \
        rpcrt4.lib \
        user32.lib \
-    Dbghelp.lib \
-    strsafe.lib \
-    mpr.lib \
-    secur32.lib \
-    ole32.lib \
-    oleaut32.lib
+        Dbghelp.lib \
+        strsafe.lib \
+        mpr.lib \
+        secur32.lib \
+        ole32.lib \
+        oleaut32.lib
 
 AFSD_EXELIBS =\
        $(DESTDIR)\lib\libosi.lib \
        $(DESTDIR)\lib\afsrpc.lib \
-    $(DESTDIR)\lib\afsrx.lib \
+        $(DESTDIR)\lib\afsrx.lib \
        $(DESTDIR)\lib\afsauthent.lib \
        $(DESTDIR)\lib\afs\mtafsvldb.lib \
        $(DESTDIR)\lib\afs\mtafsint.lib \
        $(DESTDIR)\lib\libafsconf.lib \
        $(DESTDIR)\lib\afs\afsreg.lib \
-    $(LANAHELPERLIB)
+        $(LANAHELPERLIB)
 
 $(AFSD_EXEFILE): $(OUT)\afsd.obj $(AFSDOBJS) $(OUT)\afsd.res  $(RXOBJS) $(AFSD_EXELIBS)
        $(EXEGUILINK) $(AFSD_SDKLIBS)
index 1b3a06f..8c34568 100644 (file)
@@ -22,7 +22,6 @@
 #include "afsd.h"
 #include <rx\rx.h>
 #include <rx\rx_null.h>
-
 #include <WINNT/syscfg.h>
 
 #include "smb.h"
index b47c66a..effeb9e 100644 (file)
@@ -16,6 +16,8 @@ extern int cm_reInitLocalMountPoints();
 extern void cm_InitFreelance();
 extern long cm_FreelanceRemoveMount(char *toremove);
 extern long cm_FreelanceAddMount(char *filename, char *cellname, char *volume, int rw, cm_fid_t *fidp);
+extern long cm_FreelanceRemoveSymlink(char *toremove);
+extern long cm_FreelanceAddSymlink(char *filename, char *destination, cm_fid_t *fidp);
 extern int cm_clearLocalMountPointChange();
 extern int cm_FakeRootFid(cm_fid_t *fidp);
 
index 8ccc321..89973b9 100644 (file)
@@ -458,13 +458,26 @@ long cm_IoctlGetFileCellName(struct smb_ioctl *ioctlp, struct cm_user *userp)
     code = cm_ParseIoctlPath(ioctlp, userp, &req, &scp);
     if (code) return code;
 
-    cellp = cm_FindCellByID(scp->fid.cell);
-    if (cellp) {
-        strcpy(ioctlp->outDatap, cellp->namep);
+#ifdef AFS_FREELANCE_CLIENT
+    if ( cm_freelanceEnabled && 
+         scp->fid.cell==AFS_FAKE_ROOT_CELL_ID &&
+         scp->fid.volume==AFS_FAKE_ROOT_VOL_ID &&
+         scp->fid.vnode==0x1 && scp->fid.unique==0x1 ) {
+        strcpy(ioctlp->outDatap, "Freelance.Local.Root");
         ioctlp->outDatap += strlen(ioctlp->outDatap) + 1;
         code = 0;
+    } else 
+#endif /* AFS_FREELANCE_CLIENT */
+    {
+        cellp = cm_FindCellByID(scp->fid.cell);
+        if (cellp) {
+            strcpy(ioctlp->outDatap, cellp->namep);
+            ioctlp->outDatap += strlen(ioctlp->outDatap) + 1;
+            code = 0;
+        }
+        else 
+            code = CM_ERROR_NOSUCHCELL;
     }
-    else code = CM_ERROR_NOSUCHCELL;
 
     cm_ReleaseSCache(scp);
     return code;
index 0933ba4..75edee5 100644 (file)
@@ -429,7 +429,21 @@ BEGIN
     PUSHBUTTON      "OK",IDOK,22,53,45,14
     PUSHBUTTON      "Cancel",IDCANCEL,92,53,45,14
     PUSHBUTTON      "Help",9,167,53,45,14
-    LTEXT           "Share Name:",IDC_STATIC,18,10,29,8
+    LTEXT           "Submount Name:",IDC_STATIC,18,10,29,8
+    LTEXT           "Path Name:",IDC_STATIC,19,25,28,8
+END
+
+IDD_SYMBOLICLINK_ADD DIALOG DISCARDABLE  0, 0, 235, 79
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "Add Symbolic Link"
+FONT 8, "MS Sans Serif"
+BEGIN
+    EDITTEXT        IDC_NAME,62,8,163,12,ES_AUTOHSCROLL
+    EDITTEXT        IDC_DIR,62,23,163,12,ES_AUTOHSCROLL
+    PUSHBUTTON      "OK",IDOK,22,53,45,14
+    PUSHBUTTON      "Cancel",IDCANCEL,92,53,45,14
+    PUSHBUTTON      "Help",9,167,53,45,14
+    LTEXT           "Link Name:",IDC_STATIC,18,10,29,8
     LTEXT           "Path Name:",IDC_STATIC,19,25,28,8
 END
 
index d1889fb..ff3a29d 100644 (file)
@@ -51,7 +51,7 @@ void CMakeSymbolicLinkDlg::DoDataExchange(CDataExchange* pDX)
        DDX_Text(pDX, IDC_NAME, m_strName);
        DDV_MaxChars(pDX, m_strName, 63);
        DDX_Text(pDX, IDC_DIR, m_strDir);
-       DDV_MaxChars(pDX, m_strDir, 63);
+       DDV_MaxChars(pDX, m_strDir, 255);
        //}}AFX_DATA_MAP
 }