diff options
author | Tim Potter <tpot@samba.org> | 2002-05-28 02:33:11 +0000 |
---|---|---|
committer | Tim Potter <tpot@samba.org> | 2002-05-28 02:33:11 +0000 |
commit | f5a1a3190dc0d4ecdf55b870633a83ee125b816e (patch) | |
tree | e87dfd02942c2ed4bf9f81abee358872edbe4174 /source/python/py_spoolss_drivers.c | |
parent | 166aee6cc2abb5f6e91ebf3d4ec37454034b8dcd (diff) | |
download | samba-f5a1a3190dc0d4ecdf55b870633a83ee125b816e.tar.gz |
Raise a ValueError if server names aren't given in UNC format.
Diffstat (limited to 'source/python/py_spoolss_drivers.c')
-rw-r--r-- | source/python/py_spoolss_drivers.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/source/python/py_spoolss_drivers.c b/source/python/py_spoolss_drivers.c index 19fe5800aa7..b5357a78ad3 100644 --- a/source/python/py_spoolss_drivers.c +++ b/source/python/py_spoolss_drivers.c @@ -43,7 +43,7 @@ PyObject *spoolss_enumprinterdrivers(PyObject *self, PyObject *args, return NULL; if (server[0] != '\\' || server[1] != '\\') { - PyErr_SetString(spoolss_error, "bad server name"); + PyErr_SetString(PyExc_ValueError, "UNC name required"); return NULL; } @@ -259,7 +259,7 @@ PyObject *spoolss_getprinterdriverdir(PyObject *self, PyObject *args, return NULL; if (server[0] != '\\' || server[1] != '\\') { - PyErr_SetString(spoolss_error, "bad server name"); + PyErr_SetString(PyExc_ValueError, "UNC name required"); return NULL; } @@ -340,7 +340,7 @@ PyObject *spoolss_addprinterdriver(PyObject *self, PyObject *args, &info, &creds)) return NULL; - if (server[0] == '\\' && server[1] == '\\') + if (server[0] == '\\' || server[1] == '\\') server += 2; if (creds && creds != Py_None && !PyDict_Check(creds)) { |