• Main Page
  • Related Pages
  • Modules
  • Data Structures
  • Files
  • File List

dbus-sysdeps-util-win.c

00001 /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
00002 /* dbus-sysdeps-util.c Would be in dbus-sysdeps.c, but not used in libdbus
00003  * 
00004  * Copyright (C) 2002, 2003, 2004, 2005  Red Hat, Inc.
00005  * Copyright (C) 2003 CodeFactory AB
00006  *
00007  * Licensed under the Academic Free License version 2.1
00008  * 
00009  * This program is free software; you can redistribute it and/or modify
00010  * it under the terms of the GNU General Public License as published by
00011  * the Free Software Foundation; either version 2 of the License, or
00012  * (at your option) any later version.
00013  *
00014  * This program is distributed in the hope that it will be useful,
00015  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00016  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017  * GNU General Public License for more details.
00018  * 
00019  * You should have received a copy of the GNU General Public License
00020  * along with this program; if not, write to the Free Software
00021  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
00022  *
00023  */
00024 
00025 #include <config.h>
00026 
00027 #define STRSAFE_NO_DEPRECATE
00028 
00029 #include "dbus-sysdeps.h"
00030 #include "dbus-internals.h"
00031 #include "dbus-protocol.h"
00032 #include "dbus-string.h"
00033 #include "dbus-sysdeps.h"
00034 #include "dbus-sysdeps-win.h"
00035 #include "dbus-sockets-win.h"
00036 #include "dbus-memory.h"
00037 #include "dbus-pipe.h"
00038 
00039 #include <stdio.h>
00040 #include <stdlib.h>
00041 #if HAVE_ERRNO_H
00042 #include <errno.h>
00043 #endif
00044 #include <winsock2.h>   // WSA error codes
00045 
00046 #ifndef DBUS_WINCE
00047 #include <io.h>
00048 #include <lm.h>
00049 #include <sys/stat.h>
00050 #endif
00051 
00052 
00062 dbus_bool_t
00063 _dbus_become_daemon (const DBusString *pidfile,
00064                      DBusPipe         *print_pid_pipe,
00065                      DBusError        *error,
00066                      dbus_bool_t       keep_umask)
00067 {
00068   return TRUE;
00069 }
00070 
00079 static dbus_bool_t
00080 _dbus_write_pid_file (const DBusString *filename,
00081                       unsigned long     pid,
00082                       DBusError        *error)
00083 {
00084   const char *cfilename;
00085   HANDLE hnd;
00086   char pidstr[20];
00087   int total;
00088   int bytes_to_write;
00089 
00090   _DBUS_ASSERT_ERROR_IS_CLEAR (error);
00091 
00092   cfilename = _dbus_string_get_const_data (filename);
00093 
00094   hnd = CreateFileA (cfilename, GENERIC_WRITE,
00095                      FILE_SHARE_READ | FILE_SHARE_WRITE,
00096                      NULL, CREATE_NEW, FILE_ATTRIBUTE_NORMAL,
00097                      INVALID_HANDLE_VALUE);
00098   if (hnd == INVALID_HANDLE_VALUE)
00099     {
00100       char *emsg = _dbus_win_error_string (GetLastError ());
00101       dbus_set_error (error, _dbus_win_error_from_last_error (),
00102                       "Could not create PID file %s: %s",
00103                       cfilename, emsg);
00104       _dbus_win_free_error_string (emsg);
00105       return FALSE;
00106     }
00107 
00108   if (snprintf (pidstr, sizeof (pidstr), "%lu\n", pid) < 0)
00109     {
00110       dbus_set_error (error, _dbus_error_from_system_errno (),
00111                       "Failed to format PID for \"%s\": %s", cfilename,
00112                       _dbus_strerror_from_errno ());
00113       CloseHandle (hnd);
00114       return FALSE;
00115     }
00116 
00117   total = 0;
00118   bytes_to_write = strlen (pidstr);;
00119 
00120   while (total < bytes_to_write)
00121     {
00122       DWORD bytes_written;
00123       BOOL res;
00124 
00125       res = WriteFile (hnd, pidstr + total, bytes_to_write - total,
00126                        &bytes_written, NULL);
00127 
00128       if (res == 0 || bytes_written <= 0)
00129         {
00130           char *emsg = _dbus_win_error_string (GetLastError ());
00131           dbus_set_error (error, _dbus_win_error_from_last_error (),
00132                            "Could not write to %s: %s", cfilename, emsg);
00133           _dbus_win_free_error_string (emsg);
00134           CloseHandle (hnd);
00135           return FALSE;
00136         }
00137 
00138       total += bytes_written;
00139     }
00140 
00141   if (CloseHandle (hnd) == 0)
00142     {
00143       char *emsg = _dbus_win_error_string (GetLastError ());
00144       dbus_set_error (error, _dbus_win_error_from_last_error (),
00145                        "Could not close file %s: %s",
00146                       cfilename, emsg);
00147       _dbus_win_free_error_string (emsg);
00148 
00149       return FALSE;
00150     }
00151 
00152   return TRUE;
00153 }
00154 
00166 dbus_bool_t
00167 _dbus_write_pid_to_file_and_pipe (const DBusString *pidfile,
00168                                   DBusPipe         *print_pid_pipe,
00169                                   dbus_pid_t        pid_to_write,
00170                                   DBusError        *error)
00171 {
00172   if (pidfile)
00173     {
00174       _dbus_verbose ("writing pid file %s\n", _dbus_string_get_const_data (pidfile));
00175       if (!_dbus_write_pid_file (pidfile,
00176                                  pid_to_write,
00177                                  error))
00178         {
00179           _dbus_verbose ("pid file write failed\n");
00180           _DBUS_ASSERT_ERROR_IS_SET(error);
00181           return FALSE;
00182         }
00183     }
00184   else
00185     {
00186       _dbus_verbose ("No pid file requested\n");
00187     }
00188 
00189   if (print_pid_pipe != NULL && _dbus_pipe_is_valid (print_pid_pipe))
00190     {
00191       DBusString pid;
00192       int bytes;
00193 
00194       _dbus_verbose ("writing our pid to pipe %d\n", print_pid_pipe->fd_or_handle);
00195 
00196       if (!_dbus_string_init (&pid))
00197         {
00198           _DBUS_SET_OOM (error);
00199           return FALSE;
00200         }
00201 
00202       if (!_dbus_string_append_int (&pid, pid_to_write) ||
00203           !_dbus_string_append (&pid, "\n"))
00204         {
00205           _dbus_string_free (&pid);
00206           _DBUS_SET_OOM (error);
00207           return FALSE;
00208         }
00209 
00210       bytes = _dbus_string_get_length (&pid);
00211       if (_dbus_pipe_write (print_pid_pipe, &pid, 0, bytes, error) != bytes)
00212         {
00213           /* _dbus_pipe_write sets error only on failure, not short write */
00214           if (error != NULL && !dbus_error_is_set(error))
00215             {
00216               dbus_set_error (error, DBUS_ERROR_FAILED,
00217                               "Printing message bus PID: did not write enough bytes\n");
00218             }
00219           _dbus_string_free (&pid);
00220           return FALSE;
00221         }
00222 
00223       _dbus_string_free (&pid);
00224     }
00225   else
00226     {
00227       _dbus_verbose ("No pid pipe to write to\n");
00228     }
00229 
00230   return TRUE;
00231 }
00232 
00239 dbus_bool_t
00240 _dbus_verify_daemon_user (const char *user)
00241 {
00242   return TRUE;
00243 }
00244 
00252 dbus_bool_t
00253 _dbus_change_to_daemon_user  (const char    *user,
00254                               DBusError     *error)
00255 {
00256   return TRUE;
00257 }
00258 
00259 void
00260 _dbus_init_system_log (void)
00261 {
00262     // FIXME!
00263 }
00264 
00273 void
00274 _dbus_system_log (DBusSystemLogSeverity severity, const char *msg, ...)
00275 {
00276   va_list args;
00277 
00278   va_start (args, msg);
00279 
00280   _dbus_system_logv (severity, msg, args);
00281 
00282   va_end (args);
00283 }
00284 
00295 void
00296 _dbus_system_logv (DBusSystemLogSeverity severity, const char *msg, va_list args)
00297 {
00298   char *s = "";
00299   char buf[1024];
00300   
00301   switch(severity) 
00302    {
00303      case DBUS_SYSTEM_LOG_INFO: s = "info"; break;
00304      case DBUS_SYSTEM_LOG_SECURITY: s = "security"; break;
00305      case DBUS_SYSTEM_LOG_FATAL: s = "fatal"; break;
00306    }
00307    
00308   sprintf(buf,"%s%s",s,msg);
00309   vsprintf(buf,buf,args);
00310   OutputDebugStringA(buf);
00311   
00312   if (severity == DBUS_SYSTEM_LOG_FATAL)
00313     exit (1);
00314 }
00315 
00321 void
00322 _dbus_set_signal_handler (int               sig,
00323                           DBusSignalHandler handler)
00324 {
00325   _dbus_verbose ("_dbus_set_signal_handler() has to be implemented\n");
00326 }
00327 
00336 dbus_bool_t
00337 _dbus_stat(const DBusString *filename,
00338            DBusStat         *statbuf,
00339            DBusError        *error)
00340 {
00341   const char *filename_c;
00342   WIN32_FILE_ATTRIBUTE_DATA wfad;
00343   char *lastdot;
00344   DWORD rc;
00345 
00346   _DBUS_ASSERT_ERROR_IS_CLEAR (error);
00347 
00348   filename_c = _dbus_string_get_const_data (filename);
00349 
00350   if (!GetFileAttributesExA (filename_c, GetFileExInfoStandard, &wfad))
00351     {
00352       _dbus_win_set_error_from_win_error (error, GetLastError ());
00353       return FALSE;
00354     }
00355 
00356   if (wfad.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
00357     statbuf->mode = _S_IFDIR;
00358   else
00359     statbuf->mode = _S_IFREG;
00360 
00361   statbuf->mode |= _S_IREAD;
00362   if (wfad.dwFileAttributes & FILE_ATTRIBUTE_READONLY)
00363     statbuf->mode |= _S_IWRITE;
00364 
00365   lastdot = strrchr (filename_c, '.');
00366   if (lastdot && stricmp (lastdot, ".exe") == 0)
00367     statbuf->mode |= _S_IEXEC;
00368 
00369   statbuf->mode |= (statbuf->mode & 0700) >> 3;
00370   statbuf->mode |= (statbuf->mode & 0700) >> 6;
00371 
00372   statbuf->nlink = 1;
00373 
00374 #ifdef ENABLE_UID_TO_SID
00375   {
00376     PSID owner_sid, group_sid;
00377     PSECURITY_DESCRIPTOR sd;
00378 
00379     sd = NULL;
00380     rc = GetNamedSecurityInfo ((char *) filename_c, SE_FILE_OBJECT,
00381                                OWNER_SECURITY_INFORMATION |
00382                                GROUP_SECURITY_INFORMATION,
00383                                &owner_sid, &group_sid,
00384                                NULL, NULL,
00385                                &sd);
00386     if (rc != ERROR_SUCCESS)
00387       {
00388         _dbus_win_set_error_from_win_error (error, rc);
00389         if (sd != NULL)
00390           LocalFree (sd);
00391         return FALSE;
00392       }
00393     
00394     /* FIXME */
00395     statbuf->uid = _dbus_win_sid_to_uid_t (owner_sid);
00396     statbuf->gid = _dbus_win_sid_to_uid_t (group_sid);
00397 
00398     LocalFree (sd);
00399   }
00400 #else
00401   statbuf->uid = DBUS_UID_UNSET;
00402   statbuf->gid = DBUS_GID_UNSET;
00403 #endif
00404 
00405   statbuf->size = ((dbus_int64_t) wfad.nFileSizeHigh << 32) + wfad.nFileSizeLow;
00406 
00407   statbuf->atime =
00408     (((dbus_int64_t) wfad.ftLastAccessTime.dwHighDateTime << 32) +
00409      wfad.ftLastAccessTime.dwLowDateTime) / 10000000 - DBUS_INT64_CONSTANT (116444736000000000);
00410 
00411   statbuf->mtime =
00412     (((dbus_int64_t) wfad.ftLastWriteTime.dwHighDateTime << 32) +
00413      wfad.ftLastWriteTime.dwLowDateTime) / 10000000 - DBUS_INT64_CONSTANT (116444736000000000);
00414 
00415   statbuf->ctime =
00416     (((dbus_int64_t) wfad.ftCreationTime.dwHighDateTime << 32) +
00417      wfad.ftCreationTime.dwLowDateTime) / 10000000 - DBUS_INT64_CONSTANT (116444736000000000);
00418 
00419   return TRUE;
00420 }
00421 
00422 
00423 /* This file is part of the KDE project
00424 Copyright (C) 2000 Werner Almesberger
00425 
00426 libc/sys/linux/sys/dirent.h - Directory entry as returned by readdir
00427 
00428 This program is free software; you can redistribute it and/or
00429 modify it under the terms of the GNU Library General Public
00430 License as published by the Free Software Foundation; either
00431 version 2 of the License, or (at your option) any later version.
00432 
00433 This program is distributed in the hope that it will be useful,
00434 but WITHOUT ANY WARRANTY; without even the implied warranty of
00435 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00436 Library General Public License for more details.
00437 
00438 You should have received a copy of the GNU Library General Public License
00439 along with this program; see the file COPYING.  If not, write to
00440 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00441 Boston, MA 02110-1301, USA.
00442 */
00443 #define HAVE_NO_D_NAMLEN        /* no struct dirent->d_namlen */
00444 #define HAVE_DD_LOCK            /* have locking mechanism */
00445 
00446 #define MAXNAMLEN 255           /* sizeof(struct dirent.d_name)-1 */
00447 
00448 #define __dirfd(dir) (dir)->dd_fd
00449 
00450 /* struct dirent - same as Unix */
00451 struct dirent
00452   {
00453     long d_ino;                    /* inode (always 1 in WIN32) */
00454     off_t d_off;                /* offset to this dirent */
00455     unsigned short d_reclen;    /* length of d_name */
00456     char d_name[_MAX_FNAME+1];    /* filename (null terminated) */
00457   };
00458 
00459 /* typedef DIR - not the same as Unix */
00460 typedef struct
00461   {
00462     HANDLE handle;              /* FindFirst/FindNext handle */
00463     short offset;               /* offset into directory */
00464     short finished;             /* 1 if there are not more files */
00465     WIN32_FIND_DATAA fileinfo;  /* from FindFirst/FindNext */
00466     char *dir;                  /* the dir we are reading */
00467     struct dirent dent;         /* the dirent to return */
00468   }
00469 DIR;
00470 
00471 /**********************************************************************
00472 * Implement dirent-style opendir/readdir/closedir on Window 95/NT
00473 *
00474 * Functions defined are opendir(), readdir() and closedir() with the
00475 * same prototypes as the normal dirent.h implementation.
00476 *
00477 * Does not implement telldir(), seekdir(), rewinddir() or scandir().
00478 * The dirent struct is compatible with Unix, except that d_ino is
00479 * always 1 and d_off is made up as we go along.
00480 *
00481 * Error codes are not available with errno but GetLastError.
00482 *
00483 * The DIR typedef is not compatible with Unix.
00484 **********************************************************************/
00485 
00486 static DIR * _dbus_opendir(const char *dir)
00487 {
00488   DIR *dp;
00489   char *filespec;
00490   HANDLE handle;
00491   int index;
00492 
00493   filespec = malloc(strlen(dir) + 2 + 1);
00494   strcpy(filespec, dir);
00495   index = strlen(filespec) - 1;
00496   if (index >= 0 && (filespec[index] == '/' || filespec[index] == '\\'))
00497     filespec[index] = '\0';
00498   strcat(filespec, "\\*");
00499 
00500   dp = (DIR *)malloc(sizeof(DIR));
00501   dp->offset = 0;
00502   dp->finished = 0;
00503   dp->dir = strdup(dir);
00504 
00505   handle = FindFirstFileA(filespec, &(dp->fileinfo));
00506   if (handle == INVALID_HANDLE_VALUE)
00507     {
00508       if (GetLastError() == ERROR_NO_MORE_FILES)
00509         dp->finished = 1;
00510       else
00511         return NULL;
00512     }
00513 
00514   dp->handle = handle;
00515   free(filespec);
00516 
00517   return dp;
00518 }
00519 
00520 static struct dirent * _dbus_readdir(DIR *dp)
00521 {
00522   int saved_err = GetLastError();
00523 
00524   if (!dp || dp->finished)
00525     return NULL;
00526 
00527   if (dp->offset != 0)
00528     {
00529       if (FindNextFileA(dp->handle, &(dp->fileinfo)) == 0)
00530         {
00531           if (GetLastError() == ERROR_NO_MORE_FILES)
00532             {
00533               SetLastError(saved_err);
00534               dp->finished = 1;
00535             }
00536           return NULL;
00537         }
00538     }
00539   dp->offset++;
00540   
00541   strncpy(dp->dent.d_name, dp->fileinfo.cFileName, _MAX_FNAME);
00542   dp->dent.d_ino = 1;
00543   dp->dent.d_reclen = strlen(dp->dent.d_name);
00544   dp->dent.d_off = dp->offset;
00545   
00546   return &(dp->dent);
00547 }
00548 
00549 
00550 static int _dbus_closedir(DIR *dp)
00551 {
00552   if (!dp)
00553     return 0;
00554   FindClose(dp->handle);
00555   if (dp->dir)
00556     free(dp->dir);
00557   if (dp)
00558     free(dp);
00559 
00560   return 0;
00561 }
00562 
00563 
00567 struct DBusDirIter
00568   {
00569     DIR *d; 
00571   };
00572 
00580 DBusDirIter*
00581 _dbus_directory_open (const DBusString *filename,
00582                       DBusError        *error)
00583 {
00584   DIR *d;
00585   DBusDirIter *iter;
00586   const char *filename_c;
00587 
00588   _DBUS_ASSERT_ERROR_IS_CLEAR (error);
00589 
00590   filename_c = _dbus_string_get_const_data (filename);
00591 
00592   d = _dbus_opendir (filename_c);
00593   if (d == NULL)
00594     {
00595       char *emsg = _dbus_win_error_string (GetLastError ());
00596       dbus_set_error (error, _dbus_win_error_from_last_error (),
00597                       "Failed to read directory \"%s\": %s",
00598                       filename_c, emsg);
00599       _dbus_win_free_error_string (emsg);
00600       return NULL;
00601     }
00602   iter = dbus_new0 (DBusDirIter, 1);
00603   if (iter == NULL)
00604     {
00605       _dbus_closedir (d);
00606       dbus_set_error (error, DBUS_ERROR_NO_MEMORY,
00607                       "Could not allocate memory for directory iterator");
00608       return NULL;
00609     }
00610 
00611   iter->d = d;
00612 
00613   return iter;
00614 }
00615 
00629 dbus_bool_t
00630 _dbus_directory_get_next_file (DBusDirIter      *iter,
00631                                DBusString       *filename,
00632                                DBusError        *error)
00633 {
00634   struct dirent *ent;
00635 
00636   _DBUS_ASSERT_ERROR_IS_CLEAR (error);
00637 
00638 again:
00639   SetLastError (0);
00640   ent = _dbus_readdir (iter->d);
00641   if (ent == NULL)
00642     {
00643       if (GetLastError() != 0)
00644         {
00645           char *emsg = _dbus_win_error_string (GetLastError ());
00646           dbus_set_error (error, _dbus_win_error_from_last_error (),
00647                           "Failed to get next in directory: %s", emsg);
00648           _dbus_win_free_error_string (emsg);
00649         }
00650       return FALSE;
00651     }
00652   else if (ent->d_name[0] == '.' &&
00653            (ent->d_name[1] == '\0' ||
00654             (ent->d_name[1] == '.' && ent->d_name[2] == '\0')))
00655     goto again;
00656   else
00657     {
00658       _dbus_string_set_length (filename, 0);
00659       if (!_dbus_string_append (filename, ent->d_name))
00660         {
00661           dbus_set_error (error, DBUS_ERROR_NO_MEMORY,
00662                           "No memory to read directory entry");
00663           return FALSE;
00664         }
00665       else
00666         return TRUE;
00667     }
00668 }
00669 
00673 void
00674 _dbus_directory_close (DBusDirIter *iter)
00675 {
00676   _dbus_closedir (iter->d);
00677   dbus_free (iter);
00678 }
00679 
00686 dbus_bool_t
00687 _dbus_path_is_absolute (const DBusString *filename)
00688 {
00689   if (_dbus_string_get_length (filename) > 0)
00690     return _dbus_string_get_byte (filename, 1) == ':'
00691            || _dbus_string_get_byte (filename, 0) == '\\'
00692            || _dbus_string_get_byte (filename, 0) == '/';
00693   else
00694     return FALSE;
00695 }
00696  /* End of DBusInternalsUtils functions */
00698 
00710 dbus_bool_t
00711 _dbus_string_get_dirname(const DBusString *filename,
00712                          DBusString       *dirname)
00713 {
00714   int sep;
00715 
00716   _dbus_assert (filename != dirname);
00717   _dbus_assert (filename != NULL);
00718   _dbus_assert (dirname != NULL);
00719 
00720   /* Ignore any separators on the end */
00721   sep = _dbus_string_get_length (filename);
00722   if (sep == 0)
00723     return _dbus_string_append (dirname, "."); /* empty string passed in */
00724 
00725   while (sep > 0 &&
00726          (_dbus_string_get_byte (filename, sep - 1) == '/' ||
00727           _dbus_string_get_byte (filename, sep - 1) == '\\'))
00728     --sep;
00729 
00730   _dbus_assert (sep >= 0);
00731 
00732   if (sep == 0 ||
00733       (sep == 2 &&
00734        _dbus_string_get_byte (filename, 1) == ':' &&
00735        isalpha (_dbus_string_get_byte (filename, 0))))
00736     return _dbus_string_copy_len (filename, 0, sep + 1,
00737                                   dirname, _dbus_string_get_length (dirname));
00738 
00739   {
00740     int sep1, sep2;
00741     _dbus_string_find_byte_backward (filename, sep, '/', &sep1);
00742     _dbus_string_find_byte_backward (filename, sep, '\\', &sep2);
00743 
00744     sep = MAX (sep1, sep2);
00745   }
00746   if (sep < 0)
00747     return _dbus_string_append (dirname, ".");
00748 
00749   while (sep > 0 &&
00750          (_dbus_string_get_byte (filename, sep - 1) == '/' ||
00751           _dbus_string_get_byte (filename, sep - 1) == '\\'))
00752     --sep;
00753 
00754   _dbus_assert (sep >= 0);
00755 
00756   if ((sep == 0 ||
00757        (sep == 2 &&
00758         _dbus_string_get_byte (filename, 1) == ':' &&
00759         isalpha (_dbus_string_get_byte (filename, 0))))
00760       &&
00761       (_dbus_string_get_byte (filename, sep) == '/' ||
00762        _dbus_string_get_byte (filename, sep) == '\\'))
00763     return _dbus_string_copy_len (filename, 0, sep + 1,
00764                                   dirname, _dbus_string_get_length (dirname));
00765   else
00766     return _dbus_string_copy_len (filename, 0, sep - 0,
00767                                   dirname, _dbus_string_get_length (dirname));
00768 }
00769 
00770 
00778 dbus_bool_t
00779 _dbus_unix_user_is_process_owner (dbus_uid_t uid)
00780 {
00781   return FALSE;
00782 }
00783 
00784 dbus_bool_t _dbus_windows_user_is_process_owner (const char *windows_sid)
00785 {
00786   return TRUE;
00787 }
00788 
00789 /*=====================================================================
00790   unix emulation functions - should be removed sometime in the future
00791  =====================================================================*/
00792 
00802 dbus_bool_t
00803 _dbus_unix_user_is_at_console (dbus_uid_t         uid,
00804                                DBusError         *error)
00805 {
00806   dbus_set_error (error, DBUS_ERROR_NOT_SUPPORTED,
00807                   "UNIX user IDs not supported on Windows\n");
00808   return FALSE;
00809 }
00810 
00811 
00820 dbus_bool_t
00821 _dbus_parse_unix_group_from_config (const DBusString  *groupname,
00822                                     dbus_gid_t        *gid_p)
00823 {
00824   return FALSE;
00825 }
00826 
00835 dbus_bool_t
00836 _dbus_parse_unix_user_from_config (const DBusString  *username,
00837                                    dbus_uid_t        *uid_p)
00838 {
00839   return FALSE;
00840 }
00841 
00842 
00853 dbus_bool_t
00854 _dbus_unix_groups_from_uid (dbus_uid_t            uid,
00855                             dbus_gid_t          **group_ids,
00856                             int                  *n_group_ids)
00857 {
00858   return FALSE;
00859 }
00860 
00861 
00862  /* DBusString stuff */
00864 
00865 /************************************************************************
00866  
00867  error handling
00868  
00869  ************************************************************************/
00870 
00871 
00872 
00873 
00874 
00875 /* lan manager error codes */
00876 const char*
00877 _dbus_lm_strerror(int error_number)
00878 {
00879 #ifdef DBUS_WINCE
00880   // TODO
00881   return "unknown";
00882 #else
00883   const char *msg;
00884   switch (error_number)
00885     {
00886     case NERR_NetNotStarted:
00887       return "The workstation driver is not installed.";
00888     case NERR_UnknownServer:
00889       return "The server could not be located.";
00890     case NERR_ShareMem:
00891       return "An internal error occurred. The network cannot access a shared memory segment.";
00892     case NERR_NoNetworkResource:
00893       return "A network resource shortage occurred.";
00894     case NERR_RemoteOnly:
00895       return "This operation is not supported on workstations.";
00896     case NERR_DevNotRedirected:
00897       return "The device is not connected.";
00898     case NERR_ServerNotStarted:
00899       return "The Server service is not started.";
00900     case NERR_ItemNotFound:
00901       return "The queue is empty.";
00902     case NERR_UnknownDevDir:
00903       return "The device or directory does not exist.";
00904     case NERR_RedirectedPath:
00905       return "The operation is invalid on a redirected resource.";
00906     case NERR_DuplicateShare:
00907       return "The name has already been shared.";
00908     case NERR_NoRoom:
00909       return "The server is currently out of the requested resource.";
00910     case NERR_TooManyItems:
00911       return "Requested addition of items exceeds the maximum allowed.";
00912     case NERR_InvalidMaxUsers:
00913       return "The Peer service supports only two simultaneous users.";
00914     case NERR_BufTooSmall:
00915       return "The API return buffer is too small.";
00916     case NERR_RemoteErr:
00917       return "A remote API error occurred.";
00918     case NERR_LanmanIniError:
00919       return "An error occurred when opening or reading the configuration file.";
00920     case NERR_NetworkError:
00921       return "A general network error occurred.";
00922     case NERR_WkstaInconsistentState:
00923       return "The Workstation service is in an inconsistent state. Restart the computer before restarting the Workstation service.";
00924     case NERR_WkstaNotStarted:
00925       return "The Workstation service has not been started.";
00926     case NERR_BrowserNotStarted:
00927       return "The requested information is not available.";
00928     case NERR_InternalError:
00929       return "An internal error occurred.";
00930     case NERR_BadTransactConfig:
00931       return "The server is not configured for transactions.";
00932     case NERR_InvalidAPI:
00933       return "The requested API is not supported on the remote server.";
00934     case NERR_BadEventName:
00935       return "The event name is invalid.";
00936     case NERR_DupNameReboot:
00937       return "The computer name already exists on the network. Change it and restart the computer.";
00938     case NERR_CfgCompNotFound:
00939       return "The specified component could not be found in the configuration information.";
00940     case NERR_CfgParamNotFound:
00941       return "The specified parameter could not be found in the configuration information.";
00942     case NERR_LineTooLong:
00943       return "A line in the configuration file is too long.";
00944     case NERR_QNotFound:
00945       return "The printer does not exist.";
00946     case NERR_JobNotFound:
00947       return "The print job does not exist.";
00948     case NERR_DestNotFound:
00949       return "The printer destination cannot be found.";
00950     case NERR_DestExists:
00951       return "The printer destination already exists.";
00952     case NERR_QExists:
00953       return "The printer queue already exists.";
00954     case NERR_QNoRoom:
00955       return "No more printers can be added.";
00956     case NERR_JobNoRoom:
00957       return "No more print jobs can be added.";
00958     case NERR_DestNoRoom:
00959       return "No more printer destinations can be added.";
00960     case NERR_DestIdle:
00961       return "This printer destination is idle and cannot accept control operations.";
00962     case NERR_DestInvalidOp:
00963       return "This printer destination request contains an invalid control function.";
00964     case NERR_ProcNoRespond:
00965       return "The print processor is not responding.";
00966     case NERR_SpoolerNotLoaded:
00967       return "The spooler is not running.";
00968     case NERR_DestInvalidState:
00969       return "This operation cannot be performed on the print destination in its current state.";
00970     case NERR_QInvalidState:
00971       return "This operation cannot be performed on the printer queue in its current state.";
00972     case NERR_JobInvalidState:
00973       return "This operation cannot be performed on the print job in its current state.";
00974     case NERR_SpoolNoMemory:
00975       return "A spooler memory allocation failure occurred.";
00976     case NERR_DriverNotFound:
00977       return "The device driver does not exist.";
00978     case NERR_DataTypeInvalid:
00979       return "The data type is not supported by the print processor.";
00980     case NERR_ProcNotFound:
00981       return "The print processor is not installed.";
00982     case NERR_ServiceTableLocked:
00983       return "The service database is locked.";
00984     case NERR_ServiceTableFull:
00985       return "The service table is full.";
00986     case NERR_ServiceInstalled:
00987       return "The requested service has already been started.";
00988     case NERR_ServiceEntryLocked:
00989       return "The service does not respond to control actions.";
00990     case NERR_ServiceNotInstalled:
00991       return "The service has not been started.";
00992     case NERR_BadServiceName:
00993       return "The service name is invalid.";
00994     case NERR_ServiceCtlTimeout:
00995       return "The service is not responding to the control function.";
00996     case NERR_ServiceCtlBusy:
00997       return "The service control is busy.";
00998     case NERR_BadServiceProgName:
00999       return "The configuration file contains an invalid service program name.";
01000     case NERR_ServiceNotCtrl:
01001       return "The service could not be controlled in its present state.";
01002     case NERR_ServiceKillProc:
01003       return "The service ended abnormally.";
01004     case NERR_ServiceCtlNotValid:
01005       return "The requested pause or stop is not valid for this service.";
01006     case NERR_NotInDispatchTbl:
01007       return "The service control dispatcher could not find the service name in the dispatch table.";
01008     case NERR_BadControlRecv:
01009       return "The service control dispatcher pipe read failed.";
01010     case NERR_ServiceNotStarting:
01011       return "A thread for the new service could not be created.";
01012     case NERR_AlreadyLoggedOn:
01013       return "This workstation is already logged on to the local-area network.";
01014     case NERR_NotLoggedOn:
01015       return "The workstation is not logged on to the local-area network.";
01016     case NERR_BadUsername:
01017       return "The user name or group name parameter is invalid.";
01018     case NERR_BadPassword:
01019       return "The password parameter is invalid.";
01020     case NERR_UnableToAddName_W:
01021       return "@W The logon processor did not add the message alias.";
01022     case NERR_UnableToAddName_F:
01023       return "The logon processor did not add the message alias.";
01024     case NERR_UnableToDelName_W:
01025       return "@W The logoff processor did not delete the message alias.";
01026     case NERR_UnableToDelName_F:
01027       return "The logoff processor did not delete the message alias.";
01028     case NERR_LogonsPaused:
01029       return "Network logons are paused.";
01030     case NERR_LogonServerConflict:
01031       return "A centralized logon-server conflict occurred.";
01032     case NERR_LogonNoUserPath:
01033       return "The server is configured without a valid user path.";
01034     case NERR_LogonScriptError:
01035       return "An error occurred while loading or running the logon script.";
01036     case NERR_StandaloneLogon:
01037       return "The logon server was not specified. Your computer will be logged on as STANDALONE.";
01038     case NERR_LogonServerNotFound:
01039       return "The logon server could not be found.";
01040     case NERR_LogonDomainExists:
01041       return "There is already a logon domain for this computer.";
01042     case NERR_NonValidatedLogon:
01043       return "The logon server could not validate the logon.";
01044     case NERR_ACFNotFound:
01045       return "The security database could not be found.";
01046     case NERR_GroupNotFound:
01047       return "The group name could not be found.";
01048     case NERR_UserNotFound:
01049       return "The user name could not be found.";
01050     case NERR_ResourceNotFound:
01051       return "The resource name could not be found.";
01052     case NERR_GroupExists:
01053       return "The group already exists.";
01054     case NERR_UserExists:
01055       return "The user account already exists.";
01056     case NERR_ResourceExists:
01057       return "The resource permission list already exists.";
01058     case NERR_NotPrimary:
01059       return "This operation is only allowed on the primary domain controller of the domain.";
01060     case NERR_ACFNotLoaded:
01061       return "The security database has not been started.";
01062     case NERR_ACFNoRoom:
01063       return "There are too many names in the user accounts database.";
01064     case NERR_ACFFileIOFail:
01065       return "A disk I/O failure occurred.";
01066     case NERR_ACFTooManyLists:
01067       return "The limit of 64 entries per resource was exceeded.";
01068     case NERR_UserLogon:
01069       return "Deleting a user with a session is not allowed.";
01070     case NERR_ACFNoParent:
01071       return "The parent directory could not be located.";
01072     case NERR_CanNotGrowSegment:
01073       return "Unable to add to the security database session cache segment.";
01074     case NERR_SpeGroupOp:
01075       return "This operation is not allowed on this special group.";
01076     case NERR_NotInCache:
01077       return "This user is not cached in user accounts database session cache.";
01078     case NERR_UserInGroup:
01079       return "The user already belongs to this group.";
01080     case NERR_UserNotInGroup:
01081       return "The user does not belong to this group.";
01082     case NERR_AccountUndefined:
01083       return "This user account is undefined.";
01084     case NERR_AccountExpired:
01085       return "This user account has expired.";
01086     case NERR_InvalidWorkstation:
01087       return "The user is not allowed to log on from this workstation.";
01088     case NERR_InvalidLogonHours:
01089       return "The user is not allowed to log on at this time.";
01090     case NERR_PasswordExpired:
01091       return "The password of this user has expired.";
01092     case NERR_PasswordCantChange:
01093       return "The password of this user cannot change.";
01094     case NERR_PasswordHistConflict:
01095       return "This password cannot be used now.";
01096     case NERR_PasswordTooShort:
01097       return "The password does not meet the password policy requirements. Check the minimum password length, password complexity and password history requirements.";
01098     case NERR_PasswordTooRecent:
01099       return "The password of this user is too recent to change.";
01100     case NERR_InvalidDatabase:
01101       return "The security database is corrupted.";
01102     case NERR_DatabaseUpToDate:
01103       return "No updates are necessary to this replicant network/local security database.";
01104     case NERR_SyncRequired:
01105       return "This replicant database is outdated; synchronization is required.";
01106     case NERR_UseNotFound:
01107       return "The network connection could not be found.";
01108     case NERR_BadAsgType:
01109       return "This asg_type is invalid.";
01110     case NERR_DeviceIsShared:
01111       return "This device is currently being shared.";
01112     case NERR_NoComputerName:
01113       return "The computer name could not be added as a message alias. The name may already exist on the network.";
01114     case NERR_MsgAlreadyStarted:
01115       return "The Messenger service is already started.";
01116     case NERR_MsgInitFailed:
01117       return "The Messenger service failed to start.";
01118     case NERR_NameNotFound:
01119       return "The message alias could not be found on the network.";
01120     case NERR_AlreadyForwarded:
01121       return "This message alias has already been forwarded.";
01122     case NERR_AddForwarded:
01123       return "This message alias has been added but is still forwarded.";
01124     case NERR_AlreadyExists:
01125       return "This message alias already exists locally.";
01126     case NERR_TooManyNames:
01127       return "The maximum number of added message aliases has been exceeded.";
01128     case NERR_DelComputerName:
01129       return "The computer name could not be deleted.";
01130     case NERR_LocalForward:
01131       return "Messages cannot be forwarded back to the same workstation.";
01132     case NERR_GrpMsgProcessor:
01133       return "An error occurred in the domain message processor.";
01134     case NERR_PausedRemote:
01135       return "The message was sent, but the recipient has paused the Messenger service.";
01136     case NERR_BadReceive:
01137       return "The message was sent but not received.";
01138     case NERR_NameInUse:
01139       return "The message alias is currently in use. Try again later.";
01140     case NERR_MsgNotStarted:
01141       return "The Messenger service has not been started.";
01142     case NERR_NotLocalName:
01143       return "The name is not on the local computer.";
01144     case NERR_NoForwardName:
01145       return "The forwarded message alias could not be found on the network.";
01146     case NERR_RemoteFull:
01147       return "The message alias table on the remote station is full.";
01148     case NERR_NameNotForwarded:
01149       return "Messages for this alias are not currently being forwarded.";
01150     case NERR_TruncatedBroadcast:
01151       return "The broadcast message was truncated.";
01152     case NERR_InvalidDevice:
01153       return "This is an invalid device name.";
01154     case NERR_WriteFault:
01155       return "A write fault occurred.";
01156     case NERR_DuplicateName:
01157       return "A duplicate message alias exists on the network.";
01158     case NERR_DeleteLater:
01159       return "@W This message alias will be deleted later.";
01160     case NERR_IncompleteDel:
01161       return "The message alias was not successfully deleted from all networks.";
01162     case NERR_MultipleNets:
01163       return "This operation is not supported on computers with multiple networks.";
01164     case NERR_NetNameNotFound:
01165       return "This shared resource does not exist.";
01166     case NERR_DeviceNotShared:
01167       return "This device is not shared.";
01168     case NERR_ClientNameNotFound:
01169       return "A session does not exist with that computer name.";
01170     case NERR_FileIdNotFound:
01171       return "There is not an open file with that identification number.";
01172     case NERR_ExecFailure:
01173       return "A failure occurred when executing a remote administration command.";
01174     case NERR_TmpFile:
01175       return "A failure occurred when opening a remote temporary file.";
01176     case NERR_TooMuchData:
01177       return "The data returned from a remote administration command has been truncated to 64K.";
01178     case NERR_DeviceShareConflict:
01179       return "This device cannot be shared as both a spooled and a non-spooled resource.";
01180     case NERR_BrowserTableIncomplete:
01181       return "The information in the list of servers may be incorrect.";
01182     case NERR_NotLocalDomain:
01183       return "The computer is not active in this domain.";
01184 #ifdef NERR_IsDfsShare
01185 
01186     case NERR_IsDfsShare:
01187       return "The share must be removed from the Distributed File System before it can be deleted.";
01188 #endif
01189 
01190     case NERR_DevInvalidOpCode:
01191       return "The operation is invalid for this device.";
01192     case NERR_DevNotFound:
01193       return "This device cannot be shared.";
01194     case NERR_DevNotOpen:
01195       return "This device was not open.";
01196     case NERR_BadQueueDevString:
01197       return "This device name list is invalid.";
01198     case NERR_BadQueuePriority:
01199       return "The queue priority is invalid.";
01200     case NERR_NoCommDevs:
01201       return "There are no shared communication devices.";
01202     case NERR_QueueNotFound:
01203       return "The queue you specified does not exist.";
01204     case NERR_BadDevString:
01205       return "This list of devices is invalid.";
01206     case NERR_BadDev:
01207       return "The requested device is invalid.";
01208     case NERR_InUseBySpooler:
01209       return "This device is already in use by the spooler.";
01210     case NERR_CommDevInUse:
01211       return "This device is already in use as a communication device.";
01212     case NERR_InvalidComputer:
01213       return "This computer name is invalid.";
01214     case NERR_MaxLenExceeded:
01215       return "The string and prefix specified are too long.";
01216     case NERR_BadComponent:
01217       return "This path component is invalid.";
01218     case NERR_CantType:
01219       return "Could not determine the type of input.";
01220     case NERR_TooManyEntries:
01221       return "The buffer for types is not big enough.";
01222     case NERR_ProfileFileTooBig:
01223       return "Profile files cannot exceed 64K.";
01224     case NERR_ProfileOffset:
01225       return "The start offset is out of range.";
01226     case NERR_ProfileCleanup:
01227       return "The system cannot delete current connections to network resources.";
01228     case NERR_ProfileUnknownCmd:
01229       return "The system was unable to parse the command line in this file.";
01230     case NERR_ProfileLoadErr:
01231       return "An error occurred while loading the profile file.";
01232     case NERR_ProfileSaveErr:
01233       return "@W Errors occurred while saving the profile file. The profile was partially saved.";
01234     case NERR_LogOverflow:
01235       return "Log file %1 is full.";
01236     case NERR_LogFileChanged:
01237       return "This log file has changed between reads.";
01238     case NERR_LogFileCorrupt:
01239       return "Log file %1 is corrupt.";
01240     case NERR_SourceIsDir:
01241       return "The source path cannot be a directory.";
01242     case NERR_BadSource:
01243       return "The source path is illegal.";
01244     case NERR_BadDest:
01245       return "The destination path is illegal.";
01246     case NERR_DifferentServers:
01247       return "The source and destination paths are on different servers.";
01248     case NERR_RunSrvPaused:
01249       return "The Run server you requested is paused.";
01250     case NERR_ErrCommRunSrv:
01251       return "An error occurred when communicating with a Run server.";
01252     case NERR_ErrorExecingGhost:
01253       return "An error occurred when starting a background process.";
01254     case NERR_ShareNotFound:
01255       return "The shared resource you are connected to could not be found.";
01256     case NERR_InvalidLana:
01257       return "The LAN adapter number is invalid.";
01258     case NERR_OpenFiles:
01259       return "There are open files on the connection.";
01260     case NERR_ActiveConns:
01261       return "Active connections still exist.";
01262     case NERR_BadPasswordCore:
01263       return "This share name or password is invalid.";
01264     case NERR_DevInUse:
01265       return "The device is being accessed by an active process.";
01266     case NERR_LocalDrive:
01267       return "The drive letter is in use locally.";
01268     case NERR_AlertExists:
01269       return "The specified client is already registered for the specified event.";
01270     case NERR_TooManyAlerts:
01271       return "The alert table is full.";
01272     case NERR_NoSuchAlert:
01273       return "An invalid or nonexistent alert name was raised.";
01274     case NERR_BadRecipient:
01275       return "The alert recipient is invalid.";
01276     case NERR_AcctLimitExceeded:
01277       return "A user's session with this server has been deleted.";
01278     case NERR_InvalidLogSeek:
01279       return "The log file does not contain the requested record number.";
01280     case NERR_BadUasConfig:
01281       return "The user accounts database is not configured correctly.";
01282     case NERR_InvalidUASOp:
01283       return "This operation is not permitted when the Netlogon service is running.";
01284     case NERR_LastAdmin:
01285       return "This operation is not allowed on the last administrative account.";
01286     case NERR_DCNotFound:
01287       return "Could not find domain controller for this domain.";
01288     case NERR_LogonTrackingError:
01289       return "Could not set logon information for this user.";
01290     case NERR_NetlogonNotStarted:
01291       return "The Netlogon service has not been started.";
01292     case NERR_CanNotGrowUASFile:
01293       return "Unable to add to the user accounts database.";
01294     case NERR_TimeDiffAtDC:
01295       return "This server's clock is not synchronized with the primary domain controller's clock.";
01296     case NERR_PasswordMismatch:
01297       return "A password mismatch has been detected.";
01298     case NERR_NoSuchServer:
01299       return "The server identification does not specify a valid server.";
01300     case NERR_NoSuchSession:
01301       return "The session identification does not specify a valid session.";
01302     case NERR_NoSuchConnection:
01303       return "The connection identification does not specify a valid connection.";
01304     case NERR_TooManyServers:
01305       return "There is no space for another entry in the table of available servers.";
01306     case NERR_TooManySessions:
01307       return "The server has reached the maximum number of sessions it supports.";
01308     case NERR_TooManyConnections:
01309       return "The server has reached the maximum number of connections it supports.";
01310     case NERR_TooManyFiles:
01311       return "The server cannot open more files because it has reached its maximum number.";
01312     case NERR_NoAlternateServers:
01313       return "There are no alternate servers registered on this server.";
01314     case NERR_TryDownLevel:
01315       return "Try down-level (remote admin protocol) version of API instead.";
01316     case NERR_UPSDriverNotStarted:
01317       return "The UPS driver could not be accessed by the UPS service.";
01318     case NERR_UPSInvalidConfig:
01319       return "The UPS service is not configured correctly.";
01320     case NERR_UPSInvalidCommPort:
01321       return "The UPS service could not access the specified Comm Port.";
01322     case NERR_UPSSignalAsserted:
01323       return "The UPS indicated a line fail or low battery situation. Service not started.";
01324     case NERR_UPSShutdownFailed:
01325       return "The UPS service failed to perform a system shut down.";
01326     case NERR_BadDosRetCode:
01327       return "The program below returned an MS-DOS error code:";
01328     case NERR_ProgNeedsExtraMem:
01329       return "The program below needs more memory:";
01330     case NERR_BadDosFunction:
01331       return "The program below called an unsupported MS-DOS function:";
01332     case NERR_RemoteBootFailed:
01333       return "The workstation failed to boot.";
01334     case NERR_BadFileCheckSum:
01335       return "The file below is corrupt.";
01336     case NERR_NoRplBootSystem:
01337       return "No loader is specified in the boot-block definition file.";
01338     case NERR_RplLoadrNetBiosErr:
01339       return "NetBIOS returned an error:      The NCB and SMB are dumped above.";
01340     case NERR_RplLoadrDiskErr:
01341       return "A disk I/O error occurred.";
01342     case NERR_ImageParamErr:
01343       return "Image parameter substitution failed.";
01344     case NERR_TooManyImageParams:
01345       return "Too many image parameters cross disk sector boundaries.";
01346     case NERR_NonDosFloppyUsed:
01347       return "The image was not generated from an MS-DOS diskette formatted with /S.";
01348     case NERR_RplBootRestart:
01349       return "Remote boot will be restarted later.";
01350     case NERR_RplSrvrCallFailed:
01351       return "The call to the Remoteboot server failed.";
01352     case NERR_CantConnectRplSrvr:
01353       return "Cannot connect to the Remoteboot server.";
01354     case NERR_CantOpenImageFile:
01355       return "Cannot open image file on the Remoteboot server.";
01356     case NERR_CallingRplSrvr:
01357       return "Connecting to the Remoteboot server...";
01358     case NERR_StartingRplBoot:
01359       return "Connecting to the Remoteboot server...";
01360     case NERR_RplBootServiceTerm:
01361       return "Remote boot service was stopped; check the error log for the cause of the problem.";
01362     case NERR_RplBootStartFailed:
01363       return "Remote boot startup failed; check the error log for the cause of the problem.";
01364     case NERR_RPL_CONNECTED:
01365       return "A second connection to a Remoteboot resource is not allowed.";
01366     case NERR_BrowserConfiguredToNotRun:
01367       return "The browser service was configured with MaintainServerList=No.";
01368     case NERR_RplNoAdaptersStarted:
01369       return "Service failed to start since none of the network adapters started with this service.";
01370     case NERR_RplBadRegistry:
01371       return "Service failed to start due to bad startup information in the registry.";
01372     case NERR_RplBadDatabase:
01373       return "Service failed to start because its database is absent or corrupt.";
01374     case NERR_RplRplfilesShare:
01375       return "Service failed to start because RPLFILES share is absent.";
01376     case NERR_RplNotRplServer:
01377       return "Service failed to start because RPLUSER group is absent.";
01378     case NERR_RplCannotEnum:
01379       return "Cannot enumerate service records.";
01380     case NERR_RplWkstaInfoCorrupted:
01381       return "Workstation record information has been corrupted.";
01382     case NERR_RplWkstaNotFound:
01383       return "Workstation record was not found.";
01384     case NERR_RplWkstaNameUnavailable:
01385       return "Workstation name is in use by some other workstation.";
01386     case NERR_RplProfileInfoCorrupted:
01387       return "Profile record information has been corrupted.";
01388     case NERR_RplProfileNotFound:
01389       return "Profile record was not found.";
01390     case NERR_RplProfileNameUnavailable:
01391       return "Profile name is in use by some other profile.";
01392     case NERR_RplProfileNotEmpty:
01393       return "There are workstations using this profile.";
01394     case NERR_RplConfigInfoCorrupted:
01395       return "Configuration record information has been corrupted.";
01396     case NERR_RplConfigNotFound:
01397       return "Configuration record was not found.";
01398     case NERR_RplAdapterInfoCorrupted:
01399       return "Adapter ID record information has been corrupted.";
01400     case NERR_RplInternal:
01401       return "An internal service error has occurred.";
01402     case NERR_RplVendorInfoCorrupted:
01403       return "Vendor ID record information has been corrupted.";
01404     case NERR_RplBootInfoCorrupted:
01405       return "Boot block record information has been corrupted.";
01406     case NERR_RplWkstaNeedsUserAcct:
01407       return "The user account for this workstation record is missing.";
01408     case NERR_RplNeedsRPLUSERAcct:
01409       return "The RPLUSER local group could not be found.";
01410     case NERR_RplBootNotFound:
01411       return "Boot block record was not found.";
01412     case NERR_RplIncompatibleProfile:
01413       return "Chosen profile is incompatible with this workstation.";
01414     case NERR_RplAdapterNameUnavailable:
01415       return "Chosen network adapter ID is in use by some other workstation.";
01416     case NERR_RplConfigNotEmpty:
01417       return "There are profiles using this configuration.";
01418     case NERR_RplBootInUse:
01419       return "There are workstations, profiles, or configurations using this boot block.";
01420     case NERR_RplBackupDatabase:
01421       return "Service failed to backup Remoteboot database.";
01422     case NERR_RplAdapterNotFound:
01423       return "Adapter record was not found.";
01424     case NERR_RplVendorNotFound:
01425       return "Vendor record was not found.";
01426     case NERR_RplVendorNameUnavailable:
01427       return "Vendor name is in use by some other vendor record.";
01428     case NERR_RplBootNameUnavailable:
01429       return "(boot name, vendor ID) is in use by some other boot block record.";
01430     case NERR_RplConfigNameUnavailable:
01431       return "Configuration name is in use by some other configuration.";
01432     case NERR_DfsInternalCorruption:
01433       return "The internal database maintained by the Dfs service is corrupt.";
01434     case NERR_DfsVolumeDataCorrupt:
01435       return "One of the records in the internal Dfs database is corrupt.";
01436     case NERR_DfsNoSuchVolume:
01437       return "There is no DFS name whose entry path matches the input Entry Path.";
01438     case NERR_DfsVolumeAlreadyExists:
01439       return "A root or link with the given name already exists.";
01440     case NERR_DfsAlreadyShared:
01441       return "The server share specified is already shared in the Dfs.";
01442     case NERR_DfsNoSuchShare:
01443       return "The indicated server share does not support the indicated DFS namespace.";
01444     case NERR_DfsNotALeafVolume:
01445       return "The operation is not valid on this portion of the namespace.";
01446     case NERR_DfsLeafVolume:
01447       return "The operation is not valid on this portion of the namespace.";
01448     case NERR_DfsVolumeHasMultipleServers:
01449       return "The operation is ambiguous because the link has multiple servers.";
01450     case NERR_DfsCantCreateJunctionPoint:
01451       return "Unable to create a link.";
01452     case NERR_DfsServerNotDfsAware:
01453       return "The server is not Dfs Aware.";
01454     case NERR_DfsBadRenamePath:
01455       return "The specified rename target path is invalid.";
01456     case NERR_DfsVolumeIsOffline:
01457       return "The specified DFS link is offline.";
01458     case NERR_DfsNoSuchServer:
01459       return "The specified server is not a server for this link.";
01460     case NERR_DfsCyclicalName:
01461       return "A cycle in the Dfs name was detected.";
01462     case NERR_DfsNotSupportedInServerDfs:
01463       return "The operation is not supported on a server-based Dfs.";
01464     case NERR_DfsDuplicateService:
01465       return "This link is already supported by the specified server-share.";
01466     case NERR_DfsCantRemoveLastServerShare:
01467       return "Can't remove the last server-share supporting this root or link.";
01468     case NERR_DfsVolumeIsInterDfs:
01469       return "The operation is not supported for an Inter-DFS link.";
01470     case NERR_DfsInconsistent:
01471       return "The internal state of the Dfs Service has become inconsistent.";
01472     case NERR_DfsServerUpgraded:
01473       return "The Dfs Service has been installed on the specified server.";
01474     case NERR_DfsDataIsIdentical:
01475       return "The Dfs data being reconciled is identical.";
01476     case NERR_DfsCantRemoveDfsRoot:
01477       return "The DFS root cannot be deleted. Uninstall DFS if required.";
01478     case NERR_DfsChildOrParentInDfs:
01479       return "A child or parent directory of the share is already in a Dfs.";
01480     case NERR_DfsInternalError:
01481       return "Dfs internal error.";
01482       /* the following are not defined in mingw */
01483 #if 0
01484 
01485     case NERR_SetupAlreadyJoined:
01486       return "This machine is already joined to a domain.";
01487     case NERR_SetupNotJoined:
01488       return "This machine is not currently joined to a domain.";
01489     case NERR_SetupDomainController:
01490       return "This machine is a domain controller and cannot be unjoined from a domain.";
01491     case NERR_DefaultJoinRequired:
01492       return "The destination domain controller does not support creating machine accounts in OUs.";
01493     case NERR_InvalidWorkgroupName:
01494       return "The specified workgroup name is invalid.";
01495     case NERR_NameUsesIncompatibleCodePage:
01496       return "The specified computer name is incompatible with the default language used on the domain controller.";
01497     case NERR_ComputerAccountNotFound:
01498       return "The specified computer account could not be found.";
01499     case NERR_PersonalSku:
01500       return "This version of Windows cannot be joined to a domain.";
01501     case NERR_PasswordMustChange:
01502       return "The password must change at the next logon.";
01503     case NERR_AccountLockedOut:
01504       return "The account is locked out.";
01505     case NERR_PasswordTooLong:
01506       return "The password is too long.";
01507     case NERR_PasswordNotComplexEnough:
01508       return "The password does not meet the complexity policy.";
01509     case NERR_PasswordFilterError:
01510       return "The password does not meet the requirements of the password filter DLLs.";
01511 #endif
01512 
01513     }
01514   msg = strerror (error_number);
01515   if (msg == NULL)
01516     msg = "unknown";
01517 
01518   return msg;
01519 #endif //DBUS_WINCE
01520 }
01521 
01536 dbus_bool_t
01537 _dbus_command_for_pid (unsigned long  pid,
01538                        DBusString    *str,
01539                        int            max_len,
01540                        DBusError     *error)
01541 {
01542   // FIXME
01543   return FALSE;
01544 }

Generated on Fri Oct 8 2010 for D-Bus by  doxygen 1.7.1